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/)
-   -   Error compiling: nmake' is not recognized as an internal or external command (https://www.cfd-online.com/Forums/fluent-udf/120482-error-compiling-nmake-not-recognized-internal-external-command.html)

rayolau July 8, 2013 09:17

Error compiling: nmake' is not recognized as an internal or external command
 
Hello everyone, I hope you can help me with this error, I read a lot in the programming forum, but still happening.

I have installed:
- Windows 7 Home Premium, 64 bit, service pack 1
-Fluent 6.3.26
-Microsoft Visual Studio 2010 Professional.

The error I get when I want to compile a udf is this is a common mistake in this forum, for example, appears in this thread: http://www.cfd-online.com/Forums/flu...e-problem.html

Code:


    Welcome to Fluent 6.3.26

    Copyright 2006 Fluent Inc.
    All Rights Reserved

Loading "c:\fluent.inc\fluent6.3.26\lib\fl_s1119.dmp"
Done.
 

>        1 archivo(s) copiado(s).
(system "copy c:\fluent.inc\fluent6.3.26\src\makefile_nt.udf libudff\ntx86\2d\makefile")
        1 archivo(s) copiado(s).
(chdir "libudff")()
(chdir "ntx86\2d")()
"nmake" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
"nmake" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.


Done.
"C:/MODELOS/compilar"

Opening library "libudff"...
Error: open_udf_library: El sistema no puede encontrar el archivo especificado.

Error Object: ()

I followed the steps in: http://www.cfd-online.com/Forums/flu...e-problem.html

- First installed Fluent 6.3.26 in C:\FLUENT.INC
- Second: Download Visual Studio 2010 Professional, in C:\Microsoft Visual Studio 10.0
- environment variables:
*PATH --> C:\Microsoft Visual Studio 10.0;C:\Fluent.Inc;c:\fluent.inc\ntbin\ntx86
*FLUENT_INC --> c:\fluent.inc

-system variables:
*PATH --> C:\Microsoft Visual Studio 10.0;C:\Fluent.Inc
- finally, open SDK fluent through in the folder where you want to compile the file.c.

Despite following these steps, I still get the same error.
Anyone know how I can fix it? Thanks in advance!

blackmask July 8, 2013 22:22

That can not be right. The PATH variable must contain the directory where "nmake.exe" resides. Do you happen to have a "nmake.exe" in the "C:\Microsoft Visual Studio 10.0" directory?

For a conventional windows program the executable files would be in a directory named "bin". You should check where the "nmake.exe" locates (say, "C:\Program Files\haha\hehe\bin") and then prepend that directory to the PATH variable,i.e.,

*Path --> C:\Program Files\haha\hehe\bin;C:\Fluent.Inc

!!!Make sure that "nmake.exe" is in the "C:\Program Files\haha\hehe\bin" directory.

rayolau July 9, 2013 06:28

Quote:

Originally Posted by blackmask (Post 438561)
That can not be right. The PATH variable must contain the directory where "nmake.exe" resides. Do you happen to have a "nmake.exe" in the "C:\Microsoft Visual Studio 10.0" directory?

For a conventional windows program the executable files would be in a directory named "bin". You should check where the "nmake.exe" locates (say, "C:\Program Files\haha\hehe\bin") and then prepend that directory to the PATH variable,i.e.,

*Path --> C:\Program Files\haha\hehe\bin;C:\Fluent.Inc

!!!Make sure that "nmake.exe" is in the "C:\Program Files\haha\hehe\bin" directory.

Thank you for your reply!
I have ensured that in the bin folder is NMAKE.EXE, and I changed the paths. environment variables that I have now are:

user variables:
- PATH: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin;C:\Fluent.Inc;c:\fluent.inc\ntbin\ntx86
- FLUENT.INC: c:\fluent.inc

System variables:
-PATH: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin;C:\Fluent.Inc;C:\Program Files\Microsoft Windows Performance Toolkit\

I opened fluent 6.3.26 from Windows SDK 7.1, in the folder that is located compile file.c want.

The UDF is an example of the UDF User Guide. I say this because, now, I appear errors are others, and I think the problem is still setup.

The udf is this:
Code:

#include "udf.h"


DEFINE_PROFILE(inlet_x_velocity, thread, index)
{
  real x[ND_ND];                /* this will hold the position vector */
  real y;
  face_t f;

  begin_f_loop(f, thread)
    {
      F_CENTROID(x,f,thread);
      y = x[1];
      F_PROFILE(f, thread, index) = 20. - y*y/(.0745*.0745)*20.;
    }
  end_f_loop(f, thread)
}

The error is this:


Code:

Welcome to Fluent 6.3.26

    Copyright 2006 Fluent Inc.
    All Rights Reserved

Loading "c:\fluent.inc\fluent6.3.26\lib\fl_s1119.dmp"
Done.
 

> Deleted old libudff\ntx86\2d\libudf.dll
        1 archivo(s) copiado(s).
(system "copy c:\fluent.inc\fluent6.3.26\src\makefile_nt.udf libudff\ntx86\2d\makefile")
        1 archivo(s) copiado(s).
(chdir "libudff")()
(chdir "ntx86\2d")()
prueba.c
c:\fluent.inc\fluent6.3.26\src\config.h(119) : error C2143: error de sintaxis : falta '{' delante de ':'
c:\fluent.inc\fluent6.3.26\src\config.h(119) : error C2059: error de sintaxis : ':'
c:\fluent.inc\fluent6.3.26\cortex\src\dll.h(58) : error C2061: error de sintaxis : identificador 'CX_DLL_GetProc'
c:\fluent.inc\fluent6.3.26\cortex\src\dll.h(58) : error C2059: error de sintaxis : ';'
c:\fluent.inc\fluent6.3.26\cortex\src\dll.h(58) : error C2059: error de sintaxis : 'tipo'

Done.

I doubt it's a syntax error because the udf is a textbook example. In addition, the line number on which brand syntax errors (58 and 119) do not exist! the udf not have those line numbers.

What I can do? Have any idea what happens?
Thank you so much!
Laura

blackmask July 9, 2013 08:28

It is definitely not an error caused by the source file. The message indicates that the errors are caused by headers provided by Fluent Inc., which means something is wrong with your configuration.

Try to change
Code:

c:\fluent.inc
in your PATH variable to something like
Code:

c:\fluent.inc\fluent6.3.26\ntbin
c:\fluent.inc\fluent6.3.26\bin

I can not tell what the correct name because I do not have windows system at hand. But you should know that if a directory contains no executable file then it is meaningless to put it in the PATH variable.

I am sorry that all what I can suggest because I never use Fluent in win* so that I have no idea of the essential setups for compiling udf in win*.

rayolau July 10, 2013 04:53

PATH --> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin;C:\Fluent.Inc;c:\fluent.inc\ntbin\ntx8 6;

FLUENT_INC --> C:\Fluent.Inc\ntbin\ntx86

Also, I added two more environment variables I've read in:http://zhaoyueshuai.blog.163.com/blo...1122672611933/

And now, I have a different error... :confused:

Code:

>        1 archivo(s) copiado(s).
(system "copy C:\Fluent.Inc\fluent6.3.26\src\makefile_nt.udf libudf2\ntx86\2d\makefile")
        1 archivo(s) copiado(s).
(chdir "libudf2")()
(chdir "ntx86\2d")()
prueba.c
c:\fluent.inc\fluent6.3.26\src\machine.h(114) : warning C4005: 'stdout' : redefinici¢n de macro
        C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\stdio.h(158) : vea la definici¢n anterior de 'stdout'
c:\fluent.inc\fluent6.3.26\src\machine.h(115) : warning C4005: 'stderr' : redefinici¢n de macro
        C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\stdio.h(159) : vea la definici¢n anterior de 'stderr'
c:\fluent.inc\fluent6.3.26\src\machine.h(116) : warning C4005: 'stdin' : redefinici¢n de macro
        C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\stdio.h(157) : vea la definici¢n anterior de 'stdin'
# Generating udf_names.c because of makefile prueba.obj
udf_names.c
c:\fluent.inc\fluent6.3.26\src\machine.h(114) : warning C4005: 'stdout' : redefinici¢n de macro
        C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\stdio.h(158) : vea la definici¢n anterior de 'stdout'
c:\fluent.inc\fluent6.3.26\src\machine.h(115) : warning C4005: 'stderr' : redefinici¢n de macro
        C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\stdio.h(159) : vea la definici¢n anterior de 'stderr'
c:\fluent.inc\fluent6.3.26\src\machine.h(116) : warning C4005: 'stdin' : redefinici¢n de macro
        C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\stdio.h(157) : vea la definici¢n anterior de 'stdin'

# Linking libudf.dll because of makefile user_nt.udf udf_names.obj prueba.obj
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

  Creando biblioteca libudf.lib y objeto libudf.exp

Done.
"c:/MODELOS/compilar"

Opening library "libudf2"...
Error: open_udf_library: %1 no es una aplicación Win32 válida.


Error Object: ()

