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:
Robert Underwood 2021-01-07 15:58:33 -05:00 committed by GitHub
parent b6e32a265b
commit 2f19346c9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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')