...
Although it is not normally necessary to specify them, the following examples show the recommended compiler options and how to set them for the cmake and configure commands.
| Section |
|---|
| Section |
|---|
| Column |
|---|
| Panel |
|---|
| borderColor | white |
|---|
| bgColor | white |
|---|
| titleBGColor | white |
|---|
| borderStyle | dotted |
|---|
| title | If using 'configurecmake' command |
|---|
| | Code Block |
|---|
| title | gcc/gfortran compilers |
|---|
| export CC=gcc
export FC=gfortran
export CCFLAGScmake .... -DCMAKE_C_FLAGS="-g -O2"
export FCFLAGS -DCMAKE_Fortran_FLAGS="-g -O2" |
| Code Block |
|---|
| export CC=icc
export FC=ifort
export CFLAGScmake ... -DCMAKE_C_FLAGS="-g -O1 -fp-model precise"
export FCFLAGS \
-DCMAKE_Fortran_FLAGS="-g -O1 -fp-model precise" | |
| | Column |
|---|
| language | bash |
|---|
| title | Cray compiler (cce) |
|---|
|
| | Panel |
|---|
| borderColor | white |
|---|
| bgColor | white |
|---|
| titleBGColor | white |
|---|
| borderStyle | dotted |
|---|
| title | If using 'cmake' command |
|---|
| | Code Block |
|---|
| title | gcc/gfortran compilers |
|---|
| export CC=gcccc
export FC=gfortranftn
cmake .... -DCMAKE_C_FLAGS="-gO1 -O2"G2 -DCMAKEhflex_Fortran_FLAGS="-g -O2mp=conservative -hadd_paren -hfp1" \
-DCMAKE_Fortran_FLAGS="-O1 -G2 -hflex_mp=conservative -hadd_paren -hfp1" |
| Code Block |
|---|
| export CC=iccxlc_r
export FC=ifortxlf90_r
cmake ... -DCMAKE_C_FLAGS="-g -O1O2 -fp-model preciseqstrict -qarch=auto -qtune=auto" -DCMAKE_Fortran_FLAGS="-g -O1O2 -fp-model precise" |
|
|
|
| Note |
|---|
We currently recommend not using a higher optimization level than -O1 with the Intel compiler. Failures have been seen with grib_api and the Intel compiler when compiled with -O2. |
qstrict -qarch=auto -qtune=auto" |
|
|
|
| Column |
|---|
| Panel |
|---|
| borderColor | white |
|---|
| bgColor | white |
|---|
| titleBGColor | white |
|---|
| borderStyle | dotted |
|---|
| title | If using 'configure' command |
|---|
| | Code Block |
|---|
| title | gcc/gfortran compilers |
|---|
| language | bash |
|---|
| title | Cray compiler (cce) |
|---|
| export CC=ccgcc
export FC=ftngfortran
export CFLAGSCCFLAGS="-O1g -G2 -hflex_mp=conservative -hadd_paren -hfp1O2"
export FCFLAGS="-O1g -G2 -hflex_mp=conservative -hadd_paren -hfp1"O2"
./configure ... |
| Code Blockcode |
|---|
| export CC=xlc_ricc
export FC=xlf90_rifort
export CFLAGS="-g -O2O1 -qstrict -qarch=auto -qtune=autofp-model precise"
export FCFLAGS="-g -O2O1 -qstrict -qarch=auto -qtune=auto" |
|
| | Column |
|---|
fp-model precise"
./configure ... |
| | Panel |
|---|
| borderColor | white |
|---|
| bgColor | white |
|---|
| titleBGColor | white |
|---|
| borderStyle | dotted |
|---|
| title | If using 'cmake' command |
|---|
| | Code Block |
|---|
| language | bash |
|---|
| title | Cray compiler (cce) |
|---|
| export CC=cc
export FC=ftn
cmake ... -DCMAKE_C_FLAGSexport CFLAGS="-O1 -G2 -hflex_mp=conservative -hadd_paren -hfp1" -DCMAKE_Fortran_FLAGS
export FCFLAGS="-O1 -G2 -hflex_mp=conservative -hadd_paren -hfp1"
./configure ... |
| Code Block |
|---|
| export CC=xlc_r
export FC=xlf90_r
cmake ... -DCMAKE_C_FLAGSexport CFLAGS="-g -O2 -qstrict -qarch=auto -qtune=auto" -DCMAKE_Fortran_FLAGS
export FCFLAGS="-g -O2 -qstrict -qarch=auto -qtune=auto"
./configure ... |
|
|
|
| Note |
|---|
|
We currently recommend not using a higher optimization level than -O1 with the Intel compiler. Failures have been seen with grib_api and the Intel compiler when compiled with -O2. |
| Note |
|---|
|
For the IBM xlc compiler we recommend disabling the creation of 'shared libraries' which is known to cause problems with some versions of grib_api. In this example, note the use of the '_r' form of the IBM compiler to ensure grib_api is compiled 'thread-safe'. |
...