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
14 # usage: die status message...
18 [ $# -gt 0 ] || set -- "Error - Halting"
23 # Get an ON/OFF string from a command:
25 if "$@" > /dev/null ; then
33 echo "Build mode $build_mode on $(uname -np)" >&2
45 die 1 "Unknown build_mode $build_mode"
49 if test "$(uname -o)" = "Msys"; then
50 if [ -z "$NUMBER_OF_PROCESSORS" ]; then
51 NUMBER_OF_PROCESSORS=1
53 GENERATOR="MSYS Makefiles"
55 NUMBER_OF_PROCESSORS="$(nproc)" || NUMBER_OF_PROCESSORS=1
56 GENERATOR="Unix Makefiles"
61 if test "$(uname -o)" != "Msys"; then
63 echo "XX Get out of the tree"
65 if [ -d $WORKSPACE/build ]
67 rm -rf $WORKSPACE/build
69 mkdir $WORKSPACE/build
73 echo "XX Build the archive out of the tree"
77 cmake -G"$GENERATOR" -Denable_documentation=OFF $WORKSPACE
78 make dist -j$NUMBER_OF_PROCESSORS
81 echo "XX Open the resulting archive"
83 tar xzf `cat VERSION`.tar.gz
88 echo "XX Configure and build SimGrid"
92 -Denable_debug=ON -Denable_documentation=OFF -Denable_coverage=OFF \
93 -Denable_model-checking=$(onoff test "$build_mode" = "ModelChecker") \
94 -Denable_smpi_ISP_testsuite=$(onoff test "$build_mode" = "ModelChecker") \
95 -Denable_compile_optimizations=$(onoff test "$build_mode" = "Debug") \
96 -Denable_smpi_MPICH3_testsuite=$(onoff test "$build_mode" != "DynamicAnalysis") \
97 -Denable_lua=$(onoff test "$build_mode" != "DynamicAnalysis") \
98 -Denable_mallocators=$(onoff test "$build_mode" != "DynamicAnalysis") \
99 -Denable_memcheck=$(onoff test "$build_mode" = "DynamicAnalysis") \
100 -Denable_compile_warnings=ON -Denable_smpi=ON -Denable_lib_static=OFF \
101 -Denable_latency_bound_tracking=OFF -Denable_jedule=OFF \
102 -Denable_tracing=ON -Denable_java=ON
103 make -j$NUMBER_OF_PROCESSORS VERBOSE=1
105 if test "$(uname -o)" != "Msys"; then
113 echo "XX Run the tests"
117 ctest -T test --output-on-failure --no-compress-output || true
118 if [ -f Testing/TAG ] ; then
119 xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults.xml
120 mv CTestResults.xml $WORKSPACE
124 echo "XX Done. Return the results to cmake"
127 if [ "$build_mode" = "DynamicAnalysis" ]
129 ctest -D ContinuousStart
130 ctest -D ContinuousConfigure
131 ctest -D ContinuousBuild
132 ctest -D ContinuousMemCheck
133 ctest -D ContinuousSubmit
136 ctest -D ContinuousStart
137 ctest -D ContinuousConfigure
138 ctest -D ContinuousBuild
139 ctest -D ContinuousTest
140 ctest -D ContinuousSubmit