Skip to content

Building on ALCF Theta

Cameron Smith edited this page Feb 17, 2017 · 2 revisions

Setup

Create a build directory:

mkdir /path/to/build/dir

Create an environment file named gnu-sim.env with the following contents:

#!/bin/bash
module swap PrgEnv-intel PrgEnv-gnu
d=/gpfs/theta-fs1/home/cwsmith/develop
export CMAKE_PREFIX_PATH=$d/deps/install-gnu:$CMAKE_PREFIX_PATH
module use $d/deps/modules
module load simModSuite/11.0-170119dev-gnu
export SIM_MPI=gnucraympich

Source the file:

source gnu-sim.env 

Configure

Create a file named config.phastaChef.sh with the following contents:

#!/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
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" \
  -DCMAKE_INSTALL_PREFIX=$PWD/install/ \
  \
  -DSCOREC_PREFIX=/path/to/core/install \
  -DPHASTA_SRC_DIR=/path/to/phasta/source \
  \
  -DPHASTA_SKIP_MPI_CHECK=ON \
  -DPHASTA_INCOMPRESSIBLE=ON  \
  -DPHASTA_COMPRESSIBLE=OFF \
  -DPHASTA_USE_SVLS=OFF \
  -DPHASTA_USE_PETSC=OFF \
  -DPHASTA_USE_LESLIB=ON \
  -DLESLIB=/path/to/libles.a \
  -DPHASTA_TESTING=ON \
  -DCASES=$HOME/develop/phastaChefTests

Run the script:

cd /path/to/build/dir
/path/to/config.phastaChef.sh /path/to/phastaChef/source/dir

Make

Run make:

make