forked from NOAA-OWP/t-route
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compiler.sh
executable file
·85 lines (76 loc) · 2.42 KB
/
compiler.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
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
75
76
77
78
79
80
81
82
83
84
85
#TODO add options for clean/noclean, make/nomake, cython/nocython
#TODO include instuctions on blowing away entire package for fresh install e.g. rm -r ~/venvs/mesh/lib/python3.6/site-packages/troute/*
#set root folder of github repo (should be named t-route)
REPOROOT=`pwd`
#For each build step, you can set these to true to make it build
#or set it to anything else (or unset) to skip that step
build_mc_kernel=true
build_diffusive_tulane_kernel=true
build_reservoir_kernel=true
build_framework=true
build_routing=true
build_nwm=true
if [ -z "$F90" ]
then
export F90="gfortran"
echo "using F90='gfortran'"
fi
#if you have custom static library paths, uncomment below and export them
#export LIBRARY_PATH=<paths>:$LIBRARY_PATH
#if you have custom dynamic library paths, uncomment below and export them
#export LD_LIBRARY_PATHS=<paths>:$LD_LIBRARY_PATHS
export NETCDFINC=/usr/include/openmpi-x86_64/
echo "Making MC kernel"
if [[ "$build_mc_kernel" == true ]]; then
#building reach and resevoir kernel files .o
cd $REPOROOT/src/kernel/muskingum/
make clean
make || exit
make install || exit
fi
echo "Making Diffusive kernel"
if [[ "$build_diffusive_tulane_kernel" == true ]]; then
#building reach and resevoir kernel files .o
cd $REPOROOT/src/kernel/diffusive/
make clean
make diffusive.o
make pydiffusive.o
make install || exit
fi
echo "Making Reservoir kernel"
if [[ "$build_reservoir_kernel" == true ]]; then
cd $REPOROOT/src/kernel/reservoir/
make clean
#make NETCDFINC=`nc-config --includedir` || exit
#make binding_lp.a
#make install_lp || exit
make
make install_lp || exit
make install_rfc || exit
fi
echo "Making framework"
if [[ "$build_framework" == true ]]; then
#creates troute package
cd $REPOROOT/src/troute-network
rm -rf build
##python setup.py --use-cython install
##python setup.py --use-cython develop
python setup.py build_ext --inplace --use-cython || exit
pip install -e . || exit
fi
echo "Building routing"
if [[ "$build_routing" == true ]]; then
#updates troute package with the execution script
cd $REPOROOT/src/troute-routing
rm -rf build
#python setup.py --use-cython install
#python setup.py --use-cython develop
python setup.py build_ext --inplace --use-cython || exit
pip install -e . || exit
fi
echo "Building NWM"
if [[ "$build_nwm" == true ]]; then
#updates troute package with the execution script
cd $REPOROOT/src/troute-nwm
pip install -e . || exit
fi