diff --git a/.github/workflows/test-tpls.yml b/.github/workflows/test-tpls.yml index 3b726de15b..8f0df94fc6 100644 --- a/.github/workflows/test-tpls.yml +++ b/.github/workflows/test-tpls.yml @@ -21,9 +21,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive + token: ${{ secrets.GITHUB_TOKEN }} - name: Log into registry ${{ env.REGISTRY }} if: github.event_name != 'pull_request' diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 342891af6c..72929a3632 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -59,8 +59,8 @@ include: when: always - local: .gitlab/jobs-prod.yml rules: - - if: '$CI_PIPELINE_SOURCE == "scheduled" || $CI_COMMIT_TAG' + - if: '$CI_PIPELINE_SOURCE == "scheduled"' when: never - - if: '$CI_PIPELINE_SOURCE == "push"' + - if: '$CI_PIPELINE_SOURCE == "push" || $CI_COMMIT_TAG' when: always - local: .gitlab/pages.yml diff --git a/.gitlab/os.yml b/.gitlab/os.yml index 70c46053b8..2b161d322a 100644 --- a/.gitlab/os.yml +++ b/.gitlab/os.yml @@ -4,7 +4,7 @@ .sys_config: variables: LLNL_SERVICE_USER: sphapp - UPSTREAM_DIR: /usr/WS2/sduser/Spheral/spack_upstream/0.22 + UPSTREAM_DIR: /usr/WS2/sduser/Spheral/spack_upstream/1.1.0 DISPLAY: ':0.0' .on_toss_4_x86: diff --git a/.gitlab/scripts.yml b/.gitlab/scripts.yml index 490296e050..860a6e03e4 100644 --- a/.gitlab/scripts.yml +++ b/.gitlab/scripts.yml @@ -130,7 +130,7 @@ rules: - !reference [.merge_pr_rule, rules] script: - - ./$SCRIPT_DIR/devtools/tpl-manager.py --no-upstream --spack-dir=$UPSTREAM_DIR + - ./$SCRIPT_DIR/devtools/tpl-manager.py --update-upstream .toss_update_permissions: stage: update_permissions @@ -140,7 +140,8 @@ - !reference [.merge_pr_rule, rules] script: - ml load mpifileutils - - dchmod --mode go+rx $UPSTREAM_DIR + - $RUN_CMD -n $NPROC dchmod --mode go+rx $UPSTREAM_DIR + dependencies: [] # ------------------------------------------------------------------------------ # Production Installation scripts diff --git a/.gitlab/specs.yml b/.gitlab/specs.yml index cfdebddfca..44acefc9c1 100644 --- a/.gitlab/specs.yml +++ b/.gitlab/specs.yml @@ -3,28 +3,28 @@ .gcc_mpi_cxxonly: variables: - SPEC: '%gcc+mpi' + SPEC: '+mpi%gcc' EXTRA_CMAKE_ARGS: '-DSPHERAL_ENABLE_PYTHON=OFF -DSPHERAL_ENABLE_STATIC=ON -DENABLE_WARNINGS_AS_ERRORS=On' .gcc_mpi: variables: - SPEC: '%gcc+mpi' + SPEC: '+mpi%gcc' EXTRA_CMAKE_ARGS: '-DSPHERAL_ENABLE_DOCS=On -DENABLE_WARNINGS_AS_ERRORS=On' .gcc_~mpi: variables: - SPEC: '%gcc~mpi' + SPEC: '~mpi%gcc' EXTRA_CMAKE_ARGS: '-DSPHERAL_ENABLE_DOCS=On -DENABLE_WARNINGS_AS_ERRORS=On' .gcc_~mpi_Debug: variables: - SPEC: '%gcc~mpi' + SPEC: '~mpi%gcc' EXTRA_CMAKE_ARGS: '-DCMAKE_BUILD_TYPE=Debug -DENABLE_WARNINGS_AS_ERRORS=On' .clang_mpi_dev_build: variables: - SPEC: '%clang+mpi' + SPEC: '+mpi%clang' EXTRA_CMAKE_ARGS: '-DENABLE_WARNINGS_AS_ERRORS=On -DENABLE_DEV_BUILD=On' @@ -42,21 +42,21 @@ .rocm_mpi: variables: - SPEC: '%rocmcc+mpi~rocm' + SPEC: '+mpi~rocm%rocmcc' .rocm_~mpi: variables: - SPEC: '%rocmcc~mpi~rocm' + SPEC: '~mpi~rocm%rocmcc' .rocm_~mpi_Debug: variables: - SPEC: '%rocmcc~mpi~rocm' + SPEC: '~mpi~rocm%rocmcc' EXTRA_CMAKE_ARGS: '-DCMAKE_BUILD_TYPE=Debug -DENABLE_WARNINGS_AS_ERRORS=On' .hip_rocm_mpi: variables: - SPEC: '%rocmcc+mpi+rocm' + SPEC: '+mpi+rocm%rocmcc' .hip_rocm_~mpi: variables: - SPEC: '%rocmcc~mpi+rocm' + SPEC: '~mpi+rocm%rocmcc' diff --git a/Dockerfile b/Dockerfile index 4cc883032b..c99c45f272 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ # Optional Arguments: # --progress=plain : Prints plain output to terminal instead of windowed version. # --build-args SPEC=... : Specify optional build argument to override. Default = gcc -# e.g. --build-args SPEC=clang +# e.g. --build-args SPEC=clang # To build and run a spheral test: # sudo env DOCKERBUILDKIT=1 docker build . --target spheral --tag spheral (--progress=plain) (--network none) @@ -22,29 +22,61 @@ # ----------------------------------------------------------------------------- # SPHERAL-BUILD-ENV # ----------------------------------------------------------------------------- -FROM ubuntu:20.04 AS spheral-build-env-local +FROM ubuntu:24.04 AS spheral-build-env-local ARG SPEC=gcc ARG HOST_CONFIG=docker-$SPEC # Update Ubuntu and install necessary packages. ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update -y -RUN apt-get upgrade -y -RUN apt-get install -y build-essential git gfortran mpich autotools-dev autoconf sqlite pkg-config uuid gettext cmake libncurses-dev libgdbm-dev libffi-dev libssl-dev libexpat-dev libreadline-dev libbz2-dev locales python python3 unzip libtool wget curl libcurl4-openssl-dev tk-dev -RUN apt-get install -y python3-dev python3-venv python3-pip -RUN apt-get install -y iputils-ping -# Setup system locale for pip package encoding/decoding +RUN apt-get update -y && \ + apt-get upgrade -y && \ + apt-get install -y \ + ca-certificates \ + netbase \ + iproute2 \ + build-essential \ + git \ + gfortran \ + autotools-dev \ + autoconf \ + sqlite3 \ + pkg-config \ + uuid \ + gettext \ + cmake \ + openmpi-bin \ + libopenmpi-dev \ + libncurses-dev \ + libgdbm-dev \ + libffi-dev \ + libssl-dev \ + libexpat-dev \ + libreadline-dev \ + libbz2-dev \ + locales \ + python3 \ + python3-dev \ + python3-venv \ + python3-pip \ + unzip \ + libtool \ + wget \ + curl \ + libcurl4-openssl-dev \ + tk-dev \ + iputils-ping && \ + rm -rf /var/lib/apt/lists/* + +# Setup system locale for pip package encoding/decoding RUN locale-gen en_US.UTF-8 # Set up TPLs for SPEC WORKDIR /home/spheral/workspace/ -COPY scripts scripts - - -RUN python3 scripts/devtools/tpl-manager.py --spec spheral%$SPEC --spack-dir /home +COPY scripts scripts +RUN python3 scripts/devtools/tpl-manager.py --spec spheral%$SPEC --tpl-dir /home COPY . . # Configure Spheral with SPEC TPLs. @@ -78,7 +110,7 @@ WORKDIR /home/spheral/workspace/ # Copy Spheral source and generate host config from tpl-manager (all dependencies should already be installed). COPY . . -RUN python3 scripts/devtools/tpl-manager.py --spec spheral%$SPEC --spack-dir /home +RUN python3 scripts/devtools/tpl-manager.py --spec spheral%$SPEC --tpl-dir /home # Configure Spheral with SPEC TPLs. RUN mv *.cmake $HOST_CONFIG.cmake diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 0caf970e87..c04c72673f 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -22,6 +22,9 @@ Notable changes include: * Gitlab pages now uses Plotly for interactive visualizations. * Gathering of performance data for the deploy stage is now parallelized over ranks and threads. * Merges to develop will copy installs to a shared directory for use by the performance testing scripts. + * Updated build system support spack v1 + * Updated TPL Manager to support spack v1.1.0 + * Updated CI to support python v3.12 and Ubuntu 24.04 Version v2025.12.0 -- Release date 2025-12-19 ============================================== @@ -278,12 +281,12 @@ Version v2024.06.1 -- Release date 2024-07-09 * Bug Fixes / improvements: * CD pipeline hotfix for installing release builds on LC machines. - * Fixes an issue with the use of the axom::quest::SignedDistance interface. + * Fixes an issue with the use of the axom::quest::SignedDistance interface. Version v2024.06.0 -- Release date 2024-06-27 ============================================== * Important Notes: - * External users of the code will need to supply config files for tpl-manager to find system libraries correctly. Steps to do this are detailed in the external user build guide. + * External users of the code will need to supply config files for tpl-manager to find system libraries correctly. Steps to do this are detailed in the external user build guide. Notable changes include: @@ -325,7 +328,7 @@ Notable changes include: * DEM * new field list to track max particle overlap * user can optional turn off fast time stepping - + * Build changes / improvements: * Improved the target export functionality. @@ -336,13 +339,13 @@ Notable changes include: * Initial volumes for damage models were incorrectly not taking into account pore space when computing failure statistics for seeding flaws. Fixed. * DEM * fixed bug in solid boundary unique indices that causes particle sticking - * fixed bug in solid boundary update policies + * fixed bug in solid boundary update policies * fixed solid boundary restartability for moving bcs Version v2024.01.00 -- Release date 2024-01-19 ============================================== * Important Notes: - * The PolyClipper, BLT, and PYB11Generator submodules have been modified. Be sure to recursively update the submodules. + * The PolyClipper, BLT, and PYB11Generator submodules have been modified. Be sure to recursively update the submodules. Notable changes include: @@ -370,7 +373,7 @@ Notable changes include: * Bug Fixes / improvements: * Fixed melt behavior in Steinberg-Guinan strength model, which was ignoring melt for damaged material. * Fixed range of dimensionless melt temperature for Johnson-Cook strength. - * FSISPH new features and modifications to method. + * FSISPH new features and modifications to method. * NOTE constructor inputs have changed. * strength implementation modified. * new features added including plane strain option and settable minP for interfaces. @@ -442,7 +445,7 @@ Notable changes include: * Adding user specified functions for shear modulus and yield strength as a function of damage. * Build changes / improvements: - * The C++ library interface is compiled into a single Spheral_CXX library. + * The C++ library interface is compiled into a single Spheral_CXX library. * Previous Spheral C++ libraries are still CMAKE targets, but are "ojbect" libraries. * ATS bumped to version 7.0.9 for blueos smpi option support. * Eigen bumped to 3.4.0 for NVCC compatiblity. @@ -501,7 +504,7 @@ Notable changes include: * Bug Fixes / improvements: * Spheral fixed when running in Debug mode with MPI=Off. * Typos fixed in quickstart guide. https://github.com/LLNL/spheral/pull/116 - * Pedantic check for expired pointer to the RestartRegistrar. Ensures we don't call into deleted objects. + * Pedantic check for expired pointer to the RestartRegistrar. Ensures we don't call into deleted objects. * Switching GammaLaw and Polytropic EOS to the isentrpic bulk modulus for consistency w/ Solid EOS. * Update scalar and tensor damage calc in FSISPH to be more consistent with SolidSPHHydro. * CullenDehnen segfault fix. diff --git a/docs/build_guide/include/tpls.rst.inc b/docs/build_guide/include/tpls.rst.inc index b97ab2bef6..ebc72a1c55 100644 --- a/docs/build_guide/include/tpls.rst.inc +++ b/docs/build_guide/include/tpls.rst.inc @@ -29,7 +29,7 @@ Overall, the following options can be provided to ``tpl-manager.py``: Display Spheral Spack info, including variants and dependencies. -.. option:: --spack-dir +.. option:: --tpl-dir Where to create the Spack instance to use. Optional, default ``./../spheral-spack-tpls``. diff --git a/scripts/devtools/tpl-manager.py b/scripts/devtools/tpl-manager.py index 373eec6b3d..eaeaa396dd 100755 --- a/scripts/devtools/tpl-manager.py +++ b/scripts/devtools/tpl-manager.py @@ -9,18 +9,11 @@ def get_config_dir(base_dir): "Return directory containing the repo.yaml file for a base dir" return os.path.join(base_dir, "scripts/spack") -# Spack instance info -default_spack_dir = os.path.join(os.getcwd(), "../spheral-spack-tpls") - -# Set environment variables so Spack no longer uses ~/.spack directory -os.environ["SPACK_USER_CACHE_PATH"] = os.path.join(default_spack_dir, "misc") -os.environ["SPACK_DISABLE_LOCAL_CONFIG"] = "true" - +default_install_args = dict(stop_at="initconfig", fail_fast=True) default_spack_url = "https://github.com/spack/spack.git" -spack_commit = "5fe93fee1eec46a0750bd340198bffcb92ff9eec" -# Current repo (either LLNLSpheral or Spheral) -package_name = "spheral" +spack_commit = "0c2be44e4ece21eb091ad5de4c97716b7c6d4c87" # Spack version: v1.1.0 +# Current repo (either LLNLSpheral or Spheral) base_dir = os.getcwd() package_dirs = {"spheral": base_dir} @@ -31,6 +24,8 @@ def get_config_dir(base_dir): package_name = "llnlspheral" package_dirs["spheral"] = os.path.join(base_dir, "spheral") package_dirs.update({"llnlspheral": base_dir}) +else: + package_name = "spheral" print(f"Managing {package_name} TPLs") class SpheralTPL: @@ -47,16 +42,15 @@ def parse_args(self): help="Show the Spheral Spack info, including dependencies and variants.") parser.add_argument("--add-spec", action="store_true", help="Set this flag to add the --spec to the environment.") - parser.add_argument("--spack-dir", type=str, - default=default_spack_dir, + parser.add_argument("--tpl-dir", type=str, + default=os.path.join(os.getcwd(), "../spheral-spack-tpls"), help="Directory to install Spack instance and a build directory.") - parser.add_argument("--spack-url", type=str, default=default_spack_url, - help="URL to download spack.") + parser.add_argument("--update-upstream", action="store_true", + help="Install TPLs into the upstream instead of the local build. "+\ + "Installs all specs in the current environment.") parser.add_argument("--clean", action="store_true", help="Set this flag to ensure concretizations/installs are fresh. "+\ "If issues arise, try using this flag.") - parser.add_argument("--no-upstream", action="store_true", - help="Ignore upstream by temporarily modifying environment.") parser.add_argument("--init-only", action="store_true", help="Download Spack but do not concretize or install.") parser.add_argument("--skip-init", action="store_true", @@ -71,9 +65,17 @@ def parse_args(self): help="Tells tpl-manager to use the dev_pkg environment. "+\ "Assumes TPLs are for buildcache creation if no --spec is provided. "+\ "Assumes building from a buildcache if --spec is provided.") + parser.add_argument("--spack-url", type=str, default=default_spack_url, + help="URL to download spack.") + parser.add_argument("--spack-debug-level", type=int, default=0, + help="Set debug output level for spack instance usage.") self.args = parser.parse_args() + # Set environment variables so Spack no longer uses ~/.spack directory + os.environ["SPACK_USER_CACHE_PATH"] = os.path.join(self.args.tpl_dir, "misc") + os.environ["SPACK_DISABLE_LOCAL_CONFIG"] = "true" + if (not self.args.spec and self.args.ci_run): raise Exception("Must specify a --spec if doing --ci-run") @@ -82,24 +84,34 @@ def parse_args(self): if (self.args.spec): print(f"Installing {self.args.spec}") - def add_spack_paths(self, spack_dir): + def add_spack_paths(self, tpl_dir): "Append spack path to system to use spack python modules" - spack_path = os.path.join(spack_dir, "lib", "spack") + spack_path = os.path.join(tpl_dir, "lib", "spack") sys.path.append(spack_path) - spack_external_path = os.path.join(spack_path, "external") - sys.path.append(spack_external_path) - sys.path.append(os.path.join(spack_external_path, "_vendoring")) + sys.path.append(os.path.join(spack_path, "spack")) + sys.path.append(os.path.join(spack_path, "_vendoring")) global spack, SpackCommand try: import spack from spack.main import SpackCommand spack = spack + + # + # Workaround: Cause spack to set its internal working directory + # state before we make any further spack API calls. + spack.paths.set_working_dir() except ImportError as e: raise ImportError("Failed to import Spack python module") from e + def print_specs(self, specs): + if (type(specs) != list): + specs = [specs] + install_status = spack.spec.Spec.install_status + print(spack.spec.tree(specs, format=spack.spec.DISPLAY_FORMAT, status_fn=install_status, hashes=True, hashlen=6)) + def clone_spack(self): "Clone Spack and add paths to use spack python" - tpl_root = self.args.spack_dir + tpl_root = self.args.tpl_dir if (not os.path.exists(tpl_root)): os.mkdir(tpl_root) spack_dir = os.path.join(tpl_root, "spack") @@ -111,9 +123,6 @@ def clone_spack(self): if (cur_hash != spack_commit): sexe(f"git -C {spack_dir} fetch --depth=2 origin {spack_commit}") sexe(f"git -C {spack_dir} checkout FETCH_HEAD") - uber_env_trash = os.path.join(spack_dir, "etc/spack/defaults/upstreams.yaml") - if (self.args.clean and os.path.exists(uber_env_trash)): - sexe(f"git -C {spack_dir} clean -df") self.add_spack_paths(spack_dir) def check_lock_file(self): @@ -159,7 +168,7 @@ def find_all_spack_packages(self, packages, req=True): def modify_env_file(self, env_file, mod_func): "Modify the spack.yaml file" from spack.util import spack_yaml - # Load the spack.yaml file + import re with open(env_file) as ff: try: loader = spack_yaml.load(ff) @@ -169,6 +178,18 @@ def modify_env_file(self, env_file, mod_func): with open(env_file, 'w') as ff: spack_yaml.dump(loader, ff) + # Fixup spack.yaml include:: list + # + # Spack's YAML dumper automatically quotes 'include::' because '::' + # is special in YAML, but Spack requires it to be unquoted to recognize the + # include directive + with open(env_file, 'r') as ff: + content = ff.read() + content = re.sub(r" '['\"]?include:+['\"]?:", " include::", content) + + with open(env_file, 'w') as ff: + ff.write(content) + def custom_spack_env(self, env_name): "Use/create a custom Spack environment" from spack import environment @@ -179,27 +200,40 @@ def custom_spack_env(self, env_name): # Create a new environment env_cmd = SpackCommand("env") env_cmd("create", "--without-view", "-d", self.env_dir) + def set_concretize(loader): - new_dict = {"concretizer": {"unify": False}} - loader["spack"].update(new_dict) + develop_dict = {} + repos_list = [] + + for package, path in package_dirs.items(): + repo_path = os.path.abspath(os.path.join(get_config_dir(path), f"spack_repo/{package}")) + repos_list.append(repo_path) + dev_path = os.path.abspath(path) + develop_dict[package] = { + "path": dev_path, + "spec": f"{package}@=develop" + } + + loader["spack"]["concretizer"] = { + "unify": False, + "reuse": False, + "compiler_mixing": False + } + loader["spack"]["develop"] = develop_dict + loader["spack"]["include::"] = [ + "../../configs/config.yaml" + ] + loader["spack"]["repos"] = repos_list + return loader + self.modify_env_file(env_file, set_concretize) + self.spack_env = environment.Environment(self.env_dir) environment.activate(self.spack_env) - # Get all the Spack commands - repo_cmd = SpackCommand("repo") - dev_cmd = SpackCommand("develop") comp_cmd = SpackCommand("compiler") ext_cmd = SpackCommand("external") - cur_repos = repo_cmd("list") # spack repo list - # Add the repos and develop paths to the spack environment - for package, path in package_dirs.items(): - if (package+" " not in cur_repos): - repo_path = os.path.abspath(get_config_dir(path)) - repo_cmd("add", f"{repo_path}") # spack repo add - dev_path = os.path.abspath(path) - dev_cmd("-p", dev_path, f"{package}@=develop") # spack develop @=develop comp_cmd("find") # spack compiler find ext_cmd("find") # spack external find provider_dict = {} @@ -225,11 +259,9 @@ def set_concretize(loader): opt_packages = ["hdf5", "ncurses"] for i in opt_packages: self.find_spack_package(i, req=False) - # Hard-coding providers for these packages vastly improves TPL system provider_dict.update({"zlib-api": ["zlib"], "blas": ["openblas"], "lapack": ["openblas"]}) - # Always add the spec for a custom environment if (provider_dict): self.config_env_providers(provider_dict) self.args.add_spec = True @@ -242,25 +274,6 @@ def set_providers(loader): return loader self.modify_env_file(env_file, set_providers) - def remove_upstream(self): - "Modify the spack.yaml to remove the upstream" - # TODO: Ideally use spack config command to achieve this - # Remove upstream.yaml or upstream entry - def do_remove(loader): - if ("upstreams" in loader["spack"]): - del loader["spack"]["upstreams"] - if ("include" in loader["spack"]): - for i, x in enumerate(loader["spack"]["include"]): - if ("upstreams.yaml" in x): - del loader["spack"]["include"][i] - return loader - - # Copy spack.yaml to origspack.yaml and overwrite spack.yaml - # with upstreams removed - env_file = os.path.join(self.env_dir, "spack.yaml") - shutil.copyfile(env_file, os.path.join(self.env_dir, "origspack.yaml")) - self.modify_env_file(env_file, do_remove) - def activate_spack_env(self): "Activates a Spack environment or creates and activates one when necessary" config_env_dir = os.path.join(get_config_dir(base_dir), "environments") @@ -272,8 +285,6 @@ def activate_spack_env(self): # For LC systems self.env_dir = os.path.join(config_env_dir, default_env) print(f"Activating Spack environment in {self.env_dir}") - if self.args.no_upstream: - self.remove_upstream() from spack import environment self.spack_env = environment.Environment(self.env_dir) environment.activate(self.spack_env) @@ -286,43 +297,48 @@ def activate_spack_env(self): def concretize_spec(self, check_spec): "Concretize the spec" - if (check_spec): - self.spack_spec = spack.spec.Spec(self.args.spec) - if (self.args.add_spec): - add_cmd = SpackCommand("add") - add_cmd(self.args.spec) - conc_cmd = SpackCommand("concretize") - conc_args = ["-U"] + if (self.args.add_spec): + with self.spack_env.write_transaction(): + self.spack_env.add(self.args.spec) + self.spack_env.write() + + force_conc = False if (self.args.clean): - conc_args.append("-f") + force_conc = True print("Cleaning and concretizing environment") else: print("Concretizing environment") - conc_cmd(*conc_args) + + with self.spack_env.write_transaction(): + conc_spec = self.spack_env.concretize(force=force_conc) + self.spack_env.write() + + if conc_spec: + print("Concretized specs") + for x in conc_spec: + print(x) if (check_spec): + self.spack_spec = spack.spec.Spec(self.args.spec) matches = self.spack_env.matching_spec(self.spack_spec) if (not matches): raise Exception(f"{self.args.spec} not found in current "+\ "environment. Rerun with --add-spec to add it.") self.spack_spec = matches print(f"Found matching root spec for {self.args.spec}") - - def do_install(self, install_args, spec): - install_cmd = SpackCommand("install") - if (self.args.dry_run): - install_args.append("--fake") - print(f"Running spack {' '.join(install_args)} {spec}") - install_cmd(*install_args, spec) + self.print_specs(self.spack_spec) + else: + specs = self.spack_env.concrete_roots() + self.print_specs(specs) def install_and_config(self): "Install TPLs and create host config file for given spec" spec = self.args.spec # Load the spack package recipe python class if (package_name == "llnlspheral"): - from spack.pkg.llnlspheral.llnlspheral import Llnlspheral + from spack_repo.llnlspheral.packages.llnlspheral.package import Llnlspheral spack_spheral = Llnlspheral(self.spack_spec) else: - from spack.pkg.spheral.spheral import Spheral + from spack_repo.spheral.packages.spheral.package import Spheral spack_spheral = Spheral(self.spack_spec) # Get host config file name from spack package recipe @@ -333,15 +349,14 @@ def install_and_config(self): # Avoid overwriting existing host config file shutil.copyfile(host_config_file, "orig"+host_config_file) mod_host_config = True - if (self.args.ci_run): - spec_cmd = SpackCommand("spec") - print(f"Running spack spec -IL {spec}") - spec_cmd("-IL", spec) - install_args = ["-u", "initconfig", "--fail-fast"] if (self.args.dev_pkg): - # Spec is provided so assumes we are building from a buildcache - install_args.extend(["--use-buildcache", "package:never,dependencies:only", "--no-check-signature"]) - self.do_install(install_args, spec) + self.spack_env.install_specs([self.spack_spec], + package_use_cache=False, + dependencies_cache_only=True, + unsigned=True, + **default_install_args) + else: + self.spack_env.install_specs([self.spack_spec], **default_install_args) if (self.args.ci_run): shutil.copyfile(host_config_file, "gitlab.cmake") host_config_file = "gitlab.cmake" @@ -360,7 +375,16 @@ def __init__(self): self.clone_spack() if (self.args.init_only): return + + if (self.args.spack_debug_level > 0): + import spack.llnl.util.tty as tty + tty.set_debug(self.args.spack_debug_level) + self.activate_spack_env() + + debug_cmd = SpackCommand("debug") + debug_cmd("report") + if (self.args.show_specs): find_cmd = SpackCommand("find") find_cmd("-r") @@ -379,15 +403,21 @@ def __init__(self): else: # Concretize the current environment self.concretize_spec(check_spec=False) - # No spec is given, install TPLs for all env specs - install_args = ["-u", "initconfig", "--fail-fast"] - self.do_install(install_args, package_name) - - # Undo any file changes we made to spack.yaml - orig_file = os.path.join(self.spack_env.path, "origspack.yaml") - if (self.args.no_upstream and os.path.exists(orig_file)): - # Revert env file if it was modified - os.rename(orig_file, os.path.join(self.spack_env.path, "spack.yaml")) + if self.args.update_upstream: + upstream_dir = spack.config.get("upstreams:spheral_shared:install_tree") + spack.config.set("config", {"install_tree": {"root": str(upstream_dir), "padded_length": 0}}) + print("WARNING: Modifying local Spack files, do not commit these changes") + with self.spack_env.manifest.use_config(): + print(spack.config.get("config:install_tree")) + print(f"Installing to {upstream_dir}") + # Pass None so it installs TPLs for all specs + self.spack_env.install_all(install_deps=True, install_package=False, fail_fast=True) + # Equivalent of running spack reindex + spack.store.STORE.reindex() + print("WARNING: Be sure to update permissions and groups on upstream.") + else: + self.spack_env.install_specs(None, **default_install_args) + # Remove symbolic directory created by Spack print("Removing Spack symbolic build directories") build_dirs = glob.glob("build-*") diff --git a/scripts/lc/generate-buildcache.sh b/scripts/lc/generate-buildcache.sh index 3ed145b4dc..77cb47a53f 100644 --- a/scripts/lc/generate-buildcache.sh +++ b/scripts/lc/generate-buildcache.sh @@ -1,5 +1,12 @@ trap 'echo "# $BASH_COMMAND"' DEBUG +run_cmd() { + if ! eval $1 ; then + echo "FAILED" + exit 1 + fi +} + ### Create a tar file containing: # dev-pkg/ # *cloned spheral repo.* @@ -54,23 +61,23 @@ cp -a $SPHERAL_PIP_CACHE_DIR/. $RESOURCE_DIR/pip_cache # Creates a local Spack repo # Activates and concretizes the dev_pkg Spheral Spack environment # Installs the Spheral dependencies for all specs -./$SCRIPT_DIR/devtools/tpl-manager.py --dev-pkg --clean +run_cmd "./$SCRIPT_DIR/devtools/tpl-manager.py --dev-pkg --clean" # Source Spack for the current terminal source ../spheral-spack-tpls/spack/share/spack/setup-env.sh # Activate our dev spack environment -spack env activate ./scripts/spack/environments/dev_pkg +run_cmd "spack env activate ./scripts/spack/environments/dev_pkg" # Create a mirror of all tpl specs in our environment # (should only be our deps for a single spec in the env). -spack mirror create -a -d $RESOURCE_DIR/mirror --exclude-specs "llnlspheral spheral" +run_cmd "spack mirror create -a -d $RESOURCE_DIR/mirror --exclude-specs 'llnlspheral spheral'" # Use spack to list all specs in the mirror and push them to the buildcache. -spack buildcache push -auf $RESOURCE_DIR/mirror $(spack find --format /{hash}) +run_cmd "spack buildcache push -u -f $RESOURCE_DIR/mirror $(spack find --format /{hash})" # Mirror bootstrap packages needed to start a spack instance on an airgapped system. -spack bootstrap mirror --binary-packages $RESOURCE_DIR +run_cmd "spack bootstrap mirror --binary-packages $RESOURCE_DIR" # Tar up everything in the $CI_BUILD_DIR -tar -czf $CI_BUILD_DIR/$DEV_PKG_NAME.tar.gz -C ../ $PKG_DIR +run_cmd "tar -czf $CI_BUILD_DIR/$DEV_PKG_NAME.tar.gz -C ../ $PKG_DIR" diff --git a/scripts/lc/install-from-dev-pkg.sh b/scripts/lc/install-from-dev-pkg.sh index 4c3bc86e5d..a4b7713b09 100644 --- a/scripts/lc/install-from-dev-pkg.sh +++ b/scripts/lc/install-from-dev-pkg.sh @@ -26,7 +26,7 @@ echo $PWD mkdir -p $INSTALL_DIR cp -a $PWD/resources/pip_cache/. $SPHERAL_PIP_CACHE_DIR -./$SCRIPT_DIR/devtools/tpl-manager.py --spack-url $SPACK_URL --init-only --no-upstream --spack-dir $INSTALL_DIR/spheral-spack-tpls --clean +./$SCRIPT_DIR/devtools/tpl-manager.py --spack-url $SPACK_URL --init-only --tpl-dir $INSTALL_DIR/spheral-spack-tpls --clean source $INSTALL_DIR/spheral-spack-tpls/spack/share/spack/setup-env.sh spack env activate ./scripts/spack/environments/dev_pkg @@ -42,7 +42,7 @@ spack buildcache update-index $PWD/resources/mirror # With these inputs, tpl-manager will build with --use-buildcache package:never,dependencies:only -u initconfig # This ensures the TPLs are only built from cache and Spheral isn't built -$BUILD_ALLOC ./$SCRIPT_DIR/devtools/tpl-manager.py --no-upstream --spack-dir $INSTALL_DIR/spheral-spack-tpls --spec $DEV_PKG_SPEC --skip-init --dev-pkg +$BUILD_ALLOC ./$SCRIPT_DIR/devtools/tpl-manager.py --tpl-dir $INSTALL_DIR/spheral-spack-tpls --spec $DEV_PKG_SPEC --skip-init --dev-pkg HOST_CONFIG_FILE=$(ls -t | grep -E "*\.cmake" | head -1) $BUILD_ALLOC ./$SCRIPT_DIR/devtools/host-config-build.py --host-config $HOST_CONFIG_FILE -i $INSTALL_DIR --build --no-clean -DSPHERAL_PIP_CACHE_DIR=$SPHERAL_PIP_CACHE_DIR -DSPHERAL_NETWORK_CONNECTED=Off diff --git a/scripts/spack/configs/blueos_3_ppc64le_ib/compilers.yaml b/scripts/spack/configs/blueos_3_ppc64le_ib/compilers.yaml deleted file mode 100644 index 84c1b8b70b..0000000000 --- a/scripts/spack/configs/blueos_3_ppc64le_ib/compilers.yaml +++ /dev/null @@ -1,27 +0,0 @@ -compilers: -- compiler: - spec: clang@9.0.0 - paths: - cc: /usr/tce/packages/clang/clang-9.0.0/bin/clang - cxx: /usr/tce/packages/clang/clang-9.0.0/bin/clang++ - f77: /usr/tce/packages/xl/xl-beta-2019.06.20/bin/xlf2003_r - fc: /usr/tce/packages/xl/xl-beta-2019.06.20/bin/xlf2003_r - flags: {} - operating_system: rhel7 - target: ppc64le - modules: [] - environment: {} - extra_rpaths: [] -- compiler: - spec: gcc@10.2.1 - paths: - cc: /usr/tce/packages/gcc/gcc-10.2.1/bin/gcc - cxx: /usr/tce/packages/gcc/gcc-10.2.1/bin/g++ - f77: /usr/tce/packages/gcc/gcc-10.2.1/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-10.2.1/bin/gfortran - flags: {} - operating_system: rhel7 - target: ppc64le - modules: [] - environment: {} - extra_rpaths: [] diff --git a/scripts/spack/configs/blueos_3_ppc64le_ib/packages.yaml b/scripts/spack/configs/blueos_3_ppc64le_ib/packages.yaml deleted file mode 100644 index ea43681acb..0000000000 --- a/scripts/spack/configs/blueos_3_ppc64le_ib/packages.yaml +++ /dev/null @@ -1,183 +0,0 @@ -packages: - all: - target: [ppc64le] - compiler: [gcc, clang] - providers: - blas: [netlib-lapack] - lapack: [netlib-lapack] - mpi: [spectrum-mpi] - zlib-api: [zlib] - cmake: - version: [3.21.1] - buildable: false - externals: - - spec: cmake@3.21.1 - prefix: /usr/tce/packages/cmake/cmake-3.21.1 - gmake: - version: [4.2.1] - buildable: false - externals: - - spec: gmake@4.2.1 - prefix: /usr - git: - version: [2.29.1] - buildable: false - externals: - - spec: git@2.29.1+tcltk - prefix: /usr/tce - perl: - version: [5.26.3] - buildable: false - externals: - - spec: perl@5.26.3 - prefix: /usr - - cuda: - version: - - 11.1.0 - - 11.0.2 - - 10.1.243 - buildable: false - externals: - - spec: cuda@11.4.1+allow-unsupported-compilers - prefix: /usr/tce/packages/cuda/cuda-11.4.1 - - spec: cuda@11.1.0~allow-unsupported-compilers - prefix: /usr/tce/packages/cuda/cuda-11.1.0 - - spec: cuda@11.0.2~allow-unsupported-compilers - prefix: /usr/tce/packages/cuda/cuda-11.0.2 - - spec: cuda@10.1.243~allow-unsupported-compilers - prefix: /usr/tce/packages/cuda/cuda-10.1.243 - - spectrum-mpi: - externals: - - spec: spectrum-mpi@10.3.1.03rtm0%pgi@19.10 - prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-pgi-19.10 - - spec: spectrum-mpi@10.3.1.03rtm0%pgi@20.4 - prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-pgi-20.4 - - spec: spectrum-mpi@10.3.1.03rtm0%gcc@8.3.1 - prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1 - - spec: spectrum-mpi@10.3.1.03rtm0%gcc@4.9.3 - prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-4.9.3 - - spec: spectrum-mpi@10.3.1.03rtm0%gcc@10.2.1 - prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-10.2.1 - - spec: spectrum-mpi@10.3.1.03rtm0%clang@9.0.0 - prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-9.0.0 - - spec: spectrum-mpi@10.3.1.03rtm0%clang@9.0.0-ibm - prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-ibm-2019.10.03 - - spec: spectrum-mpi@10.3.1.03rtm0%clang@10.0.1-ibm - prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-ibm-10.0.1 - - spec: spectrum-mpi@10.3.1.03rtm0%xl@16.1.1.7 - prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-xl-2020.03.18 - - spec: spectrum-mpi@10.3.1.03rtm0%xl@beta2019.06.20 - prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-xl-beta-2019.06.20 - buildable: false - -# ------ SYSTEM LIBS ------- - python: - externals: - - spec: python@3.8.2 - prefix: /usr/apps/python-3.8.2 - buildable: false - ncurses: - externals: - - spec: ncurses@5.9 - prefix: /usr - buildable: false - readline: - externals: - - spec: readline@7.0 - prefix: /collab/usr/gapps/python/build/spack-coralea.3/opt/spack/linux-rhel7-ppc64le/gcc-4.9.3/readline-7.0-owal6z2zh5zotgvdmwow6sgdn6cqfn43 - buildable: false - autoconf: - externals: - - spec: autoconf@2.69 - prefix: /usr - buildable: false - automake: - externals: - - spec: automake@1.13.4 - prefix: /usr - buildable: false - libtool: - externals: - - spec: libtool@2.4.2 - prefix: /usr - buildable: false - bzip2: - externals: - - spec: bzip2@1.0.6 - prefix: /usr - buildable: false - expat: - externals: - - spec: expat@2.4.1 - prefix: /usr - buildable: false - gdbm: - externals: - - spec: gdbm@1.19 - prefix: /usr - buildable: false - gettext: - externals: - - spec: gettext@0.19 - prefix: /usr - buildable: false - libffi: - externals: - - spec: libffi@3.3 - prefix: /usr - buildable: false - openssl: - externals: - - spec: openssl@1.1.1 - prefix: /usr - buildable: false - ossp-uuid: - externals: - - spec: ossp-uuid@1.62 - prefix: /usr - buildable: false - sqlite: - externals: - - spec: sqlite@3.36.0 - prefix: /usr - buildable: false - pkg-config: - externals: - - spec: pkg-config@0.27.1 - prefix: /usr - buildable: false - tar: - externals: - - spec: tar@1.26 - prefix: /usr - buildable: false - elfutils: - externals: - - spec: elfutils@0.176 - prefix: /usr - buildable: false - tcl: - externals: - - spec: tcl@8.5.19 - prefix: /usr - buildable: false - tk: - externals: - - spec: tk@8.5.19 - prefix: /usr - buildable: false - fontconfig: - externals: - - spec: fontconfig@2.13.1 - prefix: /usr - buildable: false - -#---- Extension Dependencies - - hwloc: - externals: - - spec: hwloc@5.7.5 - prefix: /usr - buildable: false diff --git a/scripts/spack/configs/blueos_3_ppc64le_ib_p9 b/scripts/spack/configs/blueos_3_ppc64le_ib_p9 deleted file mode 120000 index f06fef9d53..0000000000 --- a/scripts/spack/configs/blueos_3_ppc64le_ib_p9 +++ /dev/null @@ -1 +0,0 @@ -blueos_3_ppc64le_ib \ No newline at end of file diff --git a/scripts/spack/configs/config.yaml b/scripts/spack/configs/config.yaml index 0eb3cef933..002c6211f5 100644 --- a/scripts/spack/configs/config.yaml +++ b/scripts/spack/configs/config.yaml @@ -1,215 +1,17 @@ # ------------------------------------------------------------------------- -# This is the default spack configuration file. -# -# Settings here are versioned with Spack and are intended to provide -# sensible defaults out of the box. Spack maintainers should edit this -# file to keep it current. -# -# Users can override these settings by editing the following files. -# # Per-spack-instance settings (overrides defaults): # $SPACK_ROOT/etc/spack/config.yaml -# -# Per-user settings (overrides default and site settings): -# ~/.spack/config.yaml # ------------------------------------------------------------------------- config: - # 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 - projections: - all: "{architecture}/{compiler.name}-{compiler.version}/{name}-{version}-{hash}" - # install_tree can include an optional padded length (int or boolean) - # default is False (do not pad) - # if padded_length is True, Spack will pad as close to the system max path - # length as possible - # if padded_length is an integer, Spack will pad to that many characters, - # assuming it is higher than the length of the install_tree root. padded_length: 128 - - - # Locations where templates should be found - template_dirs: - - $spack/templates - - # Directory where licenses should be located - license_dir: $spack/etc/spack/licenses - - # Temporary locations Spack can try to use for builds. - # - # Recommended options are given below. - # - # Builds can be faster in temporary directories on some (e.g., HPC) systems. - # Specifying `$tempdir` will ensure use of the default temporary directory - # (i.e., ``$TMP` or ``$TMPDIR``). - # - # Another option that prevents conflicts and potential permission issues is - # to specify `$user_cache_path/stage`, which ensures each user builds in their - # home directory. - # - # A more traditional path uses the value of `$spack/var/spack/stage`, which - # builds directly inside Spack's instance without staging them in a - # temporary space. Problems with specifying a path inside a Spack instance - # are that it precludes its use as a system package and its ability to be - # pip installable. - # - # In Spack environment files, chaining onto existing system Spack - # installations, the $env variable can be used to download, cache and build - # into user-writable paths that are relative to the currently active - # environment. - # - # In any case, if the username is not already in the path, Spack will append - # the value of `$user` in an attempt to avoid potential conflicts between - # users in shared temporary spaces. - # - # The build stage can be purged with `spack clean --stage` and - # `spack clean -a`, so it is important that the specified directory uniquely - # identifies Spack staging to avoid accidentally wiping out non-Spack work. + misc_cache: $spack/../misc_cache + test_stage: $spack/../test_stage + source_cache: $spack/../source_cache build_stage: - - $spack/../builds - - # Directory in which to run tests and store test results. - # Tests will be stored in directories named by date/time and package - # name/hash. - test_stage: $user_cache_path/test - - # Cache directory for already downloaded source tarballs and archived - # repositories. This can be purged with `spack clean --downloads`. - source_cache: $spack/var/spack/cache - - - ## Directory where spack managed environments are created and stored - # environments_root: $spack/var/spack/environments - - - # Cache directory for miscellaneous files, like the package index. - # This can be purged with `spack clean --misc-cache` - misc_cache: $spack/misccache - - - # Timeout in seconds used for downloading sources etc. This only applies - # to the connection phase and can be increased for slow connections or - # servers. 0 means no timeout. - connect_timeout: 60 - - - # If this is false, tools like curl that use SSL will not verify - # certifiates. (e.g., curl will use use the -k option) - verify_ssl: true - - - # Suppress gpg warnings from binary package verification - # Only suppresses warnings, gpg failure will still fail the install - # Potential rationale to set True: users have already explicitly trusted the - # gpg key they are using, and may not want to see repeated warnings that it - # is self-signed or something of the sort. - suppress_gpg_warnings: false - - - # If set to true, Spack will always check checksums after downloading - # archives. If false, Spack skips the checksum step. - checksum: true - - - # If set to true, Spack will fetch deprecated versions without warning. - # If false, Spack will raise an error when trying to install a deprecated version. - deprecated: true - - - # If set to true, `spack install` and friends will NOT clean - # potentially harmful variables from the build environment. Use wisely. - dirty: false - - - # The language the build environment will use. This will produce English - # compiler messages by default, so the log parser can highlight errors. - # If set to C, it will use English (see man locale). - # If set to the empty string (''), it will use the language from the - # user's environment. - build_language: C - - - # When set to true, concurrent instances of Spack will use locks to - # avoid modifying the install tree, database file, etc. If false, Spack - # will disable all locking, but you must NOT run concurrent instances - # of Spack. For filesystems that don't support locking, you should set - # this to false and run one Spack at a time, but otherwise we recommend - # enabling locks. - locks: true - - # The default url fetch method to use. - # If set to 'curl', Spack will require curl on the user's system - # If set to 'urllib', Spack will use python built-in libs to fetch - url_fetch_method: urllib - - # The maximum number of jobs to use for the build system (e.g. `make`), when - # the -j flag is not given on the command line. Defaults to 16 when not set. - # Note that the maximum number of jobs is limited by the number of cores - # available, taking thread affinity into account when supported. For instance: - # - With `build_jobs: 16` and 4 cores available `spack install` will run `make -j4` - # - With `build_jobs: 16` and 32 cores available `spack install` will run `make -j16` - # - With `build_jobs: 2` and 4 cores available `spack install -j6` will run `make -j6` - build_jobs: 54 - - - # If set to true, Spack will use ccache to cache C compiles. - ccache: false - - - # How long to wait to lock the Spack installation database. This lock is used - # when Spack needs to manage its own package metadata and all operations are - # expected to complete within the default time limit. The timeout should - # therefore generally be left untouched. - db_lock_timeout: 60 - - - # How long to wait when attempting to modify a package (e.g. to install it). - # This value should typically be 'null' (never time out) unless the Spack - # instance only ever has a single user at a time, and only if the user - # anticipates that a significant delay indicates that the lock attempt will - # never succeed. - package_lock_timeout: null - - - # Control how shared libraries are located at runtime on Linux. See the - # the Spack documentation for details. - shared_linking: - # Spack automatically embeds runtime search paths in ELF binaries for their - # dependencies. Their type can either be "rpath" or "runpath". For glibc, rpath is - # inherited and has precedence over LD_LIBRARY_PATH; runpath is not inherited - # and of lower precedence. DO NOT MIX these within the same install tree. - type: rpath - - - # (Experimental) Embed absolute paths of dependent libraries directly in ELF - # binaries to avoid runtime search. This can improve startup time of - # executables with many dependencies, in particular on slow filesystems. - bind: false - - - # Set to 'false' to allow installation on filesystems that doesn't allow setgid bit - # manipulation by unprivileged user (e.g. AFS) - allow_sgid: true - - # Whether to show status information during building and installing packages. - # This gives information about Spack's current progress as well as the current - # and total number of packages. Information is shown both in the terminal - # title and inline. - install_status: true - - # Number of seconds a buildcache's index.json is cached locally before probing - # for updates, within a single Spack invocation. Defaults to 10 minutes. - binary_index_ttl: 600 - - flags: - # Whether to keep -Werror flags active in package builds. - keep_werror: 'none' - - # A mapping of aliases that can be used to define new commands. For instance, - # `sp: spec -I` will define a new command `sp` that will execute `spec` with - # the `-I` argument. Aliases cannot override existing commands. - aliases: - concretise: concretize - containerise: containerize - rm: remove + - $spack/../build_stage +repos: + builtin: + destination: $spack/../packages + git: "https://github.com/spack/spack-packages.git" + commit: 0f833a16999a012153c040c26c98256c14a1a4fd diff --git a/scripts/spack/configs/generic/concretizer.yaml b/scripts/spack/configs/generic/concretizer.yaml deleted file mode 100644 index 4e6375b591..0000000000 --- a/scripts/spack/configs/generic/concretizer.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# ------------------------------------------------------------------------- -# This is the default spack configuration file. -# -# Settings here are versioned with Spack and are intended to provide -# sensible defaults out of the box. Spack maintainers should edit this -# file to keep it current. -# -# Users can override these settings by editing -# `$SPACK_ROOT/etc/spack/concretizer.yaml`, `~/.spack/concretizer.yaml`, -# or by adding a `concretizer:` section to an environment. -# ------------------------------------------------------------------------- -concretizer: - # Whether to consider installed packages or packages from buildcaches when - # concretizing specs. If `true`, we'll try to use as many installs/binaries - # as possible, rather than building. If `false`, we'll always give you a fresh - # concretization. - reuse: true - # Options that tune which targets are considered for concretization. The - # concretization process is very sensitive to the number targets, and the time - # needed to reach a solution increases noticeably with the number of targets - # considered. - targets: - # Determine whether we want to target specific or generic microarchitectures. - # An example of the first kind might be for instance "skylake" or "bulldozer", - # while generic microarchitectures are for instance "aarch64" or "x86_64_v4". - granularity: generic - # If "false" allow targets that are incompatible with the current host (for - # instance concretize with target "icelake" while running on "haswell"). - # If "true" only allow targets that are compatible with the host. - host_compatible: true - # When "true" concretize root specs of environments together, so that each unique - # package in an environment corresponds to one concrete spec. This ensures - # environments can always be activated. When "false" perform concretization separately - # on each root spec, allowing different versions and variants of the same package in - # an environment. - unify: true diff --git a/scripts/spack/configs/generic/packages.yaml b/scripts/spack/configs/generic/packages.yaml deleted file mode 100644 index 3c10f211c5..0000000000 --- a/scripts/spack/configs/generic/packages.yaml +++ /dev/null @@ -1,108 +0,0 @@ -packages: - mpich: - externals: - - spec: mpich@3.3.2 - prefix: /usr - buildable: false - -# ------ SYSTEM LIBS ------- - ncurses: - externals: - - spec: ncurses@6.2 - prefix: /usr - buildable: false - readline: - externals: - - spec: readline@8.0 - prefix: /usr - buildable: false - autoconf: - externals: - - spec: autoconf@2.69 - prefix: /usr - buildable: false - automake: - externals: - - spec: automake@1.16.1 - prefix: /usr - buildable: false - libtool: - externals: - - spec: libtool@2.4.6 - prefix: /usr - buildable: false - bzip2: - externals: - - spec: bzip2@1.0.8 - prefix: /usr - buildable: false - expat: - externals: - - spec: expat@2.2.9 - prefix: /usr - buildable: false - gdbm: - externals: - - spec: gdbm@1.18.1 - prefix: /usr - buildable: false - gettext: - externals: - - spec: gettext@0.19.8.1 - prefix: /usr - buildable: false - libffi: - externals: - - spec: libffi@3.3 - prefix: /usr - buildable: false - openssl: - externals: - - spec: openssl@1.1.1 - prefix: /usr - buildable: false - ossp-uuid: - externals: - - spec: ossp-uuid@1.6.2 - prefix: /usr - buildable: false - sqlite: - externals: - - spec: sqlite@2.8.17 - prefix: /usr - buildable: false - pkg-config: - externals: - - spec: pkg-config@0.29.1 - prefix: /usr - buildable: false - tar: - externals: - - spec: tar@1.30 - prefix: /usr - buildable: false - elfutils: - externals: - - spec: elfutils@0.176 - prefix: /usr - buildable: false - tcl: - externals: - - spec: tcl@8.6.9 - prefix: /usr - buildable: false - tk: - externals: - - spec: tk@8.6.9 - prefix: /usr - buildable: false - fontconfig: - externals: - - spec: fontconfig@2.13.1 - prefix: /usr - buildable: false - netlib-lapack: - externals: - - spec: netlib-lapack@3.9.0 - prefix: /usr - buildable: false diff --git a/scripts/spack/configs/toss_4_x86_64_ib/compilers.yaml b/scripts/spack/configs/toss_4_x86_64_ib/compilers.yaml deleted file mode 100644 index bbd7ea626c..0000000000 --- a/scripts/spack/configs/toss_4_x86_64_ib/compilers.yaml +++ /dev/null @@ -1,27 +0,0 @@ -compilers:: -- compiler: - spec: clang@14.0.6 - paths: - cc: /usr/tce/packages/clang/clang-14.0.6/bin/clang - cxx: /usr/tce/packages/clang/clang-14.0.6/bin/clang++ - f77: /usr/tce/packages/gcc/gcc-10.3.1/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-10.3.1/bin/gfortran - flags: {} - operating_system: rhel8 - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] -- compiler: - spec: gcc@10.3.1 - paths: - cc: /usr/tce/packages/gcc/gcc-10.3.1/bin/gcc - cxx: /usr/tce/packages/gcc/gcc-10.3.1/bin/g++ - f77: /usr/tce/packages/gcc/gcc-10.3.1/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-10.3.1/bin/gfortran - flags: {} - operating_system: rhel8 - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] diff --git a/scripts/spack/configs/toss_4_x86_64_ib/packages.yaml b/scripts/spack/configs/toss_4_x86_64_ib/packages.yaml index 8ca7291fc0..97674b413a 100644 --- a/scripts/spack/configs/toss_4_x86_64_ib/packages.yaml +++ b/scripts/spack/configs/toss_4_x86_64_ib/packages.yaml @@ -3,7 +3,6 @@ packages: # This defaults us to machine specific flags of ivybridge which allows # us to run on broadwell as well target: [ivybridge] - compiler: [gcc, clang] providers: blas: [openblas] lapack: [openblas] @@ -12,12 +11,40 @@ packages: pil: [py-pillow] jpeg: [libjpeg] zlib-api: [zlib] + permissions: + read: group + write: group + group: sduser + gcc: + externals: + - spec: gcc@10.3.1 languages:='c,c++,fortran' + prefix: /usr/tce/packages/gcc/gcc-10.3.1 + extra_attributes: + compilers: + c: /usr/tce/packages/gcc/gcc-10.3.1/bin/gcc + cxx: /usr/tce/packages/gcc/gcc-10.3.1/bin/g++ + fortran: /usr/tce/packages/gcc/gcc-10.3.1/bin/gfortran + flags: {} + environment: {} + extra_rpaths: [] + llvm: + externals: + - spec: llvm@14.0.6+clang+flang~lld~lldb + prefix: /usr/tce/packages/clang/clang-14.0.6 + extra_attributes: + compilers: + c: /usr/tce/packages/clang/clang-14.0.6/bin/clang + cxx: /usr/tce/packages/clang/clang-14.0.6/bin/clang++ + fortran: /usr/tce/packages/clang/clang-14.0.6-magic/bin/flang + flags: {} + environment: {} + extra_rpaths: [] cmake: - version: [3.23.1] + version: [3.25.2] buildable: false externals: - - spec: cmake@3.23.1 - prefix: /usr/tce/packages/cmake/cmake-3.23.1 + - spec: cmake@3.25.2 + prefix: /usr/tce/packages/cmake/cmake-3.25.2 gmake: version: [4.2.1] buildable: false @@ -39,20 +66,13 @@ packages: mvapich2: externals: - - spec: mvapich2@2.3.6%gcc@10.3.1~cuda~debug~regcache~wrapperrpath ch3_rank_bits=32 - file_systems=lustre,nfs,ufs process_managers=slurm - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-10.3.1 - - spec: mvapich2@2.3.6%clang@14.0.6~alloca~cuda~debug+regcache+wrapperrpath ch3_rank_bits=32 - fabrics=mrail file_systems=auto process_managers=slurm - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6 + - spec: mvapich2@2.3.6~cuda~debug~regcache~wrapperrpath ch3_rank_bits=32 file_systems=lustre,nfs,ufs process_managers=slurm %gcc@10.3.1 + prefix: /usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-10.3.1-magic + - spec: mvapich2@2.3.6~alloca~cuda~debug+regcache+wrapperrpath ch3_rank_bits=32 fabrics=mrail file_systems=auto process_managers=slurm %clang@14.0.6 + prefix: /usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6-magic buildable: false # ------ SYSTEM LIBS ------- - python: - externals: - - spec: python@3.9.12 - prefix: /usr/tce/packages/python/python-3.9.12 - buildable: false ncurses: externals: - spec: ncurses@5.9 diff --git a/scripts/spack/configs/toss_4_x86_64_ib_cray/compilers.yaml b/scripts/spack/configs/toss_4_x86_64_ib_cray/compilers.yaml deleted file mode 100644 index ab6f2671c8..0000000000 --- a/scripts/spack/configs/toss_4_x86_64_ib_cray/compilers.yaml +++ /dev/null @@ -1,14 +0,0 @@ -compilers:: -- compiler: - spec: rocmcc@=6.2.0 - paths: - cc: /usr/tce/packages/rocmcc/rocmcc-6.2.0-magic/bin/amdclang - cxx: /usr/tce/packages/rocmcc/rocmcc-6.2.0-magic/bin/amdclang++ - f77: /usr/tce/packages/rocmcc/rocmcc-6.2.0-magic/bin/amdflang - fc: /usr/tce/packages/rocmcc/rocmcc-6.2.0-magic/bin/amdflang - flags: {} - operating_system: rhel8 - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] diff --git a/scripts/spack/configs/toss_4_x86_64_ib_cray/packages.yaml b/scripts/spack/configs/toss_4_x86_64_ib_cray/packages.yaml index 5a3ed82d3f..75f4897045 100644 --- a/scripts/spack/configs/toss_4_x86_64_ib_cray/packages.yaml +++ b/scripts/spack/configs/toss_4_x86_64_ib_cray/packages.yaml @@ -1,12 +1,24 @@ packages: all: - compiler: [rocmcc] providers: blas: [openblas] lapack: [openblas] mpi: [cray-mpich] pkgconfig: [pkg-config] zlib-api: [zlib] + permissions: + read: group + write: group + group: sduser + llvm-amdgpu: + externals: + - spec: llvm-amdgpu@6.2.0 + prefix: /usr/tce/packages/rocmcc/rocmcc-6.2.0-magic + extra_attributes: + compilers: + c: /usr/tce/packages/rocmcc/rocmcc-6.2.0-magic/bin/amdclang + cxx: /usr/tce/packages/rocmcc/rocmcc-6.2.0-magic/bin/amdclang++ + fortran: /usr/tce/packages/rocmcc/rocmcc-6.2.0-magic/bin/amdflang cmake: version: [3.24.2] buildable: false @@ -36,61 +48,39 @@ packages: version: [6.2.0] buildable: false externals: - - spec: hip@6.2.0%rocmcc@6.2.0 + - spec: hip@6.2.0%llvm-amdgpu@6.2.0 prefix: /usr/tce/packages/rocmcc/rocmcc-6.2.0-magic/ - llvm-amdgpu: - version: [6.2.0] - buildable: false - externals: - - spec: llvm-amdgpu@6.2.0%rocmcc@6.2.0 - prefix: /usr/tce/packages/rocmcc/rocmcc-6.2.0-magic/llvm hsa-rocr-dev: version: [6.2.0] buildable: false externals: - - spec: hsa-rocr-dev@6.2.0%rocmcc@6.2.0 + - spec: hsa-rocr-dev@6.2.0%llvm-amdgpu@6.2.0 prefix: /usr/tce/packages/rocmcc/rocm-6.2.0-magic/ rocminfo: version: [6.2.0] buildable: false externals: - - spec: rocminfo@6.2.0%rocmcc@6.2.0 + - spec: rocminfo@6.2.0%llvm-amdgpu@6.2.0 prefix: /usr/tce/packages/rocmcc/rocm-6.2.0-magic/ rocm-device-libs: version: [6.2.0] buildable: false externals: - - spec: rocm-device-libs@6.2.0%rocmcc@6.2.0 + - spec: rocm-device-libs@6.2.0%llvm-amdgpu@6.2.0 prefix: /usr/tce/packages/rocmcc/rocm-6.2.0-magic/ rocprim: version: [6.2.0] buildable: false externals: - - spec: rocprim@6.2.0%rocmcc@6.2.0 + - spec: rocprim@6.2.0%llvm-amdgpu@6.2.0 prefix: /usr/tce/packages/rocmcc/rocm-6.2.0-magic/ # ------ SYSTEM LIBS ------- - py-decorator: - externals: - - spec: py-decorator@5.1.1 - prefix: /collab/usr/gapps/python/build/spack-toss4.1/var/spack/environments/python/._view/75prb56irmif5ejtirjthpx6kq3gqo52/lib/python3.9/site-packages - buildable: false - py-pip: - externals: - - spec: py-pip@22.0.4 - prefix: /usr/tce/packages/python/python-3.9.12 - buildable: false readline: externals: - spec: readline@7.0 prefix: /usr buildable: false - python: - externals: - - spec: python@3.9.12 - prefix: /usr/tce/packages/python/python-3.9.12 - buildable: false - autoconf: externals: - spec: autoconf@2.69 diff --git a/scripts/spack/configs/ubuntu20.04/concretizer.yaml b/scripts/spack/configs/ubuntu20.04/concretizer.yaml deleted file mode 100644 index 4e6375b591..0000000000 --- a/scripts/spack/configs/ubuntu20.04/concretizer.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# ------------------------------------------------------------------------- -# This is the default spack configuration file. -# -# Settings here are versioned with Spack and are intended to provide -# sensible defaults out of the box. Spack maintainers should edit this -# file to keep it current. -# -# Users can override these settings by editing -# `$SPACK_ROOT/etc/spack/concretizer.yaml`, `~/.spack/concretizer.yaml`, -# or by adding a `concretizer:` section to an environment. -# ------------------------------------------------------------------------- -concretizer: - # Whether to consider installed packages or packages from buildcaches when - # concretizing specs. If `true`, we'll try to use as many installs/binaries - # as possible, rather than building. If `false`, we'll always give you a fresh - # concretization. - reuse: true - # Options that tune which targets are considered for concretization. The - # concretization process is very sensitive to the number targets, and the time - # needed to reach a solution increases noticeably with the number of targets - # considered. - targets: - # Determine whether we want to target specific or generic microarchitectures. - # An example of the first kind might be for instance "skylake" or "bulldozer", - # while generic microarchitectures are for instance "aarch64" or "x86_64_v4". - granularity: generic - # If "false" allow targets that are incompatible with the current host (for - # instance concretize with target "icelake" while running on "haswell"). - # If "true" only allow targets that are compatible with the host. - host_compatible: true - # When "true" concretize root specs of environments together, so that each unique - # package in an environment corresponds to one concrete spec. This ensures - # environments can always be activated. When "false" perform concretization separately - # on each root spec, allowing different versions and variants of the same package in - # an environment. - unify: true diff --git a/scripts/spack/configs/ubuntu20.04/packages.yaml b/scripts/spack/configs/ubuntu20.04/packages.yaml deleted file mode 100644 index 9c0c449e25..0000000000 --- a/scripts/spack/configs/ubuntu20.04/packages.yaml +++ /dev/null @@ -1,123 +0,0 @@ -packages: - mpich: - externals: - - spec: mpich@3.3.2 - prefix: /usr - buildable: false - all: - providers: - mpi: [mpich] - blas: [netlib-lapack] - lapack: [netlib-lapack] -# ------ SYSTEM LIBS ------- -# FIXME: Currently allowing spack to build cmake - git: - externals: - - spec: git@2.25.1 - prefix: /usr - buildable: false - python: - externals: - - spec: python@3.8.10 - prefix: /usr - buildable: false - ncurses: - externals: - - spec: ncurses@6.2 - prefix: /usr - buildable: false - perl: - buildable: false - externals: - - spec: perl@5.30.0 - prefix: /usr - readline: - externals: - - spec: readline@8.0 - prefix: /usr - buildable: false - autoconf: - externals: - - spec: autoconf@2.69 - prefix: /usr - buildable: false - automake: - externals: - - spec: automake@1.16.1 - prefix: /usr - buildable: false - libtool: - externals: - - spec: libtool@2.4.6 - prefix: /usr - buildable: false - bzip2: - externals: - - spec: bzip2@1.0.8 - prefix: /usr - buildable: false - expat: - externals: - - spec: expat@2.2.9 - prefix: /usr - buildable: false - gdbm: - externals: - - spec: gdbm@1.18.1 - prefix: /usr - buildable: false - gettext: - externals: - - spec: gettext@0.19.8.1 - prefix: /usr - buildable: false - libffi: - externals: - - spec: libffi@3.3 - prefix: /usr - buildable: false - openssl: - externals: - - spec: openssl@1.1.1 - prefix: /usr - buildable: false - ossp-uuid: - externals: - - spec: ossp-uuid@1.6.2 - prefix: /usr - buildable: false - sqlite: - externals: - - spec: sqlite@2.8.17 - prefix: /usr - buildable: false - pkg-config: - externals: - - spec: pkg-config@0.29.1 - prefix: /usr - buildable: false - tar: - externals: - - spec: tar@1.30 - prefix: /usr - buildable: false - elfutils: - externals: - - spec: elfutils@0.176 - prefix: /usr - buildable: false - tcl: - externals: - - spec: tcl@8.6.9 - prefix: /usr - buildable: false - tk: - externals: - - spec: tk@8.6.9 - prefix: /usr - buildable: false - fontconfig: - externals: - - spec: fontconfig@2.13.1 - prefix: /usr - buildable: false diff --git a/scripts/spack/configs/upstreams.yaml b/scripts/spack/configs/upstreams.yaml index d761b5ce42..29040da4b0 100644 --- a/scripts/spack/configs/upstreams.yaml +++ b/scripts/spack/configs/upstreams.yaml @@ -1,3 +1,3 @@ upstreams: spheral_shared: - install_tree: /usr/WS2/sduser/Spheral/spack_upstream/0.22/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_p + install_tree: /usr/WS2/sduser/Spheral/spack_upstream/1.1.0 diff --git a/scripts/spack/environments/dev_pkg/spack.yaml b/scripts/spack/environments/dev_pkg/spack.yaml index e908f682ab..f46403265e 100644 --- a/scripts/spack/environments/dev_pkg/spack.yaml +++ b/scripts/spack/environments/dev_pkg/spack.yaml @@ -4,14 +4,14 @@ spack: view: false concretizer: unify: false + reuse: false + compiler_mixing: false develop: spheral: path: ../../../../ spec: spheral@=develop - include: + include:: - ../../configs/toss_4_x86_64_ib/packages.yaml - - ../../configs/toss_4_x86_64_ib/compilers.yaml - ../../configs/config.yaml - - ../../configs/upstreams.yaml repos: - - ../../ + - ../../spack_repo/spheral diff --git a/scripts/spack/environments/toss_4_x86_64_ib/spack.yaml b/scripts/spack/environments/toss_4_x86_64_ib/spack.yaml index c5ff09ef14..01d881706c 100644 --- a/scripts/spack/environments/toss_4_x86_64_ib/spack.yaml +++ b/scripts/spack/environments/toss_4_x86_64_ib/spack.yaml @@ -6,14 +6,15 @@ spack: view: false concretizer: unify: false + reuse: false + compiler_mixing: false develop: spheral: path: ../../../../ spec: spheral@=develop - include: + include:: - ../../configs/toss_4_x86_64_ib/packages.yaml - - ../../configs/toss_4_x86_64_ib/compilers.yaml - ../../configs/config.yaml - ../../configs/upstreams.yaml repos: - - ../../ + - ../../spack_repo/spheral diff --git a/scripts/spack/environments/toss_4_x86_64_ib_cray/spack.yaml b/scripts/spack/environments/toss_4_x86_64_ib_cray/spack.yaml index 7a0b0cf108..ab0869a89e 100644 --- a/scripts/spack/environments/toss_4_x86_64_ib_cray/spack.yaml +++ b/scripts/spack/environments/toss_4_x86_64_ib_cray/spack.yaml @@ -1,27 +1,29 @@ spack: specs: - matrix: - - [spheral] - - ["+mpi", "~mpi"] - - ["+rocm", "~rocm"] + - [spheral] + - [+mpi, ~mpi] + - [+rocm, ~rocm] + - ['%rocmcc'] view: false concretizer: unify: false + reuse: false + compiler_mixing: false develop: spheral: path: ../../../../ spec: spheral@=develop - include: - - ../../configs/toss_4_x86_64_ib_cray/packages.yaml - - ../../configs/toss_4_x86_64_ib_cray/compilers.yaml - - ../../configs/config.yaml - - ../../configs/upstreams.yaml + include:: + - ../../configs/toss_4_x86_64_ib_cray/packages.yaml + - ../../configs/config.yaml + - ../../configs/upstreams.yaml repos: - - ../../ + - ../../spack_repo/spheral packages: spheral: require: - - spec: "amdgpu_target=gfx90a" - when: "+rocm arch=linux-rhel8-zen3" - - spec: "amdgpu_target=gfx942" - when: "+rocm arch=linux-rhel8-zen4" + - spec: amdgpu_target=gfx90a + when: +rocm arch=linux-rhel8-zen3 + - spec: amdgpu_target=gfx942 + when: +rocm arch=linux-rhel8-zen4 diff --git a/scripts/spack/environments/ubuntu20.04/spack.yaml b/scripts/spack/environments/ubuntu20.04/spack.yaml deleted file mode 100644 index 3a8fbea842..0000000000 --- a/scripts/spack/environments/ubuntu20.04/spack.yaml +++ /dev/null @@ -1,14 +0,0 @@ -spack: - include: - - ../../configs/ubuntu20.4/packages.yaml - - ../../configs/ubuntu20.4/compilers.yaml - - ../../configs/config.yaml - view: false - concretizer: - unify: false - repos: - - ../../ - develop: - spheral: - path: ../../../../ - spec: spheral@=develop diff --git a/scripts/spack/packages/axom/package.py b/scripts/spack/packages/axom/package.py deleted file mode 100644 index 272a38fe23..0000000000 --- a/scripts/spack/packages/axom/package.py +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - - -from spack.package import * -from spack.pkg.builtin.axom import Axom as BuiltinAxom -from spack.util.executable import which_string - - -class Axom(BuiltinAxom): - """Axom provides a robust, flexible software infrastructure for the development - of multi-physics applications and computational tools.""" - - version("0.12.0", tag="v0.12.0") - - patch('constexpr.patch', when="@0.9.0") - - def initconfig_mpi_entries(self): - spec = self.spec - entries = [] - if "+mpi" in spec: - entries.append(cmake_cache_option("ENABLE_MPI", True)) - if spec["mpi"].name == "spectrum-mpi": - entries.append(cmake_cache_string("BLT_MPI_COMMAND_APPEND", "mpibind")) - - # Replace /usr/bin/srun path with srun flux wrapper path on TOSS 4 - # TODO: Remove this logic by adding `using_flux` case in - # spack/lib/spack/spack/build_systems/cached_cmake.py:196 and remove hard-coded - # path to srun in same file. - if "toss_4" in self._get_sys_type(spec): - srun_wrapper = which_string("srun") - mpi_exec_index = [ - index for index, entry in enumerate(entries) if "MPIEXEC_EXECUTABLE" in entry - ] - if mpi_exec_index: - del entries[mpi_exec_index[0]] - entries.append(cmake_cache_path("MPIEXEC_EXECUTABLE", srun_wrapper)) - else: - entries.append(cmake_cache_option("ENABLE_MPI", False)) - - return entries diff --git a/scripts/spack/packages/camp/package.py b/scripts/spack/packages/camp/package.py deleted file mode 100644 index 0e20eb4079..0000000000 --- a/scripts/spack/packages/camp/package.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - - -from spack.package import * -from spack.pkg.builtin.camp import Camp as BuiltinCamp - - -class Camp(BuiltinCamp): - - version("2025.03.0", tag="v2025.03.0", submodules=False) diff --git a/scripts/spack/packages/chai/package.py b/scripts/spack/packages/chai/package.py deleted file mode 100644 index ee56e58d85..0000000000 --- a/scripts/spack/packages/chai/package.py +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - - -from spack.package import * -from spack.pkg.builtin.chai import Chai as BuiltinChai - - -class Chai(BuiltinChai): - - version("develop", commit="b7babdc0c333baa68e53b026c63d65c48c8d8eb1", submodules=False) - depends_on("raja@2025.03.0", type="build", when="+raja") - depends_on("umpire@2025.03.1", type="build") diff --git a/scripts/spack/packages/eigen/package.py b/scripts/spack/packages/eigen/package.py deleted file mode 100644 index 8a0e7c3c36..0000000000 --- a/scripts/spack/packages/eigen/package.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - - -from spack.package import * -from spack.pkg.builtin.eigen import Eigen as BuiltinEigen - - -# TODO: This file can be removed once we update to spack 1.0 -class Eigen(BuiltinEigen, ROCmPackage): - - git = "https://gitlab.com/libeigen/eigen.git" - - version("5.0.0", tag="5.0.0") - - # Older eigen releases haven't been tested with ROCm - conflicts("+rocm @:3.4.0") - - depends_on("boost@1.53:", when="@master", type="test") - - def cmake_args(self): - args = BuiltinEigen.cmake_args(self) - - if self.spec.satisfies("+rocm"): - args.extend( - [ - self.define("ROCM_PATH", self.spec["hip"].prefix), - self.define("HIP_PATH", self.spec["hip"].prefix), - self.define("EIGEN_TEST_HIP", "ON"), - ] - ) - - if self.spec.satisfies("@master") and self.run_tests: - args.append(self.define("Boost_INCLUDE_DIR", self.spec["boost"].prefix.include)) - - return args diff --git a/scripts/spack/packages/raja/package.py b/scripts/spack/packages/raja/package.py deleted file mode 100644 index e89ff9a8e7..0000000000 --- a/scripts/spack/packages/raja/package.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - - -from spack.package import * -from spack.pkg.builtin.raja import Raja as BuiltinRaja - - -class Raja(BuiltinRaja): - - version("2025.03.0", tag="v2025.03.0", submodules=False) - depends_on("camp@2025.03.0", type="build") diff --git a/scripts/spack/packages/silo/package.py b/scripts/spack/packages/silo/package.py deleted file mode 100644 index 484c840920..0000000000 --- a/scripts/spack/packages/silo/package.py +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - - -from spack.package import * -from spack.pkg.builtin.silo import Silo as BuiltinSilo -# FIXME: This file can be removed when upgrading to spack 1.0+ - -class Silo(BuiltinSilo): - - variant("python", default=True, description="Enable Python support") - - depends_on("python", type=("build", "link"), when="+python") - - def flag_handler(self, name, flags): - (flags, dummy1, dummy2) = super().flag_handler(name, flags) - if name == "cflags" or name == "cxxflags": - if self.spec.satisfies("+python"): - flags.append(f"-I {self.spec['python'].headers.directories[0]}") - return (flags, None, None) - - def configure_args(self): - config_args = super().configure_args() - config_args.extend(self.enable_or_disable("pythonmodule", variant="python")) - return config_args diff --git a/scripts/spack/packages/umpire/package.py b/scripts/spack/packages/umpire/package.py deleted file mode 100644 index 02c9c9edb3..0000000000 --- a/scripts/spack/packages/umpire/package.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - - -from spack.package import * -from spack.pkg.builtin.umpire import Umpire as BuiltinUmpire - - -class Umpire(BuiltinUmpire): - - version("2025.03.1", tag="v2025.03.1", submodules=False) - depends_on("camp@2025.03.0", type="build") diff --git a/scripts/spack/packages/axom/constexpr.patch b/scripts/spack/spack_repo/spheral/packages/axom/constexpr.patch similarity index 100% rename from scripts/spack/packages/axom/constexpr.patch rename to scripts/spack/spack_repo/spheral/packages/axom/constexpr.patch diff --git a/scripts/spack/spack_repo/spheral/packages/axom/package.py b/scripts/spack/spack_repo/spheral/packages/axom/package.py new file mode 100644 index 0000000000..7b2a75f051 --- /dev/null +++ b/scripts/spack/spack_repo/spheral/packages/axom/package.py @@ -0,0 +1,203 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack_repo.builtin.packages.axom.package import Axom as BuiltinAxom + +import os +# import shutil +# import socket +from os.path import join as pjoin + +from spack_repo.builtin.build_systems.cached_cmake import ( + CachedCMakePackage, + cmake_cache_option, + cmake_cache_path, + cmake_cache_string, +) +from spack.util.executable import which_string +from spack_repo.builtin.build_systems.cuda import CudaPackage +from spack_repo.builtin.build_systems.rocm import ROCmPackage + +from spack.package import * + +class Axom(BuiltinAxom): + """Axom provides a robust, flexible software infrastructure for the development + of multi-physics applications and computational tools.""" + + version("0.12.0", tag="v0.12.0", commit="297544010a3dfb98145a1a85f09f9c648c00a18c", preferred=True) + + patch('constexpr.patch', when="@0.9.0") + + def initconfig_mpi_entries(self): + spec = self.spec + entries = [] + if "+mpi" in spec: + entries.append(cmake_cache_option("ENABLE_MPI", True)) + if spec["mpi"].name == "spectrum-mpi": + entries.append(cmake_cache_string("BLT_MPI_COMMAND_APPEND", "mpibind")) + + # Replace /usr/bin/srun path with srun flux wrapper path on TOSS 4 + # TODO: Remove this logic by adding `using_flux` case in + # spack/lib/spack/spack/build_systems/cached_cmake.py:196 and remove hard-coded + # path to srun in same file. + if "toss_4" in self._get_sys_type(spec): + srun_wrapper = which_string("srun") + mpi_exec_index = [ + index for index, entry in enumerate(entries) if "MPIEXEC_EXECUTABLE" in entry + ] + if mpi_exec_index: + del entries[mpi_exec_index[0]] + entries.append(cmake_cache_path("MPIEXEC_EXECUTABLE", srun_wrapper)) + else: + entries.append(cmake_cache_option("ENABLE_MPI", False)) + + return entries + + def initconfig_hardware_entries(self): + spec = self.spec + entries = [] + + if spec.satisfies("+cuda"): + entries.append(cmake_cache_option("ENABLE_CUDA", True)) + entries.append(cmake_cache_option("CMAKE_CUDA_SEPARABLE_COMPILATION", True)) + + # CUDA_FLAGS + cudaflags = "${CMAKE_CUDA_FLAGS} -restrict --expt-extended-lambda " + + # Pass through any cxxflags to the host compiler via nvcc's Xcompiler flag + host_cxx_flags = spec.compiler_flags["cxxflags"] + cudaflags += " ".join(["-Xcompiler=%s " % flag for flag in host_cxx_flags]) + + if spec.satisfies("^blt@:0.5.1"): + # This is handled internally by BLT now + if spec.satisfies("+cpp14"): + cudaflags += " -std=c++14" + else: + cudaflags += " -std=c++11" + entries.append(cmake_cache_string("CMAKE_CUDA_FLAGS", cudaflags, force=True)) + + entries.append("# nvcc does not like gtest's 'pthreads' flag\n") + entries.append(cmake_cache_option("gtest_disable_pthreads", True)) + + if spec.satisfies("+rocm"): + entries.append("#------------------{0}\n".format("-" * 60)) + entries.append("# Axom ROCm specifics\n") + entries.append("#------------------{0}\n\n".format("-" * 60)) + + entries.append(cmake_cache_option("ENABLE_HIP", True)) + + rocm_root = os.path.dirname(spec["llvm-amdgpu"].prefix) + entries.append(cmake_cache_path("ROCM_PATH", rocm_root)) + + hip_link_flags = "-L{0}/lib -Wl,-rpath,{0}/lib ".format(rocm_root) + + if "+mpi" in spec: + # Recommended MPI flags + hip_link_flags += "-lxpmem " + hip_link_flags += "-L/opt/cray/pe/mpich/{0}/gtl/lib ".format(spec["mpi"].version) + hip_link_flags += "-Wl,-rpath,/opt/cray/pe/mpich/{0}/gtl/lib ".format( + spec["mpi"].version + ) + hip_link_flags += "-lmpi_gtl_hsa " + + # Fixes for mpi for rocm until wrapper paths are fixed + # These flags are already part of the wrapped compilers on TOSS4 systems + if spec.satisfies("+fortran") and self.is_fortran_compiler("amdflang"): + hip_link_flags += "-Wl,--disable-new-dtags " + + if spec.satisfies("^hip@6.0.0:"): + hip_link_flags += "-L{0}/lib/llvm/lib -Wl,-rpath,{0}/lib/llvm/lib ".format( + rocm_root + ) + else: + hip_link_flags += "-L{0}/llvm/lib -Wl,-rpath,{0}/llvm/lib ".format(rocm_root) + hip_link_flags += "-lpgmath -lflang -lflangrti -lompstub " + + # Remove extra link library for crayftn + if spec.satisfies("+fortran") and self.is_fortran_compiler("crayftn"): + entries.append( + cmake_cache_string("BLT_CMAKE_IMPLICIT_LINK_LIBRARIES_EXCLUDE", "unwind") + ) + + # Additional libraries for TOSS4 + hip_link_flags += "-lamdhip64 -lhsakmt -lhsa-runtime64 -lamd_comgr " + + entries.append(cmake_cache_string("CMAKE_EXE_LINKER_FLAGS", hip_link_flags)) + + entries.append("#------------------{0}".format("-" * 30)) + entries.append("# Hardware Specifics") + entries.append("#------------------{0}\n".format("-" * 30)) + + # OpenMP + entries.append(cmake_cache_option("ENABLE_OPENMP", spec.satisfies("+openmp"))) + + # Enable death tests + entries.append( + cmake_cache_option( + "ENABLE_GTEST_DEATH_TESTS", not spec.satisfies("+cuda target=ppc64le:") + ) + ) + + if spec.satisfies("+fortran") and self.is_fortran_compiler("xlf"): + # Grab lib directory for the current fortran compiler + libdir = pjoin(os.path.dirname(os.path.dirname(self.compiler.fc)), "lib") + description = ( + "Adds a missing rpath for libraries " "associated with the fortran compiler" + ) + + linker_flags = "${BLT_EXE_LINKER_FLAGS} -Wl,-rpath," + libdir + + entries.append(cmake_cache_string("BLT_EXE_LINKER_FLAGS", linker_flags, description)) + + if spec.satisfies("+shared"): + linker_flags = "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-rpath," + libdir + entries.append( + cmake_cache_string("CMAKE_SHARED_LINKER_FLAGS", linker_flags, description) + ) + + description = "Converts C-style comments to Fortran style in preprocessed files" + entries.append( + cmake_cache_string( + "BLT_FORTRAN_FLAGS", "-WF,-C! -qxlf2003=polymorphic", description + ) + ) + + if ( + spec.satisfies("+openmp") + and "clang" in self.compiler.cxx + and spec.satisfies("+fortran") + and self.is_fortran_compiler("xlf") + ): + openmp_gen_exp = ( + "$<$>:" + "-fopenmp=libomp>;$<$:-qsmp=omp>" + ) + + description = "Different OpenMP linker flag between CXX and Fortran" + entries.append( + cmake_cache_string("BLT_OPENMP_LINK_FLAGS", openmp_gen_exp, description) + ) + + if spec.satisfies("target=ppc64le:"): + # Fix for working around CMake adding implicit link directories + # returned by the BlueOS compilers to link executables with + # non-system default stdlib + _roots = ["/usr/tce/packages/gcc/gcc-4.9.3", "/usr/tce/packages/gcc/gcc-4.9.3/gnu"] + _subdirs = ["lib64", "lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3"] + _existing_paths = [] + for root in _roots: + for subdir in _subdirs: + _curr_path = pjoin(root, subdir) + if os.path.exists(_curr_path): + _existing_paths.append(_curr_path) + if _existing_paths: + entries.append( + cmake_cache_string( + "BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE", ";".join(_existing_paths) + ) + ) + + return entries diff --git a/scripts/spack/packages/leos/package.py b/scripts/spack/spack_repo/spheral/packages/leos/package.py similarity index 95% rename from scripts/spack/packages/leos/package.py rename to scripts/spack/spack_repo/spheral/packages/leos/package.py index 69eca1a47e..7dbefba01b 100644 --- a/scripts/spack/packages/leos/package.py +++ b/scripts/spack/spack_repo/spheral/packages/leos/package.py @@ -14,6 +14,9 @@ # See the spack documentation for more information on building # packages. # +from spack_repo.builtin.build_systems.cached_cmake import CachedCMakePackage, cmake_cache_option, cmake_cache_path +from spack_repo.builtin.build_systems.cuda import CudaPackage +from spack_repo.builtin.build_systems.rocm import ROCmPackage from spack.package import * import os, re @@ -46,6 +49,8 @@ class Leos(CachedCMakePackage, CudaPackage, ROCmPackage): variant("rocm", default=False, description="Build LIP using RAJA + ROCM GPU code") variant("silo", default=True, description="Use Silo instead of LEOSPACT") + depends_on("c", type="build") + depends_on("cxx", type="build") # FIXME: Add dependencies if this package requires them. depends_on("mpi", when="+mpi") depends_on("hdf5") diff --git a/scripts/spack/packages/leos/patches/leos-8.2.0-CRAY.patch b/scripts/spack/spack_repo/spheral/packages/leos/patches/leos-8.2.0-CRAY.patch similarity index 100% rename from scripts/spack/packages/leos/patches/leos-8.2.0-CRAY.patch rename to scripts/spack/spack_repo/spheral/packages/leos/patches/leos-8.2.0-CRAY.patch diff --git a/scripts/spack/packages/leos/patches/leos-8.4.1-umpire-2024.02-exceptions.patch b/scripts/spack/spack_repo/spheral/packages/leos/patches/leos-8.4.1-umpire-2024.02-exceptions.patch similarity index 100% rename from scripts/spack/packages/leos/patches/leos-8.4.1-umpire-2024.02-exceptions.patch rename to scripts/spack/spack_repo/spheral/packages/leos/patches/leos-8.4.1-umpire-2024.02-exceptions.patch diff --git a/scripts/spack/packages/leos/patches/leos-8.4.1-umpire-import.patch b/scripts/spack/spack_repo/spheral/packages/leos/patches/leos-8.4.1-umpire-import.patch similarity index 100% rename from scripts/spack/packages/leos/patches/leos-8.4.1-umpire-import.patch rename to scripts/spack/spack_repo/spheral/packages/leos/patches/leos-8.4.1-umpire-import.patch diff --git a/scripts/spack/packages/leos/patches/leos-8.5-umpire-import.patch b/scripts/spack/spack_repo/spheral/packages/leos/patches/leos-8.5-umpire-import.patch similarity index 100% rename from scripts/spack/packages/leos/patches/leos-8.5-umpire-import.patch rename to scripts/spack/spack_repo/spheral/packages/leos/patches/leos-8.5-umpire-import.patch diff --git a/scripts/spack/spack_repo/spheral/packages/llvm_amdgpu/package.py b/scripts/spack/spack_repo/spheral/packages/llvm_amdgpu/package.py new file mode 100644 index 0000000000..a15752b020 --- /dev/null +++ b/scripts/spack/spack_repo/spheral/packages/llvm_amdgpu/package.py @@ -0,0 +1,28 @@ +# Copyright 2013-2025 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import os +from spack.package import * +from spack_repo.builtin.packages.llvm_amdgpu.package import LlvmAmdgpu as BuiltinLlvmAmdgpu + +# +# NOTE: We should be able to drop this package override when we move to `rocm@7` +# +class LlvmAmdgpu(BuiltinLlvmAmdgpu): + + # PR that adds this change is pending: https://github.com/spack/spack-packages/pull/1557 + provides("fortran") + + @property + def supported_languages(self): + languages = ["c", "cxx", "fortran"] + return languages + + def setup_run_environment(self, env: EnvironmentModifications) -> None: + env.prepend_path("LD_LIBRARY_PATH", self.prefix.lib) + env.set("CC", join_path(self.spec.prefix.bin, "amdclang")) + env.set("CXX", join_path(self.spec.prefix.bin, "amdclang++")) + env.set("FC", join_path(self.spec.prefix.bin, "amdflang")) + env.set("F77", join_path(self.spec.prefix.bin, "amdflang")) diff --git a/scripts/spack/packages/m-aneos/package.py b/scripts/spack/spack_repo/spheral/packages/m_aneos/package.py similarity index 90% rename from scripts/spack/packages/m-aneos/package.py rename to scripts/spack/spack_repo/spheral/packages/m_aneos/package.py index 0f1cfd6a22..631bad0108 100644 --- a/scripts/spack/packages/m-aneos/package.py +++ b/scripts/spack/spack_repo/spheral/packages/m_aneos/package.py @@ -3,17 +3,19 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.makefile import MakefilePackage from spack.package import * class MAneos(MakefilePackage): - """M-Aneos""" + """MAneos""" homepage = "https://github.com/isale-code/M-ANEOS" url = "https://github.com/isale-code/M-ANEOS/releases/download/v1.0beta/M-ANEOS-v1.0.tar.gz" version('1.0', sha256='3101b113fa59a8b615ec7e9e25479ab9c10d3e544173df0307bb675872773d31') + depends_on("fortran", type="build") depends_on('autoconf', type='build') depends_on('automake', type='build') depends_on('libtool', type='build') diff --git a/scripts/spack/packages/opensubdiv/oneapi.patch b/scripts/spack/spack_repo/spheral/packages/opensubdiv/oneapi.patch similarity index 100% rename from scripts/spack/packages/opensubdiv/oneapi.patch rename to scripts/spack/spack_repo/spheral/packages/opensubdiv/oneapi.patch diff --git a/scripts/spack/packages/opensubdiv/package.py b/scripts/spack/spack_repo/spheral/packages/opensubdiv/package.py similarity index 91% rename from scripts/spack/packages/opensubdiv/package.py rename to scripts/spack/spack_repo/spheral/packages/opensubdiv/package.py index cfca7ad335..0187fab9a4 100644 --- a/scripts/spack/packages/opensubdiv/package.py +++ b/scripts/spack/spack_repo/spheral/packages/opensubdiv/package.py @@ -4,6 +4,8 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.cmake import CMakePackage +from spack_repo.builtin.build_systems.cuda import CudaPackage from spack.package import * @@ -32,6 +34,8 @@ def url_for_version(self, version): variant('pic', default=True, description='Produce position-independent code (for shared libs)') + depends_on("c", type="build") + depends_on("cxx", type="build") depends_on('cmake@2.8.6:', type='build') # depends_on('graphviz', type='build', when='+doc') # depends_on('doxygen', type='build', when='+doc') @@ -48,9 +52,10 @@ def url_for_version(self, version): patch('oneapi.patch', when='%oneapi') - def setup_build_environment(self, env): + def setup_build_environment(self, env: EnvironmentModifications) -> None: if '+pic' in self.spec: env.append_flags('CFLAGS', self.compiler.cc_pic_flag) + env.append_flags('CXXFLAGS', self.compiler.cxx_pic_flag) def cmake_args(self): spec = self.spec diff --git a/scripts/spack/packages/polytope/package.py b/scripts/spack/spack_repo/spheral/packages/polytope/package.py similarity index 84% rename from scripts/spack/packages/polytope/package.py rename to scripts/spack/spack_repo/spheral/packages/polytope/package.py index c0e70eae4c..e536250ceb 100644 --- a/scripts/spack/packages/polytope/package.py +++ b/scripts/spack/spack_repo/spheral/packages/polytope/package.py @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * import os @@ -13,12 +14,13 @@ class Polytope(CMakePackage): git = "https://github.com/LLNL/polytope.git" url = "https://github.com/LLNL/polytope/archive/v0.7.5.tar.gz" # DO NOT COMMIT, FOR TESTING ONLY - version('v0.7.5', tag='v0.7.5', submodules=True) - version('master', commit='f09d1b55162538330d592baa48f32bee75f136ec', submodules=True, preferred=True) - version('0.7.3', tag='0.7.3', submodules=True) + version('v0.7.5', commit='949fc7723e7a013edb0d00ac993bbb746eccdf9d', tag='v0.7.5', submodules=True, preferred=True) variant('python', default=True, description='Enable Python Support.') + depends_on("c", type="build") + depends_on("cxx", type="build") + extends('python', when='+python') depends_on('python@3: +zlib +shared', type=('build', 'run'), when='+python') depends_on('boost', type=('build', 'run')) diff --git a/scripts/spack/packages/polytope/polytope_cxx.patch b/scripts/spack/spack_repo/spheral/packages/polytope/polytope_cxx.patch similarity index 100% rename from scripts/spack/packages/polytope/polytope_cxx.patch rename to scripts/spack/spack_repo/spheral/packages/polytope/polytope_cxx.patch diff --git a/scripts/spack/packages/qhull/package.py b/scripts/spack/spack_repo/spheral/packages/qhull/package.py similarity index 88% rename from scripts/spack/packages/qhull/package.py rename to scripts/spack/spack_repo/spheral/packages/qhull/package.py index e70273f1e7..9c44a8efcd 100644 --- a/scripts/spack/packages/qhull/package.py +++ b/scripts/spack/spack_repo/spheral/packages/qhull/package.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack.package import * -from spack.pkg.builtin.qhull import Qhull as BuiltinQhull +from spack_repo.builtin.packages.qhull.package import Qhull as BuiltinQhull class Qhull(BuiltinQhull): diff --git a/scripts/spack/packages/spheral/package.py b/scripts/spack/spack_repo/spheral/packages/spheral/package.py similarity index 92% rename from scripts/spack/packages/spheral/package.py rename to scripts/spack/spack_repo/spheral/packages/spheral/package.py index ef5746d363..c8733a3f60 100644 --- a/scripts/spack/packages/spheral/package.py +++ b/scripts/spack/spack_repo/spheral/packages/spheral/package.py @@ -3,6 +3,9 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.cached_cmake import CachedCMakePackage, cmake_cache_option, cmake_cache_path, cmake_cache_string +from spack_repo.builtin.build_systems.cuda import CudaPackage +from spack_repo.builtin.build_systems.rocm import ROCmPackage from spack.package import * import spack import socket @@ -26,7 +29,8 @@ class Spheral(CachedCMakePackage, CudaPackage, ROCmPackage): # ------------------------------------------------------------------------- # Is LEOS available in a standard place? # ------------------------------------------------------------------------- - from spack.pkg.spheral.leos import Leos + + from spack_repo.spheral.packages.leos.package import Leos LEOSpresent = os.path.exists(Leos.fileLoc) # ------------------------------------------------------------------------- @@ -46,11 +50,16 @@ class Spheral(CachedCMakePackage, CudaPackage, ROCmPackage): # ------------------------------------------------------------------------- # Depends # ------------------------------------------------------------------------- + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build") + depends_on('python@3.12', when='+python') + depends_on('mpi', when='+mpi') depends_on('cmake@3.21.0:', type='build') - depends_on('boost@1.85.0 +system +filesystem -atomic -container -coroutine -chrono -context -date_time -exception -fiber -graph -iostreams -locale -log -math -mpi -program_options -python -random -regex -test -thread -timer -wave +pic', type='build') + depends_on('boost@1.85.0 +system +filesystem ~atomic ~container ~coroutine ~chrono ~context ~date_time ~exception ~fiber ~graph ~iostreams ~locale ~log ~math ~mpi ~program_options ~python ~random ~regex ~test ~thread ~timer ~wave +pic', type='build') depends_on('zlib@1.3 +shared +pic', type='build') @@ -62,13 +71,15 @@ class Spheral(CachedCMakePackage, CudaPackage, ROCmPackage): depends_on('hdf5 +hl', type='build') - depends_on('silo+python +hdf5', type='build') + depends_on('silo@4.12.0 ~shared +hdf5', type='build') + + depends_on('raja@2025.09.1', type='build') + depends_on('chai@2025.09.0+raja', type='build') - depends_on('chai@develop+raja', type='build') + depends_on('conduit@0.9.1 +shared +hdf5~hdf5_compat ~test ~parmetis', type='build') - depends_on('conduit@0.9.1 +shared +hdf5~hdf5_compat -test ~parmetis', type='build') + depends_on('axom@0.12.0 +hdf5 ~lua ~examples ~python ~fortran', type='build') - depends_on('axom@0.12.0 +hdf5 -lua -examples -python -fortran', type='build') with when('+rocm') or when('+cuda'): depends_on('axom ~shared', type='build') diff --git a/scripts/spack/packages/sundials/mpi_cxx_link.patch b/scripts/spack/spack_repo/spheral/packages/sundials/mpi_cxx_link.patch similarity index 100% rename from scripts/spack/packages/sundials/mpi_cxx_link.patch rename to scripts/spack/spack_repo/spheral/packages/sundials/mpi_cxx_link.patch diff --git a/scripts/spack/packages/sundials/package.py b/scripts/spack/spack_repo/spheral/packages/sundials/package.py similarity index 80% rename from scripts/spack/packages/sundials/package.py rename to scripts/spack/spack_repo/spheral/packages/sundials/package.py index 765a22ddad..ee48f3246f 100644 --- a/scripts/spack/packages/sundials/package.py +++ b/scripts/spack/spack_repo/spheral/packages/sundials/package.py @@ -7,7 +7,7 @@ import sys from spack.package import * -from spack.pkg.builtin.sundials import Sundials as BuiltinSundials +from spack_repo.builtin.packages.sundials.package import Sundials as BuiltinSundials class Sundials(BuiltinSundials): diff --git a/scripts/spack/repo.yaml b/scripts/spack/spack_repo/spheral/repo.yaml similarity index 70% rename from scripts/spack/repo.yaml rename to scripts/spack/spack_repo/spheral/repo.yaml index 7bc25be80f..e5b5cc4cb8 100644 --- a/scripts/spack/repo.yaml +++ b/scripts/spack/spack_repo/spheral/repo.yaml @@ -1,2 +1,3 @@ repo: namespace: 'spheral' + api: v2.2 diff --git a/tests/functional/Damage/TensileRod/TensileRod-1d.py b/tests/functional/Damage/TensileRod/TensileRod-1d.py index b9bebd9c8e..33df0efb6a 100644 --- a/tests/functional/Damage/TensileRod/TensileRod-1d.py +++ b/tests/functional/Damage/TensileRod/TensileRod-1d.py @@ -187,7 +187,8 @@ def restoreState(self, file, path): order = 5 if DamageModelConstructor in (GradyKippTensorDamage, GradyKippTensorDamageOwen, ProbabilisticDamageModel): - damageName = os.path.join(str(DamageModelConstructor.__name__), str(damageCoupling)) + damageName = os.path.join(str(DamageModelConstructor.__name__), + f"{damageCoupling.__class__.__name__}.{damageCoupling.name}") else: damageName = DamageModelConstructor.__name__