-
Notifications
You must be signed in to change notification settings - Fork 2
/
compile.sh
executable file
·46 lines (25 loc) · 1.2 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
#!/bin/bash
echo ${1}
rm -rf obj/
mkdir obj
cp -r src/ obj/
cd obj
if [[ ${1} == *"GPU=off"* ]]; then
cmake .. ${1}
make -j4
cp *.mod src/
gfortran -E -cpp ../src/sht_data_module.f90 > src/sht_data_module.f90
gfortran -E -cpp ../src/sht_main.f90 > src/sht_main.f90
f90wrap -m fastSHT -k src/kind_map src/sht_main.f90 src/sht_data_init.f90 src/convert_alm.f90
LDFLAGS="-cpp -lpthread -ldl -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -qopenmp" f2py-f90wrap --fcompiler=intelem -c -m _fastSHT f90wrap_*.f90 --f90flags="-cpp -lpthread -ldl" *.a
else
export FC=nvfortran
cmake .. -DGPU=on
make -j4
cp *.mod src/
gfortran -E -cpp -DGPU=True ../src/sht_data_module.f90 > src/sht_data_module.f90
gfortran -E -cpp -DGPU=True ../src/sht_main.f90 > src/sht_main.f90
f90wrap -m fastSHT -k src/kind_map src/sht_main.f90 src/convert_alm.f90 src/sht_data_init.f90
LDFLAGS="-cpp -Mcuda -acc -Mcudalib=cublas -fPIC -lcufft -pgf90libs -mp -lpthread -lm -ldl -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread" f2py-f90wrap --fcompiler=nv -c -m _fastSHT f90wrap_*.f90 --f90flags="-cpp -acc -Mcud\
a -Mcudalib=cublas -pgf90libs -mp -lpthread -lm -ldl" *.a
fi