spack setup: Fix broken module convenience settings.

This commit is contained in:
Elizabeth F 2016-04-27 20:57:04 -04:00
parent 4a6b5d5247
commit 4d466fe879

View file

@ -1497,8 +1497,21 @@ def make_executable(path):
os.chmod(path, mode) os.chmod(path, mode)
class CMakePackage(StagedPackage): 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): def configure_args(self):
"""Returns package-specific arguments to be provided to the configure command.""" """Returns package-specific arguments to be provided to the configure command."""
return list() return list()
@ -1576,10 +1589,12 @@ def install_configure(self):
cmake(self.source_directory, *options) cmake(self.source_directory, *options)
def install_build(self): def install_build(self):
make = self.make_make()
with working_dir(self.build_directory, create=False): with working_dir(self.build_directory, create=False):
make() make()
def install_install(self): def install_install(self):
make = self.make_make()
with working_dir(self.build_directory, create=False): with working_dir(self.build_directory, create=False):
make('install') make('install')