Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add more infos to Flags output, and write them to a file.
[simgrid.git] / tools / jenkins / Flags.sh
1 #!/bin/sh
2
3 set -e
4
5 die() {
6     echo "$@"
7     exit 1
8 }
9
10 do_cleanup() {
11   for d in "$WORKSPACE/build"
12   do
13     if [ -d "$d" ]
14     then
15       rm -rf "$d" || die "Could not remote $d"
16     fi
17   done
18 }
19
20 # Get an ON/OFF string from a command:
21 onoff() {
22   if "$@" > /dev/null ; then
23     echo ON
24   else
25     echo OFF
26   fi
27 }
28
29 ###¬†Cleanup previous runs
30
31 ! [ -z "$WORKSPACE" ] || die "No WORKSPACE"
32 [ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist"
33
34 do_cleanup
35
36 for d in "$WORKSPACE/build"
37 do
38   mkdir "$d" || die "Could not create $d"
39 done
40
41 NUMPROC="$(nproc)" || NUMPROC=1
42
43 cd $WORKSPACE/build
44
45 NSTEPS=16
46 STEP=1
47
48 for buildjava in ON OFF
49 do
50   for builddebug in ON OFF
51   do
52     for buildsmpi in ON OFF
53     do
54       for buildmc in ON OFF
55       do
56         echo "Step ${STEP}/${NSTEPS} - Building with java=${buildjava}, debug=${builddebug}, SMPI=${buildsmpi}, MC=${buildmc}"
57         echo "Step ${STEP}/${NSTEPS} - Building with java=${buildjava}, debug=${builddebug}, SMPI=${buildsmpi}, MC=${buildmc}" > $WORKSPACE/buildstep
58         cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=${buildjava} \
59               -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \
60               -Denable_jedule=ON -Denable_mallocators=ON -Denable_debug=${builddebug} \
61               -Denable_smpi=${buildsmpi} -Denable_smpi_MPICH3_testsuite=${buildsmpi} -Denable_model-checking=${buildmc} \
62               -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_ISP_testsuite=OFF \
63               -Denable_ns3=$(onoff test "$buildmc" != "ON") -Denable_coverage=OFF $WORKSPACE
64         make -j$NUMPROC
65         make clean
66         STEP=$((${STEP}+1))
67       done
68     done
69   done
70 done 
71
72 echo "All builds finished cleanly" > $WORKSPACE/buildstep
73