-
Notifications
You must be signed in to change notification settings - Fork 13
/
compile.sh
25 lines (21 loc) · 666 Bytes
/
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
#!/bin/bash
# Fortran compiler to use
export FC=gfortran
# Compiler flags to use
export FFLAGS="-O2 -Wall -ffree-line-length-none -fmax-array-constructor=90000"
# Installation directory
export target=$(pwd) # this installs x2dhf under bin/ in the present directory
#export target=${HOME} # this installs x2dhf in ${HOME}/bin
# Number of parallel processes in build
export npar=4
# No changes should be necessary hereafter.
if [[ ! -d objdir ]]; then
mkdir objdir
fi
cd objdir
cmake .. \
-DCMAKE_INSTALL_PREFIX=${target} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_Fortran_FLAGS_RELEASE:STRING="-DNDEBUG"
make -j ${npar} install VERBOSE=1
cd ..