|
[Sponsors] |
September 23, 2014, 09:56 |
compiling udf on windows7 64-bit
|
#1 |
Member
ad
Join Date: Apr 2014
Posts: 75
Rep Power: 12 |
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 |
|
November 26, 2014, 14:30 |
|
#2 |
New Member
Join Date: Nov 2014
Location: SP, Brazil
Posts: 5
Rep Power: 12 |
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 |
|
November 27, 2014, 11:10 |
|
#3 |
Member
ad
Join Date: Apr 2014
Posts: 75
Rep Power: 12 |
I'm positive
|
|
March 10, 2015, 11:28 |
|
#4 |
New Member
Join Date: Mar 2015
Posts: 9
Rep Power: 11 |
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! |
|
June 23, 2015, 12:58 |
|
#5 |
New Member
Ericson
Join Date: Jun 2015
Posts: 10
Rep Power: 11 |
Where is the place for adding the variables?
User variables or System variables... |
|
June 24, 2015, 04:16 |
|
#6 |
Member
ad
Join Date: Apr 2014
Posts: 75
Rep Power: 12 |
system variables
|
|
November 16, 2015, 12:02 |
|
#7 |
New Member
Ericson
Join Date: Jun 2015
Posts: 10
Rep Power: 11 |
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??? |
|
March 7, 2016, 22:11 |
|
#8 |
Senior Member
navid
Join Date: Jan 2010
Posts: 110
Rep Power: 16 |
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? |
|
March 12, 2016, 16:20 |
|
#9 |
Member
ad
Join Date: Apr 2014
Posts: 75
Rep Power: 12 |
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 |
|
March 14, 2016, 13:39 |
|
#10 |
Senior Member
navid
Join Date: Jan 2010
Posts: 110
Rep Power: 16 |
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. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
compiling my Udf | noa | Fluent UDF and Scheme Programming | 8 | November 7, 2018 21:08 |
error in compiling udf | sugumaran | Fluent UDF and Scheme Programming | 5 | August 26, 2010 16:25 |
compiling linked udf (C/fortran mixed) | bawfuls | Fluent UDF and Scheme Programming | 0 | July 13, 2010 17:53 |
Compiling UDF in Fluent 12 | jsm | FLUENT | 1 | July 22, 2009 08:40 |
Udf compiling problem | ranjit | FLUENT | 6 | February 15, 2007 14:19 |