ticket_216_TicketSummary_AdditionalCMakeConfigFiles - ACCESS-NRI/accessdev-Trac-archive GitHub Wiki
Additional Sample Cmake Configuration files
Following is some sample CMake configuration files which may assist in constructing one that will for our programming environment.
configure_example_intel.sh
This is a sample that ECMWF sent to Jin to show a configuration file for Intel compilers.
#!/usr/bin/ksh
# This is a template of a script for building ODB API. See instructions in file INSTALL.
# Please edit values of the cmake options or delete them.
#export CRAYPE_LINK_TYPE=dynamic
#module load PrgEnv-gnu
module swap PrgEnv-cray PrgEnv-intel
#COMMON_FLAGS="-g -fPIC -dynamic -Wl,--as-needed"
INSTALL_PREFIX=/usr/local/apps/odb_api/$(cat ../../VERSION.cmake|awk '{print $3}'|sed 's/["]//g')/INTEL/140/
ODB_ROOT=/usr/local/apps/odb/CY40R1.001/INTEL/140/
echo INSTALL_PREFIX=$INSTALL_PREFIX
SRC=$(cd ../.. && pwd)
cmake ../.. \
-DCMAKE_BUILD_TYPE=$(basename $(pwd) | sed 's/\W[a-zA-Z0-9]*//') \
-DCMAKE_PREFIX_PATH=/usr/local/apps/ \
-DCMAKE_C_COMPILER=cc \
-DCMAKE_SKIP_RPATH=ON \
-DCMAKE_C_FLAGS="$COMMON_FLAGS -g -traceback " \
-DCMAKE_CXX_COMPILER=CC \
-DCMAKE_CXX_FLAGS="$COMMON_FLAGS" \
-DCMAKE_Fortran_COMPILER=ftn \
-DCMAKE_Fortran_FLAGS="-dynamic -g -openmp -fpp -convert big_endian -integer-size 32 -real-size 64 -fpe0 -traceback -assume byterecl -assume cc_omp -assume underscore -names lowercase -DLINUX" \
-DCMAKE_Fortran_FLAGS_DEBUG="-O0" \
-DCMAKE_Fortran_FLAGS_RELEASE="-O3" \
-DLINKER_LANGUAGE=CXX \
-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX \
-DODB_PATH=$ODB_ROOT \
-DCMAKE_MODULE_PATH=$(cd ../../ecbuild/cmake/ && pwd) \
-DECLIB_SOURCE=$(cd ../../eclib/ && pwd) \
-DBUILD_SHARED_LIBS=OFF \
-DODB_API_MIGRATOR=ON \
-DODB_API_FORTRAN=ON \
-DODB_API_PYTHON=OFF \
-DBISON_EXECUTABLE=/usr/bin/bison \
-DSWIG_EXECUTABLE=/usr/bin/swig
configure_nci_shared_ttl.sh
This is an example that Tan put together for Intel compilers
#!/bin/sh
# This is a template of a script for building ODB API. See instructions in file INSTALL.
# Please edit values of the cmake options or delete them.
# compile-time env
# ToDo
# how to remove all Python modulefiles?
module unload intel-cc intel-fc python python/2.7.6-matplotlib cmake odb
module load intel-cc/14.2.144
module load intel-fc/14.2.144
module load python/2.7.6
module load cmake/3.0.0
# temporary fix before modulefile for ODB becomes available
. /projects/access/da/utilities/odb/scripts/odb.ksh default
SRC=$(cd ../.. && pwd)
cmake ../.. \
-DCMAKE_BUILD_TYPE=production \
-DCMAKE_PREFIX_PATH=$PYTHON_BASE \
-DCMAKE_C_COMPILER=/apps/intel-ct/cc-wrapper/icc \
-DCMAKE_CXX_COMPILER=/apps/intel-ct/cc-wrapper/icpc \
-DCMAKE_Fortran_COMPILER=/apps/intel-ct/fc-wrapper/ifort \
-DCMAKE_INSTALL_PREFIX=/projects/access/apps/odb/odbapi/0.10.3 \
-DFORTRAN_LIBRARIES="-L$INTEL_FC_ROOT/lib/intel64 -lifcore -lifport -liomp5" \
-DCMAKE_C_FLAGS="-nofor_main" \
-DODB_PATH=$ODB_ROOT \
-DECKIT_SOURCE=$SRC/eckit \
-DBUILD_SHARED_LIBS=ON \
-DENABLE_MIGRATOR=ON \
-DENABLE_FORTRAN=ON \
-DENABLE_PYTHON=ON \
-DBISON_EXECUTABLE=/usr/bin/bison \
-DSWIG_EXECUTABLE=/usr/bin/swig
#-DPGI_PATH=/path/to/pgf95
#-DXLF_PATH=/path/to/xlf
#-DFLEX_EXECUTABLE=/usr/local/apps/bison/current/bin/flex