CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   On Compiling a UDF (

David Chabot May 16, 2005 11:44

On Compiling a UDF
Hi, I am having difficulty compiling a UDF that was working fine when interpreted. I would be greatful for some help in solving this problem.

I take the following steps: i)Place case file, 1 source file and 1 header file in the same directory. ii) I use the UDF panel. I Add my source file and header file in the proper panels and then click on build. This is were it gets complicated..

I get the following message:

Make sure that UDF source files are in the directory that contains your case and data files. If you have an existing libudf directory, please remove this directory

to ensure that the latest files are used. 1 file(s) copied.

1 file(s) copied. (system "move user_nt.udf libudf\ntx86\2d")0 (system "copy C:\FLUENT.INC\fluent6.1.22\src\makefile_nt.udf libudf\ntx86\2d\makefile") 1 file(s) copied. 0 (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. Opening library "libudf"... Error: open_udf_library: The system cannot find the file specified. Error Object: ()

Relating to this I have A few questions. 1) I have MS VC++ but cannot compile my udf using this program. I get an error message. Is it possbile that my error is due to this. If so, How to be able to compile my udf using MS C++? 2) I read somwhere that one can set the MS VC++ environement variables by running Vcvar32.bat in a command prompt. Does this need to be done each time I open Fluent? 3) I find that Fluent user guide is not clear enough on explaining where to place files that will constitute the library. Should I create folder libudf and put the proper files there?

Thanks in advance

pUl| May 16, 2005 18:20

Re: On Compiling a UDF
'nmake' is not recognized as an internal or external command

There you go. Check your installation, environment variables etc from the FAQ:

david May 17, 2005 09:27

Re: On Compiling a UDF
Thanks for the quick response.

David Chabot May 19, 2005 11:46

Re: On Compiling a UDF
Hi PUI, I tried to set up the Visual C++ environment variables as described in the following link:

After having set the variables, I typed cl in a command prompt window. Ok. I get a similar message but the version of the compiler is slightly different (Compiler Version 12.00.8186 instead of 12.00.8804.)

When I type link/version in a new prompt window I unfortunately do not get what I should. I get the following:

Microsoft (R) Incremental Linker Version 6.00.8168 Copyright (C) Microsoft Corp 1992-1998. All rights reserved. LINK : fatal error LNK146: no argument specified with option "/version"

Note that the linker version is not the one suggested by Fluent. I downloaded Microsoft Visual Studio 6 full version of Service Pack 6 and installed it so I'm surprised to see that the versions (both for compiler and linker) differ from what is suggested on the Fluent website.

Any suggestions? Let me know if you'd like to see the log file generated by FLuent when attempting to build the library. Many thanks David

pUl| May 19, 2005 15:27

Re: On Compiling a UDF
yes, the log file please.

David Chabot May 20, 2005 09:13

Re: On Compiling a UDF
HI PU1l, It appears that my problem was that I had a syntax error in my interpreted code itself (although I could use it with no problem). When compiling, this syntax error was picked up. That was causing this problem.

Thanks for your time Regards, David

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