-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmake.sh
More file actions
61 lines (51 loc) · 858 Bytes
/
make.sh
File metadata and controls
61 lines (51 loc) · 858 Bytes
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
#!/bin/bash
# -n: Make afresh
# -p: Production
# -g: GPU
n_flag=0
p_flag=0
g_flag=0
while getopts 'npgh' flag
do
case "${flag}" in
n) n_flag=1 ;;
p) p_flag=1 ;;
g) g_flag=1 ;;
h) echo "-n: build anew; -p: production; -g: GPU acceration"
exit 1 ;;
esac
done
if [ $p_flag -ne 1 ]
then
cmakeopt='-DCMAKE_BUILD_TYPE=Debug'
else
cmakeopt=''
fi
if [ $g_flag -eq 1 ]
then
export FC=nvfortran
fi
rm src/*.old
fppfiles="src/linalg.fpp"
for fppfile in ${fppfiles}
do
fypp -m itertools ${fppfile} "${fppfile%.fpp}.f90"
done
if [ $n_flag -eq 1 ]
then
rm -r build
mkdir build; cd $_
cmake .. ${cmakeopt}
make
cp els.x ..
cd ..
else
cd build
make
cp els.x ..
cd ..
fi
for fppfile in ${fppfiles}
do
mv "${fppfile%.fpp}.f90" "${fppfile%.fpp}.old"
done