Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

detect number of procs during sphinx build #16512

Merged
merged 2 commits into from
Oct 22, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion docs/python_docs/python/Makefile_sphinx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,26 @@
# Makefile for Sphinx documentation
#

# Begin number of processors detection
NPROCS := 1
OS := $(shell uname)
export NPROCS

ifeq ($(NUMJOBS),)

ifeq ($(OS),Linux)
NPROCS := $(shell grep -c ^processor /proc/cpuinfo)
szha marked this conversation as resolved.
Show resolved Hide resolved
else ifeq ($(OS),Darwin)
NPROCS := $(shell system_profiler | awk '/Number of CPUs/ {print $$4}{next;}')
endif # $(OS)

else
NPROCS := $(NUMJOBS)
endif # $(NUMJOBS)
# End number of processors detection

# You can set these variables from the command line.
SPHINXOPTS = -j 32 -c ../scripts
SPHINXOPTS = -j$(NPROCS) -c ../scripts
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
Expand Down