Commit 22bd1501 authored by Sean Leavey's avatar Sean Leavey
Browse files

Fix Makefile CPU detection on Mac

parent 6d58b7cd
# Detect number of threads to build with.
ifndef CPU_COUNT
OS = $(shell uname -s)
ifeq ($(OS), Linux)
NUM_THREADS = $(shell grep -c ^processor /proc/cpuinfo)
else ifeq ($(OS), Darwin)
NUM_THREADS = $(shell system_profiler | awk '/Number of CPUs/ {print $$4}{next;}')
NUM_THREADS = $(shell nproc || 1)
else
NUM_THREADS = 1
endif
else
# Override detected count with CPU_COUNT environment variable if exists.
override NUM_THREADS = $(CPU_COUNT)
NUM_THREADS = $(CPU_COUNT)
endif
# Ideally we should use a packaging tool command like pip here instead of just `python
......
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