CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

compiling udf on windows7 64-bit

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By adi.ptb
  • 1 Post By dtmith

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 23, 2014, 08:56
Default compiling udf on windows7 64-bit
  #1
Member
 
ad
Join Date: Apr 2014
Posts: 75
Rep Power: 12
adi.ptb is on a distinguished road
i tried to compile a udf on winx64,i did nearlly everything that was out there but nothing seemd to work for me,i kept getting the"Error:The UDF library you are trying to load (libudf) is not compiled for 2ddp on the current platform (win64)" when i run fluent using visual studio x64 command prompt i had this error: win SDk Dir not found,and using the windows7 SDK cmd shell i had this error:the x64 compilers are not currently installed. after a whole week working on it finallay i found the solution heres what you need and what you should do:
my softwares:Ansys fluent15.0(64bit),Microsoft windows7 SDK.Net framework4.0,visual studio 10 ultimate,VC++ 10 express
set your variables as:
(control panel-->system-->advanced system settings-->environment variables-->system variables-->add)
name:Include
value:

:\Program Files\Microsoft SDKs\Windows\v7.1\Include;C:\Program Files (x86)\Microsoft Visual Studio10.0\VC\atlmfc\include;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include
name:Lib
value:C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib
name:Libpath
value: C:\Windows\Microsoft.NET\Framework64\v4.30319;C:\W indo ws\Microsoft.NET\Framework64\v2.0.50727;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib
this the important one
nameath
value:C:\Program Files\ANSYS Inc\v150\fluent\ntbin\win64;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin;C:\Windows\Microsoft.NET\Framework64\v 4 .30319;C:\Windows\Microsoft.NET\Framework64\v2.0.5 0727 ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcpackages;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools;C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\x64;C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin;"C:\Windows\System32"
the red one is the whole solution
after setting your environment variables run fluent from SDK cmd shell:
start-->all programs-->microsoft windows SDK v7.1-->windows SDK 7.1 command prompt
then go to your working directory where your cas and c files are then copy the address of your working directory for example my working directory is (C:\Users\edi\Desktop\kkk)
in command prompt type:cd (right click and paste your working directory address) for example:cd
C:\Users\edi\Desktop\kkk
press enter then type fluent then press enter
after that read your mesh file and compile your udf
cheers
ndabir likes this.
adi.ptb is offline   Reply With Quote

Old   November 26, 2014, 13:30
Default
  #2
New Member
 
Join Date: Nov 2014
Location: SP, Brazil
Posts: 5
Rep Power: 11
ana_mg is on a distinguished road
Hi, I also was trying with this modification and adding the same variables:
name:Include
value:c:\Program Files\Microsoft SDKs\Windows\v7.1\Include;C:\Program Files (x86)\Microsoft Visual Studio10.0\VC\atlmfc\Include;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Include
name:Lib
value:C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib
name:Libpath
value: C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Windows\Microsoft.NET\Framework64\v2.0.5 0727;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib

name: path
value:C:\Program Files\ANSYS Inc\v150\fluent\ntbin\win64;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin;C:\Windows\Microsoft.NET\Framework64\v 4.0.30319;C:\Windows\Microsoft.NET\Framework64\v2. 0.5 0727 ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcpackages;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools;C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\x64;C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin;"C:\Windows\System32"

Are you sure that the last part is correct? Probably it should be ;C:<working directory> not the "C:\Windows\System32"

Thanks
ana_mg is offline   Reply With Quote

Old   November 27, 2014, 10:10
Default
  #3
Member
 
ad
Join Date: Apr 2014
Posts: 75
Rep Power: 12
adi.ptb is on a distinguished road
I'm positive
adi.ptb is offline   Reply With Quote

Old   March 10, 2015, 10:28
Default
  #4
New Member
 
Join Date: Mar 2015
Posts: 9
Rep Power: 11
dtmith is on a distinguished road
Awesome, thanks! I've spent ages trying to get parallel compiling working in Windows 7 64 bit with ansys 15. I've done so many things I'm not exactly sure which ones are necessary, but I used all your environment variables, modified to work with Visual Studio 12 and SDK v7.0 instead of v7.1, I couldn't find and folders labelled "atlmfc" so I left those out but it worked fine anyway.

