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"
11 rm -rf /tmp/simgrid*tmp
17 if [ -e /usr/lib/jvm/java-7-openjdk-amd64 ] ;
19 export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
22 # usage: die status message...
26 [ $# -gt 0 ] || set -- "Error - Halting"
31 # Get an ON/OFF string from a command:
33 if "$@" > /dev/null ; then
40 # Check that we have what we need, or die quickly
41 test -e /bin/tar || die "I need tar to compile. Please fix your slave."
42 test -e /bin/gzip || die "I need gzip to compile. Please fix your slave."
43 test -e /usr/include/libunwind.h || die "I need libunwind to compile. Please fix your slave."
44 test -e /usr/include/valgrind/valgrind.h || die "I need valgrind to compile. Please fix your slave."
47 echo "Build mode $build_mode on $(uname -np)" >&2
59 die 1 "Unknown build_mode $build_mode"
63 if test "$(uname -o)" = "Msys"; then
64 if [ -z "$NUMBER_OF_PROCESSORS" ]; then
65 NUMBER_OF_PROCESSORS=1
67 GENERATOR="MSYS Makefiles"
69 NUMBER_OF_PROCESSORS="$(nproc)" || NUMBER_OF_PROCESSORS=1
70 GENERATOR="Unix Makefiles"
75 if test "$(uname -o)" != "Msys"; then
77 echo "XX Get out of the tree"
79 if [ -d $WORKSPACE/build ]
81 rm -rf $WORKSPACE/build
83 mkdir $WORKSPACE/build
87 echo "XX Build the archive out of the tree"
91 cmake -G"$GENERATOR" -Denable_documentation=OFF $WORKSPACE
92 make dist -j$NUMBER_OF_PROCESSORS
95 echo "XX Open the resulting archive"
97 tar xzf `cat VERSION`.tar.gz
102 echo "XX Configure and build SimGrid"
105 cmake -G"$GENERATOR"\
106 -Denable_debug=ON -Denable_documentation=OFF -Denable_coverage=OFF \
107 -Denable_model-checking=$(onoff test "$build_mode" = "ModelChecker") \
108 -Denable_smpi_ISP_testsuite=$(onoff test "$build_mode" = "ModelChecker") \
109 -Denable_compile_optimizations=$(onoff test "$build_mode" = "Debug") \
110 -Denable_smpi_MPICH3_testsuite=$(onoff test "$build_mode" != "DynamicAnalysis") \
111 -Denable_mallocators=$(onoff test "$build_mode" != "DynamicAnalysis") \
112 -Denable_memcheck=$(onoff test "$build_mode" = "DynamicAnalysis") \
113 -Denable_compile_warnings=ON -Denable_smpi=ON \
114 -Denable_latency_bound_tracking=OFF -Denable_jedule=OFF \
115 -Denable_tracing=ON -Denable_java=ON -Denable_lua=OFF
116 # -Denable_lua=$(onoff test "$build_mode" != "DynamicAnalysis") \
119 make -j$NUMBER_OF_PROCESSORS VERBOSE=1
121 if test "$(uname -o)" != "Msys"; then
129 echo "XX Run the tests"
133 ctest -T test --output-on-failure --no-compress-output || true
134 if [ -f Testing/TAG ] ; then
135 xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults.xml
136 mv CTestResults.xml $WORKSPACE
140 echo "XX Done. Return the results to cmake"
143 if [ "$build_mode" = "DynamicAnalysis" ]
145 ctest -D ContinuousStart
146 ctest -D ContinuousConfigure
147 ctest -D ContinuousBuild
148 ctest -D ContinuousMemCheck
149 ctest -D ContinuousSubmit
152 ctest -D ContinuousStart
153 ctest -D ContinuousConfigure
154 ctest -D ContinuousBuild
155 ctest -D ContinuousTest
156 ctest -D ContinuousSubmit