forked from gimli-org/gimli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.jenkins.sh
75 lines (60 loc) · 2.18 KB
/
.jenkins.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
# This script is for continuous integration using Jenkins (http://jenkins-ci.org/)
# It is called from the parent directory, i.e. bash -xe trunk/.jenkins.sh
echo "Starting automatic build #$BUILD_NUMBER on" `date`
start=$(date +"%s")
# Show last change to repo in build log
echo `git --git-dir trunk/.git log -1 --pretty="Last change by %cn (%h): %B"`
# link python to python3
ln -sf /usr/bin/python3 python
export PATH=`pwd`:$PATH
# Show system information
lsb_release -d
uname -a
gcc --version
cmake --version
python --version
python -c "import numpy; print(numpy.__version__)"
python -c "import matplotlib; print(matplotlib.__version__)"
################
# Main build #
################
# just do this if something is wrong with the thirdparty sources
#rm -rf thirdParty/src
rm -rf build # Uncomment for clean build (expensive, but necessary sometimes)
rm -f build/build_tests.html # remove old test report
rm -f build/CMakeCache.txt # clean old cache
mkdir -p build
cd build
CLEAN=1 cmake ../trunk \
-DPYVERSION=3 \
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
-DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.4m.so \
-DBoost_PYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libboost_python-py34.so
make -j 16 gimli
make pygimli J=12
#############################
# Testing & documentation #
#############################
# Test gimli
make gtest
# Test pygimli
export PYTHONPATH=`pwd`/../trunk/python:$PYTHONPATH
python << END
import pygimli as pg
print(pg.__version__)
pg.test(htmlreport='build_tests.html', abort=True)
END
# Build documentation
export PATH=/opt/texbin:$PATH # for building pdf
export PUBLISH="True" # for correct PATH settings in sidebar gallery
export PATH=`pwd`/../trunk/python/apps:$PATH
chmod +x ../trunk/python/apps/*
make clean-gallery
make doc # = doxygen, sphinxapi, sphinxpdf, sphinxhtml
end=$(date +"%s")
echo "Ending automatic build #$BUILD_NUMBER".
diff=$(($end-$start))
echo "$(($diff / 60)) minutes and $(($diff % 60)) seconds elapsed."
# If this script fails, a mail with the log file will be send to mail@pygimli.org.
# If it succeeds, the documentation will be uploaded to pygimli.org.
# In any case, a badge icon of the current status and the log file will be uploaded.