Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

Section
Column

 

Code Block
titlegcc/gfortran compilers
export CC=gcc
export FC=gfortran
export CCFLAGS="-g -O2"
export FCFLAGS="-g -O2"

...

Code Block
languagebash
titleCray 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
titlePortland compiler:
export CC=pgcc
export FC=pgf90
export CFLAGS="-g -O2"
export FCFLAGS="-g -O2"

...