Skip to content

Building on NERSC Cori

Cameron Smith edited this page Mar 9, 2017 · 2 revisions

KNL

Core

Install core and its dependencies following the instructions here:

https://github.com/SCOREC/core/wiki/Building-on-NERSC-Cori

Be sure to pass -DPUMI_FORTRAN_INTERFACE=ON and -DCMAKE_Fortran_COMPILER=ftn when running cmake for core.

Setup

module swap craype-haswell craype-mic-knl
module load cmake
mkdir build-phastachef-knl-intel
cd !$ #bash-fu to get previous argument

Config

Create a script with the following content, edit the paths, then run it.

#!/bin/bash -ex
[ $# -ne 1 ] && echo "Usage: $0 <path to phastachef source>" && exit 1
src=$1
[ ! -e $src ] && echo "phastaChef source path $src does not exist" && exit 1

core=/path/to/core/install
phasta=/path/to/phasta/source
libles=/path/to/libles.a
[ ! -e $core ] && echo "core install path $core does not exist" && exit 1
[ ! -e $phasta ] && echo "phasta source path $phasta does not exist" && exit 1
[ ! -e $libles ] && echo "libles path $libles phasta does not exist" && exit 1

opt="-craype-verbose -Wextra -pedantic -O3 -Ofast"
cmake $src \
  -DCMAKE_C_COMPILER=cc \
  -DCMAKE_CXX_COMPILER=CC \
  -DCMAKE_Fortran_COMPILER=ftn \
  -DCMAKE_C_FLAGS="$opt" \
  -DCMAKE_CXX_FLAGS="$opt" \
  -DCMAKE_Fortran_FLAGS="$opt" \
  -DCMAKE_EXE_LINKER_FLAGS="$opt" \
  \
  -DSCOREC_PREFIX=$core \
  -DPHASTA_SRC_DIR=$phasta \
  \
  -DPHASTA_SKIP_MPI_CHECK=ON \
  -DPHASTA_INCOMPRESSIBLE=ON  \
  -DPHASTA_COMPRESSIBLE=OFF \
  -DPHASTA_USE_SVLS=OFF \
  -DPHASTA_USE_PETSC=OFF \
  -DPHASTA_USE_LESLIB=ON \
  -DLESLIB=$libles