How to compile CFX user routine in Linux
Hello,
I am trying to compile a user routine (pt_erosion.F) on a linux cluster. I have installed intels fortran compiler ifort and gfortran. Right now the fortran script is not modified. I have added the path to the include folder (installed in <ANSYS install dir>/CFX/include) to $PATH However, when I am running "ifort pt_erosion.F" it gives the following output pt_erosion.F(1): #error: can't find include file: cfx5ext.h pt_erosion.F(37): #error: can't find include file: cfd_sysdep.h pt_erosion.F(38): #error: can't find include file: cfd_constants.h pt_erosion.F(114): #error: can't find include file: cfd_sysdep.h pt_erosion.F(115): #error: can't find include file: cfd_constants.h Do any of you have any idea how to solve this problem? |
Have you done the HVAC tutorial provided by ANSYS CFX ?
Have you read the documentation regarding creation of shared libraries ? Quote:
|
I have had a look at it, however, I don't seem to know what to do in the linux environment (new to that). I have successfully compiled a windows version of the user routine
|
There is no difference.. Follow the same steps.
|
So on windows when I want to compile the file (after adding all the paths and so on) I first navigate to the intel compiler folder and use "ifortvars.bat intel64"
-first problem: there is no ifortvars.bat (obviously since it is for windows right?) but a .sh and .csh. When I run "ifortvars.sh intel64" for example -bash states ifortvars.sh command is not found. What to do about that? On windows I compile by saying "cfx5mkext -64bit pt_erosion.F". but again -bash can not find the command, here cfx5mkext. And that makes sense since I haven't started ifortvars.sh intel64 right? I am very sorry if I ask stupid questions, however, I don't seem to be able to figure out this from the ANSYS help |
I have tried running ifortvars.sh by the command "sh ./ifortvars.sh intel64" (right way to execute programs in linux?), but I get the following errors
./ifortvars.sh: line 10: syntax error near unexpected token `newline' ./ifortvars.sh: line 10: `PROD_DIR=<INSTALLDIR>' |
Okay, it seams I have gotten this wrong all the time.
First of all pt_erosion.F and cfx5mkext.ccl needs to be in the same directory. With the intel compiler installed, the following command will compile (for 64 bit architecture) the user routine /<ANSYS instal dir>/CFX/bin/cfx5mkext -64bit pt_erosion.F |
how to compiler user routine
Quote:
A folder named "linux-amd64" was created. There have two files named "libTStat_Control.so" and "libTStat_Control.o" in the folder. But when I run HVAC.def I get a dialog box and the follow error. For details of my problem: http://www.cfd-online.com/Forums/cfx...ubroutine.html Please forgive me for a stupid questions I want to ask. What is the step to compiler a user Fortran routine in Linux. Can you help me? Thanks! |
Hello
I hope you can answer me on this I have a problem I do not know how to install FORTRAN on Linux Thank you very mush |
you should have fortran installed, check by typing 'gfortran --version' in your terminal. If you have none, there are plenty of ways you can find online on how to install it. Be sure to check out the tutorials in CFX manual though, as shown here you need cfx5mkext to compile it, aliases can be useful here.
|
Quote:
This problem have been solved by myself. I unstall Intel Fortran Compiler (or you can also delete the environment varibles of Intel Fortran Compiler). Then, I copy the file "cfx5mkext.ccl" to the working directory. And then add the Portland Group compiler flag "-Bstatic_pgi" to every line which starts with "ext link ldflags =" in cfx5mkext.ccl. See CFX tutorials "Compiling User Fortran for use on Linux Machines Without a Compiler Installation" for more details |
Note that Ansys dropped support for all Fortran compilers except Intel with release 17. I believe that Intel Fortran v15.0.2 is the current supported version.
|
Thank you very much for your answer
Do you have any idea about the Real Gas Property table model ? I am using it but the Ansys CFX can not read it On Linux |
Sorry, I have never used it. Have you talked to ansys support about your problems?
|
Quote:
|
All times are GMT -4. The time now is 13:42. |