From 6c5b4dbd701916bd1f939a9983c2c0879a74b460 Mon Sep 17 00:00:00 2001 From: Daniel Markstedt Date: Sat, 7 Oct 2023 07:56:14 +0000 Subject: [PATCH] Use 1 compiler thread per 450MB RAM --- easyinstall.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/easyinstall.sh b/easyinstall.sh index 2f7f2cd404..f6e6db649a 100755 --- a/easyinstall.sh +++ b/easyinstall.sh @@ -49,7 +49,9 @@ echo -e $logo CONNECT_TYPE="FULLSPEC" # clang v11 is the latest distributed by Buster COMPILER="clang++-11" -CORES=1 +MEM=$(grep MemTotal /proc/meminfo | awk '{print $2}') +CORES=`expr $MEM / 450000` +[ $CORES -gt $(nproc) ] && CORES=$(nproc) USER=$(whoami) BASE=$(dirname "$(readlink -f "${0}")") CPP_PATH="$BASE/cpp"