Skip to content

Commit

Permalink
Merge pull request #9 from NCAR/hgoelzer/dutchbuild
Browse files Browse the repository at this point in the history
Add build scripts for dutch national clusters lisa and cartesius
  • Loading branch information
billsacks authored Jan 18, 2018
2 parents 0ba164e + 0bb68a5 commit 3488e2e
Show file tree
Hide file tree
Showing 4 changed files with 333 additions and 0 deletions.
89 changes: 89 additions & 0 deletions builds/cartesius-intel/cartesius-intel-cmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Run this script by typing: source cartesius-intel-cmake
# After this script completes, type: make -j 8
# If rebuilding, type 'make clean' before running 'make -j 8'

# This cmake configuration script is set up to perform a parallel build without Trilinos

# Set path to top cism directory
# Note, this is an easy way to build out of source.
# In directory you want to build in, run:
# source $CISM/builds/cartesius-intel/cartesius-intel-serial-cmake $CISM
# where $CISM is the path to the top level cism directory.
if [ $# -eq 0 ]
then
cism_top="../.."
else
cism_top=${1%/}
fi

echo CISM: "${cism_top}"

module purge
module load surfsara
module load hdf5/impi/intel/1.8.14
module load cmake/3.5.2
module load mkl/11.2
module load netcdf-fortran/impi/intel/4.4.2
module load netcdf-c/impi/intel/4.3.3.1
module load python/2.7.9

## Resulting module list
# 1) compilerwrappers 7) hdf5/impi/intel/1.8.14(default)
# 2) c/intel/15.0.0(default) 8) cmake/3.5.2(default)
# 3) fortran/intel/15.0.0(default) 9) mkl/11.2(default)
# 4) mpi/impi/5.0.3.048(default) 10) netcdf-fortran/impi/intel/4.4.2(default)
# 5) bull 11) netcdf-c/impi/intel/4.3.3.1(default)
# 6) surfsara 12) python/2.7.9(default)

## where 'module load surfsara' will give you the following
# 1) compilerwrappers 3) fortran/intel/15.0.0(default) 5) bull
# 2) c/intel/15.0.0(default) 4) mpi/impi/5.0.3.048(default) 6) surfsara

# remove old build data:
rm -f ./CMakeCache.txt
rm -fr ./CMakeFiles

echo
echo "Doing CMake Configuration step"

# A few non-intuitive things:
#
# - CISM_FORCE_FORTRAN_LINKER: without this, cmake tries to use a C++ linker, which doesn't work
#
# - CISM_INCLUDE_IMPLICIT_LINK_LIBRARIES: if this is on (the default), some
# libraries are included on the link line which can't be found (e.g.,
# hdf5). This may be related to the fact that trilinos on yellowstone is old,
# and/or the fact that cmake wants to use a C++ linker but we're telling it to
# use a fortran linker.

cmake \
-D CISM_BUILD_CISM_DRIVER:BOOL=ON \
-D CISM_ENABLE_BISICLES=OFF \
-D CISM_ENABLE_FELIX=OFF \
\
-D CISM_USE_TRILINOS:BOOL=OFF \
-D CISM_MPI_MODE:BOOL=ON \
-D CISM_SERIAL_MODE:BOOL=OFF \
\
-D CISM_USE_GPTL_INSTRUMENTATION:BOOL=OFF \
-D CISM_COUPLED:BOOL=OFF \
-D CISM_USE_CISM_FRONT_END:BOOL=OFF \
\
-D CISM_TRILINOS_DIR=$SURFSARA_TRILINOS_ROOT \
-D CISM_NETCDF_DIR=$SURFSARA_NETCDFC_ROOT \
-D CISM_FORCE_FORTRAN_LINKER:BOOL=OFF \
-D CISM_INCLUDE_IMPLICIT_LINK_LIBRARIES:BOOL=ON \
-D CMAKE_VERBOSE_MAKEFILE:BOOL=OFF \
\
-D CMAKE_CXX_COMPILER=mpiicpc \
-D CMAKE_C_COMPILER=mpiicc \
-D CMAKE_Fortran_COMPILER=mpiifort \
\
-D CMAKE_Fortran_FLAGS:STRING="-fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -xHost -O2 -mkl" \
-D CMAKE_C_FLAGS:STRING="-O2 -fp-model precise -xHost" \
-D CMAKE_CXX_FLAGS:STRING="-O2 -fp-model precise -xHost" \
\
-D CISM_EXTRA_LIBS:STRING="-lnetcdff" \
"${cism_top}"

# Note: last argument above "../.." or ${cism_top} is path to top cism directory
87 changes: 87 additions & 0 deletions builds/cartesius-intel/cartesius-intel-serial-cmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Run this script by typing: source cartesius-intel-serial-cmake
# After this script completes, type: make
# If rebuilding, type 'make clean' before running 'make'

# This cmake configuration script is set up to perform a serial build

# Set path to top cism directory
# Note, this is an easy way to build out of source.
# In directory you want to build in, run:
# source $CISM/builds/cartesius-intel/cartesius-intel-serial-cmake $CISM
# where $CISM is the path to the top level cism directory.
if [ $# -eq 0 ]
then
cism_top="../.."
else
cism_top=${1%/}
fi

echo CISM: "${cism_top}"

module purge
module load surfsara
module load hdf5/serial/intel/1.8.10-patch1
module load netcdf
module load mkl
module load cmake
module load lapack/mkl
module load blas/netlib/intel

## Resulting module list
# 1) compilerwrappers 7) hdf5/serial/intel/1.8.10-patch1
# 2) c/intel/15.0.0(default) 8) netcdf/serial/intel/4.1.3(default)
# 3) fortran/intel/15.0.0(default) 9) mkl/11.2(default)
# 4) mpi/impi/5.0.3.048(default) 10) cmake/3.5.2(default)
# 5) bull 11) lapack/mkl(default)
# 6) surfsara 12) blas/netlib/intel/2011.04.19(default)

## where 'module load surfsara' will give you the following
# 1) compilerwrappers 3) fortran/intel/15.0.0(default) 5) bull
# 2) c/intel/15.0.0(default) 4) mpi/impi/5.0.3.048(default) 6) surfsara

# remove old build data:
rm -f ./CMakeCache.txt
rm -fr ./CMakeFiles

echo
echo "Doing CMake Configuration step"

# A few non-intuitive things:
#
# - CISM_FORCE_FORTRAN_LINKER: without this, cmake tries to use a C++ linker, which doesn't work
#
# - CISM_INCLUDE_IMPLICIT_LINK_LIBRARIES: (this is a note that applies to the
# parallel build with trilinos, and may or may not apply to this serial
# build): if this is on (the default), some libraries are included on the link
# line which can't be found (e.g., hdf5). This may be related to the fact that
# trilinos on yellowstone is old, and/or the fact that cmake wants to use a
# C++ linker but we're telling it to use a fortran linker.

cmake \
-D CISM_USE_TRILINOS:BOOL=OFF \
-D CISM_COUPLED:BOOL=OFF \
-D CISM_MPI_MODE:BOOL=OFF \
-D CISM_SERIAL_MODE:BOOL=ON \
-D CISM_BUILD_SIMPLE_GLIDE:BOOL=ON \
-D CISM_BUILD_SIMPLE_BISICLES:BOOL=OFF \
-D CISM_BUILD_GLINT_EXAMPLE:BOOL=OFF \
-D CISM_BUILD_CISM_DRIVER:BOOL=ON \
-D CISM_USE_GPTL_INSTRUMENTATION:BOOL=OFF \
-D CISM_USE_DEFAULT_IO:BOOL=OFF \
-D CISM_USE_CISM_FRONT_END:BOOL=OFF \
\
-D CISM_NETCDF_DIR=/hpc/sw/netcdf-fortran-4.2-intel-seq \
-D CISM_FORCE_FORTRAN_LINKER:BOOL=ON \
-D CISM_INCLUDE_IMPLICIT_LINK_LIBRARIES:BOOL=ON \
-D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \
\
-D CMAKE_CXX_COMPILER=icpc \
-D CMAKE_C_COMPILER=icc \
-D CMAKE_Fortran_COMPILER=ifort \
\
-D CMAKE_Fortran_FLAGS:STRING="-fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -xHost -O2 -L/ /hpc/sw/blas-2011.04.19-intel/lib/libblas.a" \
-D CMAKE_C_FLAGS:STRING="-O2 -fp-model precise -xHost" \
-D CMAKE_CXX_FLAGS:STRING="-O2 -fp-model precise -xHost" \
"${cism_top}"

# Note: last argument above "../.." or ${cism_top} is path to top cism directory
86 changes: 86 additions & 0 deletions builds/lisa-gnu/lisa-gnu-cmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Run this script by typing: source lisa-gnu-cmake
# After this script completes, type: make -j 8
# If rebuilding, type 'make clean' before running 'make -j 8'

# This cmake configuration script is set up to perform a parallel build

# Set path to top cism directory
# Note, this is an easy way to build out of source.
# In directory you want to build in, run:
# source $CISM/builds/lisa-gnu/lisa-gnu-cmake $CISM
# where $CISM is the path to the top level cism directory.
if [ $# -eq 0 ]
then
cism_top="../.."
else
cism_top=${1%/}
fi

echo CISM: "${cism_top}"

module purge
module load surfsara

# This results in the following module list
# 1) libgfortran/32/1(default) 5) oldwheezy/1.0(default)
# 2) stdenv/1.3(default) 6) moab/default
# 3) compilerwrappers 7) surfsara/1.1(default)
# 4) licenses/1.0(default)

# Note: netcdf was compiled by hand to match the used compiler version with
# the same module set as above
##netCDF-Fortran 4.4.4:
# ./configure --prefix=/home/hgoelzer/prog/netcdf/build
# make install
##netCDF configure 4.5.0
# ./configure --prefix=/home/hgoelzer/prog/netcdf/build --disable-netcdf-4 --disable-dap
# make install

NETCDF_ROOT="/home/hgoelzer/prog/netcdf/build"

# Note: openmpi paths are specified manually as loading the corresponding module
# leads to side effects.

MPI_INC_DIR="/sara/sw/openmpi-gnu-1.6.5-gf4.7/include"
MPI_LIB_DIR="/sara/sw/openmpi-gnu-1.6.5-gf4.7/lib"

# remove old build data:
rm -f ./CMakeCache.txt
rm -rf ./CMakeFiles

echo
echo "Doing CMake Configuration step"

cmake \
-D CISM_BUILD_CISM_DRIVER:BOOL=ON \
-D CISM_ENABLE_BISICLES=OFF \
-D CISM_ENABLE_FELIX=OFF \
\
-D CISM_USE_TRILINOS:BOOL=${CISM_USE_TRILINOS:=OFF} \
-D CISM_MPI_MODE:BOOL=ON \
-D CISM_SERIAL_MODE:BOOL=OFF \
\
-D CISM_USE_GPTL_INSTRUMENTATION:BOOL=OFF \
-D CISM_COUPLED:BOOL=OFF \
\
-D CISM_GNU=ON \
\
-D CISM_TRILINOS_DIR=$CISM_TRILINOS_DIR \
\
-D CISM_NETCDF_DIR=$NETCDF_ROOT \
\
-D CMAKE_Fortran_FLAGS="-g -O2 -ffree-line-length-none -fPIC -fno-range-check" \
\
-D CMAKE_CXX_COMPILER=mpicxx \
-D CMAKE_C_COMPILER=mpicc \
-D CMAKE_Fortran_COMPILER=mpif90 \
\
-D CISM_EXTRA_LIBS:STRING="-lblas" \
\
-D CISM_MPI_INC_DIR=$MPI_INC_DIR \
-D CISM_MPI_LIB_DIR=$MPI_LIB_DIR \
\
-D CMAKE_VERBOSE_MAKEFILE=OFF \
"${cism_top}"

# Note: last argument above "../.." or ${cism_top} is path to top cism directory
71 changes: 71 additions & 0 deletions builds/lisa-gnu/lisa-gnu-serial-cmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Run this script by typing: source lisa-gnu-serial-cmake
# After this script completes, type: make
# If rebuilding, type 'make clean' before running 'make'

# This cmake configuration script is set up to perform a serial build

# Set path to top cism directory
# Note, this is an easy way to build out of source.
# In directory you want to build in, run:
# source $CISM/builds/lisa-gnu/lisa-gnu-serial-cmake $CISM
# where $CISM is the path to the top level cism directory.
if [ $# -eq 0 ]
then
cism_top="../.."
else
cism_top=${1%/}
fi

echo CISM: "${cism_top}"

module purge
module load surfsara

# Note: netcdf was compiled by hand to match the used compiler version with
# the same module set as above
##netCDF-Fortran 4.4.4:
# ./configure --prefix=/home/hgoelzer/prog/netcdf/build
# make install
##netCDF configure 4.5.0
# ./configure --prefix=/home/hgoelzer/prog/netcdf/build --disable-netcdf-4 --disable-dap
# make install

NETCDF_ROOT="/home/hgoelzer/prog/netcdf/build"

# remove old build data:
rm -f ./CMakeCache.txt
rm -rf ./CMakeFiles

echo
echo "Doing CMake Configuration step"

cmake \
-D CISM_USE_TRILINOS:BOOL=OFF \
-D CISM_COUPLED:BOOL=OFF \
-D CISM_MPI_MODE:BOOL=OFF \
-D CISM_SERIAL_MODE:BOOL=ON \
-D CISM_BUILD_CISM_DRIVER=ON \
-D CISM_BUILD_SIMPLE_GLIDE:BOOL=OFF \
-D CISM_BUILD_SIMPLE_BISICLES:BOOL=OFF \
-D CISM_BUILD_GLINT_EXAMPLE:BOOL=OFF \
-D CISM_USE_GPTL_INSTRUMENTATION:BOOL=OFF \
-D CISM_USE_DEFAULT_IO:BOOL=OFF \
-D CISM_USE_CISM_FRONT_END:BOOL=ON \
\
-D CISM_GNU=ON \
\
-D CISM_NETCDF_DIR=$NETCDF_ROOT \
\
-D CMAKE_Fortran_FLAGS="-g -O2 -ffree-line-length-none -fPIC -fno-range-check" \
\
-D CMAKE_CXX_COMPILER=g++ \
-D CMAKE_C_COMPILER=gcc \
-D CMAKE_Fortran_COMPILER=gfortran \
\
-D CISM_EXTRA_LIBS:STRING="-lblas" \
\
-D CMAKE_VERBOSE_MAKEFILE=ON \
"${cism_top}"

# Note: last argument above "../.." or ${cism_top} is path to top cism directory

0 comments on commit 3488e2e

Please sign in to comment.