diff --git a/core/setup.py b/core/setup.py index 27f99082d1..14324ef152 100755 --- a/core/setup.py +++ b/core/setup.py @@ -94,7 +94,8 @@ def build_extension(self, ext): else: cmake_args += ['-DCMAKE_CXX_FLAGS="-Wno-pedantic"'] cmake_args += ["-DCMAKE_BUILD_TYPE=" + cfg] - build_args += ["--", "-j4"] + jobs = os.environ.get("MAX_JOBS", "4") + build_args += ["--", f"-j{jobs}"] env = os.environ.copy() diff --git a/docs/source/developer_guide/developer_guide_installation.rst b/docs/source/developer_guide/developer_guide_installation.rst index 5e92e49a01..5f6305ede6 100644 --- a/docs/source/developer_guide/developer_guide_installation.rst +++ b/docs/source/developer_guide/developer_guide_installation.rst @@ -142,6 +142,7 @@ Once it is done, you can compile ``opengate_core``. pip install colored cd /core export CMAKE_PREFIX_PATH=/geant4.11-build/:/itk-build/:${CMAKE_PREFIX_PATH} + export MAX_JOBS=$(nproc) # optional environment variable to set the number of parallel jobs for compilation pip install -e . -v The pip install will run cmake, compile the sources and create the