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 # ensure that the locales are set, so that perl keeps its nerves
13 echo "XXXX Cleanup previous attempts. Remaining content of /tmp:"
14 rm -rf /tmp/simgrid-java*
16 find /builds/workspace/SimGrid-Multi/ -name "hs_err_pid*.log" | xargs rm -f
22 if [ -e /usr/lib/jvm/java-7-openjdk-amd64 ] ;
24 export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
27 # usage: die status message...
31 [ $# -gt 0 ] || set -- "Error - Halting"
36 # Get an ON/OFF string from a command:
38 if "$@" > /dev/null ; then
45 # Check that we have what we need, or die quickly.
46 # The paths are not the same on all platforms, unfortunately.
47 #test -e /bin/tar || die 1 "I need tar to compile. Please fix your slave."
48 #test -e /bin/gzip || die 1 "I need gzip to compile. Please fix your slave."
49 #test -e /usr/include/libunwind.h || die 1 "I need libunwind to compile. Please fix your slave."
50 #test -e /usr/include/valgrind/valgrind.h || die 1 "I need valgrind to compile. Please fix your slave."
53 echo "Build mode $build_mode on $(uname -np)" >&2
65 die 1 "Unknown build_mode $build_mode"
69 if test "$(uname -o)" = "Msys"; then
70 if [ -z "$NUMBER_OF_PROCESSORS" ]; then
71 NUMBER_OF_PROCESSORS=1
73 GENERATOR="MSYS Makefiles"
75 NUMBER_OF_PROCESSORS="$(nproc)" || NUMBER_OF_PROCESSORS=1
76 GENERATOR="Unix Makefiles"
82 echo "XX Get out of the tree"
84 if [ -d $WORKSPACE/build ]
86 rm -rf $WORKSPACE/build
88 mkdir $WORKSPACE/build
91 if test "$(uname -o)" != "Msys"; then
93 echo "XX Build the archive out of the tree"
97 cmake -G"$GENERATOR" -Denable_documentation=OFF $WORKSPACE
98 make dist -j$NUMBER_OF_PROCESSORS
101 echo "XX Open the resulting archive"
103 tar xzf `cat VERSION`.tar.gz
107 #for windows we don't make dist, but we still want to build out of source
112 echo "XX Configure and build SimGrid"
115 cmake -G"$GENERATOR"\
116 -Denable_debug=ON -Denable_documentation=OFF -Denable_coverage=OFF \
117 -Denable_model-checking=$(onoff test "$build_mode" = "ModelChecker") \
118 -Denable_smpi_ISP_testsuite=$(onoff test "$build_mode" = "ModelChecker") \
119 -Denable_compile_optimizations=$(onoff test "$build_mode" = "Debug") \
120 -Denable_smpi_MPICH3_testsuite=$(onoff test "$build_mode" != "DynamicAnalysis") \
121 -Denable_mallocators=$(onoff test "$build_mode" != "DynamicAnalysis") \
122 -Denable_memcheck=$(onoff test "$build_mode" = "DynamicAnalysis") \
123 -Denable_compile_warnings=$(onoff test "$GENERATOR" != "MSYS Makefiles") -Denable_smpi=ON \
124 -Denable_jedule=OFF -Denable_java=ON -Denable_lua=OFF $SRCFOLDER
125 # -Denable_lua=$(onoff test "$build_mode" != "DynamicAnalysis") \
127 make -j$NUMBER_OF_PROCESSORS VERBOSE=1
129 if test "$(uname -o)" != "Msys"; then
137 echo "XX Run the tests"
141 ctest -T test --output-on-failure --no-compress-output || true
142 if [ -f Testing/TAG ] ; then
143 xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults.xml
144 mv CTestResults.xml $WORKSPACE
148 echo "XX Done. Return the results to cmake"