-
Notifications
You must be signed in to change notification settings - Fork 1
/
compile.sh
64 lines (50 loc) · 1.12 KB
/
compile.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
56
57
58
59
60
61
62
#!/bin/sh
#
# Check if we are in cluster
case "$HOSTNAME" in
glogin*)
module purge
module load gcc/13.2.0
module load cmake
# For LAPACK
module load EB/apps
module load LAPACK/3.12.0-GCC-13.2.0
;;
*)
;;
esac
# Setup
builddir="build"
if [ ! -d ./${builddir} ]; then mkdir ${builddir}; fi
# CLI loop
gen_args=""
bld_args=""
while [ "$1" != "" ]
do
case "$1" in
-c | --clean | --rebuild)
bld_args="${bld_args}--clean-first "
;;
*)
gen_args="${gen_args}$1 "
esac
shift
done
# Generation
cmake \
${gen_args} \
-D CMAKE_Fortran_COMPILER=gfortran \
-D BUILD_SHARED_LIBS=OFF \
-D enable-openmp=ON \
-D enable-sym-ev-routine=OFF \
-D enable-single=OFF \
-D enable-gpu-code=OFF \
-D enable-cuda=ON \
-D enable-gpu-double=OFF \
-S . -B ${builddir}
if [ "$?" != "0" ]; then exit 1; fi
# Build
cmake --build ${builddir} --config Debug ${bld_args}
if [ "$?" != "0" ]; then exit 1; fi
cmake --build ${builddir} --config Release ${bld_args}
if [ "$?" != "0" ]; then exit 1; fi