CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   'nmake' is not recognized as an internal or external command ... (https://www.cfd-online.com/Forums/fluent/107467-nmake-not-recognized-internal-external-command.html)

Alexander00 December 25, 2020 15:34

Quote:

Originally Posted by kailash007 (Post 787379)
I wanted to answer my own question if someone is facing this issue. The solution provided in this link worked for me. Need to create a LIB system variable and copy the path where Kernel32.lib is present

could you please elaborate the steps of the procedure?
it would really be helpful. Thankyou.

Alexander00 December 25, 2020 15:37

Quote:

Originally Posted by adambarfi (Post 384062)
OK! I solved it.:cool:
I Installed the VS and ran the Fluent in its command prompt.

I have actually tried this and the code is compiling but are the results easily accessible?

AlexanderZ December 27, 2020 23:47

Quote:

are the results easily accessible?
what do you mean? which results are you talking about?

umeralizuberi March 25, 2021 03:23

still the same issue if i load it with command prompt it give nmake error and if i load it directly (after following all the steps ) it give fatal errror C1083

Alexander00 March 25, 2021 04:52

Quote:

Originally Posted by umeralizuberi (Post 799807)
still the same issue if i load it with command prompt it give nmake error and if i load it directly (after following all the steps ) it give fatal errror C1083

use ANSYS 2021 R1, udf is compiling easily. Also, it has built-in compiler.

umeralizuberi March 25, 2021 05:39

can you send me download link? and is there any other way of doing it(without installing this new version)?

thanks in advance

Alexander00 March 25, 2021 06:20

Quote:

Originally Posted by umeralizuberi (Post 799825)
can you send me download link? and is there any other way of doing it(without installing this new version)?

thanks in advance

https://shareappscrack.com/ansys-pro...token=54980498

and no i couldn't find any other solution for my laptop.

umeralizuberi March 25, 2021 09:02

thanks for your time

Romu April 15, 2021 21:21

Quote:

Originally Posted by k_ina (Post 763312)
Hello~
I have encountered the same problem regarding nmake. Adding it to the windows environment variables path and running Fluent without command prompt gave me another error (Fatal Error C1083). After some searching, I managed to solve it and now UDFs can be compiled without running from command prompt! So I wanted to share my steps to hopefully help others:

1) Install Visual Studio (version 2019 for me)

2) Go to "C:\Program Files (x86)\Microsoft Visual Studio\2019" and type in the search bar "nmake" to find where nmake is located.
For me, it's located in "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bi n\Hostx64\x64". This is your nmake location.

3) Go to Control Panel->Settings->System Settings->Environment Variables->System Variables
and find "Path", then click on "Modify"

4) Click "new" and add your nmake location to the path. Then click ok.

5) Open Fluent, open a Fluid Flow (Fluent) component, and right click on "Setup" -> Edit.
Click "+Show more Options", then go to "Environment".
Copy the udf.bat location (for me it's "C:\Program Files\ANSYS Inc\v182\fluent/ntbin\win64/")
and paste it in the explorer to open it.

6) Right click on "udf.bat"->Open with Notepad++ (as administrator).

7) Paste the following text (but make sure the folder paths and VS version are correct for your own computer). Careful to paste the following texts in their appropriate locations:

Paste this text before "echo "No MSVC compiler detected!""

echo trying to find MS C compiler, version 19....

set MSVC_DEFAULT=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build
if exist "%MSVC_DEFAULT%\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%
if not "%MSVC%" == "" goto msvc_env19


and further below you paste this text before ":ms_c_end":

:msvc_env19
set MSVC_VERSION=19
call "%MSVC%\vcvarsall.bat" x86_amd64
goto ms_c_end



8) Save the udf.bat file, and restart Fluent. Now you should be able to directly compile codes without any problems and without having to run through command prompt :)

sir, i am getting this error but i get confused while i am following your solution:
explain to me here plz"5) Open Fluent, open a Fluid Flow (Fluent) component, and right click on "Setup" -> Edit.
Click "+Show more Options", then go to "Environment".
Copy the udf.bat location (for me it's "C:\Program Files\ANSYS Inc\v182\fluent/ntbin\win64/")
and paste it in the explorer to open it."

AlexanderZ April 15, 2021 22:47

Quote:

Originally Posted by Romu (Post 801678)
sir, i am getting this error but i get confused while i am following your solution:
explain to me here plz"5) Open Fluent, open a Fluid Flow (Fluent) component, and right click on "Setup" -> Edit.
Click "+Show more Options", then go to "Environment".
Copy the udf.bat location (for me it's "C:\Program Files\ANSYS Inc\v182\fluent/ntbin\win64/")
and paste it in the explorer to open it."

this is solution for fluent version up to v19.2

Romu April 17, 2021 03:10

Quote:

Originally Posted by AlexanderZ (Post 801688)
this is solution for fluent version up to v19.2

thanks,

yes I am using also v195, I think that it should be solved, can you try to explain again this statement you wrote while solving this issue<<Copy the udf.bat location (for me it's "C:\Program Files\ANSYS Inc\v182\fluent/ntbin\win64/")
and paste it in the explorer to open it.>>

when I reach at this step, I get lost. thanks

AlexanderZ April 19, 2021 22:55

that's not my guide, whatever

5) Open Fluent, open a Fluid Flow (Fluent) component, and right click on "Setup" -> Edit.
Click "+Show more Options", then go to "Environment".
Copy the udf.bat location (for me it's "C:\Program Files\ANSYS Inc\v182\fluent/ntbin\win64/")

go to this directory, find there file "udf.bat"

6) Right click on "udf.bat"->Open with Notepad++ (as administrator).

7) Paste the following text (but make sure the folder paths and VS version are correct for your own computer). Careful to paste the following texts in their appropriate locations:

Paste this text before "echo "No MSVC compiler detected!""

echo trying to find MS C compiler, version 19....

set MSVC_DEFAULT=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build
if exist "%MSVC_DEFAULT%\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%
if not "%MSVC%" == "" goto msvc_env19

and further below you paste this text before ":ms_c_end":

:msvc_env19
set MSVC_VERSION=19
call "%MSVC%\vcvarsall.bat" x86_amd64
goto ms_c_end


8) Save the udf.bat file, and restart Fluent. Now you should be able to directly compile codes without any problems and without having to run through command prompt

Boyboy September 13, 2021 08:00

Quote:

Originally Posted by antoinetonee (Post 791524)
Tried your suggestion, it still doesn't work. The 'nmake' is still not recognized. I think I need to reinstall everything afterall.

In all fairness, I see this problem has been around since quite a long time and sadly ANSYS hasn't done anything about it despite tons of complaints. A more simplified and robust compiler should do, but alas it seems they simply don't want to bother.

I can fully relate to what you are feeling. I felt the same way, before following what k_ina posted. Make sure you've installed the C++ related workload. (In VS, go Tools menu=>Get Tools and Features=>Install the Desktop Development With C++ workload). It's only then, you will see the nmake.exe file and also the vcvarsall.bat file. After installation, you can then follow what @k_ina posted


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