Improve paralellism on multisocket CPU

Current formula counts CPUs in first socket only. This change counts
all physical cores in all sockets.

I have system with two socket (each of them has 28 cores. As result the job is
running with `-j 28` instead of `-j 112` and building at 25% utilization.
This commit is contained in:
Miroslav Suchý 2026-08-17 22:16:59 +02:00 committed by trix
commit 749d91ee2c

View file

@ -632,7 +632,7 @@ sed -i -e 's@USE_MSLK_DEFAULT ON@USE_MSLK_DEFAULT OFF@' CMakeLists.txt
#
%ifarch x86_64
# Real cores, No hyperthreading
COMPILE_JOBS=`cat /proc/cpuinfo | grep -m 1 'cpu cores' | awk '{ print $4 }'`
COMPILE_JOBS=`lscpu -p=CORE | grep -v '^#' | sort -u |wc -l`
%else
# cpuinfo format varies on other arches, fall back to nproc
COMPILE_JOBS=`nproc`