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
41 echo "Build mode $build_mode on $(uname -np)" >&2
53 die 1 "Unknown build_mode $build_mode"
57 if test "$(uname -o)" = "Msys"; then
58 if [ -z "$NUMBER_OF_PROCESSORS" ]; then
59 NUMBER_OF_PROCESSORS=1
61 GENERATOR="MSYS Makefiles"
63 NUMBER_OF_PROCESSORS="$(nproc)" || NUMBER_OF_PROCESSORS=1
64 GENERATOR="Unix Makefiles"
69 if test "$(uname -o)" != "Msys"; then
71 echo "XX Get out of the tree"
73 if [ -d $WORKSPACE/build ]
75 rm -rf $WORKSPACE/build
77 mkdir $WORKSPACE/build
81 echo "XX Build the archive out of the tree"
85 cmake -G"$GENERATOR" -Denable_documentation=OFF $WORKSPACE
86 make dist -j$NUMBER_OF_PROCESSORS
89 echo "XX Open the resulting archive"
91 tar xzf `cat VERSION`.tar.gz
96 echo "XX Configure and build SimGrid"
100 -Denable_debug=ON -Denable_documentation=OFF -Denable_coverage=OFF \
101 -Denable_model-checking=$(onoff test "$build_mode" = "ModelChecker") \
102 -Denable_smpi_ISP_testsuite=$(onoff test "$build_mode" = "ModelChecker") \
103 -Denable_compile_optimizations=$(onoff test "$build_mode" = "Debug") \
104 -Denable_smpi_MPICH3_testsuite=$(onoff test "$build_mode" != "DynamicAnalysis") \
105 -Denable_mallocators=$(onoff test "$build_mode" != "DynamicAnalysis") \
106 -Denable_memcheck=$(onoff test "$build_mode" = "DynamicAnalysis") \
107 -Denable_compile_warnings=ON -Denable_smpi=ON \
108 -Denable_latency_bound_tracking=OFF -Denable_jedule=OFF \
109 -Denable_tracing=ON -Denable_java=ON -Denable_lua=OFF
110 # -Denable_lua=$(onoff test "$build_mode" != "DynamicAnalysis") \
113 make -j$NUMBER_OF_PROCESSORS VERBOSE=1
115 if test "$(uname -o)" != "Msys"; then
123 echo "XX Run the tests"
127 ctest -T test --output-on-failure --no-compress-output || true
128 if [ -f Testing/TAG ] ; then
129 xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults.xml
130 mv CTestResults.xml $WORKSPACE
134 echo "XX Done. Return the results to cmake"
137 if [ "$build_mode" = "DynamicAnalysis" ]
139 ctest -D ContinuousStart
140 ctest -D ContinuousConfigure
141 ctest -D ContinuousBuild
142 ctest -D ContinuousMemCheck
143 ctest -D ContinuousSubmit
146 ctest -D ContinuousStart
147 ctest -D ContinuousConfigure
148 ctest -D ContinuousBuild
149 ctest -D ContinuousTest
150 ctest -D ContinuousSubmit