py-scikit-learn: do parallel builds of C extension (#20733)
Enabled parallel builds of the C-extension upto the parallelism allowed by spack. https://scikit-learn.org/stable/developers/advanced_installation.html#parallel-builds
This commit is contained in:
parent
b6e32a265b
commit
2f19346c9a
1 changed files with 3 additions and 0 deletions
|
@ -62,6 +62,9 @@ class PyScikitLearn(PythonPackage):
|
||||||
conflicts('~openmp', when='@:999', msg='Only master supports ~openmp')
|
conflicts('~openmp', when='@:999', msg='Only master supports ~openmp')
|
||||||
|
|
||||||
def setup_build_environment(self, env):
|
def setup_build_environment(self, env):
|
||||||
|
# enable parallel builds of the sklearn backend
|
||||||
|
env.append_flags("SKLEARN_BUILD_PARALLEL", str(make_jobs))
|
||||||
|
|
||||||
# https://scikit-learn.org/stable/developers/advanced_installation.html#building-from-source
|
# https://scikit-learn.org/stable/developers/advanced_installation.html#building-from-source
|
||||||
if self.spec.satisfies('~openmp'):
|
if self.spec.satisfies('~openmp'):
|
||||||
env.set('SKLEARN_NO_OPENMP', 'True')
|
env.set('SKLEARN_NO_OPENMP', 'True')
|
||||||
|
|
Loading…
Reference in a new issue