Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Enable _GLIBCXX_DEBUG for one of the builds.
[simgrid.git] / tools / jenkins / Flags.sh
index 352db71..1dfb5d4 100755 (executable)
@@ -2,7 +2,7 @@
 
 set -e
 
-echo "Starting Flags.sh $@" 
+echo "Starting Flags.sh $*"
 
 die() {
     echo "$@"
@@ -18,11 +18,11 @@ onoff() {
   fi
 }
 
-[ $# -eq 5 ] || die "Needs 5 arguments : JAVA MC SMPI DEBUG MSG"
+[ $# -eq 3 ] || die "Needs 3 arguments : MC SMPI DEBUG"
 
 ### Cleanup previous runs
 
-! [ -z "$WORKSPACE" ] || die "No WORKSPACE"
+[ -n "$WORKSPACE" ] || die "No WORKSPACE"
 [ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist"
 
 do_cleanup() {
@@ -40,60 +40,57 @@ do_cleanup "$WORKSPACE/build"
 
 NUMPROC="$(nproc)" || NUMPROC=1
 
-cd $WORKSPACE/build
+cd "$WORKSPACE"/build
 
 #we can't just receive ON or OFF as values as display is bad in the resulting jenkins matrix
 
-if [ $1 = "JAVA" ]
-then
-  buildjava="ON"
-else
-  buildjava="OFF"
-fi
-
-if [ $2 = "MC" ]
+if [ "$1" = "MC" ]
 then
   buildmc="ON"
 else
   buildmc="OFF"
 fi
 
-if [ $3 = "SMPI" ]
+if [ "$2" = "SMPI" ]
 then
   buildsmpi="ON"
 else
   buildsmpi="OFF"
 fi
 
-if [ $4 = "DEBUG" ]
+if [ "$3" = "DEBUG" ]
 then
   builddebug="ON"
 else
   builddebug="OFF"
 fi
 
-if [ $4 = "MSG" ]
-then
-  buildmsg="ON"
-else
-  buildmsg="OFF"
-fi
+echo "Step ${STEP}/${NSTEPS} - Building with debug=${builddebug}, SMPI=${buildsmpi}, MC=${buildmc}"
 
-if [ $buildmsg = "OFF" -a $buildjava = "ON" ] 
-then
-  echo "Don't even try to build Java without MSG"
-  exit 1
+if [ "${builddebug}/${buildsmpi}/${buildmc}" = "ON/ON/ON"; then
+    # ${buildmc}=ON because "why not", and especially because it doesn't
+    # compile with -D_GLIBCXX_DEBUG and -Denable_ns3=ON together
+    export CXXFLAGS=-D_GLIBCXX_DEBUG
+    runtests="ON"
+else
+    runtests="OFF"
 fi
 
-echo "Step ${STEP}/${NSTEPS} - Building with java=${buildjava}, debug=${builddebug}, SMPI=${buildsmpi}, MC=${buildmc}, MSG=${buildmsg}"
-cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=${buildjava} -Denable_MSG=${buildmsg} \
+cmake -Denable_documentation=OFF \
       -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \
-      -Denable_jedule=ON -Denable_mallocators=ON -Denable_debug=${builddebug} \
+      -Denable_mallocators=ON -Denable_debug=${builddebug} \
       -Denable_smpi=${buildsmpi} -Denable_smpi_MPICH3_testsuite=${buildsmpi} -Denable_model-checking=${buildmc} \
-      -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_ISP_testsuite=OFF \
-      -Denable_ns3=$(onoff test "$buildmc" != "ON") -Denable_coverage=OFF $WORKSPACE
+      -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_MBI_testsuite=OFF \
+      -Denable_ns3=$(onoff test "$buildmc" != "ON") -DNS3_HINT=/builds/ns-3-dev/build/ \
+      -Denable_coverage=OFF -DLTO_EXTRA_FLAG="auto" -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
+      "$WORKSPACE"
 
 make -j$NUMPROC tests
-make clean
 
+if [ "$runtests" = "ON" ]; then
+    # exclude tests known to fail with _GLIBCXX_DEBUG
+    ctest -j$NUMPROC -E '^[ps]thread-|mc-bugged1-liveness'
+fi
 
+cd ..
+rm -rf build