make/ninja: use the right number of jobs (#34057)

This commit is contained in:
Harmen Stoppels 2022-11-23 12:35:15 +01:00 committed by GitHub
parent fe1c105161
commit 55c77d659e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 5 deletions

View file

@ -5,7 +5,7 @@
import re
from spack.build_environment import MakeExecutable
from spack.build_environment import MakeExecutable, determine_number_of_jobs
from spack.package import *
@ -89,5 +89,9 @@ def symlink_gmake(self):
symlink("make", "gmake")
def setup_dependent_package(self, module, dspec):
module.make = MakeExecutable(self.spec.prefix.bin.make, make_jobs)
module.gmake = MakeExecutable(self.spec.prefix.bin.gmake, make_jobs)
module.make = MakeExecutable(
self.spec.prefix.bin.make, determine_number_of_jobs(parallel=dspec.package.parallel)
)
module.gmake = MakeExecutable(
self.spec.prefix.bin.gmake, determine_number_of_jobs(parallel=dspec.package.parallel)
)

View file

@ -3,7 +3,9 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.build_environment import MakeExecutable, determine_number_of_jobs
from spack.package import *
from spack.util.executable import which_string
class NinjaFortran(Package):
@ -92,6 +94,6 @@ def setup_dependent_package(self, module, dspec):
module.ninja = MakeExecutable(
which_string(name, path=[self.spec.prefix.bin], required=True),
determine_number_of_jobs(parallel=self.parallel),
determine_number_of_jobs(parallel=dspec.package.parallel),
supports_jobserver=True, # This fork supports jobserver
)

View file

@ -79,6 +79,6 @@ def setup_dependent_package(self, module, dspec):
module.ninja = MakeExecutable(
which_string(name, path=[self.spec.prefix.bin], required=True),
determine_number_of_jobs(parallel=self.parallel),
determine_number_of_jobs(parallel=dspec.package.parallel),
supports_jobserver=self.spec.version == ver("kitware"),
)