From 4d466fe879820e18f18e96809f6825d393792de3 Mon Sep 17 00:00:00 2001 From: Elizabeth F Date: Wed, 27 Apr 2016 20:57:04 -0400 Subject: [PATCH] spack setup: Fix broken module convenience settings. --- lib/spack/spack/package.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 51ee3d7d8b..ceb1a499a5 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -1497,8 +1497,21 @@ def make_executable(path): os.chmod(path, mode) + class CMakePackage(StagedPackage): + def make_make(self): + import multiprocessing + # number of jobs spack will to build with. + jobs = multiprocessing.cpu_count() + if not self.parallel: + jobs = 1 + elif self.make_jobs: + jobs = self.make_jobs + + make = spack.build_environment.MakeExecutable('make', jobs) + return make + def configure_args(self): """Returns package-specific arguments to be provided to the configure command.""" return list() @@ -1576,10 +1589,12 @@ def install_configure(self): cmake(self.source_directory, *options) def install_build(self): + make = self.make_make() with working_dir(self.build_directory, create=False): make() def install_install(self): + make = self.make_make() with working_dir(self.build_directory, create=False): make('install')