|
[Sponsors] |
June 3, 2015, 08:30 |
How to compile CFX user routine in Linux
|
#1 |
New Member
Join Date: Apr 2015
Posts: 7
Rep Power: 11 |
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? |
|
June 3, 2015, 09:55 |
|
#2 | |
Senior Member
Join Date: Jun 2009
Posts: 1,869
Rep Power: 33 |
Have you done the HVAC tutorial provided by ANSYS CFX ?
Have you read the documentation regarding creation of shared libraries ? Quote:
|
||
June 3, 2015, 09:57 |
|
#3 |
New Member
Join Date: Apr 2015
Posts: 7
Rep Power: 11 |
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
|
|
June 3, 2015, 10:05 |
|
#4 |
Senior Member
Join Date: Jun 2009
Posts: 1,869
Rep Power: 33 |
There is no difference.. Follow the same steps.
|
|
June 3, 2015, 10:52 |
|
#5 |
New Member
Join Date: Apr 2015
Posts: 7
Rep Power: 11 |
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 |
|
June 3, 2015, 11:01 |
|
#6 |
New Member
Join Date: Apr 2015
Posts: 7
Rep Power: 11 |
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>' |
|
June 4, 2015, 05:36 |
|
#7 |
New Member
Join Date: Apr 2015
Posts: 7
Rep Power: 11 |
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 |
|
April 24, 2016, 23:46 |
how to compiler user routine
|
#8 | |
New Member
Bruce Xiao
Join Date: Jan 2015
Posts: 26
Rep Power: 11 |
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! |
||
April 27, 2016, 05:28 |
|
#9 |
Member
Yuva
Join Date: Oct 2015
Location: Korea Rep of
Posts: 33
Rep Power: 11 |
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 |
|
April 27, 2016, 10:09 |
|
#10 |
Member
Join Date: Jan 2016
Posts: 34
Rep Power: 10 |
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.
|
|
May 3, 2016, 07:19 |
|
#11 | |
New Member
Bruce Xiao
Join Date: Jan 2015
Posts: 26
Rep Power: 11 |
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 |
||
May 3, 2016, 07:47 |
|
#12 |
Senior Member
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22 |
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.
|
|
May 3, 2016, 08:46 |
|
#13 |
Member
Yuva
Join Date: Oct 2015
Location: Korea Rep of
Posts: 33
Rep Power: 11 |
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 |
|
May 3, 2016, 08:49 |
|
#14 |
Senior Member
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22 |
Sorry, I have never used it. Have you talked to ansys support about your problems?
|
|
May 3, 2016, 09:06 |
|
#15 |
New Member
Bruce Xiao
Join Date: Jan 2015
Posts: 26
Rep Power: 11 |
Sorry, I do not know about the "Real Gas Property table model ". I suggest you search "Real Gas Property" in CFX tutorial. Maybe you can get some usefull infortmation about this problem.
|
|
Tags |
compile, fortran, linux, pt_erosion, user routine |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
User Fortran with CFX 14.5.7 on winnt_amd64 | HLo | CFX | 22 | December 13, 2015 09:26 |
How to get vertex(node) number in CFX user Fortran.. | flyply | CFX | 4 | February 4, 2014 20:51 |
CFX in linux red hat does wrok | timguo | CFX | 3 | January 28, 2014 03:51 |
CFD Short Course & CFX User Day | Chris Reeves | CFX | 0 | September 11, 2000 09:53 |
CFX User Subroutine Archive | David Creech | Main CFD Forum | 0 | March 17, 1999 13:41 |