Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
It is now possible to read/write the RNG state in a file.
[simgrid.git] / BuildSimGrid.sh
1 #!/usr/bin/env sh
2 #
3 # This little script rebuilds and runs the SimGrid archive in parallel, extracting a log
4 # This is almost an internal script, but others may find this useful
5 #
6 # Copyright (c) 2017-2020 The SimGrid Team. Licence: LGPL of WDFPL, as you want.
7
8 if [ ! -e Makefile ] ; then
9   if [ -e build/default/Makefile ] ; then
10     cd build/default
11   else
12     echo "Please configure SimGrid before building it:"
13     echo "   ccmake ."
14     exit 1
15   fi
16 fi
17
18 target=tests
19 ncores=$(grep -c processor /proc/cpuinfo)
20
21 install_path=$(sed -n 's/^CMAKE_INSTALL_PREFIX:PATH=//p' CMakeCache.txt)
22 if [ -e ${install_path} ] && [ -d ${install_path} ] && [ -x ${install_path} ] && [ -w ${install_path} ] ; then
23   target=install
24 fi
25
26 (
27   echo "install_path: ${install_path}"
28   echo "Target: ${target}"
29   echo "Cores: ${ncores}"
30   (nice make -j${ncores} ${target} tests || make ${target} tests) && nice ctest -j${ncores} --output-on-failure ; date
31 ) 2>&1 | tee BuildSimGrid.sh.log
32