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

Error: Udf library not compiled on the current platform

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By vinerm
  • 1 Post By vinerm

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 21, 2020, 11:01
Default Error: Udf library not compiled on the current platform
  #1
Member
 
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6
franc1 is on a distinguished road
Hi everybody,

I now that this is a many-times faced problem, but despite i read a lot of suggestions in this forum, i still have this error.

I'm not a master in C language and in compiling. I use ansys 18.1 and VS2015.

I have to use a UDF compiled function in my simulation problem in order to apply a particular boundary condition. I solved the "nmake" problem by running fluent into the command prompt of VS2015.

I go to user-defined-functions>compiled, i load my .c file of my UDF function and i press button "build" near the library name and this message appears:

"Copied C:\Ansys\Projects\TESI\Dati_salvati\UDF_PROCEDURE/C:\Ansys\Projects\TESI\Dati_salvati\UDF_PROCEDURE\ wallheatflux.c to libudf\src
udf_names.c and user_nt.udf files in 2ddp are upto date.
(system "copy "C:\PROGRA~1\ANSYSI~1\v181\fluent"\fluent18.1.0\sr c\udf\makefile_nt.udf "libudf\win64\2ddp\makefile" ")
1 file copiati.
(chdir "libudf")(chdir "win64\2ddp")# Generating ud_io1.h

Done."

Then i press the button "load" and the error is the following:

"Error: The UDF library you are trying to load (libudf) is not compiled for 2ddp on the current platform (win64).\n\n Impossibile trovare il file specificato.
\n\nC:\Ansys\Projects\TESI\Dati_salvati\UDF_PROCED URE\libudf\win64\2ddp\libudf.dll
Error Object: #f "

I put the case and the .c file in the same folder as some tutorials suggest, but the error is the same.

How can i solve this?

Thank you in advance!
franc1 is offline   Reply With Quote

Old   April 21, 2020, 11:27
Default Working Directory
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
Use the command

pwd

in Fluent user interface to check if the current working directory is correct. Since you started from VS Prompt, it is possible that Fluent started from a different directory, hence, is unable to load the library. If it shows the directory that is not same as the location where the library is located, change the directory using command

sync-chdir <directory name where library is located>

And then try to load the library.
franc1 likes this.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   April 21, 2020, 12:34
Default
  #3
Member
 
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6
franc1 is on a distinguished road
Thanks for the reply.

The same error is occurring even if i did what you suggest me.

I note that i have no "libudf.dll" file in the folder "libudf" that i generated. it's for this reason that it cannot find it.
How can i get this .dll file? Is this a specific library which i don't have?
franc1 is offline   Reply With Quote

Old   April 21, 2020, 12:38
Default .dll
  #4
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
When Fluent compiles a library, it generates .dll file. If that is not there, then Fluent did not compile it. The reason for non-compilation should be the log that Fluent creates when you click on Build. Remove the library folder and re-Build. Then check the output within Fluent's interface. Do not load.
franc1 likes this.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   April 21, 2020, 12:55
Default
  #5
Member
 
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6
franc1 is on a distinguished road
Well i removed the library folder and i re-build. It generates a folder "libudf" with inside two folders. The first one is the UDF function i add initially, while the other one is called "2ddp" and inside i have: log, makefile, ud_io1.h, user_nt.udf

No library is created. Is there something important that i forgot?

Thank you for your patience
franc1 is offline   Reply With Quote

Old   April 21, 2020, 12:57
Default Log
  #6
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
Could you copy the log file or Fluent's output in its window here?
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   April 21, 2020, 13:05
Default
  #7
Member
 
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6
franc1 is on a distinguished road
Ok, i didn't know that "log" is kind of an information about the error. Inside the log there is:
""cl" it is not recognized as an internal or external command,
an executable program or batch file.
NMAKE : U1077: 'cl' : return code '0x1'
Stop."

Which means that i did not solve the nmake problem?
franc1 is offline   Reply With Quote

Old   April 21, 2020, 13:07
Default cl
  #8
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
cl is actually linker. The problem is not what you did but how Windows operates. You need to start VS Prompt via Run As Administrator and then launch Fluent to compile the UDF. Then, it will work.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   April 21, 2020, 13:15
Default
  #9
Member
 
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6
franc1 is on a distinguished road
Even if i run as administrator the problem is the same.
I checked the log and is exactly the same as before.
franc1 is offline   Reply With Quote

Old   April 21, 2020, 13:17
Default Log
  #10
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
Could you paste or attach the log file here? It appears that VS is not installed with Administrator privileges.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   April 21, 2020, 13:36
Default
  #11
Member
 
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6
franc1 is on a distinguished road
I can only upload it as a txt file because its normal extension is "invalid file" for the forum.
(the log is in italian)

Thank you a lot
Attached Files
File Type: txt log.txt (149 Bytes, 3 views)
franc1 is offline   Reply With Quote

Old   April 21, 2020, 14:14
Default Installation
  #12
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
Yes, it is pointing towards installation issue in VS. Look at the following

https://www.ibm.com/support/pages/er...turn-code-0x80

While installing VS, you need to ensure that setup is started as Run As Administrator.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   April 21, 2020, 15:10
Default
  #13
Member
 
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6
franc1 is on a distinguished road
Is there a way to change the path without reinstalling the Visual Studio programme?
If not, i just have to run the .exe installation file as administrator?

Thank you a lot
franc1 is offline   Reply With Quote

Old   April 21, 2020, 16:02
Default
  #14
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,761
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Running the .exe as an admin won't help if you're missing paths. Off the top of my head I don't know which ones, but it is an installation problem. Either you change the paths in environmental variables or you re-install it so that the installer sets the right paths.
LuckyTran is offline   Reply With Quote

Old   April 21, 2020, 16:23
Default Path
  #15
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
This could or could not be about the path. Most likely, its about incapability to be able to link. If it is really about path, then usually the path for cl.exe is

C:\Program Files (x86)\Microsoft Visual Studio xx.0\VC\bin

But this is most likely already set. If not, set it and try again. VS also provides multiple command prompts. Prefer to use Developer Command Prompt.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   April 22, 2020, 07:43
Default
  #16
Member
 
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6
franc1 is on a distinguished road
Hi,
i solved the problem of the cl.exe. it wasn't on the VS2015 folders, so i noticed that the C++ language for VS2015 was not installed. I installed it and now the error is about syntax, which i'll try to solve by myself.

Thank you vinerm for the help, it has been very helpful
franc1 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
Current density visualisation (PEM fuel cell add-on module) pchoopanya FLUENT 10 August 21, 2023 15:33
Adding compiled turbulence model to the library - OpenFOAM 5.0 netto005 OpenFOAM Programming & Development 0 April 18, 2018 11:53
UDF library load error smgeorge531 Fluent UDF and Scheme Programming 6 August 26, 2013 05:06
What is the difference between current time step and current time djing FLUENT 4 May 1, 2012 17:18
CFX11 + Fortran compiler ? Mohan CFX 20 March 30, 2011 19:56


All times are GMT -4. The time now is 17:02.