From 2f19346c9af459770aa879d2ee0b9dfde6ddbaff Mon Sep 17 00:00:00 2001 From: Robert Underwood Date: Thu, 7 Jan 2021 15:58:33 -0500 Subject: [PATCH] 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 --- var/spack/repos/builtin/packages/py-scikit-learn/package.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/var/spack/repos/builtin/packages/py-scikit-learn/package.py b/var/spack/repos/builtin/packages/py-scikit-learn/package.py index a580f35a54..b1fb4bfe9f 100644 --- a/var/spack/repos/builtin/packages/py-scikit-learn/package.py +++ b/var/spack/repos/builtin/packages/py-scikit-learn/package.py @@ -62,6 +62,9 @@ class PyScikitLearn(PythonPackage): conflicts('~openmp', when='@:999', msg='Only master supports ~openmp') 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 if self.spec.satisfies('~openmp'): env.set('SKLEARN_NO_OPENMP', 'True')