For people having similar issues, I also followed this (in addition to adding all the environment variables mentioned here)
http://www.simutechgroup.com/CFD/com...5-or-15-0.html

With the slight modification that I ran fluent through the "Microsoft Windows SDK v7.0" command prompt rather than the Visual Studio one.

Now I just have to figure out how to write my UDF to do what I want, but at least it's compiling now!
khaled_khafagy likes this.
dtmith is offline   Reply With Quote

Old   June 23, 2015, 11:58
Default
  #5
New Member
 
Ericson
Join Date: Jun 2015
Posts: 10
Rep Power: 10
Ericson is on a distinguished road
Where is the place for adding the variables?
User variables or System variables...
Ericson is offline   Reply With Quote

Old   June 24, 2015, 03:16
Default
  #6
Member
 
ad
Join Date: Apr 2014
Posts: 75
Rep Power: 12
adi.ptb is on a distinguished road
system variables
adi.ptb is offline   Reply With Quote

Old   November 16, 2015, 11:02
Default
  #7
New Member
 
Ericson
Join Date: Jun 2015
Posts: 10
Rep Power: 10
Ericson is on a distinguished road
I've make my environment variable like yours,, but when i'm trying to compile my udf, i've got this error message :


Copied G:\udf.c to libudf\src
(system "copy "C:\PROGRA~1\ANSYSI~1\v140\fluent"\fluent14.0.0\sr c\makefile_nt.udf "libudf\win64\3ddp\makefile" ")
1 file(s) copied.
(chdir "libudf")()
(chdir "win64\3ddp")()
# Generating ud_io1.h
udf.c
# Generating udf_names.c because of makefile udf.obj
udf_names.c
# Linking libudf.dll because of makefile user_nt.udf udf_names.obj udf.obj
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.

LINK : fatal error LNK1104: cannot open file 'LIBCMT.lib'

What should I do???
Ericson is offline   Reply With Quote

Old   March 7, 2016, 21:11
Default
  #8
Senior Member
 
navid
Join Date: Jan 2010
Posts: 110
Rep Power: 16
ndabir is on a distinguished road
Hi ad,

Thanks for your solution. It worked perfectly for me after struggling with it for a long time. Now I can compile udf with parallel processing. My only concern is that now I have to run fluent through SDK command prompt. Is there anyway I can compile udf in parallel while I start Fluent from workbench?
ndabir is offline   Reply With Quote

Old   March 12, 2016, 15:20
Default
  #9
Member
 
ad
Join Date: Apr 2014
Posts: 75
Rep Power: 12
adi.ptb is on a distinguished road
I think you should do the following:when you run the fluent from the workbench and the fluent panel opens you choose parallel for processing options and then you just do the usual thing for compiling.
Define---->User-Defined---->Functions----->Compiled
adi.ptb is offline   Reply With Quote

Old   March 14, 2016, 12:39
Default
  #10
Senior Member
 
navid
Join Date: Jan 2010
Posts: 110
Rep Power: 16
ndabir is on a distinguished road
It is not that simple. I have already tried this. When I run the fluent from workbench and compile the udf, I will get this erro:

LINK : fatal error LNK1104: cannot open file 'kernel32.lib'

But if I run fluent from SDk, I can run fluent in parallel with no problem.
ndabir is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
compiling my Udf noa Fluent UDF and Scheme Programming 8 November 7, 2018 20:08
error in compiling udf sugumaran Fluent UDF and Scheme Programming 5 August 26, 2010 15:25
compiling linked udf (C/fortran mixed) bawfuls Fluent UDF and Scheme Programming 0 July 13, 2010 16:53
Compiling UDF in Fluent 12 jsm FLUENT 1 July 22, 2009 07:40
Udf compiling problem ranjit FLUENT 6 February 15, 2007 13:19


All times are GMT -4. The time now is 07:30.