-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpostBuild
executable file
·74 lines (62 loc) · 2.15 KB
/
postBuild
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
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
set -ex
sPath_home=$(pwd)
if [ ! -d "bin" ]; then
mkdir bin
fi
cd bin
sPath_bin=$(pwd)
cd $sPath_home
#change directory to the external folder
#check external folder, create it if not exist
if [ ! -d "external" ]; then
mkdir external
fi
cd external
sPath_external=$(pwd)
#check whether the folder DGGRID exists or not, if exist, delete it
if [ -d "DGGRID" ]; then
rm -rf DGGRID
fi
#clone a git repo to the external folder
sDggrid_url='https://github.com/sahrk/DGGRID.git'
git clone $sDggrid_url
#change directory to the DGGRID folder
cd DGGRID # enter the cloned repo
mkdir build # Make a directory to compile into
cd build # Switch into build directory
#cmake -DCMAKE_BUILD_TYPE=Release .. -DWITH_EXT_SHAPELIB=ON -DSHAPELIB_ROOT_DIR='/usr/local/Cellar/shapelib/1.6.0' # Prepare to compile
cmake -DCMAKE_BUILD_TYPE=Release ..
make # Build code.
#make install # Optionally install on your machine
sFolder_bin=src/apps/dggrid
cd $sFolder_bin
./dggrid -v
./dggrid -h
echo "dggrid model is compiled successfully!"
# Copy the dggrid binary to /home/jovyan/.
cp dggrid /home/jovyan/
#cp dggrid $sPath_bin/
#compile hexwatershed model
cd $sPath_external
#check whether the folder DGGRID exists or not, if exist, delete it
if [ -d "hexwatershed" ]; then
rm -rf hexwatershed
fi
#clone a git repo to the external folder
sHexwatershed_url='https://github.com/changliao1025/hexwatershed.git'
git clone $sHexwatershed_url
#change directory to the DGGRID folder
cd hexwatershed # enter the cloned repo
if [ -d "build" ]; then
rm -rf build
fi
mkdir build # Make a directory to compile into
cd build # Switch into build directory
cmake -DCMAKE_BUILD_TYPE=Release .. # Prepare to compile
make # Build code.
#make install # Optionally install on your machine
# Copy the dggrid binary to /home/jovyan/.
cp hexwatershed /home/jovyan/
#cp hexwatershed $sPath_bin/
echo "HexWatershed model is compiled successfully!"