CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Compile Fluent UDF with Windows 10

Register Blogs Community New Posts Updated Threads Search

Like Tree24Likes
  • 22 Post By daniel_pramudita
  • 1 Post By AlexanderZ
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 12, 2018, 13:28
Default Compile Fluent UDF with Windows 10
  #1
New Member
 
Join Date: Jan 2018
Posts: 12
Rep Power: 8
daniel_pramudita is on a distinguished road
Hi everyone,

In this thread I would like to share a kind of guide for those who'd want to compile Fluent user defined function (UDF) in Windows 10, based on my experience of course. There are some similar threads on UDF compiling, but mostly they are from some years ago and thus not easily applicable for Windows 10.

Windows 10 is a 64-bit OS, which often has some compatibility issues with Fluent. The most common one is the error "'nmake' is not recognized as an internal or external command, operable program or batch file".
(see https://www.cfd-online.com/Wiki/Flue...tch_file.22.3F).
The issue can be resolved by installing the Microsoft Visual Studio, which will "provide" the missing 'nmake' file. In most online threats on this matter, older versions of Visual Studio and Visual C++ are mentioned. For example, in the Fluent FAQ available in this website (https://www.cfd-online.com/Wiki/Fluent_FAQ), Visual C++ 2008 and VS 2010 are mentioned (recommended). However, the newest versions of actually works well and thus you should go for it. The VS 2017 community version can be downloaded for free.

The main idea is the same as the one explained for Windows 7 (see first https://www.cfd-online.com/Wiki/Flue...ows_7_64bit.3F).
The differences are:
  1. 1. Use newest Visual Studio (2017, at the time this thread is created) instead. This latest version is a package that includes the Visual C++, .NET, etc.
  2. 2. You don't need to install Software Development Kit (SKD) for 64bit systems. It is already incorporated in the Visual Studio.
  3. 3. VS 2017 has slightly different folder structure, so entry the Environmental Variable 'Path' is also different. It is respectively C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools and C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bi n\Hostx64\x64. The main idea here is that the entry should point to the location where 'nmake.exe' is located. The another entry is the same (C:\Program Files\ANSYS Inc\v172\fluent\ntbin\win64).
    (To access the Environmental Variables in Windows 10, search for View Advanced System Settings in Start Menu)
  4. 4. Open Fluent from x64 Native Tools Command Prompt for VS 2017, instead from SDK Command Prompt. (Since the emergence of Windows 10, there is no more standalone SDK command prompt). To find the x64 Native Tools Command Prompt for VS 2017, search using the word 'prompt' in the Start Menu Search, and then select the program from the list appearing.

The following video can be of great help to those who are not familiar with the above mentioned steps: https://www.youtube.com/watch?v=xt2hnE9_LdM.

So, to those who starts from ANSYS installation, the main step will be:
1. Install ANSYS
2. Install Microsoft Visual Studio 2017. Make sure to select the Windows options (see the above youtube video).
3. Set the environmental variables.
4. Run Fluent from x64 Native Tools Command Prompt for VS 2017.

PS: I already had the Visual C++ 2008 and Visual Studio 2010 installed in my PC (as suggested for Windows 7) when I finally succeeded with this method. However, I am quite sure that in the end they played no role at all since I am running from the x64 Native Tools Command Prompt for VS 2017. If you still face the same problem after those steps I mention above, you may try installing Visual C++ 2008 and Visual Studio 2010 as well.

I hope this small guide can help you all, and you don't have to face the hardship I went through.
Any correction and further suggestion are welcomed.

Daniel
lei, almosallam, Zari and 19 others like this.
daniel_pramudita is offline   Reply With Quote

Old   February 19, 2018, 17:20
Default Thanks a lot
  #2
New Member
 
Jing
Join Date: Feb 2013
Posts: 25
Rep Power: 13
serene6390 is on a distinguished road
I've been stuck with this problem for quite a long time.
Thank you so much for your help.
I followed your step and everything finally works.
serene6390 is offline   Reply With Quote

Old   October 17, 2018, 09:35
Default
  #3
Member
 
Oula
Join Date: Apr 2015
Location: United Kingdom
Posts: 81
Rep Power: 11
Oula is on a distinguished road
Hi Daniel

Thank you so much for sharing this guideline. I followed the instructions in the video, but still same problem. I'm using ANSYS v160. Please help.

Regards
Oula
Oula is offline   Reply With Quote

Old   October 17, 2018, 10:51
Default
  #4
Member
 
Oula
Join Date: Apr 2015
Location: United Kingdom
Posts: 81
Rep Power: 11
Oula is on a distinguished road
Quote:
Originally Posted by daniel_pramudita View Post
Hi everyone,

In this thread I would like to share a kind of guide for those who'd want to compile Fluent user defined function (UDF) in Windows 10, based on my experience of course. There are some similar threads on UDF compiling, but mostly they are from some years ago and thus not easily applicable for Windows 10.

Windows 10 is a 64-bit OS, which often has some compatibility issues with Fluent. The most common one is the error "'nmake' is not recognized as an internal or external command, operable program or batch file".
(see https://www.cfd-online.com/Wiki/Flue...tch_file.22.3F).
The issue can be resolved by installing the Microsoft Visual Studio, which will "provide" the missing 'nmake' file. In most online threats on this matter, older versions of Visual Studio and Visual C++ are mentioned. For example, in the Fluent FAQ available in this website (https://www.cfd-online.com/Wiki/Fluent_FAQ), Visual C++ 2008 and VS 2010 are mentioned (recommended). However, the newest versions of actually works well and thus you should go for it. The VS 2017 community version can be downloaded for free.

The main idea is the same as the one explained for Windows 7 (see first https://www.cfd-online.com/Wiki/Flue...ows_7_64bit.3F).
The differences are:
  1. 1. Use newest Visual Studio (2017, at the time this thread is created) instead. This latest version is a package that includes the Visual C++, .NET, etc.
  2. 2. You don't need to install Software Development Kit (SKD) for 64bit systems. It is already incorporated in the Visual Studio.
  3. 3. VS 2017 has slightly different folder structure, so entry the Environmental Variable 'Path' is also different. It is respectively C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools and C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bi n\Hostx64\x64. The main idea here is that the entry should point to the location where 'nmake.exe' is located. The another entry is the same (C:\Program Files\ANSYS Inc\v172\fluent\ntbin\win64).
    (To access the Environmental Variables in Windows 10, search for View Advanced System Settings in Start Menu)
  4. 4. Open Fluent from x64 Native Tools Command Prompt for VS 2017, instead from SDK Command Prompt. (Since the emergence of Windows 10, there is no more standalone SDK command prompt). To find the x64 Native Tools Command Prompt for VS 2017, search using the word 'prompt' in the Start Menu Search, and then select the program from the list appearing.

The following video can be of great help to those who are not familiar with the above mentioned steps: https://www.youtube.com/watch?v=xt2hnE9_LdM.

So, to those who starts from ANSYS installation, the main step will be:
1. Install ANSYS
2. Install Microsoft Visual Studio 2017. Make sure to select the Windows options (see the above youtube video).
3. Set the environmental variables.
4. Run Fluent from x64 Native Tools Command Prompt for VS 2017.

PS: I already had the Visual C++ 2008 and Visual Studio 2010 installed in my PC (as suggested for Windows 7) when I finally succeeded with this method. However, I am quite sure that in the end they played no role at all since I am running from the x64 Native Tools Command Prompt for VS 2017. If you still face the same problem after those steps I mention above, you may try installing Visual C++ 2008 and Visual Studio 2010 as well.

I hope this small guide can help you all, and you don't have to face the hardship I went through.
Any correction and further suggestion are welcomed.

Daniel
Hi Daniel
what do you mean by this:
It is respectively C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools and C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bi n\Hostx64\x64. The main idea here is that the entry should point to the location where 'nmake.exe' is located. The another entry is the same (C:\Program Files\ANSYS Inc\v172\fluent\ntbin\win64).

so in the path what do I need to type in? and what do you mean by the another entry? do you mean two entries for the path?

Thank you
Regards
Oula
Oula is offline   Reply With Quote

Old   October 22, 2018, 06:27
Default
  #5
Member
 
Oula
Join Date: Apr 2015
Location: United Kingdom
Posts: 81
Rep Power: 11
Oula is on a distinguished road
Dear all,

I'm getting the following error when compiling the UDF in fluent. Does anyone have any idea why? I'm using ANSYS 18.2 and VS 2017.

'xcopy' is not recognized as an internal or external command,
operable program or batch file.
Copied M:\Transient_Simulation -2018/M:\Transient_Simulation -2018\my_function.c to libudf\src
Creating user_nt.udf file for 3ddp_host ...
(system "copy "C:\PROGRA~1\ANSYSI~1\v182\fluent"\fluent18.2.0\sr c\udf\makefile_nt.udf "libudf\win64\3ddp_host\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\3ddp_host")Creating user_nt.udf file for 3ddp_node ...
(system "copy "C:\PROGRA~1\ANSYSI~1\v182\fluent"\fluent18.2.0\sr c\udf\makefile_nt.udf "libudf\win64\3ddp_node\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\3ddp_node")
Done.

Opening library "M:\Transient_Simulation -2018\libudf"...
Error at host: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).

The system cannot find the file specified.

M:\Transient_Simulation -2018\libudf\win64\3ddp_host\libudf.dll

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

The system cannot find the file specified.

M:\Transient_Simulation -2018\libudf\win64\3ddp_node\libudf.dll

Error: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).\n\nThe system cannot find the file specified.
\n\nM:\Transient_Simulation -2018\libudf\win64\3ddp_host\libudf.dll
Error Object: #f

Thank you
Oula
Oula is offline   Reply With Quote

Old   October 22, 2018, 23:00
Default
  #6
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Quote:
'xcopy' is not recognized as an internal or external command,
pay attention to this, try to find which file has xcopy

best regards
Oula likes this.
AlexanderZ is offline   Reply With Quote

Old   October 23, 2018, 05:45
Default
  #7
Member
 
Oula
Join Date: Apr 2015
Location: United Kingdom
Posts: 81
Rep Power: 11
Oula is on a distinguished road
Hi AlexanderZ

How to know which file has xcopy? does this mean that the nmake file problem has been solved and this a different problem that I need to deal with?. I did my search and found in a website that this error might be caused by the Visual Studio lose it's path.

Regards
Oula
Oula is offline   Reply With Quote

Old   October 25, 2018, 12:44
Default
  #8
Member
 
Oula
Join Date: Apr 2015
Location: United Kingdom
Posts: 81
Rep Power: 11
Oula is on a distinguished road
Hi everyone

For people who is experiencing the "xcopy" error when building a UDF function in Fluent, check out the link below

https://www.researchgate.net/post/UD...d8ab281f7fb92b

Regards
Oula
Oula is offline   Reply With Quote

Old   February 7, 2020, 08:12
Default UDF compile in win10
  #9
New Member
 
elaf
Join Date: May 2013
Posts: 15
Rep Power: 13
elaf_2003 is on a distinguished road
Hi
I got this error message when I tried to compile my udf. I have win 10 64
VS 2017 professional.
The udf traing to load is compiled for current 3d platforms win64
The file could not fined
I idea please to sort out this issue
Regards.
elaf_2003 is offline   Reply With Quote

Old   February 10, 2020, 00:54
Default
  #10
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
show your code
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   May 11, 2020, 04:00
Default udf compile in window
  #11
New Member
 
Patil
Join Date: May 2019
Location: Delhi, India
Posts: 2
Rep Power: 0
patil is on a distinguished road
i had installed vc 15 and ANSYS Fluent 2019 R2 in my system and define the environment variable like below:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\1033;C:\Program Files\ANSYS Inc\v194\fluent\ntbin\win64

after doing all these I'm getting the following error.

(system "copy "C:\PROGRA~1\ANSYSI~1\v194\fluent"\fluent19.4.0\sr c\udf\makefile_nt.udf "libudf\win64\3d_host\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\3d_host")'nmake' is not recognized as an internal or external command,
operable program or batch file.
Creating user_nt.udf file for 3d_node ...
(system "copy "C:\PROGRA~1\ANSYSI~1\v194\fluent"\fluent19.4.0\sr c\udf\makefile_nt.udf "libudf\win64\3d_node\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\3d_node")'nmake' is not recognized as an internal or external command,
operable program or batch files.

I'm using ANSYS Fluent 2019 R2. can anyone help me regarding this.

Thanks in advance.
patil is offline   Reply With Quote

Old   May 11, 2020, 04:43
Default
  #12
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
run VS console first
run Fluent FROM VS console
patil likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   May 11, 2020, 06:55
Default
  #13
New Member
 
Patil
Join Date: May 2019
Location: Delhi, India
Posts: 2
Rep Power: 0
patil is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
run VS console first
run Fluent FROM VS console
AlexanderZ,

Thanks for your response. I had tried this also..even with also I'm getting same error..
patil is offline   Reply With Quote

Old   May 12, 2020, 10:37
Default
  #14
Member
 
Join Date: Jun 2017
Posts: 55
Rep Power: 11
srsel6 is on a distinguished road
Hi guys,

If you're still having trouble compiling UDFs, try this video. It worked really well for me and I've never had a problem since. You need to use the same VS version as in the video.

https://www.youtube.com/watch?v=l4wcXAQ5IGY
srsel6 is offline   Reply With Quote

Old   May 12, 2020, 10:41
Default Compilation
  #15
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
The issue is the registry editing access; got to do with user access. You need to start Developer Command prompt of VS using Right-Click and Run As Administrator. Then start Fluent from that command prompt.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   May 13, 2020, 23:29
Default Compilation
  #16
New Member
 
seyf97's Avatar
 
seyf
Join Date: May 2020
Posts: 5
Rep Power: 6
seyf97 is on a distinguished road
Thank you so much! The mentioned paths finally worked for me. I have VS 2019 and ANSYS v170 Student Licence.

Important:

When installing VS, do not forget to select Windows "Universal Windows Platform Development". I had forgotten this step...
seyf97 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A Problem of Fluent Interpreted UDF: parse error knight Fluent UDF and Scheme Programming 25 August 16, 2018 11:26
How you can manage to compile your UDF with Windows 7 64bit sega Fluent UDF and Scheme Programming 3 March 23, 2017 10:18
looking for instructions on how to compile an udf in windows OS Srinivasa Rao Fluent UDF and Scheme Programming 2 May 22, 2015 11:00
Inability to compile udf in fluent stefanos FLUENT 1 December 20, 2011 07:56
Fluent on Microsoft Windows Server 2003, possible? IvanCFD FLUENT 0 February 10, 2011 05:45


All times are GMT -4. The time now is 15:01.