-
Notifications
You must be signed in to change notification settings - Fork 2
/
example-config.sh
executable file
·56 lines (47 loc) · 1.27 KB
/
example-config.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#/bin/bash -x
# edit these params
DEVLOC=fasttmp
DEVDIR=dev
CC=mpicc
CXX=mpicxx
FTN=mpif90
IMPLICIT_PETSC=OFF
# derived vars
USER=`whoami`
DEVROOT=/${DEVLOC}/${USER}/${DEVDIR}
if [ -z "${INSTALLROOT}" ] ; then
echo "No INSTALLROOT in environment, default is ${DEVROOT}/install"
INSTALLROOT=${DEVROOT}/install
fi
if [ -z "${PUMI_ROOT}" ] ; then
echo "No PUMI_ROOT in environment, default is ${INSTALLROOT}/core/"
PUMI_ROOT=${INSTALLROOT}/core/
fi
if [ -z "${PETSC_DIR}" ] ; then
echo "No PETSC_DIR in the environment!"
echo "trying module load petsc..."
module load petsc
if [ $? == 0 ] ; then
echo " succeeded!"
else
echo " failed!"
exit -1
fi
fi
CONFIG_PARAMS="${CONFIG_PARAMS} -DENABLE_PETSC=ON"
if [ "${IMPLICIT_PETSC}" == "OFF" ] ; then
CONFIG_PARAMS="${CONFIG_PARAMS} -DPETSC_DIR=${PETSC_DIR} -DPETSC_ARCH=${PETSC_ARCH}"
else
CONFIG_PARAMS="${CONFIG_PARAMS} -DPETSC_IMPLICIT_DEP=${IMPLICIT_PETSC}"
fi
PREFIX=${INSTALLROOT}/msi
cmake .. \
-DCMAKE_C_COMPILER=$CC \
-DCMAKE_CXX_COMPILER=$CXX \
-DCMAKE_Fortran_COMPILER=$FTN \
-DSCOREC_DIR=$PUMI_ROOT/lib/cmake/SCOREC/ \
-DENABLE_COMPLEX=OFF \
-DENABLE_TESTING=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
${CONFIG_PARAMS}