CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   compiling my UDF (https://www.cfd-online.com/Forums/fluent/39576-compiling-my-udf.html)

Seyed Farid Hosseinizadeh February 9, 2006 21:14

compiling my UDF
 
Hi everyone: I wrote a program that it's needed compiling it as a UDF in Fluent. I add my source file and click on Load. When I compile the program (click on Load bottom) the Fluent sends me this error: "Error: open_udf_library: The system cannot find the file specified". I tried to add UDF.H file manually on the Header box and click on Build bottom to building the UDF library but it sends another error: "Error: open_udf_library: The system cannot find the path specified." At the end my Case and Data file together my Source file are in the same directory.

Best Regards, Farid,


mAx February 10, 2006 01:28

Re: compiling my UDF
 
Hi, You have to add your source file, and then to build it. After that, you click on load.


Seyed Farid Hosseinizadeh February 10, 2006 01:47

Re: compiling my UDF
 
Hi Max: Thanks for your favor. I do your guides but still Fluent sends me this error: "c:/seyedfaridhosseinizadeh/fluentrun"

Opening library "libudf"... Error: open_udf_library: The system cannot find the file specified.

Error Object: ()"

I'm looking forward to hearing from you. Regards, Farid,

mAx February 10, 2006 02:15

Re: compiling my UDF
 
ok, look in your workink directory if you have a libudf folder. If yes, then you have to unload your libudf, with define/user-defined/functions/manage and then re-add your source, build and load (define/user-defined/functions/compiled)

Seyed Farid Hosseinizadeh February 10, 2006 02:38

Re: compiling my UDF
 
Hi. I did them but still I have a problem. As you know I don't do anything with Header file. Maybe my problem is this. I don't know and really I'm confused. "c:/seyedfaridhosseinizadeh/fluentrun"

Opening library "libudf"... Error: open_udf_library: The system cannot find the file specified.

Error Object: ()

Regards, Farid,

mAx February 10, 2006 02:57

Re: compiling my UDF
 
be sure, c++ compiler is installed on your machine

HVN February 10, 2006 04:24

Re: compiling my UDF
 
There are some specific compilers to use following your os

sagga February 10, 2006 05:54

Re: compiling my UDF
 
Hi Seyed. I think you should change the name of source code for example " Code1 " . Do not allow the name has space or symbol.

byebye

Venkatesh.V February 10, 2006 09:18

Re: compiling my UDF
 
--> Go to UDF manage menu and if any library is already loaded unload them. Then save the case file.

--> If libudf folder is there in you directory delete it.

--> now try to compile and load the library.

--> Still getting error, check directory has write file access.

--> Still getting error, check for correctness of c Compiler installation.


Tania February 10, 2006 11:50

Re: compiling my UDF
 
Hi Seyed, are you working on windows???

Seyed Farid Hosseinizadeh February 10, 2006 16:30

Re: compiling my UDF
 
Yes I'm working on windows. Thanks Bye

Seyed Farid Hosseinizadeh February 10, 2006 16:34

Re: compiling my UDF
 
Ok. Thanks I do it but it doesn't work. Thanks, Bye

Seyed Farid Hosseinizadeh February 10, 2006 16:36

Re: compiling my UDF
 
Hi: Thanks for your favor. I did anything that you said me. But I still see this error. " 1 file(s) copied. (system "copy C:\FLUENT.INC\fluent6.2.16\src\makefile_nt.udf libudf\ntx86\2ddp\makefile") 1 file(s) copied. 0 (chdir "libudf")() (chdir "ntx86\2ddp")()

Done. "c:/seyedfaridhosseinizadeh/fluentrun"

Opening library "libudf"... Error: open_udf_library: The system cannot find the file specified.

Error Object: () "

Thanks , Bye,

Tania February 10, 2006 16:48

Re: compiling my UDF
 
I got the same problem as yours when I run fluent in Linux. But in windows, every thing worked fine. But of course, I had to install visual C++.

After your built your Udf, do you find a folder named "liduf" in your working directory???

And you should also check that your fluent case is in the same folder as your UDF.

when you built your UDF, do you get any error message???


Seyed Farid Hosseinizadeh February 10, 2006 16:56

Re: compiling my UDF
 
Hi, Yes exactly. I installe Microsoft Visual Studio .Net 2003 that knows C++. I did anysteps that you figured out. At the end, I still recieve this error: " 1 file(s) copied. (system "copy C:\FLUENT.INC\fluent6.2.16\src\makefile_nt.udf libudf\ntx86\2ddp\makefile") 1 file(s) copied. 0 (chdir "libudf")() (chdir "ntx86\2ddp")()

Done. "c:/seyedfaridhosseinizadeh/fluentrun"

Opening library "libudf"... Error: open_udf_library: The system cannot find the file specified.

Error Object: () " Best Regards, farid,

Josh February 13, 2006 11:37

Re: compiling my UDF
 
I have the same prolem. When I interprete my udf, it works will, but when I compile it, it showed the same problem: "Error: open_udf_library: The system cannot find the file specified".

Can any one with UDF experience explain this? Thanks a lot!

Seyed Farid Hosseinizadeh February 13, 2006 13:08

Re: compiling my UDF
 
Hey Man, Me too, If I find my answer I will send to you.

Take Care, Best Regards, Farid,

Josh February 13, 2006 13:21

Re: compiling my UDF
 
Thank you. I am waiting for your good news!

Ravi Duggirala February 13, 2006 16:18

Re: compiling my UDF
 
Hi Guys,

If you are working on WINDOWS and installed Microsoft Visual studios.NET then,

STEP 1: Place the source file in the folder which contain case & data file (place it in C-Drive) [Create a new folder in C-Drive and place the case and data files and the Source file (.c file)]

STEP 2: Start --> All Programs --> Microsoft Visual Studio .NET 2003 --> Visual Studio .NET Tools --> Visual Studio .NET 2003 Command Prompt (it opens a command prompt)

STEP 3: In the command prompt browse the folder in which the case & data files and the source files are placed

STEP 4: Type "fluent 2ddp &" (it opens FLUENT console)

STEP 5: File --> Read --> Case & Data Files (browse for the case and data files)

STEP 6: Define --> User-Defined --> Functions --> Compiled

STEP 7: Add the source files and click BUILD and then click LOAD

Hope this will solve the problem for you people. If you have still some problems please feel free to contact me at duggirk@auburn.edu.

Ravi

Josh February 13, 2006 23:10

Re: compiling my UDF
 
Hi, Ravi,

Thank for your information. The situation to me is that I work in a network computer where everything is installed by the system administrater.

when I build my UDF, the following messege appears:

---------------------------------------------------- Deleted old libudf\ntx86\2ddp\libudf.dll

1 file(s) copied. (system "copy C:\Fluent.Inc\fluent6.2.16\src\makefile_nt.udf libudf\ntx86\2ddp\makefile") 1 file(s) copied. 0 (chdir "libudf")() (chdir "ntx86\2ddp")() '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. -----------------------------------------------------

When I load it, the following messege appears:

---------------------------------------------- "h:/szhao22/nozzle010-1"

Opening library "libudf"... Error: open_udf_library: The system cannot find the file specified.

Error Object: ()

Hope you can point out where the problem is. Thank you very much!

mAx February 14, 2006 01:53

Re: compiling my UDF
 
http://www.fluentusers.com/support/i...aq/openlib.htm ----------- Error: open_udf_library: The system cannot find the path specified Print-friendly

When trying to load a compiled UDF while running Fluent in Network Parallel you receive the error: Error: open_udf_library: The system cannot find the path specified

This error is because the other computer(s) on the cluster cannot "see" the udf through the network. Read and follow the instructions below. These changes have to take place on the computer that the compiled UDF, case and data file reside.

--------------------------------------------------------------------------------

Loading a Compiled UDF When Running Fluent Network Parallel Verify that the FLUENT.INC Environment Variables have been defined. Select the Start Menu, Programs, Fluent Inc Products, Fluent 6.1.xx, Set Environment. Choose YES to Modify. Edit the environment variable values so they don't have a local installation path, for example, C: \Fluent.Inc as all computers you are using to run FLUENT in network parallel must have access to the FLUENT.INC variables. Click on Start, Settings, Control Panel, System. Choose the Advanced Tab, choose Environment Variables. Edit the FLUENT_INC variable value using the network path format \\ followed by the computer name where FLUENT is installed. Edit the Path variable value using the network path format \\ followed by the computer name where FLUENT is installed.

After Edits Note: If you have compiled the UDF while running Fluent Network Parallel you MUST share the directory where the UDF is located so that all computers on the cluster can see this directory.

Share the directory that the case, data, and compiled UDF reside Right-click on the directory and choose Sharing from the menu. Click "Share this folder" Click OK. Note: When the directory is shared you will notice a "hand" under the directory. If you don't see the "Sharing" option contact your System Administrator. The share name, by default, will be the name of the folder/directory. The share name can be changed.

Open up a Command Prompt and browse to the directory where you have your case, data and source file. (The directory cannot contain spaces in the name, for example, C:\ Documents and Settings) Launch FLUENT. In the FLUENT window select Define, User Defined, Functions, Compiled. Choose the Add button to add your source file. Choose the Build button (as long as you are working in the directory that contains the source file you do not need to put a path to the directory in the Library Name box)

After the UDF has been successfully built in the Library Name panel it is necessary to type in the network path to the compiled UDF so that the computer nodes that you are spawning to can "see" the shared directory. Type in the name of the computer where the UDF resides using the \\ format. Type in the name of the shared directory where the UDF resides. In the example below, the shared directory name is "working". Type: libudf. Click Load.

There are many steps that must be taken in order to successfully compile and load UDF's while running FLUENT in Network Parallel.

Please see the document Compiling and Loading User Defined Functions (UDF's) running FLUENT Parallel for specific instructions.


Josh February 14, 2006 10:58

Re: compiling my UDF
 
Thank you very much! mAx.

I think this is the problem and I will follow the instructions to it.

Josh

www February 14, 2006 11:19

Re: compiling my UDF *NM*
 


All times are GMT -4. The time now is 22:39.