-
Notifications
You must be signed in to change notification settings - Fork 5
Build on SCOREC Workstations
Cameron Smith edited this page Feb 22, 2017
·
2 revisions
Install SCOREC/core
. In the instructions below we assume that core is installed to $HOME/build-core-jessie/install
.
For the instructions below we assume the following commands are run in your $HOME
directory.
git clone [email protected]:cwsmith/phastaChef.git
git clone [email protected]:PHASTA/phasta.git
wget www.scorec.rpi.edu/~cwsmith/phastaChefTests.tar.gz .
tar xzf phastaChefTests.tar.gz # use for CASES path below
mkdir build-phastaChef-jessie
Create an environment script with the following name $HOME/env.phastachef-jessie.sh
module load \
cmake/latest \
mpich3/3.1.2-thread-multiple \
parmetis/mpich3.1.2/4.0.3 \
zoltan/mpich3.1.2/3.81 \
simmetrix/simModSuite \
libles
Below is a semi-fancy bash script to run cmake. Copy and paste the contents into a file named $HOME/config-phastachef-jessie.sh
.
#!/bin/bash -e
baseflags="-fno-omit-frame-pointer -Wall -Wextra -pedantic "
usage() {
echo "Usage: $0 <buildType=dbg|opt|dbgopt|asan> <testing=true|false>"
}
type=$1
[[ "opt" != "$type" &&
"dbg" != "$type" &&
"dbgopt" != "$type" &&
"asan" != "$type" ]] &&
usage &&
exit 1
testing=$2
[[ "true" != "$testing" &&
"false" != "$testing" ]] &&
usage &&
exit 1
flags_opt="$baseflags -O2 "
flags_dbg="$baseflags -g -O0 "
flags_dbgopt="$baseflags -g -O2 "
flags_asan="$flags_dbg -fsanitize=address "
flags=flags_${type}
echo "flags ${!flags}"
set -x
cmake $HOME/phastaChef \
-DCMAKE_C_COMPILER=`which mpicc` \
-DCMAKE_CXX_COMPILER=`which mpicxx` \
-DCMAKE_C_FLAGS="${!flags}" \
-DCMAKE_CXX_FLAGS="${!flags}" \
-DCMAKE_Fortran_FLAGS="${!flags}" \
-DCMAKE_EXE_LINKER_FLAGS="-ldl ${!flags}" \
\
-DSCOREC_PREFIX=$HOME/build-core-jessie/install \
\
-DPHASTA_SRC_DIR=$HOME/phasta \
-DPHASTA_INCOMPRESSIBLE=ON \
-DPHASTA_COMPRESSIBLE=ON \
-DPHASTA_TESTING=ON \
\
-DPHASTA_USE_SVLS=OFF \
-DPHASTA_USE_PETSC=OFF \
-DPHASTA_USE_LESLIB=ON \
-DLESLIB=$LIBLES \
\
-DCASES=$HOME/phastaChefTests/
set +x
Make the script executable
chmod +x $HOME/config-phastachef-jessie.sh
Run the environment and config script
source $HOME/env.phastachef-jessie.sh
cd build-phastaChef-jessie
$HOME/config-phastachef-jessie.sh dbgopt on
cd build-phastaChef-jessie
make
If you have just logged in and have run make before then you only need to do the following
source $HOME/env.phastachef-jessie.sh
cd build-phastaChef-jessie
make