X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9b4b2e1cf9fcf5fa08f719cfc1dc7636edd8713d..1e2cc382d6eefdc91a296d134403263f63ccff65:/tools/jenkins/Flags.sh diff --git a/tools/jenkins/Flags.sh b/tools/jenkins/Flags.sh index 57b4f2722a..ea84301b4f 100755 --- a/tools/jenkins/Flags.sh +++ b/tools/jenkins/Flags.sh @@ -1,22 +1,14 @@ -#!/bin/sh +#!/usr/bin/env sh set -e +echo "Starting Flags.sh $*" + die() { echo "$@" exit 1 } -do_cleanup() { - for d in "$WORKSPACE/build" - do - if [ -d "$d" ] - then - rm -rf "$d" || die "Could not remote $d" - fi - done -} - # Get an ON/OFF string from a command: onoff() { if "$@" > /dev/null ; then @@ -26,48 +18,79 @@ onoff() { fi } -### Cleanup previous runs +[ $# -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 +do_cleanup() { + for d + do + if [ -d "$d" ] + then + rm -rf "$d" || die "Could not remove $d" + fi + mkdir "$d" || die "Could not create $d" + done +} -for d in "$WORKSPACE/build" -do - mkdir "$d" || die "Could not create $d" -done +do_cleanup "$WORKSPACE/build" NUMPROC="$(nproc)" || NUMPROC=1 -cd $WORKSPACE/build +cd "$WORKSPACE"/build -NSTEPS=16 -STEP=1 +#we can't just receive ON or OFF as values as display is bad in the resulting jenkins matrix -for buildjava in ON OFF -do - for builddebug in ON OFF - do - for buildsmpi in ON OFF - do - for buildmc in ON OFF - do - echo "Step ${STEP}/${NSTEPS} - Building with java=${buildjava}, debug=${builddebug}, SMPI=${buildsmpi}, MC=${buildmc}" - echo "Step ${STEP}/${NSTEPS} - Building with java=${buildjava}, debug=${builddebug}, SMPI=${buildsmpi}, MC=${buildmc}" > $WORKSPACE/buildstep - cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=${buildjava} \ - -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \ - -Denable_jedule=ON -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 - make -j$NUMPROC - make clean - STEP=$((${STEP}+1)) - done - done - done -done +if [ "$1" = "MC" ] +then + buildmc="ON" +else + buildmc="OFF" +fi + +if [ "$2" = "SMPI" ] +then + buildsmpi="ON" +else + buildsmpi="OFF" +fi + +if [ "$3" = "DEBUG" ] +then + builddebug="ON" +else + builddebug="OFF" +fi + +echo "Step ${STEP}/${NSTEPS} - Building with debug=${builddebug}, SMPI=${buildsmpi}, MC=${buildmc}" + +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 + +cmake -Denable_documentation=OFF \ + -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \ + -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_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 -echo "All builds finished cleanly" > $WORKSPACE/buildstep +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