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)

adambarfi September 27, 2012 15:54

'nmake' is not recognized as an internal or external command ...
 
hi everybody,

I have some problem with compiling my udf. I didn't work before with udfs. I searched the forum for my problem but I cannot solve it.

when I want to build my udf the this error apears:

Code:

Deleted old libudf\ntx86\2d\libudf.dll
        1 file(s) copied.
        1 file(s) copied.
(system "copy C:\Fluent.Inc\fluent6.3.26\src\makefile_nt.udf libudf\ntx86\2d\makefile")
        1 file(s) copied.
(chdir "libudf")()
(chdir "ntx86\2d")()
'nmake' is not recognized as an internal or external command,
operable program or batch file.
'nmake' is not recognized as an internal or external command,
operable program or batch file.

Done.

I think this error originates from Env. variables.
Is anybody here that can help me?!?!?!? what should I do???

adambarfi September 28, 2012 09:13

OK! I solved it.:cool:
I Installed the VS and ran the Fluent in its command prompt.

oinch October 1, 2012 02:15

Hello!!!

I am facing the same problem that you used to!! And this is exactely what I wanted to ask in this forum!

Can you help me please because I don't know what is VS ? And what is the method to run Fluent in its command prompt?

Thank you very much for your help!

Samia

blackmask October 1, 2012 03:49

VS = (Microsoft) Visual Studio
First you should make sure that you have at least one C compiler installed in your OS, MSVC is a common choice in windows. Then you should make sure that the directory containing "nmake.exe" is in the "Path" variable, otherwise you have to edit the Path manually. Search "manage environment variable windows" for more information.
You don't have to run Fluent from the "Visual Studio Command Prompt" if your path variable is set correctly.

oinch October 1, 2012 08:00

Thanks for your answer!

Well, I am using CVI in order to write the UDF, from the National Instrument, and it seems that the compiler is in the package. I searched "manage environment variable windows" and I openned the window path variables and there is nothing called nmake.exe or even nmake.

So I have to create the nmake.exe as a path variable?

blackmask October 6, 2012 03:54

It seems that CVI don't ship a Makefile-capable utility like "nmake.exe". You have to install MSVC in order to compile your UDF under Win* environment. There is a work-around that to compile the library manually instead of invoking the Makefile, but to install MSVC is simpler. You can use "interpreted UDF" instead if there is no restriction to do that in your UDF.

clarkie_49 October 6, 2012 04:00

Also, if you are using Windows 7 64-bit you may also need to download SDK for Windows 7 and launch fluent from the SDK command prompt (as i had to).

http://www.cfd-online.com/Wiki/Fluen...at_is_wrong.3F

oinch October 8, 2012 02:03

Well thank you very much I will try to do that !

hzsme October 8, 2012 07:52

refer to below link and solve your problom


http://www.question-defense.com/2009...-or-batch-file

nkme2007 October 10, 2012 06:19

Hello All,

I want to do analysis of heat transfer from water flowing through pipes submerged inside concrete. I am modelling in GAMBIT and wish to analyse it on Ansys FLUENT.

Can anybody help me out, how to model and simulate?

Does any tutorials exist?

Oula October 18, 2018 05:40

Quote:

Originally Posted by blackmask (Post 384300)
VS = (Microsoft) Visual Studio
First you should make sure that you have at least one C compiler installed in your OS, MSVC is a common choice in windows. Then you should make sure that the directory containing "nmake.exe" is in the "Path" variable, otherwise you have to edit the Path manually. Search "manage environment variable windows" for more information.
You don't have to run Fluent from the "Visual Studio Command Prompt" if your path variable is set correctly.


Hi Blackmask,



I know it is an old thread, but may I ask you where should I add nmake.exe? should I just typeit in the path? could you please elaborate how to set the path variable?. I'm new to this thing and totally lost. Your help is appreciated.


Regards

Oula

LuckyTran October 18, 2018 10:26

Quote:

Originally Posted by Oula (Post 710458)
Hi Blackmask,



I know it is an old thread, but may I ask you where should I add nmake.exe? should I just typeit in the path? could you please elaborate how to set the path variable?. I'm new to this thing and totally lost. Your help is appreciated.


Regards

Oula


Google environmental variables in windows. In win7 and before, right click on computer and go to properties, advanced system settings, environmental variables. Then in either user variables you should find PATH. Add your path to this variable.

Oula October 18, 2018 11:57

Quote:

Originally Posted by LuckyTran (Post 710492)
Google environmental variables in windows. In win7 and before, right click on computer and go to properties, advanced system settings, environmental variables. Then in either user variables you should find PATH. Add your path to this variable.

Dear LuckTran, thank you for your reply. I found the path in the system variable, then in the variable value what should I write in?. is the path that you have mentioned is:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bi n\Hostx64\x64;C:\Program Files\ANSYS Inc\v182\fluent\ntbin\win64

Regards
Oula

LuckyTran October 18, 2018 12:50

Quote:

Originally Posted by Oula (Post 710505)
Dear LuckTran, thank you for your reply. I found the path in the system variable, then in the variable value what should I write in?. is the path that you have mentioned is:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bi n\Hostx64\x64;C:\Program Files\ANSYS Inc\v182\fluent\ntbin\win64

Regards
Oula


add whatever is the directory where your nmake is located.

k_ina March 28, 2020 05:01

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 :)

kailash007 November 10, 2020 19:21

LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
 
Got this error when i followed the steps. Any one got this error?

kailash007 November 11, 2020 00:38

Got the answer!
 
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

antoinetonee December 24, 2020 20:42

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 :)

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.

Alexander00 December 25, 2020 15:31

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.

Yes, it is true. Even i tried everything for this error but i'm not able to solve the problem till now.
Have you found any alternative to this? please give suggestions.
The alternative solution i found is to install an Oracle virtual box with windows 7 and run fluent through that.

Alexander00 December 25, 2020 15:32

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 :)

This solution is not working for me. If possible could you suggest any other alternative method? Please help.


All times are GMT -4. The time now is 19:26.