With cmake, it is better to use the cmake variables to define the compilers rather than rely on environment variables FC and CC. Code Block |
---|
title | gcc/gfortran compilers |
---|
| export CC=gcc
export FC=gfortran
cmake .... -DCMAKE_C_COMPILER=gcc -DCMAKE_Fortran_COMPILER=gfortran-DCMAKE_C_FLAGS="-g -O2" -DCMAKE_Fortran_FLAGS="-g -O2" |
Code Block |
---|
| export CC=icc
export FC=ifort
cmake ... -DCMAKE_C_FLAGS="-g -O1 -fp-model precise" \
-DCMAKE_Fortran_FLAGS="-g -O1 -fp-model precise" |
Code Block |
---|
language | bash |
---|
title | Cray compiler (cce) |
---|
| export CC=cc
export FC=ftn
cmake ... -DCMAKE_C_FLAGS="-O1 -G2 -hflex_mp=conservative -hadd_paren -hfp1" \
-DCMAKE_Fortran_FLAGS="-O1 -G2 -hflex_mp=conservative -hadd_paren -hfp1" |
Code Block |
---|
| export CC=xlc_r
export FC=xlf90_r
cmake ... -DCMAKE_C_FLAGS="-g -O2 -qstrict -qarch=auto -qtune=auto" \
-DCMAKE_Fortran_FLAGS="-g -O2 -qstrict -qarch=auto -qtune=auto |
|