General

General

How to build a Fluent UDF library by command line on Windows using the Clang compiler provided with Fluent?

    • FAQFAQ
      Participant

      Since release 2021R1, it is possible to compile a Fluent UDF (test.c test.h) using the provided Clang compiler by command line, following the different steps bellow: 1) if needed, create appropriate environment variables (can be also included in user.txt file -see step 5): FLUENT_INC=C:Program FilesANSYS_Incv211fluent FLUENT_ARCH=win64 FLUENT_UDF_CLANG=builtin FLUENT_UDF_COMPILER=MSVC 2) create your UDF library directory (LIBUDF for example) and the following sub directories: LIBUDF src win64 3ddp_host 3ddp_node 3d_host 3d_node See also the documentation here for more details on the directory’s structure: https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v211/en/flu_udf/flu_udf_compile_directory.html 3) Copy your UDF files test.c and test.h in the src directory 4) For each subdirectory LIBUDF/win64/3ddp_host, copy/paste the file sconstruct.udf located in the directory C:Program FilesANSYS Incv211fluentfluent21.1.0srcudf and rename it : sconstruct 5) For each subdirectory LIBUDF/win64/3ddp_host, create a file user.txt composed of the following lines (example here for 3ddp_host): VERSION=’3ddp_host’ FLUENT_ARCH=’win64′ FLUENT_RELEASE=’fluent21.1.0′ CSOURCES=’ $(SRC)test.c’ HSOURCES=’$(SRC)test.h’ GPU_SUPPORT=’off’ 6) Inside each subdirectory LIBUDF/win64/3ddp_host (for each version), in order to compile your UDF, execute the command line : scons