In the link I put, put that warnings can be ignored, but the error... :( Opening library "libudf2"...
Error: open_udf_library: %1 no es una aplicación Win32 válida.


Error Object: ()

anyone know why this happens? how can fix it? Nothing found on this type of error. Thank you!

blackmask July 10, 2013 05:29

I do not know exactly. As a general rule, do not contain any space or non-ascii characters in the path of your case file. For the testing purpose, you could copy the case file and the udf source file in a root directory, say D:\. Then start fluent, read the case file and re-compile the source file to see if the problem disappears.

rayolau July 10, 2013 07:12

Blackmask, thank you very much for answering so quickly, I changed the folder to "D:/a" and still get the same error. Thanks anyway. I hope I can fix it.:(

rayolau July 10, 2013 07:36

I open the shortcut properties fluent, and PROPERTIES -> Compatibility -> I changed to Windows XP service pack 2. With that I managed to clear the error win32, but now can not find the library.
Code:

>        1 archivo(s) copiado(s).
(system "copy C:\Fluent.Inc\fluent6.3.26\src\makefile_nt.udf libudff\ntx86\2d\makefile")
        1 archivo(s) copiado(s).
(chdir "libudff")()
(chdir "ntx86\2d")()

Done.
"D:/a"

Opening library "libudff"...
Error: open_udf_library: El sistema no puede encontrar el archivo especificado.

Error Object: ()

It seems the problem of environment variables, right?

Hershey July 11, 2013 10:25

I ususally have this problem whenever I install Fluent before Visual Studio. Do this:

1. Open up fluent so that the first thing you see is the Fluent Launcher
2. Click on the Environment tab (you will have to click show more options if it is not there)
3. Make sure the checkbox is ticked for "Setup Compilation Environment for UDF"
4. Take note of the path it has labeled in the box, if it is not there look for it here:

"C:\Program Files\Ansys Inc\v145\fluent\ntbin\win64\udf.bat"

The udf.bat file is what you are looking for and the above location may be slightly different for you. Make sure that the location is written in box mentioned above after this is all done.

This file is making sure that when Fluent loads, the correct environment variables are included. You will want to make sure that code is pointing to the right direction of you visual studio installation.

When I installed Visual Studio 2012, there was no mention of it in the udf.bat file, so I just copied and pasted an older versions line of code and modified the path so Fluent recognized it.

Save any changes in the udf.bat and REMOVE any path variables that you explicitly defined in Windows.

Post back with your results please.

rayolau July 12, 2013 06:55

1 Attachment(s)
Quote:

Originally Posted by Hershey (Post 439181)
I ususally have this problem whenever I install Fluent before Visual Studio. Do this:

1. Open up fluent so that the first thing you see is the Fluent Launcher
2. Click on the Environment tab (you will have to click show more options if it is not there)
3. Make sure the checkbox is ticked for "Setup Compilation Environment for UDF"
4. Take note of the path it has labeled in the box, if it is not there look for it here:

"C:\Program Files\Ansys Inc\v145\fluent\ntbin\win64\udf.bat"

The udf.bat file is what you are looking for and the above location may be slightly different for you. Make sure that the location is written in box mentioned above after this is all done.

This file is making sure that when Fluent loads, the correct environment variables are included. You will want to make sure that code is pointing to the right direction of you visual studio installation.

When I installed Visual Studio 2012, there was no mention of it in the udf.bat file, so I just copied and pasted an older versions line of code and modified the path so Fluent recognized it.

Save any changes in the udf.bat and REMOVE any path variables that you explicitly defined in Windows.

Post back with your results please.

Thanks for your reply!

The first steps you said are not possible for Fluent 6.3.26. When I open this version of Fluent, the launcher is very basic and does not have those options. I searched the file in the folder udf.bat Fluent.inc and I have not. Probably, for this version of Fluent, that file is called differently. I followed the path equivalent to that I've put C: \ Fluent.Inc \ ntbin \ ntx86, and I have these files (image attached with files and launcher)

Thanks in advance!

Hershey July 14, 2013 23:18

Sorry, I did not see that you were using version 6. I am not familiar with setting this version up, but I did have a working copy on my previous computer. Have you tried using the "setenv.exe" that is located in the folder you have posted. It will add the appropriate paths to your system. Maybe they are slightly different than what is listed in previous suggestions.

abhinayiyer2408 September 29, 2015 07:23

Dear Rayolau,

Could you solve the problem??? I'm facing the same problem as yours... Please help me out....:confused: :( :mad:


All times are GMT -4. The time now is 21:45.