Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions repos/spack_repo/builtin/build_systems/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
build_system,
classproperty,
depends_on,
determine_number_of_jobs,
execute_install_time_tests,
extends,
filter_file,
find,
get_effective_jobs,
has_shebang,
join_path,
path_contains_subdirectory,
Expand Down Expand Up @@ -313,7 +315,7 @@ def build_directory(self) -> str:
"""
return self.pkg.stage.source_path

def config_settings(self, spec: Spec, prefix: Prefix) -> Mapping[str, object]:
def config_settings(self, spec: Spec, prefix: Prefix) -> Dict[str, object]:
"""Configuration settings to be passed to the PEP 517 build backend.
Requires pip 22.1 or newer for keys that appear only a single time,
Expand Down Expand Up @@ -363,8 +365,18 @@ def install(self, pkg: PythonPackage, spec: Spec, prefix: Prefix) -> None:
pip.add_default_arg("-m", "pip")

args = PythonPipBuilder.std_args(pkg) + [f"--prefix={prefix}"]

for setting in _flatten_dict(self.config_settings(spec, prefix)):
config_settings = self.config_settings(spec, prefix)

# Pass -jN for compile-args if supported and needed
if spec.satisfies("%py-pip@22.1: %py-meson-python@0.11:"):
# get_effective_jobs returns None when a jobserver is active, then we don't pass -j.
jobs = get_effective_jobs(
jobs=determine_number_of_jobs(parallel=pkg.parallel), supports_jobserver=True
)
if jobs is not None:
config_settings["compile-args"] = f"-j{jobs}"

for setting in _flatten_dict(config_settings):
args.append(f"--config-settings={setting}")
for option in self.install_options(spec, prefix):
args.append(f"--install-option={option}")
Expand Down
1 change: 0 additions & 1 deletion repos/spack_repo/builtin/packages/py_matplotlib/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ def flag_handler(self, name, flags):
def config_settings(self, spec, prefix):
return {
"builddir": "build",
"compile-args": f"-j{make_jobs}",
"setup-args": {
"-Dsystem-freetype": True,
"-Dsystem-qhull": True,
Expand Down
1 change: 0 additions & 1 deletion repos/spack_repo/builtin/packages/py_numpy/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ def config_settings(self, spec, prefix):

settings = {
"builddir": "build",
"compile-args": f"-j{make_jobs}",
"setup-args": {
# https://scipy.github.io/devdocs/building/blas_lapack.html
"-Dblas": blas,
Expand Down
5 changes: 3 additions & 2 deletions repos/spack_repo/builtin/packages/py_scikit_learn/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ def url_for_version(self, version):
return url.format(name, version)

def setup_build_environment(self, env: EnvironmentModifications) -> None:
# Enable parallel builds of the sklearn backend
env.append_flags("SKLEARN_BUILD_PARALLEL", str(make_jobs))
if self.spec.satisfies("@:1.4"):
# Enable parallel builds for the pre py-meson-python build system
env.append_flags("SKLEARN_BUILD_PARALLEL", str(make_jobs))

# https://scikit-learn.org/stable/developers/advanced_installation.html#macos
if self.spec.satisfies("%apple-clang"):
Expand Down
1 change: 0 additions & 1 deletion repos/spack_repo/builtin/packages/py_scipy/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ def config_settings(self, spec, prefix):

return {
"builddir": "build",
"compile-args": f"-j{make_jobs}",
"setup-args": {
# http://scipy.github.io/devdocs/building/blas_lapack.html
"-Dfortran_std": fortran_std,
Expand Down
Loading