CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   The proper way of installing Visual Studio for UDF compilation 2023 (https://www.cfd-online.com/Forums/fluent-udf/253602-proper-way-installing-visual-studio-udf-compilation-2023-a.html)

this_is_mayhem December 19, 2023 03:18

The proper way of installing Visual Studio for UDF compilation 2023
 
2 Attachment(s)
I've been struggling for a week trying to solve a compilation problem. The problem was due to incorrect VS installation. I am a little resentful about the fact that such meager information is designated to this topic (even in Fluent guidelines), hence I decided to make this thread, share my solution and some thoughs.

1. Download VS installer. I use 2019 version, but I am pretty sure it works for the latest 2022 version as well (at least udf.bat script is looking for 2022 build instruments). And of course it should work for previous VS versions.
2. In the installer under Workloads page choose Desktop development with C++ and Universal Windows platform development. This is important. My whole headache was because of this.
Attachment 97755
3. Launch Fluent via command prompt for VS.
3.1 Find Developer Command Prompt for VS 2019 in the Start menu or just type in the search bar (it could be named different for your version of VS).
Attachment 97756
3.2 Navigate to your project directory via cd command.
3.3 Type fluent command.

Some technical discourse: personally I don't understand why there is a reason to launch Fluent via VS command prompt, because when you press Build button in Fluent, it starts udf.bat script which is essentially just doing the same thing for you.


After following these steps my problem was solved. Hope it will help somebody.

äther2344 March 10, 2024 12:58

Hi there, I´m currently having problems trying to use an UDF in Ansys Fluent and I tried nearly everything I could find related to Ansys Fluent.

I tried what you explained but it didnt work out for me either. I am going to quote the error I am getting, maybe some of you out there can help me out on this issue since I am still learning Ansys. Thanks in Advance

ERROR: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).

BlueLumos March 17, 2024 16:16

Quote:

Originally Posted by äther2344 (Post 866003)
Hi there, I´m currently having problems trying to use an UDF in Ansys Fluent and I tried nearly everything I could find related to Ansys Fluent.

I tried what you explained but it didnt work out for me either. I am going to quote the error I am getting, maybe some of you out there can help me out on this issue since I am still learning Ansys. Thanks in Advance

ERROR: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).

Hi there I've also been getting the same error but that is after loading my UDF into Ansys. My error message before that is as the follows:

uvdose_par.c(42,50): error: member reference base type 'void' is not a structure or union
par_fprintf_head(fp,"(%s %d)\n",thread->head->dpm_summary.sort_file_name,14);

It seems to indicate that line " par_fprintf_head(fp,"(%s %d)\n",thread->head->dpm_summary.sort_file_name,14);" of my code below has a problem.

Would you possibly know how to solve this error? I believe solving this error will also help load for parallel use on the current platform. Many thanks.

Niall


All times are GMT -4. The time now is 09:59.