X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=fast_make.sh;h=deb86d6719df9d4812595af215fddc0c89005d09;hb=942f4fcf5d6d3d813e9da546331f599f61dee0ac;hp=471562c515aa0da35d00b7f21ff2298046409d57;hpb=931a42358442f4ee4f314613c991c838d4b4e3b7;p=clitk.git diff --git a/fast_make.sh b/fast_make.sh index 471562c..deb86d6 100755 --- a/fast_make.sh +++ b/fast_make.sh @@ -1,8 +1,9 @@ #!/bin/bash vv_dir=$(dirname $(readlink -e $(which $0))) -echo vv directory: $vv_dir +echo clitk3 directory: $vv_dir cd ${vv_dir}/build + function handle_exit { rm mem_use 2>>/dev/null @@ -26,11 +27,13 @@ then sleep 1 make -j${cpus} else #use all the available computing power by default - cpus=$(( $(cat /proc/cpuinfo | grep -c ^processor) + 0 )) + cpus=$(( $(cat /proc/cpuinfo | grep -c ^processor) + 2 )) + echo "Building with ${cpus} cpus..." fi -make -j ${cpus} $@ & -make_pid=$(jobs -p %make) +nice -n12 ionice -c3 make -j ${cpus} $@ & +make_pid=$(jobs -p %nice) + #watch memory use to avoid crashes while ps $make_pid >>/dev/null do