-
Notifications
You must be signed in to change notification settings - Fork 9
/
FullBuild.sh
47 lines (42 loc) · 1.13 KB
/
FullBuild.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
#!/bin/bash
## Compilation/build script for HEMELB
## Run from found location
## MODULE loads
export CC=$(which gcc)
export CXX=$(which g++)
export MPI_C_COMPILER=$(which mpicc)
export MPI_CXX_COMPILER=$(which mpicxx)
export SOURCE_DIR=/Path_To_GPU_code
## HEMELB build
# 1) Dependencies
BuildDep(){
cd $SOURCE_DIR/dep
rm -rf build
mkdir build
cd build
cmake -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} ..
make -j && echo "Done HemeLB Dependencies"
cd ../..
}
# 2) Source code
BuildSource(){
cd $SOURCE_DIR/src
rm -rf build
mkdir build
cd build
cmake \
-DCMAKE_CXX_FLAGS="-std=c++11 -g -Wno-narrowing" \
-DCMAKE_C_COMPILER=${CC} \
-DCMAKE_CXX_COMPILER=${CXX} \
-DHEMELB_INLET_BOUNDARY="NASHZEROTHORDERPRESSUREIOLET"\
-DHEMELB_WALL_INLET_BOUNDARY="NASHZEROTHORDERPRESSURESBB"\
-DHEMELB_OUTLET_BOUNDARY="NASHZEROTHORDERPRESSUREIOLET"\
-DHEMELB_WALL_OUTLET_BOUNDARY="NASHZEROTHORDERPRESSURESBB"\
-DCMAKE_CUDA_FLAGS="-ccbin g++ -gencode arch=compute_70,code=sm_70 -lineinfo --ptxas-options=-v --disable-warnings" \
$SOURCE_DIR/src
make -j && echo "Done HemeLB Source"
cd ../..
}
BuildDep
BuildSource
echo "Done build all"