Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add default value for every member variable (useful with default constructor).
[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 a personal script, but others may find this useful
5 #
6 # Copyright (c) 2017-2022 The SimGrid Team. Licence: LGPL of WDFPL, as you want.
7
8 if [ ! -e Makefile ] && [ ! -e build.ninja ]; 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 if [ -e build.ninja ] ; then
27   builder="ninja"
28 else
29   builder="make"
30 fi
31
32 (
33   echo "install_path: ${install_path}"
34   echo "Target: ${target}"
35   echo "Cores: ${ncores}"
36   (nice ${builder} -j${ncores} ${target} tests || make ${target} tests) && nice ctest -j${ncores} --output-on-failure ; date
37 ) 2>&1 | tee BuildSimGrid.sh.log
38