diff --git a/.gitlab/jobs-prod.yml b/.gitlab/jobs-prod.yml index a5e773e079..7b099d2800 100644 --- a/.gitlab/jobs-prod.yml +++ b/.gitlab/jobs-prod.yml @@ -2,18 +2,12 @@ # UPDATE TPL JOBS toss_update_tpls: - extends: [.toss_resource2, .update_tpls, .merge_pr_rule] + extends: [.toss_resource2, .update_tpls] cray_update_tpls: - extends: [.cray_resource2, .update_tpls, .merge_pr_rule] + extends: [.cray_resource2, .update_tpls] needs: [toss_update_tpls] -# ------------------------------------------------------------------------------ -# UPDATE PERM JOBS - -shared_tpls_update_permissions: - extends: [.toss_resource_general, .toss_update_permissions, .merge_pr_rule] - # ------------------------------------------------------------------------------ # PROD BUILD JOBS diff --git a/.gitlab/os.yml b/.gitlab/os.yml index cd68c1722d..3573810922 100644 --- a/.gitlab/os.yml +++ b/.gitlab/os.yml @@ -4,7 +4,6 @@ .sys_config: variables: LLNL_SERVICE_USER: sphapp - UPSTREAM_DIR: /usr/WS2/sduser/Spheral/spack_upstream/0.22 DISPLAY: ':0.0' .on_toss_4_x86: diff --git a/.gitlab/scripts.yml b/.gitlab/scripts.yml index e7ab578e7c..f8dee9ef41 100644 --- a/.gitlab/scripts.yml +++ b/.gitlab/scripts.yml @@ -5,7 +5,6 @@ .init: variables: GIT_STRATEGY: clone - GIT_SUBMODULE_STRATEGY: recursive stage: init script: - echo $USER @@ -86,7 +85,7 @@ # Run the performance suite and move the resulting Caliper files into the benchmark location .run_perf: - extends: [.retry_rule] + extends: [.retry_rule, .perf_pr_rule] stage: run_perf variables: GIT_STRATEGY: none @@ -105,6 +104,7 @@ .cleanup_dir: stage: cleanup + extends: [.cleanup_rule] variables: GIT_STRATEGY: empty script: @@ -124,16 +124,15 @@ GIT_STRATEGY: clone GIT_SUBMODULE_STRATEGY: recursive stage: update_tpls - script: - - ./$SCRIPT_DIR/devtools/tpl-manager.py --no-upstream --spack-dir=$UPSTREAM_DIR - -.toss_update_permissions: - stage: update_permissions variables: - GIT_STRATEGY: none + GIT_STRATEGY: clone + extends: [.merge_pr_rule] + rules: + - if: '$CI_COMMIT_MESSAGE =~ /update-upstream/' + when: always script: - - ml load mpifileutils - - dchmod --mode go+rx $UPSTREAM_DIR + - ./$SCRIPT_DIR/devtools/tpl-manager.py --update-upstream + 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..746da03637 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ # ----------------------------------------------------------------------------- # 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 @@ -31,7 +31,7 @@ ARG HOST_CONFIG=docker-$SPEC 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 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 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 @@ -40,11 +40,9 @@ RUN locale-gen en_US.UTF-8 # Set up TPLs for SPEC WORKDIR /home/spheral/workspace/ -COPY scripts scripts - +COPY scripts scripts RUN python3 scripts/devtools/tpl-manager.py --spec spheral%$SPEC --spack-dir /home - COPY . . # Configure Spheral with SPEC TPLs. diff --git a/scripts/devtools/tpl-manager.py b/scripts/devtools/tpl-manager.py index 373eec6b3d..d2b9cb8412 100755 --- a/scripts/devtools/tpl-manager.py +++ b/scripts/devtools/tpl-manager.py @@ -17,13 +17,19 @@ def get_config_dir(base_dir): os.environ["SPACK_DISABLE_LOCAL_CONFIG"] = "true" default_spack_url = "https://github.com/spack/spack.git" -spack_commit = "5fe93fee1eec46a0750bd340198bffcb92ff9eec" +# Spack version: v1.0.2 +# spack_commit = "734c5db2121b01c373eed6538e452f18887e9e44" +# Spack version: v1.1.0 +spack_commit = "0c2be44e4ece21eb091ad5de4c97716b7c6d4c87" # Current repo (either LLNLSpheral or Spheral) package_name = "spheral" base_dir = os.getcwd() package_dirs = {"spheral": base_dir} +default_install_args = dict(stop_at="initconfig", fail_fast=True) +chmod_run = "chmod -Rf g+rwX" + # Find if this repo is LLNLSpheral by checking the submodule list git_mod_cmd = "git config --file .gitmodules --name-only --get-regexp path$" git_mod_out = sexe(git_mod_cmd, ret_output=True, echo=False) @@ -50,13 +56,14 @@ def parse_args(self): parser.add_argument("--spack-dir", type=str, default=default_spack_dir, help="Directory to install Spack instance and a build directory.") + 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("--spack-url", type=str, default=default_spack_url, help="URL to download spack.") 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", @@ -67,6 +74,9 @@ def parse_args(self): help="Use to do everything but actually install. For testing purposes.") parser.add_argument("--id", type=str, default=None, help="ID string to postfix an initconfig file.") + parser.add_argument("--package-repo", type=str, default=None, + help="Specify a location to put the spack-package repo. "+\ + "Defaults to spheral-spack-tpls/packages.") parser.add_argument("--dev-pkg", action="store_true", help="Tells tpl-manager to use the dev_pkg environment. "+\ "Assumes TPLs are for buildcache creation if no --spec is provided. "+\ @@ -82,21 +92,31 @@ 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, spack_dir, package_repo): "Append spack path to system to use spack python modules" spack_path = os.path.join(spack_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 @@ -111,10 +131,7 @@ 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) + self.add_spack_paths(spack_dir, self.args.package_repo) def check_lock_file(self): "Check if any files in scripts/spack are newer than the spack.lock file" @@ -196,7 +213,7 @@ def set_concretize(loader): # 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_path = os.path.abspath(os.path.join(get_config_dir(path), f"spack_repo/{package}")) 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 @@ -242,25 +259,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 +270,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 +282,42 @@ 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): + self.spack_env.add(self.args.spec) + 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) + conc_spec = self.spack_env.concretize(force=force_conc) + 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) + self.spack_env.write() 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 +328,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" @@ -379,15 +373,23 @@ 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") + with spack.config.override("config:install_tree", upstream_dir): + spack.config.set("config", {"install_tree": {"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() + chmod_cmd = chmod_run + f" {upstream_dir}" + os.system(chmod_cmd) + 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/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..0fbcff0885 100644 --- a/scripts/spack/configs/config.yaml +++ b/scripts/spack/configs/config.yaml @@ -1,215 +1,16 @@ # ------------------------------------------------------------------------- -# 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 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..d5789391ad 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,39 @@ packages: pil: [py-pillow] jpeg: [libjpeg] zlib-api: [zlib] + permissions: + read: group + write: group + 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,12 +65,10 @@ 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 ------- 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..b4b70e007c 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,23 @@ packages: all: - compiler: [rocmcc] providers: blas: [openblas] lapack: [openblas] mpi: [cray-mpich] pkgconfig: [pkg-config] zlib-api: [zlib] + permissions: + read: group + write: group + 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,50 +47,34 @@ 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 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..68c658aab4 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.0.2 diff --git a/scripts/spack/environments/dev_pkg/spack.yaml b/scripts/spack/environments/dev_pkg/spack.yaml index e908f682ab..1b98eae56e 100644 --- a/scripts/spack/environments/dev_pkg/spack.yaml +++ b/scripts/spack/environments/dev_pkg/spack.yaml @@ -4,13 +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: 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/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..e27f940e31 --- /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") + + 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..9457b0ac9b --- /dev/null +++ b/scripts/spack/spack_repo/spheral/packages/llvm_amdgpu/package.py @@ -0,0 +1,25 @@ +# 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 + +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 92% rename from scripts/spack/packages/polytope/package.py rename to scripts/spack/spack_repo/spheral/packages/polytope/package.py index c0e70eae4c..d85bf131fb 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 @@ -19,6 +20,9 @@ class Polytope(CMakePackage): 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 94% rename from scripts/spack/packages/spheral/package.py rename to scripts/spack/spack_repo/spheral/packages/spheral/package.py index ef5746d363..0d9d336934 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,6 +50,11 @@ class Spheral(CachedCMakePackage, CudaPackage, ROCmPackage): # ------------------------------------------------------------------------- # Depends # ------------------------------------------------------------------------- + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build") + depends_on('python', when='+python') + depends_on('mpi', when='+mpi') depends_on('cmake@3.21.0:', type='build') @@ -62,9 +71,15 @@ class Spheral(CachedCMakePackage, CudaPackage, ROCmPackage): depends_on('hdf5 +hl', type='build') - depends_on('silo+python +hdf5', type='build') + # silo needs to be @ 4.11.1 to keep it the same as what was used before porting to spack v1. + # attempting to allow it to use the latest (currently 4.12) causes build failures + # + # a different option might be to use `silo~shared` + # + depends_on('silo@4.11.1+python +hdf5~fortran', type='build') depends_on('chai@develop+raja', type='build') + depends_on('raja', type='build') depends_on('conduit@0.9.1 +shared +hdf5~hdf5_compat -test ~parmetis', 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