Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Error while compiling udf on linux

TAGGED: 

    • Shyam Prasad V Atri
      Subscriber

      I tried to compile the udfs on linux with GUI I keep getting this error please let me know how to fix this

    • Rob
      Forum Moderator

      Check you haven't got the built in compiler selected, it's not needed on Linux as it's a proper OS and has it's own compiler. Unfortunately the built in compiler doesn't link on Linux so can cause problems if selected. 

    • Shyam Prasad V Atri
      Subscriber

      I don't have the built in compiler selected. 

    • Rob
      Forum Moderator

      What's the rest of the message? 

    • Shyam Prasad V Atri
      Subscriber

      this is the rest of the message

      i don't know why its not allowing me to compile it..on linux

    • Rob
      Forum Moderator

      Did it compile on Win10?  If so, did you use DOS2UNIX on the .c file on Linux before compiling? 

    • Shyam Prasad V Atri
      Subscriber

      yes this works in Windows 10

    • Shyam Prasad V Atri
      Subscriber

      what is DOS2UNIX on .c ? i just transferred the entire folder to Linux system and tried to initiate the simulation

    • Rob
      Forum Moderator

      Did you open the Fluent session & recompile? 

      DOS2UNIX is a utility to resolve problems where Windows adds weird and wonderful whitespace characters to text files. Linux thinks these characters mean something and then struggles to compile. 

    • Shyam Prasad V Atri
      Subscriber

      Yes I opened fluent and re compiled the UDF... I was not aware of that white space thing.. so does it mean that I have to retype all the UDF and it should compile? 

    • Rob
      Forum Moderator

      No, the command

      DOS2UNIX filename.c 

      ought to do it. 

      Does "force=7-2D.c" exist anywhere in your code?  Remember Fluent Linux will struggle with spaces/odd characters even more so than Windows.  

    • Shyam Prasad V Atri
      Subscriber

      yes  "force=7-2D.c"  file exists. But anyway i have renamed this file. I used the dos2unix command and converted the files. But i still see this. so is this an error now? i don't see nmake error this time.

       

       

      I am using 2d model so why do i get this error

       

    • Rob
      Forum Moderator

      That looks like an external compiler - open Fluent directly and see what happens. No need to open a case, just Fluent solver. To confirm, you're using the same version of Fluent in both cases?  

    • Shyam Prasad V Atri
      Subscriber

      I am using the same version of fluent

      from ansys/21.2

      this is from the GUI

      please let me know how to fix that error

    • Rob
      Forum Moderator

      OK, so Fluent loads, what I meant was to try compiling in Fluent and see what's going on. 

    • Shyam Prasad V Atri
      Subscriber

      I get the same message when I use the journal or when I use the GUI.

       

    • Rob
      Forum Moderator

      If you check the "n" and othe parts of the error what are the rules? The common reasons for code to fail on Linux but work on Win10 are whitespace characters and there are a few C commands that aren't supported. Without seeing any of the code (and I won't be debugging it) I can't see why it's not working. 

    • Shyam Prasad V Atri
      Subscriber

      Sure i will debug it myself. but what am i supposed to be looking for?

      I don't understand this statement

      "If you check the "n" and othe parts of the error what are the rules?" which "n" are you referring to?

      it works on windows and not on linux this is so strange.

      Is there any document which says what is different in linux and windows specifically for ansys udf?

      Because i don't see anything wrong with the program because it works well with Windows.

    • Rob
      Forum Moderator

      "No rule to make target n, needed by adjust-E" in the original error. Just checked it was Linux UDF that failed on Win10, so back to looking at your code. 

    • Shyam Prasad V Atri
      Subscriber

      No. Windows UDF is failing on linux. The udf is working fine without any problem in Win.

      "No rule to make target n, needed by adjust-E" What does this mean? I don't have any variable named n in adjust-E

       

       

    • Rob
      Forum Moderator

      What does adjust-E do? 

    • Shyam Prasad V Atri
      Subscriber

      it computes the electric field.

    • Shyam Prasad V Atri
      Subscriber

      Hello I just wanted to follow up. Is there any resolution to the problem? or can i neglect that error please let me know.

    • Rob
      Forum Moderator

      If it's an error it's not compiled. Does it do what you expect? 

    • Shyam Prasad V Atri
      Subscriber

      no it doesn't do what i expect it to do

      i still see that on the transcript

       

      i see this new error now

      i keep getting this error now. I am using the same version of ansys on linux as well as Windows (ansys/21.2). so not sure why this keeps coming up. what is the work around for this? do i need to recreate the model in Linux again?

    • Rob
      Forum Moderator

      Most of the error is saying the library isn't compiled. 

    • Shyam Prasad V Atri
      Subscriber

      But i have compiled the udf

      with this command this is in the tui command

      i use the same command in windows

      and it works without any errors

       

    • Shyam Prasad V Atri
      Subscriber

      I even load the UDFs

       

    • Rob
      Forum Moderator

      Then why is the error saying it's not compiled for the current platform? 

    • Shyam Prasad V Atri
      Subscriber

      I dont know. I tried to use the GUI on HPC cluster and it runs and i get the expected results.I believe its the issue with the TUI command.

      Does linux have a different tui command syntax? Because the above tui script works without any problems on windows

    • Shyam Prasad V Atri
      Subscriber

      never mind i found the problem

       

      the marked section has to be different for linux. it asks for header files saperatrtely and I don't have any new header files. but I would like to report this as a problem.

      in windows, the above tui script works without any problems. I get the desired output but in linux the TUI script needs to be changed. and another big issue with linux is the GUI is not good and we are advised against using it.

    • Shyam Prasad V Atri
      Subscriber

      I want to say the problem is not fixed..i am really frustrated with these bad TUI commands of ansys.

      If i give this commands individually in the linux GUI it works 

      but why does it not work when i submit this to lsf as input file. what is wrong here?

      it stops at this

      define/user-defined/compiled-functions/load "libudf16" 

      and keeps giving the error as mentioned above.

    • Rob
      Forum Moderator

      I'm always wary of running journals without the / at the beginning of the command string, ie

      /define/stuff etc

      Why aren't the .c files in the working directory? 

       

       

    • Shyam Prasad V Atri
      Subscriber

      its on the working directory. as far as /define goes i have tried both with and without / it works. but why is it not loading?

      i cant seem to understand why what is the exact way to load? it loads when i put the same commands on the console but does not work when i put it in load.in file and submit it on LSF

      please let me know what is the right format of the command on linux. the above command workes well with windows 

    • Shyam Prasad V Atri
      Subscriber

      Hey I am able to run this on the console if i run this separately

      run line 1-8 

      then run lines 9-25

      then run lines 26-30

      so i think i need to give pauses somewhere

      i used to use this when i run the tui on Windows

      (cx-pause 2)

      i guess this is a GUI command

      is there any equivalent command of this in linux? that can run when i pass it in LSF script?

       

    • Rob
      Forum Moderator

      The journal should pause when waiting for a previous line to finish, ie the command after the iterations must wait for the iterations to complete. 

      What menu level are you in when line 8 completes? 

    • Shyam Prasad V Atri
      Subscriber

      it is in solve level when line 8 completes. but even if i come back to the starting level i am not able to run the lines 9-25 continuously

      it gives me the error and after that it runs if i compile it again.

      I have to run lines 9-25 twice to make it work. not sure why this happens.

    • Rob
      Forum Moderator

      If it completes 8 in the /solve level then the next command can't run as there's no define at that level. Hence my comment about the / symbols. Running a journal section twice only makes a difference if it either changes a menu level or accidentally triggers something else. 

      We used to run setup files 3 times as those used to set models and bcs in such a way as not everything was set on the first pass. Ie buoyancy terms in the viscous panel aren't available until gravity is on operating conditions are after models in the file structure. 

Viewing 37 reply threads
  • The topic ‘Error while compiling udf on linux’ is closed to new replies.