...
Changing compiler options is not normally necessary. However, the following examples show the recommended compiler options and how to set them for the cmake and configure commands.
Panel |
---|
bgColor | lightlightgrey |
---|
borderStyle | dashed |
---|
|
Expand |
---|
title | Compiler options if using cmake (click here)... |
---|
| Panel |
---|
borderColor | white |
---|
bgColor | white |
---|
titleBGColor | white |
---|
borderStyle | dotted |
---|
title | If using 'cmake' command |
---|
| Code Block |
---|
title | gcc/gfortran compilers |
---|
| export CC=gcc
export FC=gfortran
cmake .... -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" |
|
|
|
Panel |
---|
bgColor | lightlightgrey |
---|
borderStyle | dashed |
---|
|
Expand |
---|
title | Compiler options if using configure (click here)... |
---|
| Panel |
---|
borderColor | white |
---|
bgColor | white |
---|
titleBGColor | white |
---|
borderStyle | dotted |
---|
title | If using 'configure' command |
---|
| Code Block |
---|
title | gcc/gfortran compilers |
---|
| export CC=gcc
export FC=gfortran
export CCFLAGS="-g -O2"
export FCFLAGS="-g -O2"
./configure ... |
Code Block |
---|
| export CC=icc
export FC=ifort
export CFLAGS="-g -O1 -fp-model precise"
export FCFLAGS="-g -O1 -fp-model precise"
./configure ... |
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"
./configure ... |
Code Block |
---|
| export CC=xlc_r
export FC=xlf90_r
export CFLAGS="-g -O2 -qstrict -qarch=auto -qtune=auto"
export FCFLAGS="-g -O2 -qstrict -qarch=auto -qtune=auto"
./configure ... |
|
|
|
Compiling, checks and installing
...