{"id":164982,"date":"2023-03-17T08:59:08","date_gmt":"2023-03-17T08:59:08","guid":{"rendered":"\/knowledge\/forums\/topic\/how-to-build-a-fluent-udf-library-by-command-line-on-windows-using-the-clang-compiler-provided-with-fluent\/"},"modified":"2023-07-31T12:26:40","modified_gmt":"2023-07-31T12:26:40","slug":"how-to-build-a-fluent-udf-library-by-command-line-on-windows-using-the-clang-compiler-provided-with-fluent","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/how-to-build-a-fluent-udf-library-by-command-line-on-windows-using-the-clang-compiler-provided-with-fluent\/","title":{"rendered":"How to build a Fluent UDF library by command line on Windows using the Clang compiler provided with Fluent?"},"content":{"rendered":"<p>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&#8217;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=&#8217;3ddp_host&#8217; FLUENT_ARCH=&#8217;win64&#8242; FLUENT_RELEASE=&#8217;fluent21.1.0&#8242; CSOURCES=&#8217; $(SRC)test.c&#8217; HSOURCES=&#8217;$(SRC)test.h&#8217; GPU_SUPPORT=&#8217;off&#8217;   6) Inside each subdirectory LIBUDF\/win64\/3ddp_host (for each version), in order to compile your UDF, execute the command line : scons<\/p>\n","protected":false},"template":"","class_list":["post-164982","topic","type-topic","status-publish","hentry","topic-tag-2021-r1","topic-tag-fluent","topic-tag-fluid-dynamics","topic-tag-general-fluent","topic-tag-parallel","topic-tag-udf-scripting-act-pyansys"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_wp_page_template":["default"],"_bbp_last_active_time":["3-15-2023  20:20:03"],"_bbp_forum_id":["27796"],"_bbp_author_ip":["23.56.168.180"],"_btv_view_count":["4785"],"siebel_km_number":["2064911"],"product_version":["2021 R1"],"km_published_date":["2021-06-24T00:00:00.000Z"],"family":["Fluid Dynamics"],"application_name":["FLUENT"]},"test":"articlesansys-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/164982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/164982\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/media?parent=164982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}