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 # usage: die status message...
14 [ $# -gt 0 ] || set -- "Error - Halting"
19 # Get an ON/OFF string from a command:
21 if "$@" > /dev/null ; then
29 echo "Build mode $build_mode on $(uname -np)" >&2
41 die 1 "Unknown build_mode $build_mode"
45 if test "$(uname -o)" = "Msys"; then
46 if [ -z "$NUMBER_OF_PROCESSORS" ]; then
47 NUMBER_OF_PROCESSORS=1
49 GENERATOR="MSYS Makefiles"
51 NUMBER_OF_PROCESSORS="$(nproc)" || NUMBER_OF_PROCESSORS=1
52 GENERATOR="Unix Makefiles"
57 if test "$(uname -o)" != "Msys"; then
59 echo "XX Get out of the tree"
61 if [ -d $WORKSPACE/build ]
63 rm -rf $WORKSPACE/build
65 mkdir $WORKSPACE/build
69 echo "XX Build the archive out of the tree"
73 cmake -G"$GENERATOR" -Denable_documentation=OFF $WORKSPACE
74 make dist -j$NUMBER_OF_PROCESSORS
77 echo "XX Open the resulting archive"
79 tar xzf `cat VERSION`.tar.gz
84 echo "XX Configure and build SimGrid"
88 -Denable_debug=ON -Denable_documentation=OFF -Denable_coverage=OFF \
89 -Denable_model-checking=$(onoff test "$build_mode" = "ModelChecker") \
90 -Denable_smpi_ISP_testsuite=$(onoff test "$build_mode" = "ModelChecker") \
91 -Denable_compile_optimizations=$(onoff test "$build_mode" = "Debug") \
92 -Denable_smpi_MPICH3_testsuite=$(onoff test "$build_mode" != "DynamicAnalysis") \
93 -Denable_lua=$(onoff test "$build_mode" != "DynamicAnalysis") \
94 -Denable_mallocators=$(onoff test "$build_mode" != "DynamicAnalysis") \
95 -Denable_memcheck=$(onoff test "$build_mode" = "DynamicAnalysis") \
96 -Denable_compile_warnings=ON -Denable_smpi=ON -Denable_lib_static=OFF \
97 -Denable_latency_bound_tracking=OFF -Denable_jedule=OFF \
98 -Denable_tracing=ON -Denable_java=ON
99 make -j$NUMBER_OF_PROCESSORS VERBOSE=1
101 if test "$(uname -o)" != "Msys"; then
109 echo "XX Run the tests"
113 ctest -T test --output-on-failure --no-compress-output || true
114 if [ -f Testing/TAG ] ; then
115 xsltproc $WORKSPACE/buildtools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults.xml
116 mv CTestResults.xml $WORKSPACE
120 echo "XX Done. Return the results to cmake"
123 if [ "$build_mode" = "DynamicAnalysis" ]
125 ctest -D ContinuousStart
126 ctest -D ContinuousConfigure
127 ctest -D ContinuousBuild
128 ctest -D ContinuousMemCheck
129 ctest -D ContinuousSubmit
132 ctest -D ContinuousStart
133 ctest -D ContinuousConfigure
134 ctest -D ContinuousBuild
135 ctest -D ContinuousTest
136 ctest -D ContinuousSubmit