3.3.2. Linking a Customized Mesh and Results Export Executable on a Linux Platform

3.3.2.1. Linking a Customized C Mesh and Results Export Executable on a Linux Platform

On most Linux systems you should be able to build the executable with the command:

gcc -g export.c -o export.exe -fopenmp -I<CFXROOT>/include/ -m64 -lm -lc \
-L<CFXROOT>/lib/<OSDIR> -lcclapilt -lio -lmeshexport -lunits -lpgtapi -lratlas_api \
-lratlas -L<AWPROOT>/tp/zlib/1.2.13/linx64/lib -lz

where <CFXROOT> is the directory in which CFX is installed and <OSDIR> is a directory name corresponding to the architecture of the machine.

Here, -lmeshexport, -lratlas_api, -lratlas, -lpgtapi, -lunits, -lcclapilt, and -lio indicate the libraries mentioned above, while -lm, -lc and -fopenmp are system libraries.

In this example, your own export program is named export.c and the executable file will be called export.exe. You should ensure that the libraries to which you are linking (which are in the path given after -L) appear on the command line after the source file (or object file if you are just linking to an existing object).

The compiler flags and required libraries may vary, depending on the compiler and the custom program.

The supported compilers are listed in Compiler Requirements for All Linux Versions in the Ansys, Inc. Installation Guides.

3.3.2.2. Linking a Customized Fortran Mesh and Results Export Executable on a Linux Platform

The following is an example of how to build the executable on Linux, when the source code for the executable is written in Fortran:

ifort myexport.F -L<CFXROOT>/lib/linux-amd64 -lmeshexport -lratlas_api -lratlas \
  -lpgtapi -lunits -lcclapilt -lio -lm -qopenmp -o myexport.exe \
  -L<AWPROOT>/tp/zlib/1.2.13/linx64/lib -lz

The supported compilers are listed in Compiler Requirements for All Linux Versions in the Ansys, Inc. Installation Guides.