The build process could be sped up on systems with more than 4 cores available.
Right now it sets JOBS=-j5 which is a reasonable default but doesn't optimize based on available resources.
It would be better to just use something like make -j$(nproc)
@Valmar33 I was initially going to leave it as that, however I'm unfamiliar whether macOS includes this command by default and what the behavior would be on that platform, or any others that don't.
If macOS includes this, that would be a better move. I simply wanted to support Linux/macOS building and maintain the same core_count + 1 as it was previously.
On macOS the command sysctl -n hw.ncpu should work. nproc is not available.
@Luke-Nukem Awesome, this seems like this should work! :confetti_ball:
Compile based on number of threads available on system (not cores):
readarray -t -s3 -n3 threads <<< $(lscpu) ; export threads=$((${threads[0]/:}${threads[2]/*:}))
or
readarray -t -s3 -n3 threads <<< $(lscpu) ; export threads=$((${threads[0]/:[[:space:]]}${threads[2]/:*[[:space:]]}))
then:
make -j${threads}
build_proton.sh -j5
Fixed by 0d9ec29b5e3dea0d536e9da230f4f9f97d03a9fc.
Most helpful comment
On macOS the command
sysctl -n hw.ncpushould work.nprocis not available.