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
6 # Copyright (c) 2017-2023 The SimGrid Team. Licence: LGPL of WDFPL, as you want.
8 if [ ! -e Makefile ] && [ ! -e build.ninja ]; then
9 if [ -e build/default/Makefile ] ; then
12 echo "Please configure SimGrid before building it:"
19 ncores=$(grep -c processor /proc/cpuinfo)
20 halfcores=$(expr $ncores / 2 + 1)
22 install_path=$(sed -n 's/^CMAKE_INSTALL_PREFIX:PATH=//p' CMakeCache.txt)
23 if [ -e ${install_path} ] && [ -d ${install_path} ] && [ -x ${install_path} ] && [ -w ${install_path} ] ; then
27 if [ -e build.ninja ] ; then
34 echo "install_path: ${install_path}"
35 echo "Target: ${target}"
36 echo "Cores to build: ${ncores}"
37 echo "Cores to test: ${halfcores}"
38 (nice ${builder} -j${ncores} ${target} tests || ${builder} ${target} tests) && nice ctest -j${halfcores} --output-on-failure ; date
39 ) 2>&1 | tee BuildSimGrid.sh.log