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 # Cleanup previous attempts
11 rm -rf /tmp/simgrid*tmp
12 rm -rf /tmp/surf-java*tmp
15 if [ -e /usr/lib/jvm/java-7-openjdk-amd64 ] ;
17 export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
20 # usage: die status message...
24 [ $# -gt 0 ] || set -- "Error - Halting"
29 # Get an ON/OFF string from a command:
31 if "$@" > /dev/null ; then
39 echo "Build mode $build_mode on $(uname -np)" >&2
51 die 1 "Unknown build_mode $build_mode"
55 if test "$(uname -o)" = "Msys"; then
56 if [ -z "$NUMBER_OF_PROCESSORS" ]; then
57 NUMBER_OF_PROCESSORS=1
59 GENERATOR="MSYS Makefiles"
61 NUMBER_OF_PROCESSORS="$(nproc)" || NUMBER_OF_PROCESSORS=1
62 GENERATOR="Unix Makefiles"
67 if test "$(uname -o)" != "Msys"; then
69 echo "XX Get out of the tree"
71 if [ -d $WORKSPACE/build ]
73 rm -rf $WORKSPACE/build
75 mkdir $WORKSPACE/build
79 echo "XX Build the archive out of the tree"
83 cmake -G"$GENERATOR" -Denable_documentation=OFF $WORKSPACE
84 make dist -j$NUMBER_OF_PROCESSORS
87 echo "XX Open the resulting archive"
89 tar xzf `cat VERSION`.tar.gz
94 echo "XX Configure and build SimGrid"
98 -Denable_debug=ON -Denable_documentation=OFF -Denable_coverage=OFF \
99 -Denable_model-checking=$(onoff test "$build_mode" = "ModelChecker") \
100 -Denable_smpi_ISP_testsuite=$(onoff test "$build_mode" = "ModelChecker") \
101 -Denable_compile_optimizations=$(onoff test "$build_mode" = "Debug") \
102 -Denable_smpi_MPICH3_testsuite=$(onoff test "$build_mode" != "DynamicAnalysis") \
103 -Denable_mallocators=$(onoff test "$build_mode" != "DynamicAnalysis") \
104 -Denable_memcheck=$(onoff test "$build_mode" = "DynamicAnalysis") \
105 -Denable_compile_warnings=ON -Denable_smpi=ON \
106 -Denable_latency_bound_tracking=OFF -Denable_jedule=OFF \
107 -Denable_tracing=ON -Denable_java=ON -Denable_lua=OFF
108 # -Denable_lua=$(onoff test "$build_mode" != "DynamicAnalysis") \
111 make -j$NUMBER_OF_PROCESSORS VERBOSE=1
113 if test "$(uname -o)" != "Msys"; then
121 echo "XX Run the tests"
125 ctest -T test --output-on-failure --no-compress-output || true
126 if [ -f Testing/TAG ] ; then
127 xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults.xml
128 mv CTestResults.xml $WORKSPACE
132 echo "XX Done. Return the results to cmake"
135 if [ "$build_mode" = "DynamicAnalysis" ]
137 ctest -D ContinuousStart
138 ctest -D ContinuousConfigure
139 ctest -D ContinuousBuild
140 ctest -D ContinuousMemCheck
141 ctest -D ContinuousSubmit
144 ctest -D ContinuousStart
145 ctest -D ContinuousConfigure
146 ctest -D ContinuousBuild
147 ctest -D ContinuousTest
148 ctest -D ContinuousSubmit