CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   compiling my Udf (http://www.cfd-online.com/Forums/fluent-udf/84600-compiling-my-udf.html)

noa February 3, 2011 09:11

compiling my Udf
 
I am working on windows NT 6.1 (64bit) at Ansys 13. I can't compile my udf



1. I followed the following instructions:

How can I manage to compile my UDF with Windows 7 64bit?

How can I manage to compile my UDF with Windows 7 64bit?

  • Install Visual Studio. Most of the time the Visual C++ 2008 Express Edition [3] is recommended. On my system it even works with the new Visual Studio 2010 Professional Release Candidate [4].
  • Set the correct environment variables. Browse your way through the Windows system control to 'System'. There you will find a section 'Advanced system settings'. In the following dialog go to the 'Advanced' tabulator and click on 'Environment variables' (lower right corner). Go through the 'System variables' list and search for the 'Path' entry. Add the following to the variable: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin;C:\Program Files\ANSYS Inc\v120\fluent\ntbin\win64. Adjust this entry to your system concerning the installation directories! The Visual Studio entry should point to the location where 'nmake' is located.
  • Install a Software Development Kit (SKD) for 64bit systems. This may be the difference between 32bit and 64bit systems. I have used the .NET Framework 2.0 Software Development Kit (SDK) (x64) from 2006 [5] because it is explicitly for 64bit systems and I was not sure if more recent versions are for 64bit systems as well.
  • Start FLUENT from the SDK command prompt. Do not use the Visual Studio command prompt, use the SDK command prompt! Go to the directory your case is in and type 'fluent'.


2. I verified the path is right and changed it to:
Microsoft Visual Studio 9.0 and to v 130.


3. I could start Fluent from the SDK prompt.

4. When I compiled the c file, there were no errors.

5. When I loaded the file I got the following message



> 1 file(s) copied.
(system "copy "C:\PROGRA~1\ANSYSI~1\v130\fluent"\fluent13.0.0\sr c\makefile_nt.udf "libudf\win64\2d\makefile" ")
1 file(s) copied.
(chdir "libudf")()
(chdir "win64\2d")()
# Generating ud_io1.h
Done.
Opening library "D:\sarit\tut6_files\dp0\FFF\Fluent\libudf"...
Error: The UDF library you are trying to load (libudf) is not compiled for 2d on the curent platform (win64).
The system cannot find the file specified.
D:\sarit ut6_files\dp0\FFF\Fluent\libudf\win64\2d\libudf.dl l
Error Object: #f


What to do?

DoHander February 3, 2011 10:15

With Visual Studio 2008 Pro if you start Fluent from the Visual Studio command prompt it works. I've tested this on Windows 7 64 bits.

noa February 3, 2011 10:35

compiling udf
 
When I do it, I get:

Deleted old libudf\win64\2d\libudf.dll
1 file(s) copied.
(system "copy "C:\PROGRA~1\ANSYSI~1\v130\fluent"\fluent13.0.0\sr c\makefile_nt.udf "libudf\win64\2d\makefile" ")
1 file(s) copied.
(chdir "libudf")()
(chdir "win64\2d")()
# Generating ud_io1.h
unsteady_4.c
# Generating udf_names.c because of makefile unsteady_4.obj
udf_names.c
# Linking libudf.dll because of makefile user_nt.udf udf_names.obj unsteady_4.obj
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
Done.

noa February 4, 2011 00:42

Can someone please look at this problem?

doctsh February 19, 2011 05:27

Hi...

It happened for me...spend lots of sleepless nights....

found very simple solution (accidently, of-course as I am a novice).

Build the udf after that copy the source .c file and put it in newly (fluent) created folder called 'src'.

Now again build, now you can see the whole code compiled and then you can load!

mohsen cheraghi April 26, 2011 02:06

Great..... Thanks.

Vidit Sharma November 2, 2012 07:52

Quote:

Originally Posted by doctsh (Post 296035)
Hi...

It happened for me...spend lots of sleepless nights....

found very simple solution (accidently, of-course as I am a novice).

Build the udf after that copy the source .c file and put it in newly (fluent) created folder called 'src'.

Now again build, now you can see the whole code compiled and then you can load!

Dear sir,

I have tried what u told but it didnt worked for me. Can u plz explain?? I really need to run this udf.

Regards


All times are GMT -4. The time now is 14:42.