...
By default, cmake and configure will use the preferred compiler (by searching your PATH environment variable). This may not be what you need if you have multiple compilers available. As in the above example, we enforce the use of the GNU C and Fortran compilers (as this is the default compiler for OpenIFS). If you intend to use other compilers with OpenIFS you will need to set these appropriately.
Recommended options are conservative to ensure stability and bit-reproducibility. The cmake and configure commands usually chooses a sensible set of optimized compiler flags for the choice of supported compiler.
The following examples show the recommended compiler options and how to set them for the cmake and configure commands.
Code Block |
---|
title | gcc/gfortran compilers |
---|
|
export CC=gcc
export FC=gfortran
export CCFLAGS="-g -O2"
export FCFLAGS="-g -O2" |
...
Code Block |
---|
language | bash |
---|
title | Cray compiler (cce) |
---|
|
export CC=cc
export FC=ftn
export CFLAGS="-O1 -G2 -hflex_mp=conservative -hadd_paren -hfp1"
export FCFLAGS="-O1 -G2 -hflex_mp=conservative -hadd_paren -hfp1" |
Code Block |
---|
|
export CC=pgcc
export FC=pgf90
export CFLAGS="-g -O2"
export FCFLAGS="-g -O2" |
...