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. Remaining content of /tmp:"
11 rm -rf /tmp/simgrid-java*
13 find /builds/workspace/SimGrid-Multi/ -name "hs_err_pid*.log" | xargs rm -f
19 if [ -e /usr/lib/jvm/java-7-openjdk-amd64 ] ;
21 export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
24 # usage: die status message...
28 [ $# -gt 0 ] || set -- "Error - Halting"
33 # Get an ON/OFF string from a command:
35 if "$@" > /dev/null ; then
42 # Check that we have what we need, or die quickly.
43 # The paths are not the same on all platforms, unfortunately.
44 #test -e /bin/tar || die 1 "I need tar to compile. Please fix your slave."
45 #test -e /bin/gzip || die 1 "I need gzip to compile. Please fix your slave."
46 #test -e /usr/include/libunwind.h || die 1 "I need libunwind to compile. Please fix your slave."
47 #test -e /usr/include/valgrind/valgrind.h || die 1 "I need valgrind to compile. Please fix your slave."
50 echo "Build mode $build_mode on $(uname -np)" >&2
62 die 1 "Unknown build_mode $build_mode"
66 if test "$(uname -o)" = "Msys"; then
67 if [ -z "$NUMBER_OF_PROCESSORS" ]; then
68 NUMBER_OF_PROCESSORS=1
70 GENERATOR="MSYS Makefiles"
72 NUMBER_OF_PROCESSORS="$(nproc)" || NUMBER_OF_PROCESSORS=1
73 GENERATOR="Unix Makefiles"
79 echo "XX Get out of the tree"
81 if [ -d $WORKSPACE/build ]
83 rm -rf $WORKSPACE/build
85 mkdir $WORKSPACE/build
88 if test "$(uname -o)" != "Msys"; then
90 echo "XX Build the archive out of the tree"
94 cmake -G"$GENERATOR" -Denable_documentation=OFF $WORKSPACE
95 make dist -j$NUMBER_OF_PROCESSORS
98 echo "XX Open the resulting archive"
100 tar xzf `cat VERSION`.tar.gz
104 #for windows we don't make dist, but we still want to build out of source
109 echo "XX Configure and build SimGrid"
112 cmake -G"$GENERATOR"\
113 -Denable_debug=ON -Denable_documentation=OFF -Denable_coverage=OFF \
114 -Denable_model-checking=$(onoff test "$build_mode" = "ModelChecker") \
115 -Denable_smpi_ISP_testsuite=$(onoff test "$build_mode" = "ModelChecker") \
116 -Denable_compile_optimizations=$(onoff test "$build_mode" = "Debug") \
117 -Denable_smpi_MPICH3_testsuite=$(onoff test "$build_mode" != "DynamicAnalysis") \
118 -Denable_mallocators=$(onoff test "$build_mode" != "DynamicAnalysis") \
119 -Denable_memcheck=$(onoff test "$build_mode" = "DynamicAnalysis") \
120 -Denable_compile_warnings=$(onoff test "$GENERATOR" != "MSYS Makefiles") -Denable_smpi=ON \
121 -Denable_latency_bound_tracking=OFF -Denable_jedule=OFF \
122 -Denable_tracing=ON -Denable_java=ON -Denable_lua=OFF $SRCFOLDER
123 # -Denable_lua=$(onoff test "$build_mode" != "DynamicAnalysis") \
126 make -j$NUMBER_OF_PROCESSORS VERBOSE=1
128 if test "$(uname -o)" != "Msys"; then
136 echo "XX Run the tests"
140 ctest -T test --output-on-failure --no-compress-output || true
141 if [ -f Testing/TAG ] ; then
142 xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults.xml
143 mv CTestResults.xml $WORKSPACE
147 echo "XX Done. Return the results to cmake"