Commit 655b69fc authored by Daniel Brown's avatar Daniel Brown
Browse files

fixing makefile processor counting

parent 27d1785c
Pipeline #239463 passed with stages
in 19 minutes and 15 seconds
# Detect number of threads to build with.
ifndef CPU_COUNT
NUM_THREADS = $(shell nproc || 1)
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
NUM_THREADS = $(shell nproc || 1)
endif
ifeq ($(UNAME_S),Darwin)
NUM_THREADS = $(shell sysctl -n hw.physicalcpu)
endif
else
NUM_THREADS = $(CPU_COUNT)
NUM_THREADS = $(CPU_COUNT)
endif
# Ideally we should use a packaging tool command like pip here instead of just `python
......
  • Why did you change this? We had tested this on a Mac and Windows and it worked for us. Does nproc not work on yoru machine?

  • (Ignore my deleted comment. I thought this commit was an accident from me, but it's apparently intentional and from Daniel...)

  • nproc isn't included in OSX. I imagine this is also an issue for Windows? or is that done via a batch script?

  • Ah, I see now. I did have it, but now that I checked, it is a manual install I did some time ago. Jan Just said it worked on Windows, but that might have been a WSL command line.

  • I guess the OSX line should then use sysctl -n hw.logicalcpu instead of sysctl -n hw.physicalcpu to get exactly the same behaviour as nproc.

  • That counts hyperthreads though, which isn't what we want is it?

  • I found using the logical CPU count still gave marginally better build times compared to physical CPU count. There's a table in !83 (merged). (I have 6 physical, 12 logical CPUs)

    Edited by Sean Leavey
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment