3 # This script is used by various build projects on Jenkins
5 # See https://ci.inria.fr/simgrid/job/SimGrid-Multi/configure
6 # See https://ci.inria.fr/simgrid/job/Simgrid-Windows/configure
10 echo "XXXX Cleanup previous attempts. Remaining content of /tmp:"
11 rm -rf /tmp/simgrid-java*
12 find /builds/workspace/SimGrid-Multi/ -name "hs_err_pid*.log" | xargs rm -f
18 if [ -e /usr/lib/jvm/java-7-openjdk-amd64 ] ;
20 export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
23 # usage: die status message...
27 [ $# -gt 0 ] || set -- "Error - Halting"
32 # Get an ON/OFF string from a command:
34 if "$@" > /dev/null ; then
41 # Check that we have what we need, or die quickly
42 test -e /bin/tar || die "I need tar to compile. Please fix your slave."
43 test -e /bin/gzip || die "I need gzip to compile. Please fix your slave."
44 test -e /usr/include/libunwind.h || die "I need libunwind to compile. Please fix your slave."
45 test -e /usr/include/valgrind/valgrind.h || die "I need valgrind to compile. Please fix your slave."
48 echo "Build mode $build_mode on $(uname -np)" >&2
60 die 1 "Unknown build_mode $build_mode"
64 if test "$(uname -o)" = "Msys"; then
65 if [ -z "$NUMBER_OF_PROCESSORS" ]; then
66 NUMBER_OF_PROCESSORS=1
68 GENERATOR="MSYS Makefiles"
70 NUMBER_OF_PROCESSORS="$(nproc)" || NUMBER_OF_PROCESSORS=1
71 GENERATOR="Unix Makefiles"
76 if test "$(uname -o)" != "Msys"; then
78 echo "XX Get out of the tree"
80 if [ -d $WORKSPACE/build ]
82 rm -rf $WORKSPACE/build
84 mkdir $WORKSPACE/build
88 echo "XX Build the archive out of the tree"
92 cmake -G"$GENERATOR" -Denable_documentation=OFF $WORKSPACE
93 make dist -j$NUMBER_OF_PROCESSORS
96 echo "XX Open the resulting archive"
98 tar xzf `cat VERSION`.tar.gz
103 echo "XX Configure and build SimGrid"
106 cmake -G"$GENERATOR"\
107 -Denable_debug=ON -Denable_documentation=OFF -Denable_coverage=OFF \
108 -Denable_model-checking=$(onoff test "$build_mode" = "ModelChecker") \
109 -Denable_smpi_ISP_testsuite=$(onoff test "$build_mode" = "ModelChecker") \
110 -Denable_compile_optimizations=$(onoff test "$build_mode" = "Debug") \
111 -Denable_smpi_MPICH3_testsuite=$(onoff test "$build_mode" != "DynamicAnalysis") \
112 -Denable_mallocators=$(onoff test "$build_mode" != "DynamicAnalysis") \
113 -Denable_memcheck=$(onoff test "$build_mode" = "DynamicAnalysis") \
114 -Denable_compile_warnings=ON -Denable_smpi=ON \
115 -Denable_latency_bound_tracking=OFF -Denable_jedule=OFF \
116 -Denable_tracing=ON -Denable_java=ON -Denable_lua=OFF
117 # -Denable_lua=$(onoff test "$build_mode" != "DynamicAnalysis") \
120 make -j$NUMBER_OF_PROCESSORS VERBOSE=1
122 if test "$(uname -o)" != "Msys"; then
130 echo "XX Run the tests"
134 ctest -T test --output-on-failure --no-compress-output || true
135 if [ -f Testing/TAG ] ; then
136 xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults.xml
137 mv CTestResults.xml $WORKSPACE
141 echo "XX Done. Return the results to cmake"
144 if [ "$build_mode" = "DynamicAnalysis" ]
146 ctest -D ContinuousStart
147 ctest -D ContinuousConfigure
148 ctest -D ContinuousBuild
149 ctest -D ContinuousMemCheck
150 ctest -D ContinuousSubmit
153 ctest -D ContinuousStart
154 ctest -D ContinuousConfigure
155 ctest -D ContinuousBuild
156 ctest -D ContinuousTest
157 ctest -D ContinuousSubmit