Skip to content

Commit

Permalink
Add NRN_PARALLEL_BUILDS to setup.py (#3122)
Browse files Browse the repository at this point in the history
The environment variable `NRN_PARALLEL_BUILDS` can
be used to control the build parallelism. Essentially,
`-j${NRN_PARALLEL_BUILDS}`.
  • Loading branch information
JCGoran authored Oct 9, 2024
1 parent 31c9245 commit c9ee32e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/install/python_wheels.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ bash packaging/python/build_wheels.bash linux 3* coreneuron
```
Where we are passing `3*` to build the wheels with `CoreNEURON` support for all python 3 versions.

You can also control the level of parallelization used for the build using the `NRN_PARALLEL_BUILDS` env variable (default: 4).

### macOS
As mentioned above, for macOS all dependencies have to be available on a system. You have to then clone NEURON repository and execute:

Expand Down
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,12 @@ def _run_cmake(self, ext):
if self.cmake_defs:
cmake_args += ["-D" + opt for opt in self.cmake_defs.split(",")]

build_args = ["--config", cfg, "--", "-j4"] # , 'VERBOSE=1']
build_args = [
"--config",
cfg,
"--",
f"-j{os.environ.get('NRN_PARALLEL_BUILDS', 4)}",
]

env = os.environ.copy()
env["CXXFLAGS"] = "{} -DVERSION_INFO='{}'".format(
Expand Down

0 comments on commit c9ee32e

Please sign in to comment.