forked from KNMI/adaguc-server
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompile.sh
executable file
·71 lines (56 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
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
#!/bin/bash
CURRENTDIR=`pwd`
function quit {
exit 1;
}
function clean {
rm -rf $CURRENTDIR/bin
mkdir -p $CURRENTDIR/bin
cd $CURRENTDIR/hclasses
rm -f *.o
rm -f *.a
rm -rf CMakeFiles CMakeCache.txt
cd $CURRENTDIR/CCDFDataModel
rm -f *.o
rm -f *.a
rm -rf CMakeFiles CMakeCache.txt
cd $CURRENTDIR/adagucserverEC
rm -f *.o
rm -f adagucserver
rm -f h5ncdump
rm -f aggregate_time
rm -f geojsondump
rm -rf CMakeFiles CMakeCache.txt
test -d $CURRENTDIR/bin || mkdir $CURRENTDIR/bin/
rm -f $CURRENTDIR/bin/adagucserver
rm -f $CURRENTDIR/bin/h5ncdump
rm -f $CURRENTDIR/bin/aggregate_time
rm -f $CURRENTDIR/bin/geojsondump
}
function build {
clean
cd $CURRENTDIR/bin
cmake .. && cmake --build . --parallel -v
if [ -f adagucserver ]
then
echo "[OK] ADAGUC has been succesfully compiled."
else
echo "[FAILED] ADAGUC compilation failed"
quit;
fi
echo "[OK] Everything is installed in the ./bin directory"
echo "Testing..."
ctest
retVal=$?
if [ $retVal -ne 0 ]; then
echo "[FAILED] Some of the tests failed"
else
echo "[OK] Tests succeeded"
fi
exit $retVal
}
if [ "$*" = "--clean" ]; then
clean
else
build
fi