Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spack: upgrade to 0.22.2 #2042

Merged
merged 1 commit into from
Oct 18, 2024
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
3 changes: 3 additions & 0 deletions components/admin/lmod-defaults/SPECS/lmod-defaults.spec
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ puts stderr "Setup default login environment"

prepend-path PATH %{OHPC_PUB}/bin

# include local packages installed via spack
prepend-path MODULEPATH %{OHPC_MODULEDEPS}/spack/

if { [ expr [module-info mode load] || [module-info mode display] ] } {
prepend-path MANPATH /usr/local/share/man:/usr/share/man/overrides:/usr/share/man/en:/usr/share/man
module try-add autotools
Expand Down
11 changes: 11 additions & 0 deletions components/dev-tools/spack/SOURCES/config.yaml.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/etc/spack/defaults/config.yaml 2024-09-21 10:39:55.000000000 +0000
+++ b/etc/spack/defaults/config.yaml 2024-10-01 15:05:36.648000000 +0000
@@ -17,7 +17,7 @@
# This is the path to the root of the Spack install tree.
# You can use $spack here to refer to the root of the spack instance.
install_tree:
- root: $spack/opt/spack
+ root: @@OHPC_APPS@@/spack/local
projections:
all: "{architecture}/{compiler.name}-{compiler.version}/{name}-{version}-{hash}"
# install_tree can include an optional padded length (int or boolean)
27 changes: 27 additions & 0 deletions components/dev-tools/spack/SOURCES/modules.yaml.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--- a/etc/spack/defaults/modules.yaml 2024-09-21 10:39:55.000000000 +0000
+++ b/etc/spack/defaults/modules.yaml 2024-10-01 15:05:36.648000000 +0000
@@ -38,17 +38,22 @@
default:
# Where to install modules
roots:
- tcl: $spack/share/spack/modules
+ tcl: @@OHPC_MODULEDEPS@@/spack
lmod: $spack/share/spack/lmod
+ arch_folder: false
# What type of modules to use ("tcl" and/or "lmod")
- enable: []
+ enable: ["tcl"]

tcl:
+ hide_implicits: true
+ projections:
+ all: '{name}/{version}-{compiler.name}-{compiler.version}-{architecture}'
all:
autoload: direct

# Default configurations if lmod is enabled
lmod:
+ hide_implicits: true
all:
autoload: direct
hierarchy:
44 changes: 0 additions & 44 deletions components/dev-tools/spack/SOURCES/spack.patch

This file was deleted.

19 changes: 14 additions & 5 deletions components/dev-tools/spack/SPECS/spack.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
%define pname spack

Name: %{pname}%{PROJ_DELIM}
Version: 0.21.2
Version: 0.22.2
Release: %{?dist}.1
Summary: HPC software package management

Group: %{PROJ_NAME}/dev-tools
License: LGPL
URL: https://github.com/spack/spack
Source0: https://github.com/spack/%{pname}/archive/v%{version}.tar.gz
Patch0: modules.yaml.patch
Patch1: config.yaml.patch

BuildRequires: rsync
BuildRequires: python3
Expand Down Expand Up @@ -48,7 +50,7 @@ Requires: gnupg2
Requires: gpg2
%endif

%global install_path %{OHPC_ADMIN}/%{pname}/%version
%global install_path %{OHPC_APPS}/%{pname}/%version
# Turn off the brp-python-bytecompile script
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

Expand All @@ -70,11 +72,16 @@ same package.

%prep
%setup -q -n %{pname}-%{version}
%patch -P 0 -p 1
%patch -P 1 -p 1

# cleanup any recipes that have hard-coded /bin/env in them as this will
# prevent installation on Leap
grep -rl '#!/bin/env ' . | xargs -i@ sed -i 's|#!/bin/env|#!/usr/bin/env|g' @

sed -e "s,@@OHPC_APPS@@,%{OHPC_APPS},g" -i etc/spack/defaults/config.yaml
sed -e "s,@@OHPC_MODULEDEPS@@,%{OHPC_MODULEDEPS},g" -i etc/spack/defaults/modules.yaml

%install
mkdir -p %{buildroot}%{install_path}
rsync -a --exclude=.gitignore {etc,bin,lib,var,share} %{buildroot}%{install_path}
Expand All @@ -83,8 +90,8 @@ rsync -a --exclude=.gitignore {etc,bin,lib,var,share} %{buildroot}%{install_path
rm -f %{buildroot}/%{install_path}/var/spack/repos/builtin/packages/patchelf/test/hello

# OpenHPC module file
%{__mkdir} -p %{buildroot}/%{OHPC_ADMIN}/modulefiles/spack
%{__cat} << EOF > %{buildroot}/%{OHPC_ADMIN}/modulefiles/spack/%{version}
%{__mkdir} -p %{buildroot}/%{OHPC_MODULES}/spack
%{__cat} << EOF > %{buildroot}/%{OHPC_MODULES}/spack/%{version}
#%Module1.0#####################################################################

module-whatis "Name: Spack"
Expand All @@ -97,11 +104,13 @@ set version %{version}
set SPACK_ROOT %{install_path}

prepend-path PATH %{install_path}/bin
prepend-path MODULEPATH %{install_path}/share/spack/modules/
prepend-path MODULEPATH %{OHPC_MODULEDEPS}/%{pname}/

EOF

%{__mkdir} -p %{buildroot}/%{_docdir}
%{__mkdir} -p %{buildroot}/%{OHPC_MODULEDEPS}/%{pname}/
%{__mkdir} -p %{buildroot}/%{OHPC_APPS}/%{pname}/local

%files
%{OHPC_HOME}
Expand Down
Loading