Limit JOBS to 2 on low memory 64bit systems

This commit is contained in:
2022-08-04 08:48:42 +02:00
parent 1d51e2887d
commit b5c4f35c4c
2 changed files with 13 additions and 0 deletions
+6
View File
@@ -7,6 +7,12 @@ CHECKOUT=0
ROOTDIR="$HOME/astro-soft"
JOBS=$(grep -c ^processor /proc/cpuinfo)
# 64 bit systems need more memory for compilation
if [ $(getconf LONG_BIT) -eq 64 ] && [ $(grep MemTotal < /proc/meminfo | cut -f 2 -d ':' | sed s/kB//) -lt 5000000 ]
then
echo "Low memory limiting to JOBS=2"
JOBS=2
fi
[ ! -d "$ROOTDIR" ] && mkdir $ROOTDIR
cd "$ROOTDIR"