diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 193c5fb7a70..1cac02b6cc5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ "build": { "dockerfile": "Dockerfile", "args": { - "GEOS_TPL_TAG": "290-594" + "GEOS_TPL_TAG": "261-601" } }, "runArgs": [ diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 87f12f154e8..c0d981da817 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -84,7 +84,7 @@ jobs: steps: - name: does_pr_have_necessary_labels if: ${{inputs.REQUIRED_LABEL && github.event_name == 'pull_request'}} - run: | + run: | pr_json=$(curl -H "Accept: application/vnd.github+json" https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }}) LABELS=$(echo ${pr_json} | jq -crM '[.labels[].name]') echo " the labels are ${LABELS}" @@ -197,16 +197,32 @@ jobs: script_args+=(--repository ${GITHUB_WORKSPACE_MOUNT_POINT}) # The linear algebra environment variables (ENABLE_HYPRE, ENABLE_HYPRE_DEVICE & ENABLE_TRILINOS) - # could be passed as scripts parameters as well, but a specific care must be taken to be sure + # are passed as scripts parameters. Specific care must be taken to be sure # there's no conflict with the host-config files. + + # Hypre ENABLE_HYPRE=${{ inputs.ENABLE_HYPRE }} - ENABLE_HYPRE_DEVICE=${{ inputs.ENABLE_HYPRE_DEVICE }} + if [ ! -z "${{ inputs.ENABLE_HYPRE }}" ]; then + script_args+=(--enable-hypre "${{ inputs.ENABLE_HYPRE }}") + fi + + # Trilinos ENABLE_TRILINOS=${{ inputs.ENABLE_TRILINOS }} docker_args+=(-e ENABLE_HYPRE=${ENABLE_HYPRE:-OFF}) docker_args+=(-e ENABLE_HYPRE_DEVICE=${ENABLE_HYPRE_DEVICE:-CPU}) docker_args+=(-e ENABLE_TRILINOS=${ENABLE_TRILINOS:-ON}) docker_args+=(-e GEOS_BUILD_SHARED_LIBS=${{ inputs.BUILD_SHARED_LIBS }}) + if [ ! -z "${{ inputs.ENABLE_TRILINOS }}" ]; then + script_args+=(--enable-trilinos "${{ inputs.ENABLE_TRILINOS }}") + fi + + # ENABLE_HYPRE_DEVICE + ENABLE_HYPRE_DEVICE=${{ inputs.ENABLE_HYPRE_DEVICE }} + if [ ! -z "${{ inputs.ENABLE_HYPRE_DEVICE }}" ]; then + script_args+=(--enable-hypre-device "${{ inputs.ENABLE_HYPRE_DEVICE }}") + fi + docker_args+=(--cap-add=SYS_PTRACE --rm) script_args+=(--cmake-build-type ${{ inputs.CMAKE_BUILD_TYPE }}) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index f67aee90bba..b952bbe6b2c 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -150,16 +150,25 @@ jobs: CMAKE_BUILD_TYPE: Release DOCKER_REPOSITORY: geosx/ubuntu20.04-gcc9 BUILD_SHARED_LIBS: ON + ENABLE_HYPRE: OFF + ENABLE_TRILINOS: ON + HOST_CONFIG: /spack-generated.cmake - name: Ubuntu debug (20.04, gcc 10.5.0, open-mpi 4.0.3) - github codespaces CMAKE_BUILD_TYPE: Debug DOCKER_REPOSITORY: geosx/ubuntu20.04-gcc10 BUILD_SHARED_LIBS: ON + ENABLE_HYPRE: OFF + ENABLE_TRILINOS: ON + HOST_CONFIG: /spack-generated.cmake - name: Ubuntu (20.04, gcc 10.5.0, open-mpi 4.0.3) - github codespaces CMAKE_BUILD_TYPE: Release DOCKER_REPOSITORY: geosx/ubuntu20.04-gcc10 BUILD_SHARED_LIBS: ON + ENABLE_HYPRE: OFF + ENABLE_TRILINOS: ON + HOST_CONFIG: /spack-generated.cmake - name: Ubuntu (22.04, gcc 11.4.0, open-mpi 4.1.2) CMAKE_BUILD_TYPE: Release @@ -168,6 +177,7 @@ jobs: ENABLE_TRILINOS: OFF GCP_BUCKET: geosx/ubuntu22.04-gcc11 BUILD_SHARED_LIBS: ON + HOST_CONFIG: /spack-generated.cmake - name: Ubuntu (22.04, gcc 12.3.0, open-mpi 4.1.2) CMAKE_BUILD_TYPE: Release @@ -175,6 +185,7 @@ jobs: ENABLE_HYPRE: ON ENABLE_TRILINOS: OFF BUILD_SHARED_LIBS: ON + HOST_CONFIG: /spack-generated.cmake - name: Ubuntu (22.04, clang 15.0.7, open-mpi 4.1.2) CMAKE_BUILD_TYPE: Release @@ -182,13 +193,17 @@ jobs: ENABLE_HYPRE: ON ENABLE_TRILINOS: OFF BUILD_SHARED_LIBS: ON + HOST_CONFIG: /spack-generated.cmake - name: Sherlock CPU (centos 7.9.2009, gcc 10.1.0, open-mpi 4.1.2, openblas 0.3.10) CMAKE_BUILD_TYPE: Release DOCKER_REPOSITORY: geosx/sherlock-gcc10.1.0-openmpi4.1.2-openblas0.3.10-zlib1.2.11 ENABLE_HYPRE: ON ENABLE_TRILINOS: OFF - HOST_CONFIG: host-configs/Stanford/sherlock-gcc10.cmake + BUILD_AND_TEST_CLI_ARGS: "--no-run-unit-tests" + GCP_BUCKET: geosx/Sherlock-CPU + HOST_CONFIG: /spack-generated.cmake +# HOST_CONFIG: host-configs/Stanford/sherlock-gcc10.cmake BUILD_SHARED_LIBS: ON uses: ./.github/workflows/build_and_test.yml @@ -199,6 +214,7 @@ jobs: DOCKER_REPOSITORY: ${{ matrix.DOCKER_REPOSITORY }} ENABLE_HYPRE: ${{ matrix.ENABLE_HYPRE }} ENABLE_TRILINOS: ${{ matrix.ENABLE_TRILINOS }} + BUILD_AND_TEST_CLI_ARGS: ${{ matrix.BUILD_AND_TEST_CLI_ARGS }} GCP_BUCKET: ${{ matrix.GCP_BUCKET }} HOST_CONFIG: ${{ matrix.HOST_CONFIG }} RUNS_ON: ubuntu-22.04 @@ -228,6 +244,7 @@ jobs: DOCKER_CERTS_UPDATE_COMMAND: "update-ca-certificates" REQUIRED_LABEL: "ci: run integrated tests" LOCAL_BASELINE_DIR: /data/GEOS/baselines + HOST_CONFIG: /spack-generated.cmake baseline_log: needs: [is_not_draft_pull_request] @@ -260,7 +277,7 @@ jobs: GCP_BUCKET: geosx/ubuntu22.04-gcc11 RUNS_ON: Runner_4core_16GB REQUIRED_LABEL: "ci: run code coverage" - + HOST_CONFIG: /spack-generated.cmake # mac_builds: # needs: @@ -296,6 +313,7 @@ jobs: DOCKER_RUN_ARGS: "--cpus=8 --memory=128g --runtime=nvidia -v /etc/pki/ca-trust/source/anchors/:/usr/local/share/ca-certificates/llnl:ro" DOCKER_CERTS_DIR: "/usr/local/share/ca-certificates" DOCKER_CERTS_UPDATE_COMMAND: "update-ca-certificates" + HOST_CONFIG: /spack-generated.cmake - name: Ubuntu CUDA (20.04, clang 10.0.0 + gcc 9.4.0, open-mpi 4.0.3, cuda-11.8.89) BUILD_AND_TEST_CLI_ARGS: "--no-install-schema" @@ -310,7 +328,8 @@ jobs: DOCKER_RUN_ARGS: "--cpus=8 --memory=256g --runtime=nvidia --gpus all -v /etc/pki/ca-trust/source/anchors/:/usr/local/share/ca-certificates/llnl:ro" DOCKER_CERTS_DIR: "/usr/local/share/ca-certificates" DOCKER_CERTS_UPDATE_COMMAND: "update-ca-certificates" - + HOST_CONFIG: /spack-generated.cmake + - name: Rockylinux CUDA (8, clang 17.0.6, cuda 12.5.1) BUILD_AND_TEST_CLI_ARGS: "--no-install-schema" CMAKE_BUILD_TYPE: Release @@ -324,6 +343,7 @@ jobs: DOCKER_RUN_ARGS: "--cpus=8 --memory=256g --runtime=nvidia --gpus all -v /etc/pki/ca-trust/source/anchors/:/usr/local/share/ca-certificates/llnl:ro" DOCKER_CERTS_DIR: "/usr/local/share/ca-certificates" DOCKER_CERTS_UPDATE_COMMAND: "update-ca-trust" + HOST_CONFIG: /spack-generated.cmake - name: Rockylinux CUDA (8, gcc 8.5, cuda 12.5.1) BUILD_AND_TEST_CLI_ARGS: "--no-run-unit-tests --no-install-schema" @@ -338,13 +358,13 @@ jobs: DOCKER_RUN_ARGS: "--cpus=8 --memory=128g --runtime=nvidia -v /etc/pki/ca-trust/source/anchors/:/etc/pki/ca-trust/source/anchors/llnl:ro" DOCKER_CERTS_DIR: "/etc/pki/ca-trust/source/anchors" DOCKER_CERTS_UPDATE_COMMAND: "update-ca-trust" + HOST_CONFIG: /spack-generated.cmake - name: Pangea 3 CUDA (AlmaLinux 8.8, gcc 9.4.0, open-mpi 4.1.2, cuda 11.5.0, openblas 0.3.10) BUILD_AND_TEST_CLI_ARGS: "--build-exe-only --no-install-schema" CMAKE_BUILD_TYPE: Release BUILD_GENERATOR: "--makefile" DOCKER_REPOSITORY: geosx/pangea3-almalinux8-gcc9.4-openmpi4.1.2-cuda11.5.0-openblas0.3.18 - HOST_CONFIG: host-configs/TOTAL/pangea3-gcc8.4.1-openmpi-4.1.2-wave-solver.cmake ENABLE_HYPRE_DEVICE: CUDA ENABLE_HYPRE: ON ENABLE_TRILINOS: OFF @@ -354,6 +374,7 @@ jobs: DOCKER_RUN_ARGS: "--cpus=8 --memory=128g -v /etc/pki/ca-trust/source/anchors/:/etc/pki/ca-trust/source/anchors/llnl:ro" DOCKER_CERTS_DIR: "/etc/pki/ca-trust/source/anchors" DOCKER_CERTS_UPDATE_COMMAND: "update-ca-trust" + HOST_CONFIG: /spack-generated-wave-solver-only.cmake - name: Sherlock GPU (centos 7.9.2009, gcc 10.1.0, open-mpi 4.1.2, openblas 0.3.10, cuda 12.4.0,) BUILD_AND_TEST_CLI_ARGS: "--no-run-unit-tests --no-install-schema" @@ -364,12 +385,12 @@ jobs: ENABLE_HYPRE: ON ENABLE_TRILINOS: OFF GCP_BUCKET: geosx/Sherlock-GPU - HOST_CONFIG: host-configs/Stanford/sherlock-gcc10-cuda12-sm70.cmake RUNS_ON: streak2 NPROC: 8 DOCKER_RUN_ARGS: "--cpus=8 --memory=128g --runtime=nvidia -v /etc/pki/ca-trust/source/anchors/:/etc/pki/ca-trust/source/anchors/llnl:ro" DOCKER_CERTS_DIR: "/etc/pki/ca-trust/source/anchors" DOCKER_CERTS_UPDATE_COMMAND: "update-ca-trust" + HOST_CONFIG: /spack-generated.cmake # Below this line, jobs that deploy to Google Cloud. diff --git a/.gitmodules b/.gitmodules index 029ba71a9ab..5552178f5ce 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,6 +10,3 @@ [submodule "src/coreComponents/fileIO/coupling/hdf5_interface"] path = src/coreComponents/fileIO/coupling/hdf5_interface url = ../../GEOS-DEV/hdf5_interface.git -[submodule "scripts/uberenv"] - path = scripts/uberenv - url = ../../LLNL/uberenv.git diff --git a/.uberenv_config.json b/.uberenv_config.json deleted file mode 100644 index 883612c2c25..00000000000 --- a/.uberenv_config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ -"package_name": "geosx", -"package_version": "develop", -"package_final_phase": "lvarray_hostconfig", -"package_source_dir": "../..", -"spack_url": "https://github.com/spack/spack", -"spack_commit": "e8658d6493887ef702dd38f0e9ee5870a1651c1e", -"spack_configs_path": "scripts/spack_configs", -"spack_packages_path": "scripts/spack_packages/packages", -"spack_concretizer": "clingo" -} diff --git a/scripts/ci_build_and_test_in_container.sh b/scripts/ci_build_and_test_in_container.sh index 348fe6ad229..f073e055ecb 100755 --- a/scripts/ci_build_and_test_in_container.sh +++ b/scripts/ci_build_and_test_in_container.sh @@ -38,6 +38,12 @@ Usage: $0 run a code build and test. --data-basename output.tar.gz If some data needs to be extracted from the build, the argument will define the tarball. Has to be a `tar.gz`. + --enable-hypre + One of ON or OFF (default is ON). Build geos with hypre. + --enable-hypre-device + One of CPU, CUDA, or HIP (default is CPU). Build geos with hypre GPU support. + --enable-trilinos + One of ON or OFF (default is OFF). Build geos with trilinos. --exchange-dir /path/to/exchange Folder to share data with outside of the container. --host-config host-config/my_config.cmake @@ -71,19 +77,22 @@ exit 1 # Then we'll move to the build dir. or_die cd $(dirname $0)/.. -# Parsing using getopt -args=$(or_die getopt -a -o h --long build-exe-only,cmake-build-type:,code-coverage,data-basename:,exchange-dir:,host-config:,install-dir-basename:,makefile,ninja,no-install-schema,no-run-unit-tests,nproc:,repository:,run-integrated-tests,sccache-credentials:,test-code-style,test-documentation,help -- "$@") +args=$(or_die getopt -a -o h --long build-exe-only,cmake-build-type:,code-coverage,data-basename:,enable-hypre:,enable-hypre-device:,enable-trilinos:,exchange-dir:,host-config:,install-dir-basename:,makefile,ninja,no-install-schema,no-run-unit-tests,nproc:,repository:,run-integrated-tests,sccache-credentials:,test-code-style,test-documentation,help -- "$@") # Variables with default values BUILD_EXE_ONLY=false BUILD_GENERATOR="" GEOS_INSTALL_SCHEMA=true HOST_CONFIG="host-configs/environment.cmake" +ENABLE_HYPRE=ON +ENABLE_HYPRE_DEVICE=CPU +GEOS_LA_INTERFACE=Hypre RUN_UNIT_TESTS=true RUN_INTEGRATED_TESTS=false UPLOAD_TEST_BASELINES=false TEST_CODE_STYLE=false TEST_DOCUMENTATION=false +ENABLE_TRILINOS=OFF CODE_COVERAGE=false NPROC="$(nproc)" @@ -109,6 +118,9 @@ do fi unset DATA_BASENAME DATA_BASENAME_EXT shift 2;; + --enable-hypre) ENABLE_HYPRE=$2; shift 2;; + --enable-hypre-device) ENABLE_HYPRE_DEVICE=$2; shift 2;; + --enable-trilinos) ENABLE_TRILINOS=$2; shift 2;; --exchange-dir) DATA_EXCHANGE_DIR=$2; shift 2;; --host-config) HOST_CONFIG=$2; shift 2;; --install-dir-basename) GEOS_DIR=${GEOSX_TPL_DIR}/../$2; shift 2;; @@ -141,6 +153,12 @@ if [[ -z "${GEOS_DIR}" ]]; then GEOS_DIR=/dev/null fi +if [[ "${ENABLE_HYPRE}" = ON ]]; then + GEOS_LA_INTERFACE=Hypre +else + GEOS_LA_INTERFACE=Trilinos +fi + if [[ ! -z "${SCCACHE_CREDS}" ]]; then # The credential json file is available at the root of the geos repository. # We hereafter create the config file that points to it. @@ -200,7 +218,7 @@ if [[ "${RUN_INTEGRATED_TESTS}" = true ]]; then ATS_WORKING_DIR=$tempdir/GEOS_integratedTests_working export ATS_FILTER="np<=32" - ATS_CMAKE_ARGS="-DATS_ARGUMENTS=\"--machine openmpi --ats openmpi_mpirun=/usr/bin/mpirun --ats openmpi_args=--allow-run-as-root --ats openmpi_procspernode=32 --ats openmpi_maxprocs=32\" -DPython3_ROOT_DIR=${ATS_PYTHON_HOME} -DATS_BASELINE_DIR=${ATS_BASELINE_DIR} -DATS_WORKING_DIR=${ATS_WORKING_DIR}" + ATS_CMAKE_ARGS="-DATS_ARGUMENTS=\"--machine openmpi --ats openmpi_mpirun=/usr/bin/mpirun --ats openmpi_args=--allow-run-as-root --ats openmpi_procspernode=32 --ats openmpi_maxprocs=32\" -DPython3_ROOT_DIR=${ATS_PYTHON_HOME} -DPython3_EXECUTABLE=${ATS_PYTHON_HOME}/bin/python3 -DATS_BASELINE_DIR=${ATS_BASELINE_DIR} -DATS_WORKING_DIR=${ATS_WORKING_DIR}" fi @@ -233,6 +251,10 @@ or_die python3 scripts/config-build.py \ ${BUILD_GENERATOR} \ -DBLT_MPI_COMMAND_APPEND='"--allow-run-as-root;--oversubscribe"' \ -DGEOS_INSTALL_SCHEMA=${GEOS_INSTALL_SCHEMA} \ + -DENABLE_HYPRE=${ENABLE_HYPRE} \ + -DENABLE_HYPRE_DEVICE=${ENABLE_HYPRE_DEVICE} \ + -DENABLE_TRILINOS=${ENABLE_TRILINOS} \ + -DGEOS_LA_INTERFACE:PATH=${GEOS_LA_INTERFACE} \ -DENABLE_COVERAGE=$([[ "${CODE_COVERAGE}" = true ]] && echo 1 || echo 0) \ ${SCCACHE_CMAKE_ARGS} \ ${ATS_CMAKE_ARGS} diff --git a/scripts/pygeosx_configs/blueos_3_ppc64le_ib_p9/spack.yaml b/scripts/pygeosx_configs/blueos_3_ppc64le_ib_p9/spack.yaml deleted file mode 100644 index 008808c9726..00000000000 --- a/scripts/pygeosx_configs/blueos_3_ppc64le_ib_p9/spack.yaml +++ /dev/null @@ -1,137 +0,0 @@ -#------------------------------------------------------------------------------------------------------------ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Copyright (c) 2018-2024 Lawrence Livermore National Security LLC -# Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University -# Copyright (c) 2018-2024 TotalEnergies -# Copyright (c) 2019- GEOS/GEOSX Contributors -# All rights reserved -# -# See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. -#------------------------------------------------------------------------------------------------------------ - -# %gcc@8.3.1 -# -# Uberenv command to build pygeosx dependencies: -# python3 ./scripts/uberenv/uberenv.py --spec="%gcc@8.3.1" --project-json="scripts/pygeosx_configs/pygeosx.json" - -spack: - config: - install_tree: - root: $spack/.. - projections: - all: '{compiler.name}-{compiler.version}/{name}-{version}-{hash}' - misc_cache: $spack/../misc_cache - test_stage: $spack/../test_stage - build_stage:: - - $spack/../build_stage - - view: - default: - root: ../view - projections: - all: '{name}-{version}' - - compilers:: - - compiler: - spec: gcc@8.3.1 - paths: - cc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gcc - cxx: /usr/tce/packages/gcc/gcc-8.3.1/bin/g++ - f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - flags: - # Fix for "undefined reference to `_gfortran_transfer_integer_write'" - ldlibs: -lgfortran - operating_system: rhel7 - target: ppc64le - modules: [] - environment: {} - extra_rpaths: [] - - packages: - all: - compiler: [gcc] - providers: - mpi: [spectrum-mpi] - blas: [openblas] - lapack: [openblas] - - spectrum-mpi: - buildable: False - externals: - - spec: spectrum-mpi@release%gcc@8.3.1 - prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1 - - cuda: - buildable: False - externals: - - spec: cuda@11.2.2 +allow-unsupported-compilers - prefix: /usr/tce/packages/cuda/cuda-11.2.0 - - # System level packages to not build - cmake: - buildable: False - externals: - - spec: cmake@3.21.1 - prefix: /usr/tce/packages/cmake/cmake-3.21.1 - readline: - buildable: False - 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/ - m4: - buildable: False - externals: - - spec: m4@1.4.16 - prefix: /usr - perl: - buildable: false - externals: - - spec: perl@5.16.3 - prefix: /usr - pkg-config: - buildable: false - externals: - - spec: pkg-config@0.27.1 - prefix: /usr - diffutils: - buildable: False - externals: - - spec: diffutils@3.3 - prefix: /usr/bin/ - autoconf: - buildable: False - externals: - - spec: autoconf@2.69 - prefix: /usr - automake: - buildable: False - externals: - - spec: automake@1.13.4 - prefix: /usr - libtool: - buildable: False - externals: - - spec: libtool@2.4.2 - prefix: /usr - bison: - buildable: False - externals: - - spec: bison@3.0.4 - prefix: /usr - flex: - buildable: False - externals: - - spec: flex@2.5.37 - prefix: /usr - tk: - buildable: False - externals: - - spec: tk@8.5 - prefix: /usr - tcl: - buildable: False - externals: - - spec: tcl@8.5 - prefix: /usr diff --git a/scripts/pygeosx_configs/pygeosx.json b/scripts/pygeosx_configs/pygeosx.json deleted file mode 100644 index 41b485dc130..00000000000 --- a/scripts/pygeosx_configs/pygeosx.json +++ /dev/null @@ -1,11 +0,0 @@ -{ -"package_name": "pygeosx", -"package_version": "fakeversion", -"package_final_phase": "", -"package_source_dir": "../..", -"spack_url": "https://github.com/spack/spack", -"spack_commit": "e8658d6493887ef702dd38f0e9ee5870a1651c1e", -"spack_configs_path": "scripts/pygeosx_configs", -"spack_packages_path": "scripts/spack_packages/packages", -"spack_concretizer": "clingo" -} diff --git a/scripts/pygeosx_configs/toss_4_x86_64_ib/spack.yaml b/scripts/pygeosx_configs/toss_4_x86_64_ib/spack.yaml deleted file mode 100644 index efc5a9acbf0..00000000000 --- a/scripts/pygeosx_configs/toss_4_x86_64_ib/spack.yaml +++ /dev/null @@ -1,142 +0,0 @@ -#------------------------------------------------------------------------------------------------------------ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Copyright (c) 2018-2024 Lawrence Livermore National Security LLC -# Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University -# Copyright (c) 2018-2024 TotalEnergies -# Copyright (c) 2019- GEOS/GEOSX Contributors -# All rights reserved -# -# See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. -#------------------------------------------------------------------------------------------------------------ - -# %gcc@10.3.1 -# -# Uberenv command to build pygeosx dependencies: -# python3 ./scripts/uberenv/uberenv.py --spec="%gcc@10.3.1" --project-json="scripts/pygeosx_configs/pygeosx.json" - -spack: - config: - install_tree: - root: $spack/.. - projections: - all: '{compiler.name}-{compiler.version}/{name}-{version}-{hash}' - misc_cache: $spack/../misc_cache - test_stage: $spack/../test_stage - build_stage:: - - $spack/../build_stage - - view: - default: - root: ../view - projections: - all: '{name}-{version}' - - compilers:: - - compiler: - spec: gcc@10.3.1 - paths: - cc: /usr/tce/packages/gcc/gcc-10.3.1-magic/bin/gcc - cxx: /usr/tce/packages/gcc/gcc-10.3.1-magic/bin/g++ - f77: /usr/tce/packages/gcc/gcc-10.3.1-magic/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-10.3.1-magic/bin/gfortran - operating_system: rhel8 - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] - - packages: - all: - target: [ivybridge] - compiler: [clang] - providers: - mpi: [mvapich2] - blas: [intel-oneapi-mkl] - lapack: [intel-oneapi-mkl] - - # Lock down which MPI we are using - mvapich2: - buildable: False - externals: - - spec: mvapich2@2.3%gcc@10.3.1 - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-10.3.1-magic - - intel-oneapi-mkl: - externals: - - spec: "intel-oneapi-mkl@2023.0.0" - prefix: /opt/intel/oneapi - buildable: False - - # System level packages to not build - papi: - buildable: False - externals: - - spec: papi@6.0.0.1 - prefix: /usr/tce/packages/papi/papi-6.0.0.1/ - cmake: - version: [3.26.3] - buildable: false - externals: - - spec: cmake@3.26.3 - prefix: /usr/tce/packages/cmake/cmake-3.26.3 - readline: - externals: - - spec: readline@7.0 - prefix: /collab/usr/gapps/python/build/spack-toss3.3/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/readline-7.0-e5jqqjmcjknidgwvi353pd6umpixzxr2 - buildable: false - m4: - buildable: False - externals: - - spec: m4@1.4.18 - prefix: /usr - perl: - buildable: false - externals: - - spec: perl@5.26.3 - prefix: /usr - pkg-config: - buildable: false - externals: - - spec: pkg-config@1.8.0 - prefix: /usr - diffutils: - buildable: False - externals: - - spec: diffutils@3.3 - prefix: /usr/bin - autoconf: - buildable: False - externals: - - spec: autoconf@2.69 - prefix: /usr - automake: - buildable: False - externals: - - spec: automake@1.16.1 - prefix: /usr - libtool: - buildable: False - externals: - - spec: libtool@2.4.6 - prefix: /usr - bison: - buildable: False - externals: - - spec: bison@3.0.4 - prefix: /usr - flex: - buildable: False - externals: - - spec: flex@2.6.1 - prefix: /usr - tk: - buildable: False - externals: - - spec: tk@8.6 - prefix: /usr - tcl: - buildable: False - externals: - - spec: tcl@8.6 - prefix: /usr diff --git a/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml b/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml deleted file mode 100644 index 9c737836c86..00000000000 --- a/scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml +++ /dev/null @@ -1,196 +0,0 @@ -#------------------------------------------------------------------------------------------------------------ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Copyright (c) 2018-2024 Lawrence Livermore National Security LLC -# Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University -# Copyright (c) 2018-2024 TotalEnergies -# Copyright (c) 2019- GEOS/GEOSX Contributors -# All rights reserved -# -# See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. -#------------------------------------------------------------------------------------------------------------ - -# geosx@develop%clang@10.0.1+cuda cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers -# geosx@develop%gcc@8.3.1+cuda cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers -# geosx@develop%clang@13.0.1+cuda cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers -# -# Uberenv command to build geos dependencies: -# python3 ./scripts/uberenv/uberenv.py --spec="%clang@10.0.1+cuda~uncrustify cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers" -# -# python3 ./scripts/uberenv/uberenv.py --spec="%gcc@8.3.1+cuda~uncrustify cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers" -# -# python3 ./scripts/uberenv/uberenv.py --spec="%clang@13.0.1+cuda~uncrustify cuda_arch=70 ^cuda@11.8.0+allow-unsupported-compilers" - - -spack: - config: - install_tree: - root: $spack/.. - projections: - all: '{compiler.name}-{compiler.version}/{name}-{version}-{hash}' - misc_cache: $spack/../misc_cache - test_stage: $spack/../test_stage - build_stage:: - - $spack/../build_stage - - # Regular TPLs do not need views - view: false - - compilers:: - - compiler: - spec: clang@10.0.1 - paths: - cc: /usr/tce/packages/clang/clang-10.0.1-gcc-8.3.1/bin/clang - cxx: /usr/tce/packages/clang/clang-10.0.1-gcc-8.3.1/bin/clang++ - f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - flags: {} - operating_system: rhel7 - target: ppc64le - modules: [] - environment: {} - extra_rpaths: [] - - compiler: - spec: clang@13.0.1 - paths: - cc: /usr/tce/packages/clang/clang-13.0.1-gcc-8.3.1/bin/clang - cxx: /usr/tce/packages/clang/clang-13.0.1-gcc-8.3.1/bin/clang++ - f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - flags: {} - operating_system: rhel7 - target: ppc64le - modules: [] - environment: {} - extra_rpaths: [] - - compiler: - spec: gcc@8.3.1 - paths: - cc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gcc - cxx: /usr/tce/packages/gcc/gcc-8.3.1/bin/g++ - f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran - flags: - # Fix for "undefined reference to `_gfortran_transfer_integer_write'" - ldlibs: -lgfortran - operating_system: rhel7 - target: ppc64le - modules: [] - environment: {} - extra_rpaths: [] - - packages: - all: - compiler: [gcc, clang] - providers: - mpi: [spectrum-mpi] - blas: [essl] - lapack: [essl] - - blt: - require: "@git.5a792c1775e7a7628d84dcde31652a689f1df7b5=develop" - - hypre: - require: "@git.57bfb26e268ddf003668c5d0b5938ae258922a83" - - umpire: - require: "@git.4bd9b2ded81d3216b3f62e2aad62d0e34fe2c256=develop" - - raja: - require: "@git.e330b2560747d5417cd7bd265fab3fb91d32ecbd=develop" - - camp: - require: "@git.ac34c25b722a06b138bc045d38bfa5e8fa3ec9c5=main" - - uncrustify: - require: "@git.401a4098bce9dcc47e024987403f2d59d9ba7bd2" - - superlu-dist: - require: "@git.0f6efc377df2440c235452d13d28d2c717f832a1" - - spectrum-mpi: - buildable: False - externals: - - spec: spectrum-mpi@release%gcc@8.3.1 - prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1 - # Previously clang@upstream - clingo doesn't like "upstream" version - - spec: spectrum-mpi@release%clang@10.0.1 - prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-10.0.1-gcc-8.3.1 - - spec: spectrum-mpi@release%clang@13.0.1 - prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-13.0.1-gcc-8.3.1 - - essl: - buildable: False - externals: - - spec: essl@6.3.0.2 - prefix: /usr/tcetmp/packages/essl/essl-6.3.0.2/ - - cuda: - buildable: False - externals: - - spec: cuda@11.8.0 +allow-unsupported-compilers - prefix: /usr/tce/packages/cuda/cuda-11.8.0 - - # System level packages to not build - cmake: - buildable: False - externals: - - spec: cmake@3.23.1 - prefix: /usr/tce/packages/cmake/cmake-3.23.1 - readline: - buildable: False - 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/ - m4: - buildable: False - externals: - - spec: m4@1.4.16 - prefix: /usr - perl: - buildable: false - externals: - - spec: perl@5.16.3 - prefix: /usr - pkg-config: - buildable: false - externals: - - spec: pkg-config@0.27.1 - prefix: /usr - diffutils: - buildable: False - externals: - - spec: diffutils@3.3 - prefix: /usr/bin/ - # This needs to be the prefix to the python3 LC installation - # or pygeosx package built by spack/uberenv - python: - buildable: False - externals: - - spec: python@3.8.2 - prefix: /usr/gapps/GEOSX/thirdPartyLibs/python/lassen-gcc-python/python/ - autoconf: - buildable: False - externals: - - spec: autoconf@2.69 - prefix: /usr - automake: - buildable: False - externals: - - spec: automake@1.13.4 - prefix: /usr - libtool: - buildable: False - externals: - - spec: libtool@2.4.2 - prefix: /usr - bison: - buildable: False - externals: - - spec: bison@3.0.4 - prefix: /usr - flex: - buildable: False - externals: - - spec: flex@2.5.37 - prefix: /usr diff --git a/scripts/spack_configs/darwin/compilers.yaml b/scripts/spack_configs/darwin/compilers.yaml deleted file mode 100644 index 00889a4a161..00000000000 --- a/scripts/spack_configs/darwin/compilers.yaml +++ /dev/null @@ -1,17 +0,0 @@ -compilers: -- compiler: - spec: clang@12.0.0-apple - paths: - cc: /usr/bin/clang - cxx: /usr/bin/clang++ - f77: /usr/local/bin/gfortran - fc: /usr/local/bin/gfortran - flags: - cflags: - cxxflags: - fflags: - operating_system: catalina - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] diff --git a/scripts/spack_configs/darwin/packages.yaml b/scripts/spack_configs/darwin/packages.yaml deleted file mode 100644 index 5b05bd37fad..00000000000 --- a/scripts/spack_configs/darwin/packages.yaml +++ /dev/null @@ -1,134 +0,0 @@ -packages: - all: - target: [default] - compiler: [clang] - providers: - mpi: [openmpi] - blas: [netlib-lapack] - lapack: [netlib-lapack] - - openmpi: - buildable: False - externals: - - spec: openmpi@4.0.5 - prefix: /usr/local/Cellar/open-mpi/4.0.5/ - - netlib-lapack: - buildable: False - externals: - - spec: netlib-lapack - prefix: /usr/lib/ - - cmake: - buildable: False - externals: - - spec: cmake@3.18.4 - prefix: /usr/local/Cellar/cmake/3.18.4/ - - readline: - buildable: False - externals: - - spec: readline - prefix: /usr/lib/ - - zlib: - buildable: False - externals: - - spec: zlib@1.2.11 - prefix: /usr/lib/ - - m4: - buildable: False - externals: - - spec: m4@1.4.6 - prefix: /usr/bin/ - - diffutils: - buildable: False - externals: - - spec: diffutils@2.8.1 - prefix: /usr/bin/ - - python: - buildable: False - externals: - - spec: python@3.8.6 - prefix: /usr/local/Cellar/python@3.8/3.8.6/ - - # py-sphinx: - # buildable: False - # externals: - # - spec: py-sphinx@1.6.3 - # prefix: /collab/usr/gapps/python/build/spack-toss3.2/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/python-2.7.14-7rci3jkmuht2uiwp433afigveuf4ocnu/ - # - # bison: - # buildable: False - # externals: - # - spec: bison@3.0.4 - # prefix: /usr/bin/ - # - # flex: - # buildable: False - # externals: - # - spec: flex@2.5.37 - # prefix: /usr/bin/ - # - # bzip2: - # buildable: False - # externals: - # - spec: bzip2@1.0.6 - # prefix: /usr/bin/ - # - # expat: - # buildable: False - # externals: - # - spec: expat@1.6.0 - # prefix: /usr/lib64/ - # - # gdbm: - # buildable: False - # externals: - # - spec: gdbm@4.0.0 - # prefix: /usr/lib64/ - # - # gettext: - # buildable: False - # externals: - # - spec: gettext@0.19.8.1 - # prefix: /usr/bin/ - # - # openssl: - # buildable: False - # externals: - # - spec: openssl@1.0.2 - # prefix: /usr/bin/ - # - # libffi: - # buildable: False - # externals: - # - spec: libffi@6.0.1 - # prefix: /usr/lib64/ - # - # libuuid: - # buildable: False - # externals: - # - spec: libuuid@1.3.0 - # prefix: /usr/lib64/ - # - # ncurses: - # buildable: False - # externals: - # - spec: ncurses@5.9 - # prefix: /usr/lib64/ - # - # xz: - # buildable: False - # externals: - # - spec: xz@5.2.2 - # prefix: /usr/bin/ - # - # pkg-config: - # buildable: False - # externals: - # - spec: pkg-config@0.27.1 - # prefix: /usr/bin/ diff --git a/scripts/spack_configs/summit/compilers.yaml b/scripts/spack_configs/summit/compilers.yaml deleted file mode 100644 index 2499a594cc7..00000000000 --- a/scripts/spack_configs/summit/compilers.yaml +++ /dev/null @@ -1,31 +0,0 @@ -compilers: -- compiler: - spec: gcc@9.1.0 - paths: - cc: /sw/summit/gcc/9.1.0-alpha+20190716/bin/gcc - cxx: /sw/summit/gcc/9.1.0-alpha+20190716/bin/g++ - f77: /sw/summit/gcc/9.1.0-alpha+20190716/bin/gfortran - fc: /sw/summit/gcc/9.1.0-alpha+20190716/bin/gfortran - flags: - cflags: -mcpu=native -mtune=native - cxxflags: -mcpu=native -mtune=native - operating_system: rhel8 - target: ppc64le - modules: [gcc/9.1.0] - environment: {} - extra_rpaths: [] -- compiler: - spec: gcc@10.2.0 - paths: - cc: /sw/summit/gcc/10.2.0-2/bin/gcc - cxx: /sw/summit/gcc/10.2.0-2/bin/g++ - f77: /sw/summit/gcc/10.2.0-2/bin/gfortran - fc: /sw/summit/gcc/10.2.0-2/bin/gfortran - flags: - cflags: -mcpu=native -mtune=native - cxxflags: -mcpu=native -mtune=native - operating_system: rhel8 - target: ppc64le - modules: [gcc/10.2.0] - environment: {} - extra_rpaths: [] diff --git a/scripts/spack_configs/summit/packages.yaml b/scripts/spack_configs/summit/packages.yaml deleted file mode 100644 index 30bd2940cb5..00000000000 --- a/scripts/spack_configs/summit/packages.yaml +++ /dev/null @@ -1,70 +0,0 @@ -packages: - all: - target: [default] - compiler: [gcc] - providers: - mpi: [spectrum-mpi] - blas: [openblas] - lapack: [openblas] - - openblas: - buildable: False - externals: - - spec: openblas@0.3.15 threads=openmp - modules: - - openblas/0.3.15-omp - - spectrum-mpi: - buildable: False - externals: - - spec: spectrum-mpi@10.4.0.3-20210112 - modules: - - spectrum-mpi/10.4.0.3-20210112 - - cuda: - buildable: False - externals: - - spec: cuda@11.0.3 - modules: - - cuda/11.0.3 - - spec: cuda@11.3.1 - modules: - - cuda/11.3.1 - - cmake: - buildable: False - externals: - - spec: cmake@3.18.4 - modules: - - cmake/3.18.4 - - readline: - buildable: False - externals: - - spec: readline@6.2 - prefix: /usr/lib64/ - - zlib: - buildable: False - externals: - - spec: zlib@1.2.7 - prefix: /usr/ - - m4: - buildable: False - externals: - - spec: m4@1.4.16 - prefix: /usr/bin/ - - diffutils: - buildable: False - externals: - - spec: diffutils@3.3 - prefix: /usr/bin/ - - python: - buildable: False - externals: - - spec: python@3.8 - modules: - - python/3.8-anaconda3 diff --git a/scripts/spack_configs/summit_python/compilers.yaml b/scripts/spack_configs/summit_python/compilers.yaml deleted file mode 120000 index c0fbf0f7d5d..00000000000 --- a/scripts/spack_configs/summit_python/compilers.yaml +++ /dev/null @@ -1 +0,0 @@ -../summit/compilers.yaml \ No newline at end of file diff --git a/scripts/spack_configs/summit_python/packages.yaml b/scripts/spack_configs/summit_python/packages.yaml deleted file mode 100644 index 094c8474277..00000000000 --- a/scripts/spack_configs/summit_python/packages.yaml +++ /dev/null @@ -1,120 +0,0 @@ -packages: - all: - target: [default] - compiler: [gcc] - providers: - mpi: [spectrum-mpi] - blas: [openblas] - lapack: [openblas] - - openblas: - buildable: False - externals: - - spec: openblas@0.3.9 threads=openmp - modules: - - openblas/0.3.9-omp - - spectrum-mpi: - buildable: False - externals: - - spec: spectrum-mpi@10.3.1.2-20200121 - modules: - - spectrum-mpi/10.3.1.2-20200121 - - cuda: - buildable: False - externals: - - spec: cuda@11.2.0 - modules: - - cuda/11.2.0 - - cmake: - buildable: False - externals: - - spec: cmake@3.14.5 - modules: - - cmake/3.14.2 - - readline: - buildable: False - externals: - - spec: readline@6.2 - prefix: /usr/lib64/ - - zlib: - buildable: False - externals: - - spec: zlib@1.2.7 - prefix: /usr/ - - m4: - buildable: False - externals: - - spec: m4@1.4.16 - prefix: /usr/bin/ - - diffutils: - buildable: False - externals: - - spec: diffutils@3.3 - prefix: /usr/bin/ - - bzip2: - buildable: False - externals: - - spec: bzip2@1.0.6 - prefix: /usr/bin/ - - expat: - buildable: False - externals: - - spec: expat@1.6.0 - prefix: /usr/lib64/ - - gdbm: - buildable: False - externals: - - spec: gdbm@4.0.0 - prefix: /gpfs/alpine/geo127/proj-shared/libs-for-geosx - - gettext: - buildable: False - externals: - - spec: gettext@0.19.8.1 - prefix: /usr/bin/ - - openssl: - buildable: False - externals: - - spec: openssl@1.0.2k-fips - prefix: /usr/ - - libffi: - buildable: False - externals: - - spec: libffi@6.0.1 - prefix: /usr/lib64/ - - libuuid: - buildable: False - externals: - - spec: libuuid@1.3.0 - prefix: /usr/lib64/ - - ncurses: - buildable: False - externals: - - spec: ncurses@5.9 - prefix: /usr/lib64/ - - xz: - buildable: False - externals: - - spec: xz@5.2.2 - prefix: /usr/bin/ - - pkg-config: - buildable: False - externals: - - spec: pkg-config@0.27.1 - prefix: /usr/bin/ diff --git a/scripts/spack_configs/toss_3_x86_64_ib/spack.yaml b/scripts/spack_configs/toss_3_x86_64_ib/spack.yaml deleted file mode 100644 index cf89682e891..00000000000 --- a/scripts/spack_configs/toss_3_x86_64_ib/spack.yaml +++ /dev/null @@ -1,194 +0,0 @@ -#------------------------------------------------------------------------------------------------------------ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Copyright (c) 2018-2024 Lawrence Livermore National Security LLC -# Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University -# Copyright (c) 2018-2024 TotalEnergies -# Copyright (c) 2019- GEOS/GEOSX Contributors -# All rights reserved -# -# See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. -#------------------------------------------------------------------------------------------------------------ - -# geosx@develop%clang@10.0.0 -# -# Uberenv command to build pygeosx dependencies: -# python3 ./scripts/uberenv/uberenv.py --spec="%clang@10.0.0" - -spack: - config: - install_tree: - root: $spack/.. - projections: - all: '{compiler.name}-{compiler.version}/{name}-{version}-{hash}' - misc_cache: $spack/../misc_cache - test_stage: $spack/../test_stage - build_stage:: - - $spack/../build_stage - - # Regular TPLs do not need views - view: false - - compilers:: - - compiler: - spec: clang@10.0.0 - paths: - cc: /usr/tce/packages/clang/clang-10.0.0/bin/clang - cxx: /usr/tce/packages/clang/clang-10.0.0/bin/clang++ - f77: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran - flags: - cflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.1.0 - cxxflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.1.0 - operating_system: rhel7 - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] - - compiler: - spec: clang@10.0.1 - paths: - cc: /usr/tce/packages/clang/clang-10.0.1/bin/clang - cxx: /usr/tce/packages/clang/clang-10.0.1/bin/clang++ - f77: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran - flags: - cflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.1.0 - cxxflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.1.0 - operating_system: rhel7 - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] - - compiler: - spec: gcc@8.1.0 - paths: - cc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gcc - cxx: /usr/tce/packages/gcc/gcc-8.1.0/bin/g++ - f77: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran - flags: {} - operating_system: rhel7 - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] - - compiler: - spec: intel@19.1.2 - paths: - cc: /usr/tce/packages/intel/intel-19.1.2/bin/icc - cxx: /usr/tce/packages/intel/intel-19.1.2/bin/icpc - f77: /usr/tce/packages/intel/intel-19.1.2/bin/ifort - fc: /usr/tce/packages/intel/intel-19.1.2/bin/ifort - flags: - cflags: -gcc-name=/usr/tce/packages/gcc/gcc-8.3.1/bin/gcc - cxxflags: -gxx-name=/usr/tce/packages/gcc/gcc-8.3.1/bin/g++ - fflags: -gcc-name=/usr/tce/packages/gcc/gcc-8.3.1/bin/gcc - operating_system: rhel7 - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] - - packages: - all: - target: [ivybridge] - compiler: [gcc, clang, intel] - providers: - mpi: [mvapich2] - blas: [intel-mkl] - lapack: [intel-mkl] - - # Lock down which MPI we are using - mvapich2: - buildable: False - externals: - - spec: mvapich2@2.3%gcc@8.3.1 - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-gcc-8.3.1/ - - spec: mvapich2@2.3%clang@10.0.1 - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3-clang-10.0.1 - - # Lock down blas, lapack implementation - intel-mkl: - buildable: False - externals: - - spec: intel-mkl@2020.0.166 threads=openmp - prefix: /usr/tce/packages/mkl/mkl-2020.0/ - - # System level packages to not build - papi: - buildable: False - externals: - - spec: papi@5.5.1 - prefix: /usr/tce/packages/papi/papi-5.5.1/ - cmake: - version: [3.23.1] - buildable: false - externals: - - spec: cmake@3.23.1 - prefix: /usr/tce/packages/cmake/cmake-3.23.1 - readline: - externals: - - spec: readline@7.0 - prefix: /collab/usr/gapps/python/build/spack-toss3.3/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/readline-7.0-e5jqqjmcjknidgwvi353pd6umpixzxr2 - buildable: false - zlib: - buildable: False - externals: - - spec: zlib@1.2.7 - prefix: /usr - m4: - buildable: False - externals: - - spec: m4@1.4.16 - prefix: /usr - perl: - buildable: false - externals: - - spec: perl@5.16.3 - prefix: /usr - pkg-config: - buildable: false - externals: - - spec: pkg-config@0.27.1 - prefix: /usr - diffutils: - buildable: False - externals: - - spec: diffutils@3.3 - prefix: /usr/bin - python: - buildable: False - externals: - - spec: python@3.8.2 - prefix: /usr/tce/packages/python/python-3.8.2/ - py-sphinx: - buildable: False - externals: - - spec: py-sphinx@1.6.3 - prefix: /collab/usr/gapps/python/build/spack-toss3.2/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/python-2.7.14-7rci3jkmuht2uiwp433afigveuf4ocnu/ - autoconf: - buildable: False - externals: - - spec: autoconf@2.69 - prefix: /usr - automake: - buildable: False - externals: - - spec: automake@1.13.4 - prefix: /usr - libtool: - buildable: False - externals: - - spec: libtool@2.4.2 - prefix: /usr - bison: - buildable: False - externals: - - spec: bison@3.0.4 - prefix: /usr - flex: - buildable: False - externals: - - spec: flex@2.5.37 - prefix: /usr diff --git a/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml b/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml deleted file mode 100644 index 7e061aa7e33..00000000000 --- a/scripts/spack_configs/toss_4_x86_64_ib/spack.yaml +++ /dev/null @@ -1,182 +0,0 @@ -#------------------------------------------------------------------------------------------------------------ -# SPDX-License-Identifier: LGPL-2.1-only -# -# Copyright (c) 2018-2024 Lawrence Livermore National Security LLC -# Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University -# Copyright (c) 2018-2024 TotalEnergies -# Copyright (c) 2019- GEOS/GEOSX Contributors -# All rights reserved -# -# See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. -#------------------------------------------------------------------------------------------------------------ - -# geosx@develop%clang@14.0.6 -# geosx@develop%gcc@12.1.1 -# -# Uberenv command to build pygeosx dependencies: -# python3 ./scripts/uberenv/uberenv.py --spec="%clang@14.0.6 +docs" -# -# python3 ./scripts/uberenv/uberenv.py --spec="%gcc@12.1.1 +docs" - -spack: - config: - install_tree: - root: $spack/.. - projections: - all: '{compiler.name}-{compiler.version}/{name}-{version}-{hash}' - misc_cache: $spack/../misc_cache - test_stage: $spack/../test_stage - build_stage:: - - $spack/../build_stage - - # Regular TPLs do not need views - view: false - - compilers:: - - compiler: - spec: clang@14.0.6 - paths: - cc: /usr/tce/packages/clang/clang-14.0.6-magic/bin/clang - cxx: /usr/tce/packages/clang/clang-14.0.6-magic/bin/clang++ - f77: /usr/tce/packages/gcc/gcc-12.1.1-magic/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-12.1.1-magic/bin/gfortran - operating_system: rhel8 - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] - - compiler: - spec: gcc@12.1.1 - paths: - cc: /usr/tce/packages/gcc/gcc-12.1.1-magic/bin/gcc - cxx: /usr/tce/packages/gcc/gcc-12.1.1-magic/bin/g++ - f77: /usr/tce/packages/gcc/gcc-12.1.1-magic/bin/gfortran - fc: /usr/tce/packages/gcc/gcc-12.1.1-magic/bin/gfortran - flags: {} - operating_system: rhel8 - target: x86_64 - modules: [] - environment: {} - extra_rpaths: [] - - packages: - all: - target: [ivybridge] - compiler: [gcc, clang] - providers: - mpi: [mvapich2] - blas: [intel-oneapi-mkl] - lapack: [intel-oneapi-mkl] - - blt: - require: "@git.5a792c1775e7a7628d84dcde31652a689f1df7b5=develop" - - hypre: - require: "@git.57bfb26e268ddf003668c5d0b5938ae258922a83" - - umpire: - require: "@git.4bd9b2ded81d3216b3f62e2aad62d0e34fe2c256=develop" - - raja: - require: "@git.e330b2560747d5417cd7bd265fab3fb91d32ecbd=develop" - - camp: - require: "@git.ac34c25b722a06b138bc045d38bfa5e8fa3ec9c5=main" - - uncrustify: - require: "@git.401a4098bce9dcc47e024987403f2d59d9ba7bd2" - - superlu-dist: - require: "@git.0f6efc377df2440c235452d13d28d2c717f832a1" - - # Lock down which MPI we are using - mvapich2: - buildable: False - externals: - - spec: mvapich2@2.3%gcc@12.1.1 - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-12.1.1-magic - - spec: mvapich2@2.3%clang@14.0.6 - prefix: /usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6-magic - - intel-oneapi-mkl: - externals: - - spec: "intel-oneapi-mkl@2023.2.0" - prefix: /opt/intel/oneapi - buildable: False - - # System level packages to not build - papi: - buildable: False - externals: - - spec: papi@6.0.0.1 - prefix: /usr/tce/packages/papi/papi-6.0.0.1/ - cmake: - version: [3.26.3] - buildable: false - externals: - - spec: cmake@3.26.3 - prefix: /usr/tce/packages/cmake/cmake-3.26.3 - readline: - externals: - - spec: readline@7.0 - prefix: /collab/usr/gapps/python/build/spack-toss3.3/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/readline-7.0-e5jqqjmcjknidgwvi353pd6umpixzxr2 - buildable: false - m4: - buildable: False - externals: - - spec: m4@1.4.18 - prefix: /usr - perl: - buildable: false - externals: - - spec: perl@5.26.3 - prefix: /usr - pkg-config: - buildable: false - externals: - - spec: pkg-config@1.8.0 - prefix: /usr - diffutils: - buildable: False - externals: - - spec: diffutils@3.3 - prefix: /usr/bin - # This needs to be the prefix to the pygeosx LC installation - # or system install with pygeosx dependencies - python: - buildable: False - externals: - - spec: python@3.10.8 - prefix: /usr/gapps/GEOSX/thirdPartyLibs/python/quartz-gcc-python/python/ - # This needs to be the prefix to the pygeosx LC installation - # or system install with pygeosx dependencies - py-sphinx: - buildable: False - externals: - - spec: py-sphinx@1.6.3 - prefix: /usr/gapps/GEOSX/thirdPartyLibs/python/quartz-gcc-python/python/ - autoconf: - buildable: False - externals: - - spec: autoconf@2.69 - prefix: /usr - automake: - buildable: False - externals: - - spec: automake@1.16.1 - prefix: /usr - libtool: - buildable: False - externals: - - spec: libtool@2.4.6 - prefix: /usr - bison: - buildable: False - externals: - - spec: bison@3.0.4 - prefix: /usr - flex: - buildable: False - externals: - - spec: flex@2.6.1 - prefix: /usr diff --git a/scripts/spack_packages/packages/chai/package.py b/scripts/spack_packages/packages/chai/package.py deleted file mode 100644 index 6ce16a6a510..00000000000 --- a/scripts/spack_packages/packages/chai/package.py +++ /dev/null @@ -1,198 +0,0 @@ -# Copyright 2013-2023 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 socket - -from spack.package import * - - -class Chai(CachedCMakePackage, CudaPackage, ROCmPackage): - """ - Copy-hiding array interface for data migration between memory spaces - """ - - homepage = "https://github.com/LLNL/CHAI" - git = "https://github.com/LLNL/CHAI.git" - tags = ["ecp", "e4s", "radiuss"] - - maintainers("davidbeckingsale") - - # GEOS_EDIT_START - version("2023.06.0", tag="v2023.06.0", submodules=False) - # GEOS_EDIT_END - - version("develop", branch="develop", submodules=False) - version("main", branch="main", submodules=False) - version("2022.03.0", tag="v2022.03.0", submodules=False) - version("2.4.0", tag="v2.4.0", submodules=True) - version("2.3.0", tag="v2.3.0", submodules=True) - version("2.2.2", tag="v2.2.2", submodules=True) - version("2.2.1", tag="v2.2.1", submodules=True) - version("2.2.0", tag="v2.2.0", submodules=True) - version("2.1.1", tag="v2.1.1", submodules=True) - version("2.1.0", tag="v2.1.0", submodules=True) - version("2.0.0", tag="v2.0.0", submodules=True) - version("1.2.0", tag="v1.2.0", submodules=True) - version("1.1.0", tag="v1.1.0", submodules=True) - version("1.0", tag="v1.0", submodules=True) - - variant("enable_pick", default=False, description="Enable pick method") - variant("shared", default=True, description="Build Shared Libs") - variant("raja", default=False, description="Build plugin for RAJA") - variant("benchmarks", default=False, description="Build benchmarks.") - variant("examples", default=True, description="Build examples.") - variant("openmp", default=False, description="Build using OpenMP") - # TODO: figure out gtest dependency and then set this default True - # and remove the +tests conflict below. - variant("tests", default=False, description="Build tests") - - depends_on("cmake@3.8:", type="build") - depends_on("cmake@3.9:", type="build", when="+cuda") - depends_on("cmake@3.14:", when="@2022.03.0:") - - # GEOS_EDIT_START - depends_on("blt@0.5.3:", type="build", when="@2023.06.0:") - # # GEOS_EDIT_END - depends_on("blt@0.5.0:", type="build", when="@2022.03.0:") - depends_on("blt@0.4.1:", type="build", when="@2.4.0:") - depends_on("blt@0.4.0:", type="build", when="@2.3.0") - depends_on("blt@0.3.6:", type="build", when="@:2.2.2") - - depends_on("umpire") - # GEOS_EDIT_START - depends_on("umpire@2023.06.0:", when="@2023.06.0:") - # GEOS_EDIT_END - depends_on("umpire@2022.03.0:", when="@2022.03.0:") - depends_on("umpire@6.0.0", when="@2.4.0") - depends_on("umpire@4.1.2", when="@2.2.0:2.3.0") - depends_on("umpire@main", when="@main") - - with when("+cuda"): - depends_on("umpire+cuda") - for sm_ in CudaPackage.cuda_arch_values: - depends_on("umpire+cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) - - with when("+rocm"): - depends_on("umpire+rocm") - for arch in ROCmPackage.amdgpu_targets: - depends_on( - "umpire+rocm amdgpu_target={0}".format(arch), when="amdgpu_target={0}".format(arch) - ) - - with when("+raja"): - depends_on("raja~openmp", when="~openmp") - depends_on("raja+openmp", when="+openmp") - depends_on("raja@0.14.0", when="@2.4.0") - depends_on("raja@0.13.0", when="@2.3.0") - depends_on("raja@0.12.0", when="@2.2.0:2.2.2") - depends_on("raja@2022.03.0:", when="@2022.03.0:") - # GEOS_EDIT_START - depends_on("raja@2023.06.0:", when="@2023.06.0:") - # GEOS_EDIT_END - depends_on("raja@main", when="@main") - - with when("+cuda"): - depends_on("raja+cuda") - for sm_ in CudaPackage.cuda_arch_values: - depends_on("raja+cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) - with when("+rocm"): - depends_on("raja+rocm") - for arch in ROCmPackage.amdgpu_targets: - depends_on( - "raja+rocm amdgpu_target={0}".format(arch), - when="amdgpu_target={0}".format(arch), - ) - - conflicts("+benchmarks", when="~tests") - - def _get_sys_type(self, spec): - sys_type = spec.architecture - if "SYS_TYPE" in env: - sys_type = env["SYS_TYPE"] - return sys_type - - @property - def cache_name(self): - hostname = socket.gethostname() - if "SYS_TYPE" in env: - hostname = hostname.rstrip("1234567890") - return "{0}-{1}-{2}@{3}.cmake".format( - hostname, - self._get_sys_type(self.spec), - self.spec.compiler.name, - self.spec.compiler.version, - ) - - def initconfig_compiler_entries(self): - spec = self.spec - entries = super(Chai, self).initconfig_compiler_entries() - if "+rocm" in spec: - entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc)) - return entries - - def initconfig_hardware_entries(self): - spec = self.spec - entries = super(Chai, self).initconfig_hardware_entries() - - entries.append(cmake_cache_option("ENABLE_OPENMP", "+openmp" in spec)) - - if "+cuda" in spec: - entries.append(cmake_cache_option("ENABLE_CUDA", True)) - # GEOS_EDIT_START - #entries.append(cmake_cache_option("CMAKE_CUDA_SEPARABLE_COMPILATION", True)) - #entries.append(cmake_cache_option("CUDA_SEPARABLE_COMPILATION", True)) - # GEOS_EDIT_END - - if not spec.satisfies("cuda_arch=none"): - cuda_arch = spec.variants["cuda_arch"].value - entries.append(cmake_cache_string("CUDA_ARCH", "sm_{0}".format(cuda_arch[0]))) - entries.append( - cmake_cache_string("CMAKE_CUDA_ARCHITECTURES", "{0}".format(cuda_arch[0])) - ) - flag = "-arch sm_{0}".format(cuda_arch[0]) - entries.append(cmake_cache_string("CMAKE_CUDA_FLAGS", "{0}".format(flag))) - else: - entries.append(cmake_cache_option("ENABLE_CUDA", False)) - - if "+rocm" in spec: - entries.append(cmake_cache_option("ENABLE_HIP", True)) - entries.append(cmake_cache_path("HIP_ROOT_DIR", "{0}".format(spec["hip"].prefix))) - archs = self.spec.variants["amdgpu_target"].value - if archs != "none": - arch_str = ",".join(archs) - entries.append( - cmake_cache_string("HIP_HIPCC_FLAGS", "--amdgpu-target={0}".format(arch_str)) - ) - else: - entries.append(cmake_cache_option("ENABLE_HIP", False)) - - return entries - - def initconfig_package_entries(self): - spec = self.spec - entries = [] - - option_prefix = "CHAI_" if spec.satisfies("@2022.03.0:") else "" - - entries.append(cmake_cache_path("BLT_SOURCE_DIR", spec["blt"].prefix)) - if "+raja" in spec: - entries.append(cmake_cache_option("{}ENABLE_RAJA_PLUGIN".format(option_prefix), True)) - entries.append(cmake_cache_path("RAJA_DIR", spec["raja"].prefix)) - entries.append( - cmake_cache_option("{}ENABLE_PICK".format(option_prefix), "+enable_pick" in spec) - ) - entries.append(cmake_cache_path("umpire_DIR", spec["umpire"].prefix.share.umpire.cmake)) - entries.append(cmake_cache_option("ENABLE_TESTS", "+tests" in spec)) - entries.append(cmake_cache_option("ENABLE_BENCHMARKS", "+benchmarks" in spec)) - entries.append( - cmake_cache_option("{}ENABLE_EXAMPLES".format(option_prefix), "+examples" in spec) - ) - entries.append(cmake_cache_option("BUILD_SHARED_LIBS", "+shared" in spec)) - - return entries - - def cmake_args(self): - options = [] - return options diff --git a/scripts/spack_packages/packages/essl/package.py b/scripts/spack_packages/packages/essl/package.py deleted file mode 100644 index 0a4377ff49a..00000000000 --- a/scripts/spack_packages/packages/essl/package.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2013-2022 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 * - - -# Recipe for pre-built essl library on blueos machines. -# Defines additonal flags for blueos: -# https://lc.llnl.gov/confluence/display/SIERRA/Math+Libraries -class Essl(BundlePackage): - """IBM's Engineering and Scientific Subroutine Library (ESSL).""" - - homepage = "https://www.ibm.com/systems/power/software/essl/" - - version("6.3.0.2") - - provides("blas") - provides("lapack") - - @property - def blas_libs(self): - spec = self.spec - prefix = self.prefix - - essl_root = prefix.lib64 - essl_libs = ["libesslsmpcuda", "liblapackforessl", "liblapackforessl_"] - all_libs = find_libraries(essl_libs, root=essl_root, shared=True) - - cuda_toolkit_root = "/usr/tce/packages/cuda/cuda-11.8.0/lib64" - cuda_libs = ["libcublas", "libcudart", "libcublasLt"] - all_libs += find_libraries(cuda_libs, root=cuda_toolkit_root, shared=True) - - return all_libs - - @property - def lapack_libs(self): - spec = self.spec - prefix = self.prefix - - essl_root = prefix.lib64 - essl_libs = ["libesslsmpcuda", "liblapackforessl", "liblapackforessl_"] - all_libs = find_libraries(essl_libs, root=essl_root, shared=True) - - cuda_toolkit_root = "/usr/tce/packages/cuda/cuda-11.8.0/lib64" - cuda_libs = ["libcublas", "libcudart", "libcublasLt"] - all_libs += find_libraries(cuda_libs, root=cuda_toolkit_root, shared=True) - - return all_libs diff --git a/scripts/spack_packages/packages/fesapi/package.py b/scripts/spack_packages/packages/fesapi/package.py deleted file mode 100644 index 6e95779990f..00000000000 --- a/scripts/spack_packages/packages/fesapi/package.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2013-2022 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 -import sys - -from spack.package import * - - -class Fesapi(CMakePackage): - - url = "https://github.com/F2I-Consulting/fesapi/archive/refs/tags/v2.4.0.0.tar.gz" - git = "https://github.com/F2I-Consulting/fesapi.git" - - version("2.4.0.0", sha256="a711e8a1218c876a2799f4d05a9820da71eb5503b5d51b834fae98d9fe635381") - - depends_on("hdf5") - depends_on("boost@1.67.0") - depends_on("minizip") - - def cmake_args(self): - spec = self.spec - - cppflags = " ".join(spec.compiler_flags["cppflags"]) - cxxflags = cppflags + " ".join(spec.compiler_flags["cxxflags"]) - cmake_args = [ - self.define('CMAKE_C_COMPILER', spec['mpi'].mpicc), - self.define('CMAKE_CXX_COMPILER', spec['mpi'].mpicxx), - self.define('CMAKE_CXX_FLAGS', cxxflags), - self.define('HDF5_ROOT', spec['hdf5'].prefix), - # fesAPI/spack can detect wrong version otherwise - self.define('HDF5_VERSION', spec['hdf5'].version), - self.define('MINIZIP_INCLUDE_DIR', spec['minizip'].prefix.include + "/minizip"), - self.define('MINIZIP_LIBRARY_RELEASE', spec['minizip'].prefix.lib), - self.define('Boost_INCLUDE_DIR', spec['boost'].prefix.include), - "-DWITH_EXAMPLE:BOOL=OFF", - "-DWITH_DOTNET_WRAPPING:BOOL=OFF", - "-DWITH_JAVA_WRAPPING:BOOL=OFF", - "-DWITH_PYTHON_WRAPPING:BOOL=OFF", - "-DWITH_RESQML2_2:BOOL=OFF", - "-DWITH_TEST:BOOL=OFF", - ] - - return cmake_args diff --git a/scripts/spack_packages/packages/geosx/package.py b/scripts/spack_packages/packages/geosx/package.py deleted file mode 100644 index 0fafded6d37..00000000000 --- a/scripts/spack_packages/packages/geosx/package.py +++ /dev/null @@ -1,709 +0,0 @@ -# Copyright 2013-2023 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 import * -import warnings - -import socket -import os - -from os import environ as env -from os.path import join as pjoin - -# Tested specs are located at scripts/spack_configs/<$SYS_TYPE>/spack.yaml (e.g. %clang@10.0.1) - -# WARNING: +petsc variant is yet to be tested. - - -def cmake_cache_entry(name, value, comment=""): - """Generate a string for a cmake cache variable""" - - return 'set(%s "%s" CACHE PATH "%s")\n\n' % (name, value, comment) - - -def cmake_cache_list(name, value, comment=""): - """Generate a list for a cmake cache variable""" - - indent = 5 + len(name) - join_str = '\n' + ' ' * indent - return 'set(%s %s CACHE STRING "%s")\n\n' % (name, join_str.join(value), comment) - - -def cmake_cache_string(name, string, comment=""): - """Generate a string for a cmake cache variable""" - - return 'set(%s "%s" CACHE STRING "%s")\n\n' % (name, string, comment) - - -def cmake_cache_option(name, boolean_value, comment=""): - """Generate a string for a cmake configuration option""" - - value = "ON" if boolean_value else "OFF" - return 'set(%s %s CACHE BOOL "%s")\n\n' % (name, value, comment) - - -class Geosx(CMakePackage, CudaPackage): - """GEOSX simulation framework.""" - - homepage = "https://github.com/GEOS-DEV/GEOS" - git = "https://github.com/GEOS-DEV/GEOS.git" - - # GEOSX needs submodules to build, but not necessary to build dependencies - version('develop', branch='develop') - - # SPHINX_BEGIN_VARIANTS - - variant('shared', default=True, description='Build Shared Libs.') - variant('caliper', default=True, description='Build Caliper support.') - variant('vtk', default=True, description='Build VTK support.') - variant('fesapi', default=False, description='Build fesapi support.') - variant('trilinos', default=True, description='Build Trilinos support.') - variant('hypre', default=True, description='Build HYPRE support.') - variant('petsc', default=False, description='Build PETSc support.') - variant('scotch', default=True, description='Build Scotch support.') - variant('uncrustify', default=True, description='Build Uncrustify support.') - variant('lai', - default='hypre', - description='Linear algebra interface.', - values=('trilinos', 'hypre', 'petsc'), - multi=False) - variant('pygeosx', default=True, description='Enable pygeosx.') - - # SPHINX_END_VARIANTS - - # variant('tests', default=True, description='Build tests') - # variant('benchmarks', default=False, description='Build benchmarks') - # variant('examples', default=False, description='Build examples') - - variant('docs', default=False, description='Build docs') - variant('addr2line', default=True, - description='Add support for addr2line.') - - # SPHINX_BEGIN_DEPENDS - - depends_on('cmake@3.23:', type='build') - - depends_on('blt') - - # - # Virtual packages - # - depends_on('mpi') - depends_on('blas') - depends_on('lapack') - - # - # Performance portability - # - depends_on('raja +openmp~examples~exercises~shared') - - depends_on('umpire +c+openmp~examples+fortran~device_alloc~shared') - - depends_on('chai@2023.06.0 +raja+openmp~examples~shared') - - depends_on('camp') - - with when('+cuda'): - for sm_ in CudaPackage.cuda_arch_values: - depends_on('raja+cuda cuda_arch={0}'.format(sm_), when='cuda_arch={0}'.format(sm_)) - depends_on('umpire+cuda cuda_arch={0}'.format(sm_), when='cuda_arch={0}'.format(sm_)) - depends_on('chai+cuda cuda_arch={0}'.format(sm_), when='cuda_arch={0}'.format(sm_)) - depends_on('camp+cuda cuda_arch={0}'.format(sm_), when='cuda_arch={0}'.format(sm_)) - - # - # IO - # - depends_on('hdf5@1.12.1') - depends_on('silo@4.11~fortran') - - depends_on('conduit@0.8.2~test~fortran~hdf5_compat') - - depends_on('adiak@0.2.2', when='+caliper') - depends_on('caliper@2.10.0~gotcha~sampler~libunwind~libdw', when='+caliper') - - depends_on('pugixml@1.13') - - depends_on('fmt@10.0.0 cxxstd=14') - depends_on('vtk@9.2.6', when='+vtk') - - depends_on('fesapi', when='+fesapi') - - # - # Math - # - depends_on('parmetis@4.0.3+int64') - - depends_on('superlu-dist +int64+openmp') - - depends_on('scotch@7.0.3 +mpi +int64', when='+scotch') - - depends_on('suite-sparse@5.10.1+openmp') - - trilinos_build_options = '+openmp' - trilinos_packages = '+aztec+stratimikos~amesos2~anasazi~belos~ifpack2~muelu~sacado+thyra' - depends_on('trilinos@13.4.1 ' + trilinos_build_options + trilinos_packages, when='+trilinos') - - depends_on("hypre +superlu-dist+mixedint+mpi+openmp", when='+hypre~cuda') - - depends_on("hypre +cuda+superlu-dist+mixedint+mpi+openmp+umpire+unified-memory cxxflags='-fPIC'", when='+hypre+cuda') - with when('+cuda'): - for sm_ in CudaPackage.cuda_arch_values: - depends_on('hypre+cuda cuda_arch={0}'.format(sm_), when='cuda_arch={0}'.format(sm_)) - - depends_on('petsc@3.13.0~hdf5~hypre+int64', when='+petsc') - depends_on('petsc+ptscotch', when='+petsc+scotch') - - # - # Python - # - depends_on('python') - - - # - # Dev tools - # - depends_on('uncrustify', when='+uncrustify') - - # - # Documentation - # - depends_on('doxygen@1.8.20', when='+docs', type='build') - depends_on('py-sphinx@1.6.3:', when='+docs', type='build') - - # SPHINX_END_DEPENDS - - # - # Conflicts - # - conflicts('~trilinos lai=trilinos', msg='To use Trilinos as the Linear Algebra Interface you must build it.') - conflicts('~hypre lai=hypre', msg='To use HYPRE as the Linear Algebra Interface you must build it.') - conflicts('~petsc lai=petsc', msg='To use PETSc as the Linear Algebra Interface you must build it.') - - # Only phases necessary for building dependencies and generate host configs - phases = ['geos_hostconfig', 'lvarray_hostconfig'] - #phases = ['hostconfig', 'cmake', 'build', 'install'] - - @run_after('build') - @on_package_attributes(run_tests=True) - def check(self): - """ - Searches the CMake-generated Makefile for the target ``test`` - and runs it if found. - """ - with working_dir(self.build_directory): - ctest('-V', '--force-new-ctest-process', '-j 1') - - @run_after('build') - def build_docs(self): - if '+docs' in self.spec: - with working_dir(self.build_directory): - make('docs') - - def _get_sys_type(self, spec): - sys_type = str(spec.architecture) - # if on llnl systems, we can use the SYS_TYPE - if "SYS_TYPE" in env: - sys_type = env["SYS_TYPE"] - return sys_type - - def _get_host_config_path(self, spec, lvarray=False): - var = '' - if '+cuda' in spec: - var = '-'.join([var, 'cuda']) - - hostname = socket.gethostname().rstrip('1234567890') - - if lvarray: - hostname = "lvarray-" + hostname - - host_config_path = "%s-%s-%s%s.cmake" % (hostname, self._get_sys_type(spec), (str(spec.compiler)).replace('=',''), var) - - dest_dir = self.stage.source_path - host_config_path = os.path.abspath(pjoin(dest_dir, host_config_path)) - return host_config_path - - def geos_hostconfig(self, spec, prefix, py_site_pkgs_dir=None): - """ - This method creates a 'host-config' file that specifies - all of the options used to configure and build GEOSX. - - Note: - The `py_site_pkgs_dir` arg exists to allow a package that - subclasses this package provide a specific site packages - dir when calling this function. `py_site_pkgs_dir` should - be an absolute path or `None`. - - This is necessary because the spack `site_packages_dir` - var will not exist in the base class. For more details - on this issue see: https://github.com/spack/spack/issues/6261 - """ - - ####################### - # Compiler Info - ####################### - c_compiler = env["SPACK_CC"] - cpp_compiler = env["SPACK_CXX"] - - ####################################################################### - # By directly fetching the names of the actual compilers we appear - # to doing something evil here, but this is necessary to create a - # 'host config' file that works outside of the spack install env. - ####################################################################### - - sys_type = self._get_sys_type(spec) - - ############################################## - # Find and record what CMake is used - ############################################## - - cmake_exe = spec['cmake'].command.path - cmake_exe = os.path.realpath(cmake_exe) - - host_config_path = self._get_host_config_path(spec) - with open(host_config_path, "w") as cfg: - cfg.write("#{0}\n".format("#" * 80)) - cfg.write("# Generated host-config - Edit at own risk!\n") - cfg.write("#{0}\n".format("#" * 80)) - - cfg.write("#{0}\n".format("-" * 80)) - cfg.write("# SYS_TYPE: {0}\n".format(sys_type)) - cfg.write("# Compiler Spec: {0}\n".format(spec.compiler)) - cfg.write("# CMake executable path: %s\n" % cmake_exe) - cfg.write("#{0}\n\n".format("-" * 80)) - - ####################### - # Compiler Settings - ####################### - - cfg.write("#{0}\n".format("-" * 80)) - cfg.write("# Compilers\n") - cfg.write("#{0}\n\n".format("-" * 80)) - cfg.write(cmake_cache_entry("CMAKE_C_COMPILER", c_compiler)) - cflags = ' '.join(spec.compiler_flags['cflags']) - if cflags: - cfg.write(cmake_cache_entry("CMAKE_C_FLAGS", cflags)) - - cfg.write(cmake_cache_entry("CMAKE_CXX_COMPILER", cpp_compiler)) - cxxflags = ' '.join(spec.compiler_flags['cxxflags']) - if cxxflags: - cfg.write(cmake_cache_entry("CMAKE_CXX_FLAGS", cxxflags)) - - release_flags = "-O3 -DNDEBUG" - cfg.write(cmake_cache_string("CMAKE_CXX_FLAGS_RELEASE", release_flags)) - reldebinf_flags = "-O3 -g -DNDEBUG" - cfg.write(cmake_cache_string("CMAKE_CXX_FLAGS_RELWITHDEBINFO", reldebinf_flags)) - debug_flags = "-O0 -g" - cfg.write(cmake_cache_string("CMAKE_CXX_FLAGS_DEBUG", debug_flags)) - - if "%clang arch=linux-rhel7-ppc64le" in spec: - cfg.write(cmake_cache_entry("CMAKE_EXE_LINKER_FLAGS", "-Wl,--no-toc-optimize")) - - cfg.write("#{0}\n".format("-" * 80)) - cfg.write("# CMake Standard\n") - cfg.write("#{0}\n\n".format("-" * 80)) - - cfg.write(cmake_cache_string("BLT_CXX_STD", "c++17")) - - cfg.write("#{0}\n".format("-" * 80)) - cfg.write("# MPI\n") - cfg.write("#{0}\n\n".format("-" * 80)) - - cfg.write(cmake_cache_option('ENABLE_MPI', True)) - cfg.write(cmake_cache_entry('MPI_C_COMPILER', spec['mpi'].mpicc)) - cfg.write(cmake_cache_entry('MPI_CXX_COMPILER', spec['mpi'].mpicxx)) - - if sys_type in ('linux-rhel7-ppc64le', 'linux-rhel8-ppc64le', 'blueos_3_ppc64le_ib_p9'): - cfg.write(cmake_cache_option('ENABLE_WRAP_ALL_TESTS_WITH_MPIEXEC', True)) - if socket.gethostname().rstrip('1234567890') == "lassen": - cfg.write(cmake_cache_entry('MPIEXEC', 'lrun')) - cfg.write(cmake_cache_entry('MPIEXEC_NUMPROC_FLAG', '-n')) - else: - cfg.write(cmake_cache_entry('MPIEXEC', 'jsrun')) - cfg.write(cmake_cache_list('MPIEXEC_NUMPROC_FLAG', ['-g1', '--bind', 'rs', '-n'])) - - cfg.write("#{0}\n".format("-" * 80)) - cfg.write("# OpenMP\n") - cfg.write("#{0}\n\n".format("-" * 80)) - - cfg.write(cmake_cache_option('ENABLE_OPENMP', True)) - - cfg.write('#{0}\n'.format('-' * 80)) - cfg.write('# Cuda\n') - cfg.write('#{0}\n\n'.format('-' * 80)) - if '+cuda' in spec: - cfg.write(cmake_cache_option('ENABLE_CUDA', True)) - cfg.write(cmake_cache_entry('CMAKE_CUDA_STANDARD', 17)) - - cudatoolkitdir = spec['cuda'].prefix - cfg.write(cmake_cache_entry('CUDA_TOOLKIT_ROOT_DIR', cudatoolkitdir)) - cudacompiler = '${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc' - cfg.write(cmake_cache_entry('CMAKE_CUDA_COMPILER', cudacompiler)) - - cmake_cuda_flags = ('-restrict --expt-extended-lambda -Werror ' - 'cross-execution-space-call,reorder,' - 'deprecated-declarations') - - archSpecifiers = ('-mtune', '-mcpu', '-march', '-qtune', '-qarch') - for archSpecifier in archSpecifiers: - for compilerArg in spec.compiler_flags['cxxflags']: - if compilerArg.startswith(archSpecifier): - cmake_cuda_flags += ' -Xcompiler ' + compilerArg - - if not spec.satisfies('cuda_arch=none'): - cuda_arch = spec.variants['cuda_arch'].value - cmake_cuda_flags += ' -arch sm_{0}'.format(cuda_arch[0]) - cfg.write(cmake_cache_string('CMAKE_CUDA_ARCHITECTURES', cuda_arch[0])) - - cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS', cmake_cuda_flags)) - - cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_RELEASE', '-O3 -DNDEBUG -Xcompiler -DNDEBUG -Xcompiler -O3 -Xcompiler -mcpu=powerpc64le -Xcompiler -mtune=powerpc64le')) - cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_RELWITHDEBINFO', '-g -lineinfo ${CMAKE_CUDA_FLAGS_RELEASE}')) - cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_DEBUG', '-g -G -O0 -Xcompiler -O0')) - - else: - cfg.write(cmake_cache_option('ENABLE_CUDA', False)) - - cfg.write('#{0}\n'.format('-' * 80)) - cfg.write('# Performance Portability TPLs\n') - cfg.write('#{0}\n\n'.format('-' * 80)) - - cfg.write(cmake_cache_option('ENABLE_CHAI', True)) - cfg.write(cmake_cache_entry('CHAI_DIR', spec['chai'].prefix)) - - cfg.write(cmake_cache_entry('RAJA_DIR', spec['raja'].prefix)) - - cfg.write(cmake_cache_option('ENABLE_UMPIRE', True)) - cfg.write(cmake_cache_entry('UMPIRE_DIR', spec['umpire'].prefix)) - - cfg.write(cmake_cache_entry('CAMP_DIR', spec['camp'].prefix)) - - # yapf: disable - io_tpls = ( - ('hdf5', 'HDF5', True), - ('conduit', 'CONDUIT', True), - ('silo', 'SILO', True), - ('pugixml', 'PUGIXML', True), - ('vtk', 'VTK', '+vtk' in spec), - ('fesapi', 'FESAPI', '+fesapi' in spec), - ('fmt', 'FMT', True) - ) - # yapf: enable - - cfg.write('#{0}\n'.format('-' * 80)) - cfg.write('# IO TPLs\n') - cfg.write('#{0}\n\n'.format('-' * 80)) - - if '+caliper' in spec: - cfg.write(cmake_cache_option('ENABLE_CALIPER', True)) - cfg.write(cmake_cache_entry('CALIPER_DIR', spec['caliper'].prefix)) - cfg.write(cmake_cache_entry('adiak_DIR', spec['adiak'].prefix + '/lib/cmake/adiak')) - - for tpl, cmake_name, enable in io_tpls: - if enable: - cfg.write(cmake_cache_entry('{}_DIR'.format(cmake_name), spec[tpl].prefix)) - else: - cfg.write(cmake_cache_option('ENABLE_{}'.format(cmake_name), False)) - - cfg.write('#{0}\n'.format('-' * 80)) - cfg.write('# System Math Libraries\n') - cfg.write('#{0}\n\n'.format('-' * 80)) - if '+intel-oneapi-mkl' in spec: - cfg.write(cmake_cache_option('ENABLE_MKL', True)) - cfg.write(cmake_cache_entry('MKL_INCLUDE_DIRS', spec['intel-oneapi-mkl'].prefix.include)) - cfg.write(cmake_cache_list('MKL_LIBRARIES', spec['intel-oneapi-mkl'].libs)) - elif '+mkl' in spec: - cfg.write(cmake_cache_option('ENABLE_MKL', True)) - cfg.write(cmake_cache_entry('MKL_INCLUDE_DIRS', spec['intel-mkl'].prefix.include)) - cfg.write(cmake_cache_list('MKL_LIBRARIES', spec['intel-mkl'].libs)) - elif '+essl' in spec: - cfg.write(cmake_cache_option('ENABLE_ESSL', True)) - cfg.write(cmake_cache_entry('ESSL_INCLUDE_DIRS', spec['essl'].prefix.include)) - cfg.write(cmake_cache_list('ESSL_LIBRARIES', spec['essl'].libs + spec['cuda'].libs)) - - cfg.write(cmake_cache_option('FORTRAN_MANGLE_NO_UNDERSCORE', True)) - else: - cfg.write(cmake_cache_list('BLAS_LIBRARIES', spec['blas'].libs)) - cfg.write(cmake_cache_list('LAPACK_LIBRARIES', spec['lapack'].libs)) - - # yapf: disable - math_tpls = ( - ('metis', 'METIS', True), - ('parmetis', 'PARMETIS', True), - ('scotch', 'SCOTCH', '+scotch' in spec), - ('superlu-dist', 'SUPERLU_DIST', True), - ('suite-sparse', 'SUITESPARSE', True), - ('trilinos', 'TRILINOS', '+trilinos' in spec), - ('hypre', 'HYPRE', '+hypre' in spec), - ('petsc', 'PETSC', '+petsc' in spec) - ) - # yapf: enable - - cfg.write('#{0}\n'.format('-' * 80)) - cfg.write('# Math TPLs\n') - cfg.write('#{0}\n\n'.format('-' * 80)) - for tpl, cmake_name, enable in math_tpls: - if enable: - cfg.write(cmake_cache_entry('{}_DIR'.format(cmake_name), spec[tpl].prefix)) - - if tpl == 'hypre' and '+cuda' in spec: - cfg.write(cmake_cache_string('ENABLE_HYPRE_DEVICE', "CUDA")) - elif tpl == 'hypre' and '+hip' in spec: - cfg.write(cmake_cache_string('ENABLE_HYPRE_DEVICE', "HIP")) - else: - cfg.write(cmake_cache_option('ENABLE_{}'.format(cmake_name), False)) - - if '+caliper' in spec and '+hypre' in spec and '+cuda' not in spec: - cfg.write(cmake_cache_option('ENABLE_CALIPER_HYPRE', True)) - - if 'lai=trilinos' in spec: - cfg.write(cmake_cache_entry('GEOS_LA_INTERFACE', 'Trilinos')) - if 'lai=hypre' in spec: - cfg.write(cmake_cache_entry('GEOS_LA_INTERFACE', 'Hypre')) - if 'lai=petsc' in spec: - cfg.write(cmake_cache_entry('GEOS_LA_INTERFACE', 'Petsc')) - - cfg.write('#{0}\n'.format('-' * 80)) - cfg.write('# Python\n') - cfg.write('#{0}\n\n'.format('-' * 80)) - - cfg.write(cmake_cache_entry('Python3_ROOT_DIR', os.path.join(spec['python'].prefix))) - cfg.write(cmake_cache_entry('Python3_EXECUTABLE', os.path.join(spec['python'].prefix.bin, 'python3'))) - - if '+pygeosx' in spec: - cfg.write(cmake_cache_option('ENABLE_PYGEOSX', True)) - else: - cfg.write(cmake_cache_option('ENABLE_PYGEOSX', False)) - - cfg.write('#{0}\n'.format('-' * 80)) - cfg.write('# Documentation\n') - cfg.write('#{0}\n\n'.format('-' * 80)) - if '+docs' in spec: - sphinx_bin_dir = spec['py-sphinx'].prefix.bin - cfg.write(cmake_cache_entry('SPHINX_EXECUTABLE', os.path.join(sphinx_bin_dir, 'sphinx-build'))) - - doxygen_bin_dir = spec['doxygen'].prefix.bin - cfg.write(cmake_cache_entry('DOXYGEN_EXECUTABLE', os.path.join(doxygen_bin_dir, 'doxygen'))) - else: - cfg.write(cmake_cache_option('ENABLE_DOCS', False)) - cfg.write(cmake_cache_option('ENABLE_DOXYGEN', False)) - cfg.write(cmake_cache_option('ENABLE_SPHINX', False)) - - cfg.write('#{0}\n'.format('-' * 80)) - cfg.write('# Development tools\n') - cfg.write('#{0}\n\n'.format('-' * 80)) - - cfg.write(cmake_cache_option('ENABLE_UNCRUSTIFY', '+uncrustify' in spec)) - if '+uncrustify' in spec: - cfg.write( - cmake_cache_entry('UNCRUSTIFY_EXECUTABLE', os.path.join(spec['uncrustify'].prefix.bin, 'uncrustify'))) - - if '+addr2line' in spec: - cfg.write('#{0}\n'.format('-' * 80)) - cfg.write('# addr2line\n') - cfg.write('#{0}\n\n'.format('-' * 80)) - cfg.write(cmake_cache_option('ENABLE_ADDR2LINE', True)) - cfg.write(cmake_cache_entry('ADDR2LINE_EXEC ', '/usr/bin/addr2line')) - - cfg.write('#{0}\n'.format('-' * 80)) - cfg.write('# Other\n') - cfg.write('#{0}\n\n'.format('-' * 80)) - - cfg.write(cmake_cache_option('ENABLE_MATHPRESSO', False)) - cfg.write(cmake_cache_option('ENABLE_XML_UPDATES', False)) - - # ATS - # Lassen - if sys_type in ('blueos_3_ppc64le_ib_p9'): - cfg.write(cmake_cache_string('ATS_ARGUMENTS', '--ats jsrun_omp --ats jsrun_bind=packed')) - # Quartz - if sys_type in ('toss_4_x86_64_ib'): - cfg.write(cmake_cache_string('ATS_ARGUMENTS', '--machine slurm36')) - - def lvarray_hostconfig(self, spec, prefix, py_site_pkgs_dir=None): - """ - This method creates a 'host-config' file that specifies - all of the options used to configure and build LvArray. - - Note: - The `py_site_pkgs_dir` arg exists to allow a package that - subclasses this package provide a specific site packages - dir when calling this function. `py_site_pkgs_dir` should - be an absolute path or `None`. - - This is necessary because the spack `site_packages_dir` - var will not exist in the base class. For more details - on this issue see: https://github.com/spack/spack/issues/6261 - """ - - ####################### - # Compiler Info - ####################### - c_compiler = env["SPACK_CC"] - cpp_compiler = env["SPACK_CXX"] - - ####################################################################### - # By directly fetching the names of the actual compilers we appear - # to doing something evil here, but this is necessary to create a - # 'host config' file that works outside of the spack install env. - ####################################################################### - - sys_type = self._get_sys_type(spec) - - ############################################## - # Find and record what CMake is used - ############################################## - - cmake_exe = spec['cmake'].command.path - cmake_exe = os.path.realpath(cmake_exe) - - host_config_path = self._get_host_config_path(spec, lvarray=True) - with open(host_config_path, "w") as cfg: - cfg.write("#{0}\n".format("#" * 80)) - cfg.write("# Generated host-config - Edit at own risk!\n") - cfg.write("#{0}\n".format("#" * 80)) - - cfg.write("#{0}\n".format("-" * 80)) - cfg.write("# SYS_TYPE: {0}\n".format(sys_type)) - cfg.write("# Compiler Spec: {0}\n".format(spec.compiler)) - cfg.write("# CMake executable path: %s\n" % cmake_exe) - cfg.write("#{0}\n\n".format("-" * 80)) - - ####################### - # Compiler Settings - ####################### - - cfg.write("#{0}\n".format("-" * 80)) - cfg.write("# Compilers\n") - cfg.write("#{0}\n\n".format("-" * 80)) - cfg.write(cmake_cache_entry("CMAKE_C_COMPILER", c_compiler)) - cflags = ' '.join(spec.compiler_flags['cflags']) - if cflags: - cfg.write(cmake_cache_entry("CMAKE_C_FLAGS", cflags)) - - cfg.write(cmake_cache_entry("CMAKE_CXX_COMPILER", cpp_compiler)) - cxxflags = ' '.join(spec.compiler_flags['cxxflags']) - if cxxflags: - cfg.write(cmake_cache_entry("CMAKE_CXX_FLAGS", cxxflags)) - - release_flags = "-O3 -DNDEBUG" - cfg.write(cmake_cache_string("CMAKE_CXX_FLAGS_RELEASE", release_flags)) - reldebinf_flags = "-O3 -g -DNDEBUG" - cfg.write(cmake_cache_string("CMAKE_CXX_FLAGS_RELWITHDEBINFO", reldebinf_flags)) - debug_flags = "-O0 -g" - cfg.write(cmake_cache_string("CMAKE_CXX_FLAGS_DEBUG", debug_flags)) - - if "%clang arch=linux-rhel7-ppc64le" in spec: - cfg.write(cmake_cache_entry("CMAKE_EXE_LINKER_FLAGS", "-Wl,--no-toc-optimize")) - - cfg.write('#{0}\n'.format('-' * 80)) - cfg.write('# Cuda\n') - cfg.write('#{0}\n\n'.format('-' * 80)) - if '+cuda' in spec: - cfg.write(cmake_cache_option('ENABLE_CUDA', True)) - cfg.write(cmake_cache_entry('CMAKE_CUDA_STANDARD', 17)) - - cudatoolkitdir = spec['cuda'].prefix - cfg.write(cmake_cache_entry('CUDA_TOOLKIT_ROOT_DIR', cudatoolkitdir)) - cudacompiler = '${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc' - cfg.write(cmake_cache_entry('CMAKE_CUDA_COMPILER', cudacompiler)) - - cmake_cuda_flags = ('-restrict --expt-extended-lambda -Werror ' - 'cross-execution-space-call,reorder,' - 'deprecated-declarations') - - archSpecifiers = ('-mtune', '-mcpu', '-march', '-qtune', '-qarch') - for archSpecifier in archSpecifiers: - for compilerArg in spec.compiler_flags['cxxflags']: - if compilerArg.startswith(archSpecifier): - cmake_cuda_flags += ' -Xcompiler ' + compilerArg - - if not spec.satisfies('cuda_arch=none'): - cuda_arch = spec.variants['cuda_arch'].value - cmake_cuda_flags += ' -arch sm_{0}'.format(cuda_arch[0]) - cfg.write(cmake_cache_string('CMAKE_CUDA_ARCHITECTURES', cuda_arch[0])) - - cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS', cmake_cuda_flags)) - - cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_RELEASE', '-O3 -DNDEBUG -Xcompiler -DNDEBUG -Xcompiler -O3 -Xcompiler -mcpu=powerpc64le -Xcompiler -mtune=powerpc64le')) - cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_RELWITHDEBINFO', '-g -lineinfo ${CMAKE_CUDA_FLAGS_RELEASE}')) - cfg.write(cmake_cache_string('CMAKE_CUDA_FLAGS_DEBUG', '-g -G -O0 -Xcompiler -O0')) - - else: - cfg.write(cmake_cache_option('ENABLE_CUDA', False)) - - cfg.write('#{0}\n'.format('-' * 80)) - cfg.write('# Performance Portability TPLs\n') - cfg.write('#{0}\n\n'.format('-' * 80)) - - cfg.write(cmake_cache_option('ENABLE_CHAI', True)) - cfg.write(cmake_cache_entry('CHAI_DIR', spec['chai'].prefix)) - - cfg.write(cmake_cache_entry('RAJA_DIR', spec['raja'].prefix)) - - cfg.write(cmake_cache_option('ENABLE_UMPIRE', True)) - cfg.write(cmake_cache_entry('UMPIRE_DIR', spec['umpire'].prefix)) - - cfg.write(cmake_cache_entry('CAMP_DIR', spec['camp'].prefix)) - - cfg.write('#{0}\n'.format('-' * 80)) - cfg.write('# IO TPLs\n') - cfg.write('#{0}\n\n'.format('-' * 80)) - - if '+caliper' in spec: - cfg.write(cmake_cache_option('ENABLE_CALIPER', True)) - cfg.write(cmake_cache_entry('CALIPER_DIR', spec['caliper'].prefix)) - cfg.write(cmake_cache_entry('adiak_DIR', spec['adiak'].prefix + '/lib/cmake/adiak')) - - cfg.write('#{0}\n'.format('-' * 80)) - cfg.write('# Documentation\n') - cfg.write('#{0}\n\n'.format('-' * 80)) - if '+docs' in spec: - sphinx_bin_dir = spec['py-sphinx'].prefix.bin - cfg.write(cmake_cache_entry('SPHINX_EXECUTABLE', os.path.join(sphinx_bin_dir, 'sphinx-build'))) - - doxygen_bin_dir = spec['doxygen'].prefix.bin - cfg.write(cmake_cache_entry('DOXYGEN_EXECUTABLE', os.path.join(doxygen_bin_dir, 'doxygen'))) - else: - cfg.write(cmake_cache_option('ENABLE_DOXYGEN', False)) - cfg.write(cmake_cache_option('ENABLE_SPHINX', False)) - - cfg.write('#{0}\n'.format('-' * 80)) - cfg.write('# Development tools\n') - cfg.write('#{0}\n\n'.format('-' * 80)) - - if '+addr2line' in spec: - cfg.write('#{0}\n'.format('-' * 80)) - cfg.write('# addr2line\n') - cfg.write('#{0}\n\n'.format('-' * 80)) - cfg.write(cmake_cache_option('ENABLE_ADDR2LINE', True)) - - def cmake_args(self): - pass - # spec = self.spec - # host_config_path = self._get_host_config_path(spec) - - # options = [] - # options.extend(['-C', host_config_path]) - - # # Shared libs - # options.append(self.define_from_variant('BUILD_SHARED_LIBS', 'shared')) - - # if '~tests~examples~benchmarks' in spec: - # options.append('-DGEOS_ENABLE_TESTS=OFF') - # else: - # options.append('-DGEOS_ENABLE_TESTS=ON') - - # if '~test' in spec: - # options.append('-DDISABLE_UNIT_TESTS=ON') - # elif "+tests" in spec and ('%intel' in spec or '%xl' in spec): - # warnings.warn('The LvArray unit tests take an excessive amount of' - # ' time to build with the Intel or IBM compilers.') - - # options.append(self.define_from_variant('ENABLE_EXAMPLES', 'examples')) - # options.append(self.define_from_variant('ENABLE_BENCHMARKS', - # 'benchmarks')) - # options.append(self.define_from_variant('ENABLE_DOCS', 'docs')) - - # return options diff --git a/scripts/spack_packages/packages/hdf5/package.py b/scripts/spack_packages/packages/hdf5/package.py deleted file mode 100644 index 061251f5320..00000000000 --- a/scripts/spack_packages/packages/hdf5/package.py +++ /dev/null @@ -1,747 +0,0 @@ -# Copyright 2013-2022 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) - -# GEOS_EDIT_START -# Older hdf5 spack recipe that works on lassen -# (latest spack release fails with MPI related configuration failure) -# GEOS_EDIT_END - -import os -import shutil - -import llnl.util.tty as tty - -from spack.package import * - - -class Hdf5(CMakePackage): - """HDF5 is a data model, library, and file format for storing and managing - data. It supports an unlimited variety of datatypes, and is designed for - flexible and efficient I/O and for high volume and complex data. - """ - - homepage = "https://portal.hdfgroup.org" - url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.8/src/hdf5-1.10.8.tar.gz" - list_url = "https://support.hdfgroup.org/ftp/HDF5/releases" - list_depth = 3 - git = "https://github.com/HDFGroup/hdf5.git" - maintainers = [ - "lrknox", - "brtnfld", - "byrnHDF", - "ChristopherHogan", - "epourmal", - "gheber", - "hyoklee", - "lkurz", - "soumagne", - ] - - tags = ["e4s"] - - test_requires_compiler = True - - # The 'develop' version is renamed so that we could uninstall (or patch) it - # without affecting other develop version. - version("develop-1.13", branch="develop") - version("develop-1.12", branch="hdf5_1_12") - version("develop-1.10", branch="hdf5_1_10") - version("develop-1.8", branch="hdf5_1_8") - - # Odd versions are considered experimental releases - version("1.13.2", sha256="01643fa5b37dba7be7c4db6bbf3c5d07adf5c1fa17dbfaaa632a279b1b2f06da") - - # Even versions are maintenance versions - version( - "1.12.2", - sha256="2a89af03d56ce7502dcae18232c241281ad1773561ec00c0f0e8ee2463910f14", - preferred=True, - ) - version( - "1.12.1", - sha256="79c66ff67e666665369396e9c90b32e238e501f345afd2234186bfb8331081ca", - preferred=True, - ) - version( - "1.12.0", - sha256="a62dcb276658cb78e6795dd29bf926ed7a9bc4edf6e77025cd2c689a8f97c17a", - preferred=True, - ) - version( - "1.10.9", - sha256="f5b77f59b705a755a5a223372d0222c7bc408fe8db6fa8d9d7ecf8bce291b8dd", - preferred=True, - ) - version( - "1.10.8", - sha256="d341b80d380dd763753a0ebe22915e11e87aac4e44a084a850646ff934d19c80", - preferred=True, - ) - version( - "1.10.7", - sha256="7a1a0a54371275ce2dfc5cd093775bb025c365846512961e7e5ceaecb437ef15", - preferred=True, - ) - version( - "1.10.6", - sha256="5f9a3ee85db4ea1d3b1fa9159352aebc2af72732fc2f58c96a3f0768dba0e9aa", - preferred=True, - ) - version( - "1.10.5", - sha256="6d4ce8bf902a97b050f6f491f4268634e252a63dadd6656a1a9be5b7b7726fa8", - preferred=True, - ) - version( - "1.10.4", - sha256="8f60dc4dd6ab5fcd23c750d1dc5bca3d0453bdce5c8cdaf0a4a61a9d1122adb2", - preferred=True, - ) - version( - "1.10.3", - sha256="b600d7c914cfa80ae127cd1a1539981213fee9994ac22ebec9e3845e951d9b39", - preferred=True, - ) - version( - "1.10.2", - sha256="bfec1be8c366965a99812cf02ddc97e4b708c1754fccba5414d4adccdc073866", - preferred=True, - ) - version( - "1.10.1", - sha256="048a9d149fb99aaa1680a712963f5a78e9c43b588d0e79d55e06760ec377c172", - preferred=True, - ) - version( - "1.10.0-patch1", - sha256="6e78cfe32a10e6e0629393cdfddf6cfa536571efdaf85f08e35326e1b4e9eff0", - preferred=True, - ) - version( - "1.10.0", - sha256="81f6201aba5c30dced5dcd62f5d5477a2790fd5850e02ac514ca8bf3e2bb375a", - preferred=True, - ) - version( - "1.8.22", - sha256="8406d96d9355ef8961d2739fb8fd5474ad4cdf52f3cfac657733defd9709bfaa", - preferred=True, - ) - version( - "1.8.21", - sha256="87d8c82eba5cf766d97cd06c054f4639c1049c4adeaa3a79f77f8bd374f80f37", - preferred=True, - ) - version( - "1.8.19", - sha256="a4335849f19fae88c264fd0df046bc321a78c536b2548fc508627a790564dc38", - preferred=True, - ) - version( - "1.8.18", - sha256="cdb195ad8d9e6782acf24b2488061289f615628c2ccda8457b0a0c3fb7a8a063", - preferred=True, - ) - version( - "1.8.17", - sha256="d9cda297ee76ade9881c4208987939250d397bae6252d0ccb66fa7d24d67e263", - preferred=True, - ) - version( - "1.8.16", - sha256="ed17178abd9928a7237f30370189ba767b9e39e0db45917c2ac4665eb9cb4771", - preferred=True, - ) - version( - "1.8.15", - sha256="4e963216b7d32469596bc1321a8c3f6e0c278dcbbdb7be6414c63c081b34c275", - preferred=True, - ) - version( - "1.8.14", - sha256="1dbefeeef7f591897c632b2b090db96bb8d35ad035beaa36bc39cb2bc67e0639", - preferred=True, - ) - version( - "1.8.13", - sha256="82f6b38eec103b4fccfbf14892786e0c27a8135d3252d8601cf5bf20066d38c1", - preferred=True, - ) - version( - "1.8.12", - sha256="b5cccea850096962b5fd9e96f22c4f47d2379224bb41130d9bc038bb6c37dfcb", - preferred=True, - ) - version( - "1.8.10", - sha256="4813b79c5fb8701a625b9924b8203bc7154a77f9b826ad4e034144b4056a160a", - preferred=True, - ) - - variant("shared", default=True, description="Builds a shared version of the library") - - variant("hl", default=False, description="Enable the high-level library") - variant("cxx", default=False, description="Enable C++ support") - variant("fortran", default=False, description="Enable Fortran support") - variant("java", when="@1.10:", default=False, description="Enable Java support") - variant("threadsafe", default=False, description="Enable thread-safe capabilities") - variant("tools", default=True, description="Enable building tools") - variant("mpi", default=True, description="Enable MPI support") - variant("szip", default=False, description="Enable szip support") - # Build HDF5 with API compatibility. - variant( - "api", - default="default", - description="Choose api compatibility for earlier version", - values=("default", "v114", "v112", "v110", "v18", "v16"), - multi=False, - ) - - depends_on("cmake@3.12:", type="build") - - depends_on("mpi", when="+mpi") - depends_on("java", type=("build", "run"), when="+java") - depends_on("szip", when="+szip") - depends_on("zlib@1.1.2:") - - # The compiler wrappers (h5cc, h5fc, etc.) run 'pkg-config'. - depends_on("pkgconfig", type="run") - - conflicts("api=v114", when="@1.6:1.12", msg="v114 is not compatible with this release") - conflicts("api=v112", when="@1.6:1.10", msg="v112 is not compatible with this release") - conflicts("api=v110", when="@1.6:1.8", msg="v110 is not compatible with this release") - conflicts("api=v18", when="@1.6.0:1.6", msg="v18 is not compatible with this release") - - # The Java wrappers cannot be built without shared libs. - conflicts("+java", when="~shared") - # Fortran fails built with shared for old HDF5 versions - conflicts("+fortran", when="+shared@:1.8.15") - # See https://github.com/spack/spack/issues/31085 - conflicts("+fortran+mpi", when="@1.8.22") - - # GEOS_EDIT_START - # Commenting out unused patches - - # There are several officially unsupported combinations of the features: - # 1. Thread safety is not guaranteed via high-level C-API but in some cases - # it works. - # conflicts('+threadsafe+hl') - - # 2. Thread safety is not guaranteed via Fortran (CXX) API, but it's - # possible for a dependency tree to contain a package that uses Fortran - # (CXX) API in a single thread and another one that uses low-level C-API - # in multiple threads. To allow for such scenarios, we don't specify the - # following conflicts. - # conflicts('+threadsafe+cxx') - # conflicts('+threadsafe+fortran') - - # 3. Parallel features are not supported via CXX API, but for the reasons - # described in #2 we allow for such combination. - # conflicts('+mpi+cxx') - - # There are known build failures with intel@18.0.1. This issue is - # discussed and patch is provided at - # https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/747951. - #patch("h5f90global-mult-obj-same-equivalence-same-common-block.patch", when="@1.10.1%intel@18") - - # Turn line comments into block comments to conform with pre-C99 language - # standards. Versions of hdf5 after 1.8.10 don't require this patch, - # either because they conform to pre-C99 or neglect to ask for pre-C99 - # language standards from their compiler. The hdf5 build system adds - # the -ansi cflag (run 'man gcc' for info on -ansi) for some versions - # of some compilers (see hdf5-1.8.10/config/gnu-flags). The hdf5 build - # system does not provide an option to disable -ansi, but since the - # pre-C99 code is restricted to just five lines of line comments in - # three src files, this patch accomplishes the simple task of patching the - # three src files and leaves the hdf5 build system alone. - #patch("pre-c99-comments.patch", when="@1.8.10") - - # There are build errors with GCC 8, see - # https://forum.hdfgroup.org/t/1-10-2-h5detect-compile-error-gcc-8-1-0-on-centos-7-2-solved/4441 - # patch( - # "https://salsa.debian.org/debian-gis-team/hdf5/raw/bf94804af5f80f662cad80a5527535b3c6537df6/debian/patches/gcc-8.patch", - # sha256="57cee5ff1992b4098eda079815c36fc2da9b10e00a9056df054f2384c4fc7523", - # when="@1.10.2%gcc@8:", - # ) - - # Disable MPI C++ interface when C++ is disabled, otherwise downstream - # libraries fail to link; see https://github.com/spack/spack/issues/12586 - # patch( - # "h5public-skip-mpicxx.patch", - # when="@1.8.10:1.8.21,1.10.0:1.10.5+mpi~cxx", - # sha256="b61e2f058964ad85be6ee5ecea10080bf79e73f83ff88d1fa4b602d00209da9c", - # ) - - # Fixes BOZ literal constant error when compiled with GCC 10. - # The issue is described here: https://github.com/spack/spack/issues/18625 - # patch( - # "hdf5_1.8_gcc10.patch", - # when="@:1.8.21", - # sha256="0e20187cda3980a4fdff410da92358b63de7ebef2df1d7a425371af78e50f666", - # ) - - # patch("fortran-kinds.patch", when="@1.10.7") - - # This patch may only be needed with GCC11.2 on macOS, but it's valid for - # any of the head HDF5 versions as of 12/2021. Since it's impossible to - # tell what Fortran version is part of a mixed apple-clang toolchain on - # macOS (which is the norm), and this might be an issue for other compilers - # as well, we just apply it to all platforms. - # See https://github.com/HDFGroup/hdf5/issues/1157 - # patch("fortran-kinds-2.patch", when="@1.10.8,1.12.1") - - # The argument 'buf_size' of the C function 'h5fget_file_image_c' is - # declared as intent(in) though it is modified by the invocation. As a - # result, aggressive compilers such as Fujitsu's may do a wrong - # optimization to cause an error. - # GEOS_EDIT_END - - def patch(self): - filter_file( - "INTEGER(SIZE_T), INTENT(IN) :: buf_size", - "INTEGER(SIZE_T), INTENT(OUT) :: buf_size", - "fortran/src/H5Fff.F90", - string=True, - ignore_absent=True, - ) - filter_file( - "INTEGER(SIZE_T), INTENT(IN) :: buf_size", - "INTEGER(SIZE_T), INTENT(OUT) :: buf_size", - "fortran/src/H5Fff_F03.f90", - string=True, - ignore_absent=True, - ) - if self.run_tests: - # hdf5 has ~2200 CPU-intensive tests, some of them have races: - # Often, these loop endless(at least on one Xeon and one EPYC). - # testphdf5 fails indeterministic. This fixes finishing the tests - filter_file( - "REMOVE_ITEM H5P_TESTS", - "REMOVE_ITEM H5P_TESTS t_bigio t_shapesame testphdf5", - "testpar/CMakeTests.cmake", - ) - - # The parallel compiler wrappers (i.e. h5pcc, h5pfc, etc.) reference MPI - # compiler wrappers and do not need to be changed. - filter_compiler_wrappers( - "h5cc", "h5hlcc", "h5fc", "h5hlfc", "h5c++", "h5hlc++", relative_root="bin" - ) - - def url_for_version(self, version): - url = ( - "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-{0}/hdf5-{1}/src/hdf5-{1}.tar.gz" - ) - return url.format(version.up_to(2), version) - - def flag_handler(self, name, flags): - spec = self.spec - cmake_flags = [] - - if name == "cflags": - if spec.compiler.name in ["gcc", "clang", "apple-clang", "oneapi"]: - # Quiet warnings/errors about implicit declaration of functions - # in C99: - cmake_flags.append("-Wno-error=implicit-function-declaration") - # Note that this flag will cause an error if building %nvhpc. - if spec.satisfies("@:1.8.12~shared"): - # More recent versions set CMAKE_POSITION_INDEPENDENT_CODE to - # True and build with PIC flags. - cmake_flags.append(self.compiler.cc_pic_flag) - elif name == "cxxflags": - if spec.satisfies("@:1.8.12+cxx~shared"): - cmake_flags.append(self.compiler.cxx_pic_flag) - elif name == "fflags": - if spec.satisfies("%cce+fortran"): - # Cray compiler generates module files with uppercase names by - # default, which is not handled by the CMake scripts. The - # following flag forces the compiler to produce module files - # with lowercase names. - cmake_flags.append("-ef") - if spec.satisfies("@:1.8.12+fortran~shared"): - cmake_flags.append(self.compiler.fc_pic_flag) - elif name == "ldlibs": - if "+fortran %fj" in spec: - cmake_flags.extend(["-lfj90i", "-lfj90f", "-lfjsrcinfo", "-lelf"]) - - return flags, None, (cmake_flags or None) - - @property - def libs(self): - """HDF5 can be queried for the following parameters: - - - "hl": high-level interface - - "cxx": C++ APIs - - "fortran": Fortran APIs - - "java": Java APIs - - :return: list of matching libraries - """ - query_parameters = self.spec.last_query.extra_parameters - - shared = "+shared" in self.spec - - # This map contains a translation from query_parameters - # to the libraries needed - query2libraries = { - tuple(): ["libhdf5"], - ("cxx", "fortran", "hl", "java"): [ - # When installed with Autotools, the basename of the real - # library file implementing the High-level Fortran interface is - # 'libhdf5hl_fortran'. Starting versions 1.8.22, 1.10.5 and - # 1.12.0, the Autotools installation also produces a symbolic - # link 'libhdf5_hl_fortran.' to - # 'libhdf5hl_fortran.'. Note that in the case of the - # dynamic library, the latter is a symlink to the real sonamed - # file 'libhdf5_fortran.so.'. This means that all - # dynamically linked executables/libraries of the dependent - # packages need 'libhdf5_fortran.so.' with the same - # DT_SONAME entry. However, the CMake installation (at least - # starting version 1.8.10) does not produce it. Instead, the - # basename of the library file is 'libhdf5_hl_fortran'. Which - # means that switching to CMake requires rebuilding of all - # dependant packages that use the High-level Fortran interface. - # Therefore, we do not try to preserve backward compatibility - # with Autotools installations by creating symlinks. The only - # packages that could benefit from it would be those that - # hardcode the library name in their building systems. Such - # packages should simply be patched. - "libhdf5_hl_fortran", - "libhdf5_hl_f90cstub", - "libhdf5_hl_cpp", - "libhdf5_hl", - "libhdf5_fortran", - "libhdf5_f90cstub", - "libhdf5_java", - "libhdf5", - ], - ("cxx", "hl"): [ - "libhdf5_hl_cpp", - "libhdf5_hl", - "libhdf5", - ], - ("fortran", "hl"): [ - "libhdf5_hl_fortran", - "libhdf5_hl_f90cstub", - "libhdf5_hl", - "libhdf5_fortran", - "libhdf5_f90cstub", - "libhdf5", - ], - ("hl",): [ - "libhdf5_hl", - "libhdf5", - ], - ("cxx", "fortran"): [ - "libhdf5_fortran", - "libhdf5_f90cstub", - "libhdf5_cpp", - "libhdf5", - ], - ("cxx",): [ - "libhdf5_cpp", - "libhdf5", - ], - ("fortran",): [ - "libhdf5_fortran", - "libhdf5_f90cstub", - "libhdf5", - ], - ("java",): [ - "libhdf5_java", - "libhdf5", - ], - } - - # Turn the query into the appropriate key - key = tuple(sorted(query_parameters)) - libraries = query2libraries[key] - - return find_libraries(libraries, root=self.prefix, shared=shared, recursive=True) - - @when("@:1.8.21,1.10.0:1.10.5+szip") - def setup_build_environment(self, env): - env.set("SZIP_INSTALL", self.spec["szip"].prefix) - - @run_before("cmake") - def fortran_check(self): - if "+fortran" in self.spec and not self.compiler.fc: - msg = "cannot build a Fortran variant without a Fortran compiler" - raise RuntimeError(msg) - - def cmake_args(self): - spec = self.spec - - if spec.satisfies("@:1.8.15+shared"): - tty.warn("hdf5@:1.8.15+shared does not produce static libraries") - - args = [ - # Always enable this option. This does not actually enable any - # features: it only *allows* the user to specify certain - # combinations of other arguments. - self.define("ALLOW_UNSUPPORTED", True), - # Speed-up the building by skipping the examples: - self.define("HDF5_BUILD_EXAMPLES", False), - self.define( - "BUILD_TESTING", - self.run_tests or - # Version 1.8.22 fails to build the tools when shared libraries - # are enabled but the tests are disabled. - spec.satisfies("@1.8.22+shared+tools"), - ), - self.define("HDF5_ENABLE_Z_LIB_SUPPORT", True), - self.define_from_variant("HDF5_ENABLE_SZIP_SUPPORT", "szip"), - self.define_from_variant("HDF5_ENABLE_SZIP_ENCODING", "szip"), - self.define_from_variant("BUILD_SHARED_LIBS", "shared"), - self.define("ONLY_SHARED_LIBS", False), - self.define_from_variant("HDF5_ENABLE_PARALLEL", "mpi"), - self.define_from_variant("HDF5_ENABLE_THREADSAFE", "threadsafe"), - self.define_from_variant("HDF5_BUILD_HL_LIB", "hl"), - self.define_from_variant("HDF5_BUILD_CPP_LIB", "cxx"), - self.define_from_variant("HDF5_BUILD_FORTRAN", "fortran"), - self.define_from_variant("HDF5_BUILD_JAVA", "java"), - self.define_from_variant("HDF5_BUILD_TOOLS", "tools"), - ] - - api = spec.variants["api"].value - if api != "default": - args.append(self.define("DEFAULT_API_VERSION", api)) - - if "+mpi" in spec: - args.append(self.define("CMAKE_C_COMPILER", spec["mpi"].mpicc)) - - if "+cxx" in self.spec: - args.append(self.define("CMAKE_CXX_COMPILER", spec["mpi"].mpicxx)) - - if "+fortran" in self.spec: - args.append(self.define("CMAKE_Fortran_COMPILER", spec["mpi"].mpifc)) - - # work-around for https://github.com/HDFGroup/hdf5/issues/1320 - if spec.satisfies("@1.10.8,1.13.0"): - args.append(self.define("HDF5_INSTALL_CMAKE_DIR", "share/cmake/hdf5")) - - return args - - @run_after("install") - def ensure_parallel_compiler_wrappers(self): - # When installed with Autotools and starting at least version 1.8.10, - # the package produces C compiler wrapper called either 'h5cc' (when MPI - # support is disabled) or 'h5pcc' (when MPI support is enabled). The - # CMake installation produces the wrapper called 'h5cc' (regardless of - # whether MPI support is enabled) only starting versions 1.8.21, 1.10.2 - # and 1.12.0. The current develop versions also produce 'h5pcc' when MPI - # support is enabled and the file is identical to 'h5cc'. Here, we make - # sure that 'h5pcc' is available when MPI support is enabled (only for - # versions that generate 'h5cc'). - if self.spec.satisfies("@1.8.21:1.8.22,1.10.2:1.10.7,1.12.0+mpi"): - with working_dir(self.prefix.bin): - # No try/except here, fix the condition above instead: - symlink("h5cc", "h5pcc") - - # The same as for 'h5pcc'. However, the CMake installation produces the - # Fortran compiler wrapper called 'h5fc' only starting versions 1.8.22, - # 1.10.6 and 1.12.0. The current develop versions do not produce 'h5pfc' - # at all. Here, we make sure that 'h5pfc' is available when Fortran and - # MPI support are enabled (only for versions that generate 'h5fc'). - if self.spec.satisfies( - "@1.8.22:1.8," "1.10.6:1.10," "1.12.0:1.12," "develop:" "+fortran+mpi" - ): - with working_dir(self.prefix.bin): - # No try/except here, fix the condition above instead: - symlink("h5fc", "h5pfc") - - @run_after("install") - def fix_package_config(self): - # We need to fix the pkg-config files, which are also used by the - # compiler wrappers. The files are created starting versions 1.8.21, - # 1.10.2 and 1.12.0. However, they are broken (except for the version - # 1.8.22): the files are named -.pc but reference - # packages. This was fixed in the develop versions at some point: the - # files started referencing - packages but got broken - # again: the files got names .pc but references had not been - # updated accordingly. Another issue, which we address here, is that - # some Linux distributions install pkg-config files named hdf5.pc and we - # want to override them. Therefore, the following solution makes sure - # that each -.pc file is symlinked by .pc and all - # references to - packages in the original files are - # replaced with references to packages. - pc_files = find(self.prefix.lib.pkgconfig, "hdf5*.pc", recursive=False) - - if not pc_files: - # This also tells us that the pkgconfig directory does not exist. - return - - # Replace versioned references in all pkg-config files: - filter_file( - r"(Requires(?:\.private)?:.*)(hdf5[^\s,]*)(?:-[^\s,]*)(.*)", - r"\1\2\3", - *pc_files, - backup=False - ) - - # Create non-versioned symlinks to the versioned pkg-config files: - with working_dir(self.prefix.lib.pkgconfig): - for f in pc_files: - src_filename = os.path.basename(f) - version_sep_idx = src_filename.find("-") - if version_sep_idx > -1: - tgt_filename = src_filename[:version_sep_idx] + ".pc" - if not os.path.exists(tgt_filename): - symlink(src_filename, tgt_filename) - - @run_after("install") - @on_package_attributes(run_tests=True) - def check_install(self): - self._check_install() - - def _check_install(self): - # Build and run a small program to test the installed HDF5 library - spec = self.spec - print("Checking HDF5 installation...") - checkdir = "spack-check" - with working_dir(checkdir, create=True): - # Because the release number in a develop branch is not fixed, - # only the major and minor version numbers are compared. - # Otherwise all 3 numbers are checked. - if "develop" in str(spec.version.up_to(3)): - source = r""" -#include -#include -#include -int main(int argc, char **argv) { - unsigned majnum, minnum, relnum; - herr_t herr = H5get_libversion(&majnum, &minnum, &relnum); - assert(!herr); - printf("HDF5 version %d.%d %u.%u\n", H5_VERS_MAJOR, H5_VERS_MINOR, - majnum, minnum); - return 0; -} -""" - else: - source = r""" -#include -#include -#include -int main(int argc, char **argv) { - unsigned majnum, minnum, relnum; - herr_t herr = H5get_libversion(&majnum, &minnum, &relnum); - assert(!herr); - printf("HDF5 version %d.%d.%d %u.%u.%u\n", H5_VERS_MAJOR, H5_VERS_MINOR, - H5_VERS_RELEASE, majnum, minnum, relnum); - return 0; -} -""" - expected = """\ -HDF5 version {version} {version} -""".format( - version=str(spec.version.up_to(3)) - ) - if "develop" in expected: - # Remove 'develop-' from the version in spack for checking - # version against the version in the HDF5 code. - expected = """\ -HDF5 version {version} {version} -""".format( - version=str(spec.version.up_to(3)).partition("-")[2] - ) - with open("check.c", "w") as f: - f.write(source) - if "+mpi" in spec: - cc = Executable(spec["mpi"].mpicc) - else: - cc = Executable(self.compiler.cc) - cc(*(["-c", "check.c"] + spec["hdf5"].headers.cpp_flags.split())) - cc(*(["-o", "check", "check.o"] + spec["hdf5"].libs.ld_flags.split())) - try: - check = Executable("./check") - output = check(output=str) - except ProcessError: - output = "" - success = output == expected - if not success: - print("Produced output does not match expected output.") - print("Expected output:") - print("-" * 80) - print(expected) - print("-" * 80) - print("Produced output:") - print("-" * 80) - print(output) - print("-" * 80) - raise RuntimeError("HDF5 install check failed") - shutil.rmtree(checkdir) - - def _test_check_versions(self): - """Perform version checks on selected installed package binaries.""" - spec_vers_str = "Version {0}".format(self.spec.version) - if "develop" in spec_vers_str: - # Remove 'develop-' from the version in spack for checking - # version against the version in the HDF5 code. - spec_vers_str = spec_vers_str.partition("-")[2] - - exes = [ - "h5copy", - "h5diff", - "h5dump", - "h5format_convert", - "h5ls", - "h5mkgrp", - "h5repack", - "h5stat", - "h5unjam", - ] - use_short_opt = ["h52gif", "h5repart", "h5unjam"] - for exe in exes: - reason = "test: ensuring version of {0} is {1}".format(exe, spec_vers_str) - option = "-V" if exe in use_short_opt else "--version" - self.run_test( - exe, option, spec_vers_str, installed=True, purpose=reason, skip_missing=True - ) - - def _test_example(self): - """This test performs copy, dump, and diff on an example hdf5 file.""" - test_data_dir = self.test_suite.current_test_data_dir - - filename = "spack.h5" - h5_file = test_data_dir.join(filename) - - reason = "test: ensuring h5dump produces expected output" - expected = get_escaped_text_output(test_data_dir.join("dump.out")) - self.run_test( - "h5dump", - filename, - expected, - installed=True, - purpose=reason, - skip_missing=True, - work_dir=test_data_dir, - ) - - reason = "test: ensuring h5copy runs" - options = ["-i", h5_file, "-s", "Spack", "-o", "test.h5", "-d", "Spack"] - self.run_test( - "h5copy", options, [], installed=True, purpose=reason, skip_missing=True, work_dir="." - ) - - reason = "test: ensuring h5diff shows no differences between orig and" " copy" - self.run_test( - "h5diff", - [h5_file, "test.h5"], - [], - installed=True, - purpose=reason, - skip_missing=True, - work_dir=".", - ) - - def test(self): - """Perform smoke tests on the installed package.""" - # Simple version check tests on known binaries - self._test_check_versions() - - # Run sequence of commands on an hdf5 file - self._test_example() - - # Run existing install check - self._check_install() \ No newline at end of file diff --git a/scripts/spack_packages/packages/py-pydata-sphinx-theme/package.py b/scripts/spack_packages/packages/py-pydata-sphinx-theme/package.py deleted file mode 100644 index 2d9229245bd..00000000000 --- a/scripts/spack_packages/packages/py-pydata-sphinx-theme/package.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2013-2023 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 * - -class PyPydataSphinxTheme(PythonPackage): - """A clean, three-column, Bootstrap-based Sphinx theme by and for the PyData community""" - - homepage = "https://github.com/pydata/pydata-sphinx-theme" - pypi = "pydata-sphinx-theme/pydata_sphinx_theme-0.13.3.tar.gz" - - version("0.13.3", sha256="827f16b065c4fd97e847c11c108bf632b7f2ff53a3bca3272f63f3f3ff782ecc") - - depends_on("python", type=("build", "run")) - depends_on("py-setuptools", type="build") \ No newline at end of file diff --git a/scripts/spack_packages/packages/py-sphinxcontrib-plantuml/package.py b/scripts/spack_packages/packages/py-sphinxcontrib-plantuml/package.py deleted file mode 100644 index de642a3dec4..00000000000 --- a/scripts/spack_packages/packages/py-sphinxcontrib-plantuml/package.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2013-2023 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 * - -class PySphinxcontribPlantuml(PythonPackage): - """PlantUML for Sphinx""" - - homepage = "https://github.com/sphinx-contrib/plantuml" - pypi = "sphinxcontrib-plantuml/sphinxcontrib-plantuml-0.26.tar.gz" - - version("0.26", sha256="adb3397d5cb0613632cd3dad7894381422bac24464c393cb050404dd6712b1a7") - - depends_on("python", type=("build", "run")) - depends_on("py-setuptools", type="build") \ No newline at end of file diff --git a/scripts/spack_packages/packages/pygeosx/package.py b/scripts/spack_packages/packages/pygeosx/package.py deleted file mode 100644 index 723ad48c510..00000000000 --- a/scripts/spack_packages/packages/pygeosx/package.py +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2013-2023 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 import * - -class Pygeosx(BundlePackage): - """This is a set of libraries necessary for the pygeosx ATS environment""" - - version('fakeversion') - - depends_on("py-numpy@1.21.0:1.23.4+blas+lapack") - depends_on('py-mpi4py') - depends_on('py-virtualenv') - depends_on('python@3.10:+shared+pic+tkinter+optimizations') - depends_on("py-scipy") - depends_on("openblas") - depends_on("py-matplotlib") - depends_on("py-sphinx") - depends_on("py-sphinx-argparse") \ No newline at end of file diff --git a/scripts/spack_packages/packages/trilinos/cray_secas.patch b/scripts/spack_packages/packages/trilinos/cray_secas.patch deleted file mode 100644 index 14eb4ad36c0..00000000000 --- a/scripts/spack_packages/packages/trilinos/cray_secas.patch +++ /dev/null @@ -1,26 +0,0 @@ -From f29f61e8ebcb8c887c271bc4a764192976910ca3 Mon Sep 17 00:00:00 2001 -From: Howard Pritchard -Date: Mon, 17 Aug 2020 16:05:47 -0600 -Subject: [PATCH] secas: patch FortranSettings for Cray fortran - -compiler. This problem showed up in spack based builds of LANL LAP project dependencies -on one of our cray systems using CCE. - -Signed-off-by: Howard Pritchard - -diff --git a/packages/seacas/cmake/FortranSettings.cmake b/packages/seacas/cmake/FortranSettings.cmake -index c3447d57..7a73ce5f 100644 ---- a/packages/seacas/cmake/FortranSettings.cmake -+++ b/packages/seacas/cmake/FortranSettings.cmake -@@ -8,6 +8,8 @@ IF ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") - SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fcray-pointer -fdefault-real-8 -fdefault-integer-8 -fno-range-check") - ELSEIF ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "XL") - SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -WF,-D__XLF__ -qintsize=8 -qrealsize=8 -qfixed") -+ELSEIF ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Cray") -+ SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -sdefault64") - ELSE() - SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -i8") - ENDIF() --- -2.18.4 - diff --git a/scripts/spack_packages/packages/trilinos/fix_clang_errors_12_18_1.patch b/scripts/spack_packages/packages/trilinos/fix_clang_errors_12_18_1.patch deleted file mode 100644 index 6da3f4314da..00000000000 --- a/scripts/spack_packages/packages/trilinos/fix_clang_errors_12_18_1.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 01b88601a85691da73042089778db6db5bf6cf01 Mon Sep 17 00:00:00 2001 -From: Jean-Paul Pelteret -Date: Sat, 1 Feb 2020 05:48:48 +0100 -Subject: [PATCH] Fix Clang 8.0.0 compiler errors 12.18.1 - ---- - packages/belos/tpetra/src/solvers/Belos_Tpetra_Krylov.hpp | 2 +- - packages/muelu/src/Interface/MueLu_ParameterListUtils.cpp | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/packages/belos/tpetra/src/solvers/Belos_Tpetra_Krylov.hpp b/packages/belos/tpetra/src/solvers/Belos_Tpetra_Krylov.hpp -index d4f72bc..302dfc2 100644 ---- a/packages/belos/tpetra/src/solvers/Belos_Tpetra_Krylov.hpp -+++ b/packages/belos/tpetra/src/solvers/Belos_Tpetra_Krylov.hpp -@@ -126,7 +126,7 @@ public: - virtual void - getDefaultParameters (Teuchos::ParameterList& params) const - { -- const SolverInput input; -+ const SolverInput input{}; - const int verbosity = 0; - const std::string implResScal = input.needToScale ? - "Norm of Preconditioned Initial Residual" : "None"; // ??? -diff --git a/packages/muelu/src/Interface/MueLu_ParameterListUtils.cpp b/packages/muelu/src/Interface/MueLu_ParameterListUtils.cpp -index 051a2df..a703aff 100644 ---- a/packages/muelu/src/Interface/MueLu_ParameterListUtils.cpp -+++ b/packages/muelu/src/Interface/MueLu_ParameterListUtils.cpp -@@ -143,7 +143,7 @@ namespace MueLu { - - // Usage: GetMLSubList(paramList, "smoother", 2); - const Teuchos::ParameterList & GetMLSubList(const Teuchos::ParameterList & paramList, const std::string & type, int levelID) { -- static const Teuchos::ParameterList emptyParamList; -+ static const Teuchos::ParameterList emptyParamList{}; - - char levelChar[11]; - sprintf(levelChar, "(level %d)", levelID); --- -2.10.1 (Apple Git-78) - diff --git a/scripts/spack_packages/packages/trilinos/package.py b/scripts/spack_packages/packages/trilinos/package.py deleted file mode 100644 index a34d0203dc1..00000000000 --- a/scripts/spack_packages/packages/trilinos/package.py +++ /dev/null @@ -1,890 +0,0 @@ -# Copyright 2013-2022 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) - -# GEOSX_EDIT_START -# This is an older, modified version of the spack recipe (Commit date: 3/8/22, Spack PR: #29256): -# https://github.com/spack/spack/blob/b2a02861bbbe8c989d24b8c7fbd202e31abc6bd0/var/spack/repos/builtin/packages/trilinos/package.py -# GEOSX_EDIT_END -# yapf: disable - -import os -import sys - -from spack import * -from spack.build_environment import dso_suffix -from spack.error import NoHeadersError -from spack.operating_systems.mac_os import macos_version -from spack.pkg.builtin.kokkos import Kokkos - -# Trilinos is complicated to build, as an inspiration a couple of links to -# other repositories which build it: -# https://github.com/hpcugent/easybuild-easyblocks/blob/master/easybuild/easyblocks/t/trilinos.py#L111 -# https://github.com/koecher/candi/blob/master/deal.II-toolchain/packages/trilinos.package -# https://gitlab.com/configurations/cluster-config/blob/master/trilinos.sh -# https://github.com/Homebrew/homebrew-science/blob/master/trilinos.rb and some -# relevant documentation/examples: -# https://github.com/trilinos/Trilinos/issues/175 - - -class Trilinos(CMakePackage, CudaPackage, ROCmPackage): - """The Trilinos Project is an effort to develop algorithms and enabling - technologies within an object-oriented software framework for the solution - of large-scale, complex multi-physics engineering and scientific problems. - A unique design feature of Trilinos is its focus on packages. - """ - homepage = "https://trilinos.org/" - url = "https://github.com/trilinos/Trilinos/archive/trilinos-release-12-12-1.tar.gz" - git = "https://github.com/trilinos/Trilinos.git" - - maintainers = ['keitat', 'sethrj', 'kuberry'] - - tags = ['e4s'] - - # ###################### Versions ########################## - - version('master', branch='master') - version('develop', branch='develop') - version("13.4.1", sha256="5465cbff3de7ef4ac7d40eeff9d99342c00d9d20eee0a5f64f0a523093f5f1b3") - version("13.4.0", sha256="39550006e059043b7e2177f10467ae2f77fe639901aee91cbc1e359516ff8d3e") - version('13.2.0', commit='4a5f7906a6420ee2f9450367e9cc95b28c00d744') # tag trilinos-release-13-2-0 - version('13.0.1', commit='4796b92fb0644ba8c531dd9953e7a4878b05c62d', preferred=True) # tag trilinos-release-13-0-1 - version('13.0.0', commit='9fec35276d846a667bc668ff4cbdfd8be0dfea08') # tag trilinos-release-13-0-0 - version('12.18.1', commit='55a75997332636a28afc9db1aee4ae46fe8d93e7') # tag trilinos-release-12-8-1 - version('12.14.1', sha256='52a4406cca2241f5eea8e166c2950471dd9478ad6741cbb2a7fc8225814616f0') - version('12.12.1', sha256='5474c5329c6309224a7e1726cf6f0d855025b2042959e4e2be2748bd6bb49e18') - version('12.10.1', sha256='ab81d917196ffbc21c4927d42df079dd94c83c1a08bda43fef2dd34d0c1a5512') - version('12.8.1', sha256='d20fe60e31e3ba1ef36edecd88226240a518f50a4d6edcc195b88ee9dda5b4a1') - version('12.6.4', sha256='1c7104ba60ee8cc4ec0458a1c4f6a26130616bae7580a7b15f2771a955818b73') - version('12.6.3', sha256='4d28298bb4074eef522db6cd1626f1a934e3d80f292caf669b8846c0a458fe81') - version('12.6.2', sha256='8be7e3e1166cc05aea7f856cc8033182e8114aeb8f87184cb38873bfb2061779') - version('12.6.1', sha256='4b38ede471bed0036dcb81a116fba8194f7bf1a9330da4e29c3eb507d2db18db') - version('12.4.2', sha256='fd2c12e87a7cedc058bcb8357107ffa2474997aa7b17b8e37225a1f7c32e6f0e') - version('12.2.1', sha256='088f303e0dc00fb4072b895c6ecb4e2a3ad9a2687b9c62153de05832cf242098') - version('12.0.1', sha256='eee7c19ca108538fa1c77a6651b084e06f59d7c3307dae77144136639ab55980') - version('11.14.3', sha256='e37fa5f69103576c89300e14d43ba77ad75998a54731008b25890d39892e6e60') - version('11.14.2', sha256='f22b2b0df7b88e28b992e19044ba72b845292b93cbbb3a948488199647381119') - version('11.14.1', sha256='f10fc0a496bf49427eb6871c80816d6e26822a39177d850cc62cf1484e4eec07') - - # ###################### Variants ########################## - - # Build options - variant('complex', default=False, description='Enable complex numbers in Trilinos') - variant('cuda_rdc', default=False, description='Turn on RDC for CUDA build') - variant('rocm_rdc', default=False, description='Turn on RDC for ROCm build') - variant('cxxstd', default='14', values=['11', '14', '17'], multi=False) - variant('debug', default=False, description='Enable runtime safety and debug checks') - variant('explicit_template_instantiation', default=True, description='Enable explicit template instantiation (ETI)') - variant('float', default=False, description='Enable single precision (float) numbers in Trilinos') - variant('fortran', default=True, description='Compile with Fortran support') - variant('gotype', default='long_long', - values=('int', 'long', 'long_long', 'all'), - multi=False, - description='global ordinal type for Tpetra') - variant('openmp', default=False, description='Enable OpenMP') - variant('python', default=False, description='Build PyTrilinos wrappers') - variant('shared', default=True, description='Enables the build of shared libraries') - variant('uvm', default=False, when='@13.2: +cuda', description='Turn on UVM for CUDA build') - variant('wrapper', default=False, description='Use nvcc-wrapper for CUDA build') - - # TPLs (alphabet order) - variant('adios2', default=False, description='Enable ADIOS2') - variant('boost', default=False, description='Compile with Boost') - variant('hdf5', default=False, description='Compile with HDF5') - variant('hypre', default=False, description='Compile with Hypre preconditioner') - variant('mpi', default=True, description='Compile with MPI parallelism') - variant('mumps', default=False, description='Compile with support for MUMPS solvers') - variant('suite-sparse', default=False, description='Compile with SuiteSparse solvers') - variant('superlu-dist', default=False, description='Compile with SuperluDist solvers') - variant('superlu', default=False, description='Compile with SuperLU solvers') - variant('strumpack', default=False, description='Compile with STRUMPACK solvers') - variant('x11', default=False, description='Compile with X11 when +exodus') - - # Package options (alphabet order) - variant('amesos', default=True, description='Compile with Amesos') - variant('amesos2', default=True, description='Compile with Amesos2') - variant('anasazi', default=True, description='Compile with Anasazi') - variant('aztec', default=True, description='Compile with Aztec') - variant('belos', default=True, description='Compile with Belos') - variant('chaco', default=False, description='Compile with Chaco from SEACAS') - variant('epetra', default=True, description='Compile with Epetra') - variant('epetraext', default=True, description='Compile with EpetraExt') - variant('exodus', default=False, description='Compile with Exodus from SEACAS') - variant('ifpack', default=True, description='Compile with Ifpack') - variant('ifpack2', default=True, description='Compile with Ifpack2') - variant('intrepid', default=False, description='Enable Intrepid') - variant('intrepid2', default=False, description='Enable Intrepid2') - variant('isorropia', default=False, description='Compile with Isorropia') - variant('gtest', default=False, description='Build vendored Googletest') - variant('kokkos', default=True, description='Compile with Kokkos') - variant('ml', default=True, description='Compile with ML') - variant('minitensor', default=False, description='Compile with MiniTensor') - variant('muelu', default=True, description='Compile with Muelu') - variant('nox', default=False, description='Compile with NOX') - variant('panzer', default=False, description='Compile with Panzer') - variant('piro', default=False, description='Compile with Piro') - variant('phalanx', default=False, description='Compile with Phalanx') - variant('rol', default=False, description='Compile with ROL') - variant('rythmos', default=False, description='Compile with Rythmos') - variant('sacado', default=True, description='Compile with Sacado') - variant('stk', default=False, description='Compile with STK') - variant('shards', default=False, description='Compile with Shards') - variant('shylu', default=False, description='Compile with ShyLU') - variant('stokhos', default=False, description='Compile with Stokhos') - variant('stratimikos', default=False, description='Compile with Stratimikos') - variant('teko', default=False, description='Compile with Teko') - variant('tempus', default=False, description='Compile with Tempus') - variant('thyra', default=False, description='Compile with Thyra') - variant('tpetra', default=True, description='Compile with Tpetra') - variant('trilinoscouplings', default=False, description='Compile with TrilinosCouplings') - variant('zoltan', default=False, description='Compile with Zoltan') - variant('zoltan2', default=False, description='Compile with Zoltan2') - - # Internal package options (alphabetical order) - variant('basker', default=False, description='Compile with the Basker solver in Amesos2') - variant('epetraextbtf', default=False, description='Compile with BTF in EpetraExt') - variant('epetraextexperimental', default=False, description='Compile with experimental in EpetraExt') - variant('epetraextgraphreorderings', default=False, description='Compile with graph reorderings in EpetraExt') - - # External package options - variant('dtk', default=False, description='Enable DataTransferKit (deprecated)') - variant('scorec', default=False, description='Enable SCOREC') - variant('mesquite', default=False, description='Enable Mesquite (deprecated)') - - resource(name='dtk', - git='https://github.com/ornl-cees/DataTransferKit.git', - commit='4fe4d9d56cfd4f8a61f392b81d8efd0e389ee764', # branch dtk-3.0 - placement='DataTransferKit', - when='+dtk @12.14.0:12.14') - resource(name='dtk', - git='https://github.com/ornl-cees/DataTransferKit.git', - commit='edfa050cd46e2274ab0a0b7558caca0079c2e4ca', # tag 3.1-rc1 - placement='DataTransferKit', - submodules=True, - when='+dtk @12.18.0:12.18') - resource(name='scorec', - git='https://github.com/SCOREC/core.git', - commit='73c16eae073b179e45ec625a5abe4915bc589af2', # tag v2.2.5 - placement='SCOREC', - when='+scorec') - resource(name='mesquite', - url='https://github.com/trilinos/mesquite/archive/trilinos-release-12-12-1.tar.gz', - sha256='e0d09b0939dbd461822477449dca611417316e8e8d8268fd795debb068edcbb5', - placement='packages/mesquite', - when='+mesquite @12.12.1:12.16') - resource(name='mesquite', - git='https://github.com/trilinos/mesquite.git', - commit='20a679679b5cdf15bf573d66c5dc2b016e8b9ca1', # branch trilinos-release-12-12-1 - placement='packages/mesquite', - when='+mesquite @12.18.1:12.18') - resource(name='mesquite', - git='https://github.com/trilinos/mesquite.git', - tag='develop', - placement='packages/mesquite', - when='+mesquite @master') - - # ###################### Conflicts ########################## - - # Epetra stack - with when('~epetra'): - conflicts('+amesos') - conflicts('+aztec') - conflicts('+epetraext') - conflicts('+ifpack') - conflicts('+isorropia') - conflicts('+ml', when='@13.2:') - with when('~epetraext'): - conflicts('+isorropia') - conflicts('+teko') - conflicts('+epetraextbtf') - conflicts('+epetraextexperimental') - conflicts('+epetraextgraphreorderings') - with when('+teko'): - conflicts('~stratimikos') - conflicts('@:12 gotype=long') - with when('+piro'): - conflicts('~stratimikos') - conflicts('~nox') - - # Tpetra stack - with when('~kokkos'): - conflicts('+cuda') - conflicts('+rocm') - conflicts('+tpetra') - conflicts('+intrepid2') - conflicts('+phalanx') - with when('~tpetra'): - conflicts('+amesos2') - conflicts('+dtk') - conflicts('+ifpack2') - conflicts('+muelu') - conflicts('+teko') - conflicts('+zoltan2') - - with when('~zoltan'): - conflicts('+isorropia') - conflicts('+scorec') - conflicts('+shylu') - conflicts('+zoltan2') - with when('~shards'): - conflicts('+intrepid') - conflicts('+intrepid2') - conflicts('+scorec') - conflicts('+stk') - with when('+scorec'): - conflicts('~mpi') - conflicts('~stk') - - # Panzer is not gen-2 library - with when('+panzer'): - conflicts('~intrepid2') - conflicts('~mpi') - conflicts('~phalanx') - conflicts('~sacado') - conflicts('~tpetra') - conflicts('~thyra') - conflicts('~zoltan') - conflicts('~nox') - conflicts('~rythmos') - conflicts('~piro') - conflicts('~stratimikos') - conflicts('~stk') - conflicts('~ml') - conflicts('~ifpack') - conflicts('~aztec') - - # Known requirements from tribits dependencies - conflicts('~thyra', when='+stratimikos') - conflicts('+aztec', when='~fortran') - conflicts('+basker', when='~amesos2') - conflicts('+ifpack2', when='~belos') - conflicts('+intrepid', when='~sacado') - conflicts('+minitensor', when='~boost') - conflicts('+phalanx', when='~sacado') - conflicts('+stokhos', when='~kokkos') - conflicts('+tempus', when='~nox') - - # Only allow DTK with Trilinos 12.14, 12.18 - conflicts('+dtk', when='~boost') - conflicts('+dtk', when='~intrepid2') - conflicts('+dtk', when='@:12.12,13:') - - # Installed FindTrilinos are broken in SEACAS if Fortran is disabled - # see https://github.com/trilinos/Trilinos/issues/3346 - conflicts('+exodus', when='@:13.0.1 ~fortran') - # Only allow Mesquite with Trilinos 12.12 and up, and master - conflicts('+mesquite', when='@:12.10,master') - # Strumpack is only available as of mid-2021 - conflicts('+strumpack', when='@:13.0') - # Can only use one type of SuperLU - conflicts('+superlu-dist', when='+superlu') - # For Trilinos v11 we need to force SuperLUDist=OFF, since only the - # deprecated SuperLUDist v3.3 together with an Amesos patch is working. - conflicts('+superlu-dist', when='@11.4.1:11.14.3') - # see https://github.com/trilinos/Trilinos/issues/3566 - conflicts('+superlu-dist', when='+float+amesos2+explicit_template_instantiation^superlu-dist@5.3.0:') - # Amesos, conflicting types of double and complex SLU_D - # see https://trilinos.org/pipermail/trilinos-users/2015-March/004731.html - # and https://trilinos.org/pipermail/trilinos-users/2015-March/004802.html - conflicts('+superlu-dist', when='+complex+amesos2') - # https://github.com/trilinos/Trilinos/issues/2994 - conflicts( - '+shared', when='+stk platform=darwin', - msg='Cannot build Trilinos with STK as a shared library on Darwin.' - ) - conflicts('+adios2', when='@:12.14.1') - conflicts('cxxstd=11', when='@13.2:') - conflicts('cxxstd=17', when='@:12') - conflicts('cxxstd=11', when='+wrapper ^cuda@6.5.14') - conflicts('cxxstd=14', when='+wrapper ^cuda@6.5.14:8.0.61') - conflicts('cxxstd=17', when='+wrapper ^cuda@6.5.14:10.2.89') - - # Multi-value gotype only applies to trilinos through 12.14 - conflicts('gotype=all', when='@12.15:') - - # CUDA without wrapper requires clang - for _compiler in spack.compilers.supported_compilers(): - if _compiler != 'clang': - conflicts('+cuda', when='~wrapper %' + _compiler, - msg='trilinos~wrapper+cuda can only be built with the ' - 'Clang compiler') - conflicts('+cuda_rdc', when='~cuda') - conflicts('+rocm_rdc', when='~rocm') - conflicts('+wrapper', when='~cuda') - conflicts('+wrapper', when='%clang') - - # Old trilinos fails with new CUDA (see #27180) - conflicts('@:13.0.1 +cuda', when='^cuda@11:') - # Build hangs with CUDA 11.6 (see #28439) - conflicts('+cuda +stokhos', when='^cuda@11.6:') - # Cuda UVM must be enabled prior to 13.2 - # See https://github.com/spack/spack/issues/28869 - conflicts('~uvm', when='@:13.1 +cuda') - - # stokhos fails on xl/xl_r - conflicts('+stokhos', when='%xl') - conflicts('+stokhos', when='%xl_r') - - # ###################### Dependencies ########################## - - depends_on('adios2', when='+adios2') - depends_on('blas') - depends_on('boost', when='+boost') - # Need to revisit the requirement of STK - depends_on('boost', when='+stk') - - # - depends_on('cgns', when='+exodus') - depends_on('hdf5+hl', when='+hdf5') - depends_on('hypre~internal-superlu~int64', when='+hypre') - depends_on('kokkos-nvcc-wrapper', when='+wrapper') - depends_on('lapack') - # depends_on('perl', type=('build',)) # TriBITS finds but doesn't use... - depends_on('libx11', when='+x11') - depends_on('matio', when='+exodus') - depends_on('metis', when='+zoltan') - depends_on('mpi', when='+mpi') - depends_on('netcdf-c', when="+exodus") - depends_on('parallel-netcdf', when='+exodus+mpi') - depends_on('parmetis', when='+mpi +zoltan') - depends_on('parmetis', when='+scorec') - depends_on('py-mpi4py', when='+mpi+python', type=('build', 'run')) - depends_on('py-numpy', when='+python', type=('build', 'run')) - depends_on('python', when='+python') - depends_on('python', when='@13.2: +ifpack +hypre', type='build') - depends_on('python', when='@13.2: +ifpack2 +hypre', type='build') - depends_on('scalapack', when='+mumps') - depends_on('scalapack', when='+strumpack+mpi') - depends_on('strumpack+shared', when='+strumpack') - depends_on('suite-sparse', when='+suite-sparse') - depends_on('superlu-dist', when='+superlu-dist') - depends_on('superlu@4.3 +pic', when='+superlu') - depends_on('swig', when='+python') - depends_on('zlib', when='+zoltan') - - # Trilinos' Tribits config system is limited which makes it very tricky to - # link Amesos with static MUMPS, see - # https://trilinos.org/docs/dev/packages/amesos2/doc/html/classAmesos2_1_1MUMPS.html - # One could work it out by getting linking flags from mpif90 --showme:link - # (or alike) and adding results to -DTrilinos_EXTRA_LINK_FLAGS together - # with Blas and Lapack and ScaLAPACK and Blacs and -lgfortran and it may - # work at the end. But let's avoid all this by simply using shared libs - depends_on('mumps@5.0:+shared', when='+mumps') - - for _flag in ('~mpi', '+mpi'): - depends_on('hdf5' + _flag, when='+hdf5' + _flag) - depends_on('mumps' + _flag, when='+mumps' + _flag) - for _flag in ('~openmp', '+openmp'): - depends_on('mumps' + _flag, when='+mumps' + _flag) - - # GEOSX_EDIT_START - # Do not force hwloc as dependency (MPI error on quartz) - #depends_on('hwloc', when='@13: +kokkos') - #depends_on('hwloc+cuda', when='@13: +kokkos+cuda') - # GEOSX_EDIT_END - depends_on('hypre@develop', when='@master: +hypre') - depends_on('netcdf-c+mpi+parallel-netcdf', when="+exodus+mpi@12.12.1:") - depends_on('superlu-dist@4.4:5.3', when='@12.6.2:12.12.1+superlu-dist') - depends_on('superlu-dist@5.4:6.2.0', when='@12.12.2:13.0.0+superlu-dist') - depends_on('superlu-dist@6.3.0:', when='@13.0.1:99 +superlu-dist') - depends_on('superlu-dist@:4.3', when='@11.14.1:12.6.1+superlu-dist') - depends_on('superlu-dist@develop', when='@master: +superlu-dist') - - # ###################### Patches ########################## - - # GEOSX_EDIT_START - # Comment out unused patches - - #patch('umfpack_from_suitesparse.patch', when='@11.14.1:12.8.1') - #for _compiler in ['xl', 'xl_r', 'clang']: - # patch('xlf_seacas.patch', when='@12.10.1:12.12.1 %' + _compiler) - # patch('xlf_tpetra.patch', when='@12.12.1 %' + _compiler) - patch('fix_clang_errors_12_18_1.patch', when='@12.18.1%clang') - #patch('cray_secas_12_12_1.patch', when='@12.12.1%cce') - patch('cray_secas.patch', when='@12.14.1:%cce') - - # workaround an NVCC bug with c++14 (https://github.com/trilinos/Trilinos/issues/6954) - # avoid calling deprecated functions with CUDA-11 - #patch('fix_cxx14_cuda11.patch', when='@13.0.0:13.0.1 cxxstd=14 ^cuda@11:') - # Allow building with +teko gotype=long - #patch('https://github.com/trilinos/Trilinos/commit/b17f20a0b91e0b9fc5b1b0af3c8a34e2a4874f3f.patch', - # sha256='dee6c55fe38eb7f6367e1896d6bc7483f6f9ab8fa252503050cc0c68c6340610', - # when='@13.0.0:13.0.1 +teko gotype=long') - # GEOSX_EDIT_END - - def flag_handler(self, name, flags): - is_cce = self.spec.satisfies('%cce') - - if name == 'cxxflags': - spec = self.spec - if '+mumps' in spec: - # see https://github.com/trilinos/Trilinos/blob/master/packages/amesos/README-MUMPS - flags.append('-DMUMPS_5_0') - if '+stk platform=darwin' in spec: - flags.append('-DSTK_NO_BOOST_STACKTRACE') - if '+stk%intel' in spec: - # Workaround for Intel compiler segfaults with STK and IPO - flags.append('-no-ipo') - if '+wrapper' in spec: - flags.append('--expt-extended-lambda') - elif name == 'ldflags' and is_cce: - flags.append('-fuse-ld=gold') - - # GEOSX_EDIT_START - # Property insert gcc-toolchain flag through environment - if name in ['cflags', 'cxxflags', 'cppflags']: - return (None, None, flags) - # GEOSX_EDIT_END - - if is_cce: - return (None, None, flags) - return (flags, None, None) - - def url_for_version(self, version): - url = "https://github.com/trilinos/Trilinos/archive/trilinos-release-{0}.tar.gz" - return url.format(version.dashed) - - def setup_dependent_run_environment(self, env, dependent_spec): - if '+cuda' in self.spec: - # currently Trilinos doesn't perform the memory fence so - # it relies on blocking CUDA kernel launch. This is needed - # in case the dependent app also run a CUDA backend via Trilinos - env.set('CUDA_LAUNCH_BLOCKING', '1') - - def setup_dependent_package(self, module, dependent_spec): - if '+wrapper' in self.spec: - self.spec.kokkos_cxx = self.spec["kokkos-nvcc-wrapper"].kokkos_cxx - else: - self.spec.kokkos_cxx = spack_cxx - - def setup_build_environment(self, env): - spec = self.spec - if '+cuda' in spec and '+wrapper' in spec: - if '+mpi' in spec: - env.set('OMPI_CXX', spec["kokkos-nvcc-wrapper"].kokkos_cxx) - env.set('MPICH_CXX', spec["kokkos-nvcc-wrapper"].kokkos_cxx) - env.set('MPICXX_CXX', spec["kokkos-nvcc-wrapper"].kokkos_cxx) - else: - env.set('CXX', spec["kokkos-nvcc-wrapper"].kokkos_cxx) - - if '+rocm' in spec: - if '+mpi' in spec: - env.set('OMPI_CXX', self.spec['hip'].hipcc) - env.set('MPICH_CXX', self.spec['hip'].hipcc) - env.set('MPICXX_CXX', self.spec['hip'].hipcc) - else: - env.set('CXX', self.spec['hip'].hipcc) - if '+stk' in spec: - # Using CXXFLAGS for hipcc which doesn't use flags in the spack wrappers - env.set('CXXFLAGS', '-DSTK_NO_BOOST_STACKTRACE') - - def cmake_args(self): - options = [] - - spec = self.spec - # GEOSX_EDIT_START - #define = CMakePackage.define - define = self.define - # GEOSX_EDIT_END - define_from_variant = self.define_from_variant - - def _make_definer(prefix): - def define_enable(suffix, value=None): - key = prefix + suffix - if value is None: - # Default to lower-case spec - value = suffix.lower() - elif isinstance(value, bool): - # Explicit true/false - return define(key, value) - return define_from_variant(key, value) - return define_enable - - # Return "Trilinos_ENABLE_XXX" for spec "+xxx" or boolean value - define_trilinos_enable = _make_definer("Trilinos_ENABLE_") - # Same but for TPLs - define_tpl_enable = _make_definer("TPL_ENABLE_") - - # #################### Base Settings ####################### - - options.extend([ - define('Trilinos_VERBOSE_CONFIGURE', False), - define_from_variant('BUILD_SHARED_LIBS', 'shared'), - define_trilinos_enable('ALL_OPTIONAL_PACKAGES', False), - define_trilinos_enable('ALL_PACKAGES', False), - define_trilinos_enable('CXX11', True), - define_trilinos_enable('DEBUG', 'debug'), - define_trilinos_enable('EXAMPLES', False), - define_trilinos_enable('SECONDARY_TESTED_CODE', True), - define_trilinos_enable('TESTS', False), - define_trilinos_enable('Fortran'), - define_trilinos_enable('OpenMP'), - define_trilinos_enable('EXPLICIT_INSTANTIATION', - 'explicit_template_instantiation') - ]) - - if spec.version >= Version('13'): - options.append(define_from_variant('CMAKE_CXX_STANDARD', 'cxxstd')) - else: - # Prior to version 13, Trilinos would erroneously inject - # '-std=c++11' regardless of CMAKE_CXX_STANDARD value - options.append(define( - 'Trilinos_CXX11_FLAGS', - self.compiler.cxx14_flag - if spec.variants['cxxstd'].value == '14' - else self.compiler.cxx11_flag - )) - - # ################## Trilinos Packages ##################### - - options.extend([ - define_trilinos_enable('Amesos'), - define_trilinos_enable('Amesos2'), - define_trilinos_enable('Anasazi'), - define_trilinos_enable('AztecOO', 'aztec'), - define_trilinos_enable('Belos'), - define_trilinos_enable('Epetra'), - define_trilinos_enable('EpetraExt'), - define_trilinos_enable('FEI', False), - define_trilinos_enable('Gtest'), - define_trilinos_enable('Ifpack'), - define_trilinos_enable('Ifpack2'), - define_trilinos_enable('Intrepid'), - define_trilinos_enable('Intrepid2'), - define_trilinos_enable('Isorropia'), - define_trilinos_enable('Kokkos'), - define_trilinos_enable('MiniTensor'), - define_trilinos_enable('Mesquite'), - define_trilinos_enable('ML'), - define_trilinos_enable('MueLu'), - define_trilinos_enable('NOX'), - define_trilinos_enable('Pamgen', False), - define_trilinos_enable('Panzer'), - define_trilinos_enable('Pike', False), - define_trilinos_enable('Piro'), - define_trilinos_enable('Phalanx'), - define_trilinos_enable('PyTrilinos', 'python'), - define_trilinos_enable('ROL'), - define_trilinos_enable('Rythmos'), - define_trilinos_enable('Sacado'), - define_trilinos_enable('SCOREC'), - define_trilinos_enable('Shards'), - define_trilinos_enable('ShyLU'), - define_trilinos_enable('STK'), - define_trilinos_enable('Stokhos'), - define_trilinos_enable('Stratimikos'), - define_trilinos_enable('Teko'), - define_trilinos_enable('Tempus'), - define_trilinos_enable('Thyra'), - define_trilinos_enable('Tpetra'), - define_trilinos_enable('TrilinosCouplings'), - define_trilinos_enable('Zoltan'), - define_trilinos_enable('Zoltan2'), - define_from_variant('EpetraExt_BUILD_BTF', 'epetraextbtf'), - define_from_variant('EpetraExt_BUILD_EXPERIMENTAL', - 'epetraextexperimental'), - define_from_variant('EpetraExt_BUILD_GRAPH_REORDERINGS', - 'epetraextgraphreorderings'), - define_from_variant('Amesos2_ENABLE_Basker', 'basker'), - define_from_variant('Amesos2_ENABLE_LAPACK', 'amesos2'), - ]) - - if '+dtk' in spec: - options.extend([ - define('Trilinos_EXTRA_REPOSITORIES', 'DataTransferKit'), - define_trilinos_enable('DataTransferKit', True), - ]) - - if '+exodus' in spec: - options.extend([ - define_trilinos_enable('SEACAS', True), - define_trilinos_enable('SEACASExodus', True), - define_trilinos_enable('SEACASIoss', True), - define_trilinos_enable('SEACASEpu', True), - define_trilinos_enable('SEACASExodiff', True), - define_trilinos_enable('SEACASNemspread', True), - define_trilinos_enable('SEACASNemslice', True), - ]) - else: - options.extend([ - define_trilinos_enable('SEACASExodus', False), - define_trilinos_enable('SEACASIoss', False), - ]) - - if '+chaco' in spec: - options.extend([ - define_trilinos_enable('SEACAS', True), - define_trilinos_enable('SEACASChaco', True), - ]) - else: - # don't disable SEACAS, could be needed elsewhere - options.extend([ - define_trilinos_enable('SEACASChaco', False), - define_trilinos_enable('SEACASNemslice', False) - ]) - - if '+stratimikos' in spec: - # Explicitly enable Thyra (ThyraCore is required). If you don't do - # this, then you get "NOT setting ${pkg}_ENABLE_Thyra=ON since - # Thyra is NOT enabled at this point!" leading to eventual build - # errors if using MueLu because `Xpetra_ENABLE_Thyra` is set to - # off. - - # Add thyra adapters based on package enables - options.extend( - define_trilinos_enable('Thyra' + pkg + 'Adapters', pkg.lower()) - for pkg in ['Epetra', 'EpetraExt', 'Tpetra']) - - # ######################### TPLs ############################# - - def define_tpl(trilinos_name, spack_name, have_dep): - options.append(define('TPL_ENABLE_' + trilinos_name, have_dep)) - if not have_dep: - return - depspec = spec[spack_name] - libs = depspec.libs - try: - options.extend([ - define(trilinos_name + '_INCLUDE_DIRS', - depspec.headers.directories), - ]) - except NoHeadersError: - # Handle case were depspec does not have headers - pass - - options.extend([ - define(trilinos_name + '_ROOT', depspec.prefix), - define(trilinos_name + '_LIBRARY_NAMES', libs.names), - define(trilinos_name + '_LIBRARY_DIRS', libs.directories), - ]) - - # Enable these TPLs explicitly from variant options. - # Format is (TPL name, variant name, Spack spec name) - tpl_variant_map = [ - ('ADIOS2', 'adios2', 'adios2'), - ('Boost', 'boost', 'boost'), - ('CUDA', 'cuda', 'cuda'), - ('HDF5', 'hdf5', 'hdf5'), - ('HYPRE', 'hypre', 'hypre'), - ('MUMPS', 'mumps', 'mumps'), - ('UMFPACK', 'suite-sparse', 'suite-sparse'), - ('SuperLU', 'superlu', 'superlu'), - ('SuperLUDist', 'superlu-dist', 'superlu-dist'), - ('X11', 'x11', 'libx11'), - ] - if spec.satisfies('@13.0.2:'): - tpl_variant_map.append(('STRUMPACK', 'strumpack', 'strumpack')) - - for tpl_name, var_name, spec_name in tpl_variant_map: - define_tpl(tpl_name, spec_name, spec.variants[var_name].value) - - # Enable these TPLs based on whether they're in our spec; prefer to - # require this way so that packages/features disable availability - tpl_dep_map = [ - ('BLAS', 'blas'), - ('CGNS', 'cgns'), - ('LAPACK', 'lapack'), - ('Matio', 'matio'), - ('METIS', 'metis'), - ('Netcdf', 'netcdf-c'), - ('SCALAPACK', 'scalapack'), - ('Zlib', 'zlib'), - ] - if spec.satisfies('@12.12.1:'): - tpl_dep_map.append(('Pnetcdf', 'parallel-netcdf')) - - # GEOSX_EDIT_START - #if spec.satisfies('@13:'): - # tpl_dep_map.append(('HWLOC', 'hwloc')) - # GEOSX_EDIT_END - - for tpl_name, dep_name in tpl_dep_map: - define_tpl(tpl_name, dep_name, dep_name in spec) - - # MPI settings - options.append(define_tpl_enable('MPI')) - if '+mpi' in spec: - # Force Trilinos to use the MPI wrappers instead of raw compilers - # to propagate library link flags for linkers that require fully - # resolved symbols in shared libs (such as macOS and some newer - # Ubuntu) - options.extend([ - define('CMAKE_C_COMPILER', spec['mpi'].mpicc), - define('CMAKE_CXX_COMPILER', spec['mpi'].mpicxx), - define('CMAKE_Fortran_COMPILER', spec['mpi'].mpifc), - define('MPI_BASE_DIR', spec['mpi'].prefix), - ]) - - # ParMETIS dependencies have to be transitive explicitly - have_parmetis = 'parmetis' in spec - options.append(define_tpl_enable('ParMETIS', have_parmetis)) - if have_parmetis: - options.extend([ - define('ParMETIS_LIBRARY_DIRS', [ - spec['parmetis'].prefix.lib, spec['metis'].prefix.lib - ]), - define('ParMETIS_LIBRARY_NAMES', ['parmetis', 'metis']), - define('TPL_ParMETIS_INCLUDE_DIRS', - spec['parmetis'].headers.directories + - spec['metis'].headers.directories), - ]) - - if spec.satisfies('^superlu-dist@4.0:'): - options.extend([ - define('HAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG', True), - ]) - - if spec.satisfies('^parallel-netcdf'): - options.extend([ - define('TPL_Netcdf_Enables_Netcdf4', True), - define('TPL_Netcdf_PARALLEL', True), - define('PNetCDF_ROOT', spec['parallel-netcdf'].prefix), - ]) - - options.append(define_tpl_enable('Cholmod', False)) - - if spec.satisfies('platform=darwin'): - # Don't let TriBITS define `libdl` as an absolute path to - # the MacOSX{nn.n}.sdk since that breaks at every xcode update - options.append(define_tpl_enable('DLlib', False)) - - # ################# Explicit template instantiation ################# - - complex_s = spec.variants['complex'].value - float_s = spec.variants['float'].value - - options.extend([ - define('Teuchos_ENABLE_COMPLEX', complex_s), - define('Teuchos_ENABLE_FLOAT', float_s), - ]) - - if '+tpetra +explicit_template_instantiation' in spec: - options.append(define_from_variant('Tpetra_INST_OPENMP', 'openmp')) - options.extend([ - define('Tpetra_INST_DOUBLE', True), - define('Tpetra_INST_COMPLEX_DOUBLE', complex_s), - define('Tpetra_INST_COMPLEX_FLOAT', float_s and complex_s), - define('Tpetra_INST_FLOAT', float_s), - define('Tpetra_INST_SERIAL', True), - ]) - - gotype = spec.variants['gotype'].value - if gotype == 'all': - # default in older Trilinos versions to enable multiple GOs - options.extend([ - define('Tpetra_INST_INT_INT', True), - define('Tpetra_INST_INT_LONG', True), - define('Tpetra_INST_INT_LONG_LONG', True), - ]) - else: - options.extend([ - define('Tpetra_INST_INT_INT', gotype == 'int'), - define('Tpetra_INST_INT_LONG', gotype == 'long'), - define('Tpetra_INST_INT_LONG_LONG', gotype == 'long_long'), - ]) - - # ################# Kokkos ###################### - - if '+kokkos' in spec: - arch = Kokkos.get_microarch(spec.target) - if arch: - options.append(define("Kokkos_ARCH_" + arch.upper(), True)) - - define_kok_enable = _make_definer("Kokkos_ENABLE_") - options.extend([ - define_kok_enable('CUDA'), - define_kok_enable('OPENMP' if spec.version >= Version('13') - else 'OpenMP'), - ]) - if '+cuda' in spec: - use_uvm = '+uvm' in spec - options.extend([ - define_kok_enable('CUDA_UVM', use_uvm), - define_kok_enable('CUDA_LAMBDA', True), - define_kok_enable('CUDA_RELOCATABLE_DEVICE_CODE', 'cuda_rdc') - ]) - arch_map = Kokkos.spack_cuda_arch_map - options.extend( - define("Kokkos_ARCH_" + arch_map[arch].upper(), True) - for arch in spec.variants['cuda_arch'].value - ) - - if '+rocm' in spec: - options.extend([ - define_kok_enable('ROCM', False), - define_kok_enable('HIP', True), - define_kok_enable('HIP_RELOCATABLE_DEVICE_CODE', 'rocm_rdc') - ]) - if '+tpetra' in spec: - options.append(define('Tpetra_INST_HIP', True)) - amdgpu_arch_map = Kokkos.amdgpu_arch_map - for amd_target in spec.variants['amdgpu_target'].value: - try: - arch = amdgpu_arch_map[amd_target] - except KeyError: - pass - else: - options.append(define("Kokkos_ARCH_" + arch.upper(), True)) - - # ################# System-specific ###################### - - # Fortran lib (assumes clang is built with gfortran!) - if ('+fortran' in spec - and spec.compiler.name in ['gcc', 'clang', 'apple-clang']): - fc = Executable(spec['mpi'].mpifc) if ( - '+mpi' in spec) else Executable(spack_fc) - libgfortran = fc('--print-file-name', - 'libgfortran.' + dso_suffix, - output=str).strip() - # if libgfortran is equal to "libgfortran." then - # print-file-name failed, use static library instead - if libgfortran == 'libgfortran.' + dso_suffix: - libgfortran = fc('--print-file-name', - 'libgfortran.a', - output=str).strip() - # -L -lgfortran required for OSX - # https://github.com/spack/spack/pull/25823#issuecomment-917231118 - options.append( - define('Trilinos_EXTRA_LINK_FLAGS', - '-L%s/ -lgfortran' % os.path.dirname(libgfortran))) - - if sys.platform == 'darwin' and macos_version() >= Version('10.12'): - # use @rpath on Sierra due to limit of dynamic loader - options.append(define('CMAKE_MACOSX_RPATH', True)) - else: - options.append(define('CMAKE_INSTALL_NAME_DIR', self.prefix.lib)) - - return options - - @run_after('install') - def filter_python(self): - # When trilinos is built with Python, libpytrilinos is included - # through cmake configure files. Namely, Trilinos_LIBRARIES in - # TrilinosConfig.cmake contains pytrilinos. This leads to a - # run-time error: Symbol not found: _PyBool_Type and prevents - # Trilinos to be used in any C++ code, which links executable - # against the libraries listed in Trilinos_LIBRARIES. See - # https://github.com/trilinos/Trilinos/issues/569 and - # https://github.com/trilinos/Trilinos/issues/866 - # A workaround is to remove PyTrilinos from the COMPONENTS_LIST - # and to remove -lpytrilonos from Makefile.export.Trilinos - if '+python' in self.spec: - filter_file(r'(SET\(COMPONENTS_LIST.*)(PyTrilinos;)(.*)', - (r'\1\3'), - '%s/cmake/Trilinos/TrilinosConfig.cmake' % - self.prefix.lib) - filter_file(r'-lpytrilinos', '', - '%s/Makefile.export.Trilinos' % - self.prefix.include) - - def setup_run_environment(self, env): - if '+exodus' in self.spec: - env.prepend_path('PYTHONPATH', self.prefix.lib) - - if '+cuda' in self.spec: - # currently Trilinos doesn't perform the memory fence so - # it relies on blocking CUDA kernel launch. - env.set('CUDA_LAUNCH_BLOCKING', '1') - -# yapf: enable diff --git a/scripts/spack_packages/packages/umpire/package.py b/scripts/spack_packages/packages/umpire/package.py deleted file mode 100644 index a37abf7055f..00000000000 --- a/scripts/spack_packages/packages/umpire/package.py +++ /dev/null @@ -1,299 +0,0 @@ -# Copyright 2013-2023 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 -import socket - -import llnl.util.tty as tty - -from spack.package import * -from spack.pkg.builtin.camp import hip_repair_cache - - -class Umpire(CachedCMakePackage, CudaPackage, ROCmPackage): - """An application-focused API for memory management on NUMA & GPU - architectures""" - - homepage = "https://github.com/LLNL/Umpire" - git = "https://github.com/LLNL/Umpire.git" - tags = ["radiuss", "e4s"] - - maintainers("davidbeckingsale") - - # GEOS_EDIT_START - version("2023.06.0", branch="v2023.06.0", submodules=False) - # GEOS_EDIT_END - - - version("develop", branch="develop", submodules=False) - version("main", branch="main", submodules=False) - version("2022.03.1", tag="v2022.03.1", submodules=False) - version("2022.03.0", tag="v2022.03.0", submodules=False) - version("6.0.0", tag="v6.0.0", submodules=True) - version("5.0.1", tag="v5.0.1", submodules=True) - version("5.0.0", tag="v5.0.0", submodules=True) - version("4.1.2", tag="v4.1.2", submodules=True) - version("4.1.1", tag="v4.1.1", submodules=True) - version("4.1.0", tag="v4.1.0", submodules=True) - version("4.0.1", tag="v4.0.1", submodules=True) - version("4.0.0", tag="v4.0.0", submodules=True) - version("3.0.0", tag="v3.0.0", submodules=True) - version("2.1.0", tag="v2.1.0", submodules=True) - version("2.0.0", tag="v2.0.0", submodules=True) - version("1.1.0", tag="v1.1.0", submodules=True) - version("1.0.1", tag="v1.0.1", submodules=True) - version("1.0.0", tag="v1.0.0", submodules=True) - version("0.3.5", tag="v0.3.5", submodules=True) - version("0.3.4", tag="v0.3.4", submodules=True) - version("0.3.3", tag="v0.3.3", submodules=True) - version("0.3.2", tag="v0.3.2", submodules=True) - version("0.3.1", tag="v0.3.1", submodules=True) - version("0.3.0", tag="v0.3.0", submodules=True) - version("0.2.4", tag="v0.2.4", submodules=True) - version("0.2.3", tag="v0.2.3", submodules=True) - version("0.2.2", tag="v0.2.2", submodules=True) - version("0.2.1", tag="v0.2.1", submodules=True) - version("0.2.0", tag="v0.2.0", submodules=True) - version("0.1.4", tag="v0.1.4", submodules=True) - version("0.1.3", tag="v0.1.3", submodules=True) - - # GEOS_EDIT_START - # Unused patches - - #patch("std-filesystem-pr784.patch", when="@2022.03.1 +rocm ^blt@0.5.2:") - #patch("camp_target_umpire_3.0.0.patch", when="@3.0.0") - # patch("cmake_version_check.patch", when="@4.1") - #patch("missing_header_for_numeric_limits.patch", when="@4.1:5.0.1") - # GEOS_EDIT_END - - # export targets when building pre-6.0.0 release with BLT 0.4.0+ - patch( - "https://github.com/LLNL/Umpire/commit/5773ce9af88952c8d23f9bcdcb2e503ceda40763.patch?full_index=1", - sha256="f3b21335ce5cf9c0fecc852a94dfec90fb5703032ac97f9fee104af9408d8899", - when="@:5.0.1 ^blt@0.4:", - ) - - variant("fortran", default=False, description="Build C/Fortran API") - variant("c", default=True, description="Build C API") - variant("numa", default=False, description="Enable NUMA support") - variant("shared", default=True, description="Enable Shared libs") - variant("openmp", default=False, description="Build with OpenMP support") - variant("deviceconst", default=False, description="Enables support for constant device memory") - variant("examples", default=True, description="Build Umpire Examples") - variant( - "tests", - default="none", - values=("none", "basic", "benchmarks"), - multi=False, - description="Tests to run", - ) - variant("device_alloc", default=True, description="Build Umpire Device Allocator") - - depends_on("cmake@3.8:", type="build") - depends_on("cmake@3.9:", when="+cuda", type="build") - depends_on("cmake@3.14:", when="@2022.03.0:") - - # GEOS_EDIT_START - depends_on("blt@0.5.3:", type="build", when="@2023.06.0:") - # GEOS_EDIT_END - depends_on("blt@0.5.0:", type="build", when="@2022.03.0:") - depends_on("blt@0.4.1", type="build", when="@6.0.0") - depends_on("blt@0.4.0:", type="build", when="@4.1.3:5.0.1") - depends_on("blt@0.3.6:", type="build", when="@:4.1.2") - - depends_on("camp", when="@5.0.0:") - depends_on("camp@0.2.2:0.2.3", when="@6.0.0") - depends_on("camp@0.1.0", when="@5.0.0:5.0.1") - depends_on("camp@2022.03.2:", when="@2022.03.0:") - # GEOS_EDIT_START - depends_on("camp@2023.06.0:", when="@2023.06.0:") - # GEOS_EDIT_END - depends_on("camp@main", when="@main") - depends_on("camp@main", when="@develop") - depends_on("camp+openmp", when="+openmp") - depends_on("camp~cuda", when="~cuda") - - with when("@5.0.0:"): - with when("+cuda"): - depends_on("camp+cuda") - for sm_ in CudaPackage.cuda_arch_values: - depends_on("camp+cuda cuda_arch={0}".format(sm_), when="cuda_arch={0}".format(sm_)) - - with when("+rocm"): - depends_on("camp+rocm") - for arch_ in ROCmPackage.amdgpu_targets: - depends_on( - "camp+rocm amdgpu_target={0}".format(arch_), - when="amdgpu_target={0}".format(arch_), - ) - - conflicts("+numa", when="@:0.3.2") - conflicts("~c", when="+fortran", msg="Fortran API requires C API") - conflicts("+device_alloc", when="@:2022.03.0") - - # device allocator exports device code, which requires static libs - # currently only available for cuda. - conflicts("+shared", when="+cuda") - - # https://github.com/LLNL/Umpire/issues/653 - # This range looks weird, but it ensures the concretizer looks at it as a - # range, not as a concrete version, so that it also matches 10.3.* versions. - conflicts("%gcc@10.3.0:10.3", when="+cuda") - - def _get_sys_type(self, spec): - sys_type = spec.architecture - if "SYS_TYPE" in env: - sys_type = env["SYS_TYPE"] - return sys_type - - @property - def cache_name(self): - hostname = socket.gethostname() - if "SYS_TYPE" in env: - hostname = hostname.rstrip("1234567890") - return "{0}-{1}-{2}@{3}.cmake".format( - hostname, - self._get_sys_type(self.spec), - self.spec.compiler.name, - self.spec.compiler.version, - ) - - def initconfig_compiler_entries(self): - spec = self.spec - entries = super().initconfig_compiler_entries() - - if "+rocm" in spec: - entries.insert(0, cmake_cache_path("CMAKE_CXX_COMPILER", spec["hip"].hipcc)) - - option_prefix = "UMPIRE_" if spec.satisfies("@2022.03.0:") else "" - - if "+fortran" in spec and self.compiler.fc is not None: - entries.append(cmake_cache_option("ENABLE_FORTRAN", True)) - else: - entries.append(cmake_cache_option("ENABLE_FORTRAN", False)) - - entries.append(cmake_cache_option("{}ENABLE_C".format(option_prefix), "+c" in spec)) - - return entries - - def initconfig_hardware_entries(self): - spec = self.spec - entries = super().initconfig_hardware_entries() - - option_prefix = "UMPIRE_" if spec.satisfies("@2022.03.0:") else "" - - if "+cuda" in spec: - entries.append(cmake_cache_option("ENABLE_CUDA", True)) - - if not spec.satisfies("cuda_arch=none"): - cuda_arch = spec.variants["cuda_arch"].value - entries.append(cmake_cache_string("CUDA_ARCH", "sm_{0}".format(cuda_arch[0]))) - entries.append( - cmake_cache_string("CMAKE_CUDA_ARCHITECTURES", "{0}".format(cuda_arch[0])) - ) - flag = "-arch sm_{0}".format(cuda_arch[0]) - entries.append(cmake_cache_string("CMAKE_CUDA_FLAGS", "{0}".format(flag))) - - entries.append( - cmake_cache_option( - "{}ENABLE_DEVICE_CONST".format(option_prefix), spec.satisfies("+deviceconst") - ) - ) - else: - entries.append(cmake_cache_option("ENABLE_CUDA", False)) - - if "+rocm" in spec: - entries.append(cmake_cache_option("ENABLE_HIP", True)) - entries.append(cmake_cache_path("HIP_ROOT_DIR", "{0}".format(spec["hip"].prefix))) - hip_repair_cache(entries, spec) - archs = self.spec.variants["amdgpu_target"].value - if archs != "none": - arch_str = ",".join(archs) - entries.append( - cmake_cache_string("HIP_HIPCC_FLAGS", "--amdgpu-target={0}".format(arch_str)) - ) - entries.append( - cmake_cache_string("CMAKE_HIP_ARCHITECTURES", "{0}".format(arch_str)) - ) - else: - entries.append(cmake_cache_option("ENABLE_HIP", False)) - - return entries - - def initconfig_package_entries(self): - spec = self.spec - entries = [] - - option_prefix = "UMPIRE_" if spec.satisfies("@2022.03.0:") else "" - - # TPL locations - entries.append("#------------------{0}".format("-" * 60)) - entries.append("# TPLs") - entries.append("#------------------{0}\n".format("-" * 60)) - - entries.append(cmake_cache_path("BLT_SOURCE_DIR", spec["blt"].prefix)) - if spec.satisfies("@5.0.0:"): - entries.append(cmake_cache_path("camp_DIR", spec["camp"].prefix)) - entries.append(cmake_cache_option("{}ENABLE_NUMA".format(option_prefix), "+numa" in spec)) - # GEOS_EDIT_START - - # The wrong way to initialize OpenMP from spack upstream - # entries.append( - # cmake_cache_option("{}ENABLE_OPENMP".format(option_prefix), "+openmp" in spec) - # ) - entries.append(cmake_cache_option( - "ENABLE_OPENMP", "+openmp" in spec)) - # GEOS_EDIT_END - entries.append(cmake_cache_option("ENABLE_BENCHMARKS", "tests=benchmarks" in spec)) - entries.append( - cmake_cache_option("{}ENABLE_EXAMPLES".format(option_prefix), "+examples" in spec) - ) - entries.append(cmake_cache_option("{}ENABLE_DOCS".format(option_prefix), False)) - entries.append( - cmake_cache_option("UMPIRE_ENABLE_DEVICE_ALLOCATOR", "+device_alloc" in spec) - ) - entries.append(cmake_cache_option("BUILD_SHARED_LIBS", "+shared" in spec)) - entries.append(cmake_cache_option("ENABLE_TESTS", "tests=none" not in spec)) - - return entries - - def cmake_args(self): - options = [] - return options - - def test(self): - """Perform stand-alone checks on the installed package.""" - if self.spec.satisfies("@:1") or not os.path.isdir(self.prefix.bin): - tty.info("Skipping: checks not installed in bin for v{0}".format(self.version)) - return - - # Run a subset of examples PROVIDED installed - # tutorials with readily checkable outputs. - checks = { - "malloc": ["99 should be 99"], - "recipe_dynamic_pool_heuristic": ["in the pool", "releas"], - "recipe_no_introspection": ["has allocated", "used"], - "strategy_example": ["Available allocators", "HOST"], - "tut_copy": ["Copied source data"], - "tut_introspection": ["Allocator used is HOST", "size of the allocation"], - "tut_memset": ["Set data from HOST"], - "tut_move": ["Moved source data", "HOST"], - "tut_reallocate": ["Reallocated data"], - "vector_allocator": [""], - } - - for exe in checks: - expected = checks[exe] - reason = "test: checking output from {0}".format(exe) - self.run_test( - exe, - [], - expected, - 0, - installed=False, - purpose=reason, - skip_missing=True, - work_dir=self.prefix.bin, - ) \ No newline at end of file diff --git a/scripts/spack_packages/packages/vtk/package.py b/scripts/spack_packages/packages/vtk/package.py deleted file mode 100644 index b1a666f82fe..00000000000 --- a/scripts/spack_packages/packages/vtk/package.py +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright 2013-2022 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 -import sys - -from spack import * - - -class Vtk(CMakePackage): - """The Visualization Toolkit (VTK) is an open-source, freely - available software system for 3D computer graphics, image - processing and visualization. """ - - homepage = "http://www.vtk.org" - url = "https://www.vtk.org/files/release/9.0/VTK-9.0.0.tar.gz" - list_url = "http://www.vtk.org/download/" - - maintainers = ['chuckatkins', 'danlipsa'] - - version("9.2.6", sha256="06fc8d49c4e56f498c40fcb38a563ed8d4ec31358d0101e8988f0bb4d539dd12") - version('9.1.0', sha256='8fed42f4f8f1eb8083107b68eaa9ad71da07110161a3116ad807f43e5ca5ce96') - version('9.0.3', sha256='bc3eb9625b2b8dbfecb6052a2ab091fc91405de4333b0ec68f3323815154ed8a') - version('9.0.1', sha256='1b39a5e191c282861e7af4101eaa8585969a2de05f5646c9199a161213a622c7') - version('9.0.0', sha256='15def4e6f84d72f82386617fe595ec124dda3cbd13ea19a0dcd91583197d8715') - version('8.2.0', sha256='34c3dc775261be5e45a8049155f7228b6bd668106c72a3c435d95730d17d57bb') - version('8.1.2', sha256='0995fb36857dd76ccfb8bb07350c214d9f9099e80b1e66b4a8909311f24ff0db') - version('8.1.1', sha256='71a09b4340f0a9c58559fe946dc745ab68a866cf20636a41d97b6046cb736324') - version('8.1.0', sha256='6e269f07b64fb13774f5925161fb4e1f379f4e6a0131c8408c555f6b58ef3cb7') - version('8.0.1', sha256='49107352923dea6de05a7b4c3906aaf98ef39c91ad81c383136e768dcf304069') - version('7.1.0', sha256='5f3ea001204d4f714be972a810a62c0f2277fbb9d8d2f8df39562988ca37497a') - version('7.0.0', sha256='78a990a15ead79cdc752e86b83cfab7dbf5b7ef51ba409db02570dbdd9ec32c3') - version('6.3.0', sha256='92a493354c5fa66bea73b5fc014154af5d9f3f6cee8d20a826f4cd5d4b0e8a5e') - version('6.1.0', sha256='bd7df10a479606d529a8b71f466c44a2bdd11fd534c62ce0aa44fad91883fa34') - - variant('python', default=False, description='Enable Python support') - variant('mpi', default=True, description='Enable MPI support') - - patch('vtkXMLReader-fpe.patch', when='@9.1.0:') - - extends('python', when='+python') - - # Acceptable python versions depend on vtk version - # We need vtk at least 8.0.1 for python@3, - # and at least 9.0 for python@3.8 - depends_on('python@2.7:2.9', when='@:8.0 +python', type=('build', 'run')) - depends_on('python@2.7:3.7.99', when='@8.0.1:8.9 +python', type=('build', 'run')) - depends_on('python@2.7:', when='@9.0: +python', type=('build', 'run')) - - # We need mpi4py if buidling python wrappers and using MPI - depends_on('py-mpi4py', when='+python+mpi', type='run') - - depends_on('mpi', when='+mpi') - - def cmake_args(self): - spec = self.spec - - # yapf: disable - # Added GEOSX Arguments - if '+mpi' in spec: - mpi_args = [ - self.define('CMAKE_C_COMPILER', spec['mpi'].mpicc), - self.define('CMAKE_CXX_COMPILER', spec['mpi'].mpicxx), - self.define('CMAKE_CXX_FLAGS', self.spec.compiler_flags["cxxflags"]), - '-DVTK_USE_MPI=ON', - '-DVTK_MODULE_ENABLE_VTK_IOParallelXML=YES', - '-DVTK_MODULE_ENABLE_VTK_FiltersParallelDIY2=YES' - ] - else: - mpi_args = [ - self.define('CMAKE_C_COMPILER', self.compiler.cc), - self.define('CMAKE_CXX_COMPILER', self.compiler.cxx), - self.define('CMAKE_CXX_FLAGS', self.spec.compiler_flags["cxxflags"]), - '-DVTK_USE_MPI=OFF', - '-DVTK_MODULE_ENABLE_VTK_IOParallelXML=NO', - '-DVTK_MODULE_ENABLE_VTK_FiltersParallelDIY2=NO', - ] - - cmake_args= [ - '-DVTK_GROUP_ENABLE_Imaging=DONT_WANT', - '-DVTK_GROUP_ENABLE_MPI=DONT_WANT', - '-DVTK_GROUP_ENABLE_Qt=DONT_WANT', - '-DVTK_GROUP_ENABLE_Rendering=DONT_WANT', - '-DVTK_GROUP_ENABLE_StandAlone=DONT_WANT', - '-DVTK_GROUP_ENABLE_Views=DONT_WANT', - '-DVTK_GROUP_ENABLE_Web=DONT_WANT', - '-DVTK_BUILD_ALL_MODULES=OFF', - '-DVTK_WRAP_PYTHON=OFF', - '-DVTK_WRAP_JAVA=OFF', - '-DVTK_MODULE_ENABLE_VTK_vtkm=DONT_WANT', - '-DVTK_MODULE_ENABLE_VTK_IOXML=YES', - '-DVTK_MODULE_ENABLE_VTK_IOLegacy=YES', - '-DVTK_BUILD_TESTING=OFF', - '-DVTK_LEGACY_REMOVE=ON' - ] - # yapf: enable - - cmake_args = mpi_args + cmake_args - - return cmake_args diff --git a/scripts/spack_packages/packages/vtk/vtkXMLReader-fpe.patch b/scripts/spack_packages/packages/vtk/vtkXMLReader-fpe.patch deleted file mode 100644 index c998db19811..00000000000 --- a/scripts/spack_packages/packages/vtk/vtkXMLReader-fpe.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/IO/XML/vtkXMLReader.cxx 2023-02-14 20:03:53.000000000 -0800 -+++ b/IO/XML/vtkXMLReader.cxx.patch 2023-05-12 08:52:36.017274000 -0700 -@@ -53,6 +53,7 @@ - #include - #include - #include -+#include - #include - #include // C++ locale - #include -@@ -1958,7 +1959,7 @@ - if (!this->AbortExecute) - { - // Round progress to nearest 100th. -- float rounded = static_cast(int((progress * 100) + 0.5f)) / 100.f; -+ float const rounded = std::round(progress * 100) * 0.01; - if (this->GetProgress() != rounded) - { - this->UpdateProgress(rounded); \ No newline at end of file diff --git a/scripts/spack_packages/repo.yaml b/scripts/spack_packages/repo.yaml deleted file mode 100644 index 19bb9d851f8..00000000000 --- a/scripts/spack_packages/repo.yaml +++ /dev/null @@ -1,2 +0,0 @@ -repo: - namespace: geos diff --git a/scripts/uberenv b/scripts/uberenv deleted file mode 160000 index d0cf52c5894..00000000000 --- a/scripts/uberenv +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d0cf52c58949eeb5226e7dbee8b6ac4cbea48b0c diff --git a/src/cmake/thirdparty/SetupGeosxThirdParty.cmake b/src/cmake/thirdparty/SetupGeosxThirdParty.cmake index 28549eb8927..f042521712b 100644 --- a/src/cmake/thirdparty/SetupGeosxThirdParty.cmake +++ b/src/cmake/thirdparty/SetupGeosxThirdParty.cmake @@ -726,7 +726,13 @@ endif() if(DEFINED TRILINOS_DIR AND ENABLE_TRILINOS) message(STATUS "TRILINOS_DIR = ${TRILINOS_DIR}") - include(${TRILINOS_DIR}/lib64/cmake/Trilinos/TrilinosConfig.cmake) + if(EXISTS "${TRILINOS_DIR}/lib64/cmake/Trilinos/TrilinosConfig.cmake") + include(${TRILINOS_DIR}/lib64/cmake/Trilinos/TrilinosConfig.cmake) + endif() + + if(EXISTS "${TRILINOS_DIR}/lib/cmake/Trilinos/TrilinosConfig.cmake") + include(${TRILINOS_DIR}/lib/cmake/Trilinos/TrilinosConfig.cmake) + endif() list(REMOVE_ITEM Trilinos_LIBRARIES "gtest") list(REMOVE_DUPLICATES Trilinos_LIBRARIES) diff --git a/src/coreComponents/LvArray b/src/coreComponents/LvArray index 00e3ead6706..38baddbfda0 160000 --- a/src/coreComponents/LvArray +++ b/src/coreComponents/LvArray @@ -1 +1 @@ -Subproject commit 00e3ead67060d3c3d4b8291d8e4abbf680b87eb3 +Subproject commit 38baddbfda0cd3fb96e63b1a54b9556be9389e0c diff --git a/src/coreComponents/common/CMakeLists.txt b/src/coreComponents/common/CMakeLists.txt index 9a4de42a717..2f146179456 100644 --- a/src/coreComponents/common/CMakeLists.txt +++ b/src/coreComponents/common/CMakeLists.txt @@ -81,7 +81,7 @@ set( common_sources Units.cpp ) -set( dependencyList ${parallelDeps} lvarray RAJA chai ) +set( dependencyList ${parallelDeps} lvarray RAJA chai umpire) if (TARGET conduit::conduit) set( dependencyList ${dependencyList} conduit::conduit ) diff --git a/src/coreComponents/denseLinearAlgebra/unitTests/testDenseLASolvers.cpp b/src/coreComponents/denseLinearAlgebra/unitTests/testDenseLASolvers.cpp index cbeda07ea64..305e492e9c2 100644 --- a/src/coreComponents/denseLinearAlgebra/unitTests/testDenseLASolvers.cpp +++ b/src/coreComponents/denseLinearAlgebra/unitTests/testDenseLASolvers.cpp @@ -88,6 +88,8 @@ class SingularLinearSystem : public LinearSystem< N > { std::mt19937 generator( seed ); std::uniform_real_distribution< real64 > distribution( -10.0, 10.0 ); + + solution[N-1] = 0.0; for( ptrdiff_t i=0; i + + + + + + + + @@ -1387,16 +1395,40 @@ stress - traction is applied to the faces as specified by the inner product of i + + + + + + + + + + + + + + + + + + + + + + + + @@ -1634,6 +1666,8 @@ stress - traction is applied to the faces as specified by the inner product of i + + @@ -3308,7 +3342,7 @@ Level 0 outputs no specific information for this solver. Higher levels require m - + @@ -3331,7 +3365,7 @@ Local- Add jump stabilization on interior of macro elements--> - + diff --git a/src/coreComponents/schema/schema.xsd.other b/src/coreComponents/schema/schema.xsd.other index 91ec1f05a2c..f81e52b4561 100644 --- a/src/coreComponents/schema/schema.xsd.other +++ b/src/coreComponents/schema/schema.xsd.other @@ -341,11 +341,15 @@ + + + + @@ -482,7 +486,7 @@ - + @@ -572,7 +576,7 @@ - + @@ -609,7 +613,7 @@ - + @@ -632,7 +636,7 @@ - + @@ -662,7 +666,7 @@ - + @@ -681,7 +685,7 @@ - + @@ -705,7 +709,7 @@ - + @@ -724,7 +728,7 @@ - + @@ -740,7 +744,7 @@ - + @@ -751,7 +755,7 @@ - + @@ -764,7 +768,7 @@ - + @@ -777,7 +781,7 @@ - + @@ -793,7 +797,7 @@ - + @@ -827,7 +831,7 @@ - + @@ -860,7 +864,7 @@ - + @@ -892,7 +896,7 @@ - + @@ -909,7 +913,7 @@ - + @@ -925,7 +929,7 @@ - + @@ -936,7 +940,7 @@ - + @@ -947,7 +951,7 @@ - + @@ -960,7 +964,7 @@ - + @@ -973,7 +977,7 @@ - + @@ -986,7 +990,7 @@ - + @@ -997,7 +1001,7 @@ - + @@ -1008,7 +1012,7 @@ - + @@ -1021,7 +1025,7 @@ - + @@ -1036,7 +1040,7 @@ - + @@ -1051,7 +1055,7 @@ - + @@ -1064,7 +1068,7 @@ - + @@ -1075,7 +1079,7 @@ - + @@ -1088,7 +1092,7 @@ - + @@ -1099,7 +1103,7 @@ - + @@ -1110,7 +1114,7 @@ - + @@ -1123,7 +1127,7 @@ - + @@ -1134,7 +1138,7 @@ - + @@ -1145,7 +1149,7 @@ - + @@ -1158,7 +1162,7 @@ - + @@ -1173,7 +1177,7 @@ - + @@ -1188,7 +1192,7 @@ - + @@ -1201,7 +1205,7 @@ - + @@ -1216,7 +1220,7 @@ - + @@ -1227,7 +1231,7 @@ - + @@ -1240,7 +1244,7 @@ - + @@ -1253,7 +1257,7 @@ - + @@ -1268,7 +1272,7 @@ - + @@ -1284,7 +1288,7 @@ - + @@ -1299,7 +1303,7 @@ - + @@ -1316,7 +1320,7 @@ - + @@ -1333,7 +1337,7 @@ - + @@ -1350,7 +1354,7 @@ - + @@ -1365,7 +1369,7 @@ - + @@ -1378,7 +1382,7 @@ - + @@ -1417,7 +1421,7 @@ - + @@ -1446,7 +1450,7 @@ - + @@ -1541,7 +1545,7 @@ - + @@ -3165,7 +3169,7 @@ - + @@ -3193,7 +3197,7 @@ - + @@ -3212,11 +3216,11 @@ - + - + @@ -3226,7 +3230,7 @@ - + @@ -3236,11 +3240,11 @@ - + - + @@ -3250,7 +3254,7 @@ - + @@ -3260,7 +3264,7 @@ - + @@ -3270,7 +3274,7 @@ - + @@ -3294,7 +3298,7 @@ - + @@ -3312,7 +3316,7 @@ - + @@ -3324,7 +3328,7 @@ - + @@ -3336,7 +3340,7 @@ - + @@ -3344,11 +3348,11 @@ - + - + @@ -3371,7 +3375,7 @@ - + @@ -3397,7 +3401,7 @@ - + @@ -3418,7 +3422,7 @@ - + @@ -3448,7 +3452,7 @@ - + @@ -3462,7 +3466,7 @@ - + @@ -3489,7 +3493,7 @@ - + @@ -3528,7 +3532,7 @@ - + diff --git a/src/docs/sphinx/buildGuide/SpackUberenv.rst b/src/docs/sphinx/buildGuide/SpackUberenv.rst index 7b2dc11714f..195b1d256f2 100644 --- a/src/docs/sphinx/buildGuide/SpackUberenv.rst +++ b/src/docs/sphinx/buildGuide/SpackUberenv.rst @@ -3,25 +3,98 @@ Spack and Uberenv ================= -GEOS is transitioning to a new `Spack `_ and `Uberenv `_ system for building our dependencies. We refer the reader to the `Spack documentation `_ and `Uberenv documentation `_, in particular the Spack documentation for `specs and dependencies `_, `manual compiler configuration `_ and `external packages `_ are worth reading. +GEOS is transitioning to a new `Uberenv `_ and `Spack `_ system for building our dependencies. We refer the reader to the `Uberenv documentation `_ and `Spack documentation `_, in particular the Spack documentation sections worth reading are: -Building the dependencies can be as simple as running +* `Specs and dependencies `_ +* `Virtual dependencies `_ +* `Manual compiler configuration `_ +* `External packages `_ + +Building the dependencies can be as simple as running: .. code-block:: console ./scripts/uberenv/uberenv.py -This will create a directory ``uberenv_libs`` (or a directory name you specify by adding ``--prefix directory-name``) in the current working directory, clone Spack into ``uberenv_libs/spack`` and install the dependencies into ``uberenv_libs/system_dependent_path``. It will then spit out a host-config file in the current directory which you can use to build GEOS. While the above command **should** work on every system, it **should never be used**. Invoked as such, Spack will ignore any system libraries you have installed and will go down a rabbit hole building dependencies. Furthermore this does not allow you to choose the compiler to build. Both of these are easily solved by creating a directory with a ``spack.yaml``. +from the `thirdPartyLibs `_ directory. This will create a directory ``uberenv_libs`` (or a directory name you specify by adding ``--prefix directory-name``) in the current working directory, clone Spack into ``uberenv_libs/spack`` and install the dependencies into ``uberenv_libs/system_dependent_path``. It will then spit out host-config files (see :ref:`HostConfig`) in the current directory which you can use to build GEOS or LvArray. While the above command **should** work on every system, it **should never be used** to build GEOS. Invoked as such, Spack will ignore any system libraries you have installed and will go down a rabbit hole building dependencies. Furthermore this does not allow you to choose the compiler to build with. Both of these are easily solved by creating a ``spack.yaml`` configuration file, also known in Spack as an environment file, to tell Spack where pre-installed system libraries and compiles are located. See :ref:`SpackYaml` for more on how to create a ``spack.yaml`` file. + +Once you have the ``spack.yaml`` file setup, you can run Uberenv again and instruct it to use the environment file with the command line option ``--spack-env-file``. If for instance you added Clang 14.0.6 to the ``spack.yaml`` file, then your command to build the dependencies would look something like this: + +.. code-block:: console + + ./scripts/uberenv/uberenv.py --spack-env-file=/path/to/your/spack.yaml --spec="%clang@14.0.6" --prefix=/output/path/to/third-party/GEOS/libraries + +For more Uberenv command-line options, you can run the ``uberenv.py`` script with the ``--help`` option or consult the `command line options `_. + +.. note:: + There is no requirement that your environment file be named ``spack.yaml`` when it is passed to Uberenv using the ``--spack-env-file`` command line option. + +.. note:: + On LC systems only, there is not a requirement to specify ``--spack-env-file``. This is because Uberenv uses the environment variable ``SYS_TYPE`` in combination with the ``.uberenv_config.json`` Uberenv configuration file to determine the folder name that contains the required ``spack.yaml`` file (e.g. ``scripts/spack_configs/blueos_3_ppc64le_ib_p9/spack.yaml``). More information on Uberenv configuration behavior can be found in `Uberenv spack configurations documentation `_. + +.. _SpackYaml: + +spack.yaml +---------- + +The ``spack.yaml`` configuration file tells Spack where it can find relevant packages and compilers to build GEOS third-party dependencies. Without ``spack.yaml``, building the dependencies will take significantly longer. -To prevent this from happening you'll need to create a directory with a ``spack.yaml`` file. You can find working examples for commonly used systems in `scripts/spack_configs `_. +There are many examples and resources available for constructing a ``spack.yaml`` file: -Once you have these files setup you can run Uberenv again and instruct it to use them with. If for instance you added Clang 10.0.1 to the ``spack.yaml`` file the your command would look something like this: +* GEOS's LC configuration files for `toss_4_x86_64_ib `_ and `blueos_3_ppc64le_ib_p9 `_. Additionally, the header of these configuration files include the Spack spec to pass to ``--spec`` for different compilers and package variants. +* LLNL's shared Spack configurations for RADIUSS projects: https://github.com/LLNL/radiuss-spack-configs/tree/main +* NERSC Spack Infrastructure: https://github.com/NERSC/spack-infrastructure/tree/main +* Shared Spack configuration files with other HPC sites: https://github.com/spack/spack-configs +* The documentation list mentioned above: :ref:`SpackUberenv` + +spack.yaml from scratch +~~~~~~~~~~~~~~~~~~~~~~~ + +If the examples and resources listed in :ref:`SpackYaml` are not applicable to your system, or you would like to see what packages are already installed on your system, you can call Uberenv with the following option: .. code-block:: console - ./scripts/uberenv/uberenv.py --spack-config-dir=/path/to/your/config/directory/ --spec="%clang@14.0.6" + ./scripts/uberenv/uberenv.py --setup-and-env-only + +This command will setup Spack and ask Spack create a ``spack.yaml`` environment file for you. Uberenv will invoke `spack compiler find `_ and `spack external find `_ to find pre-installed compilers and packages on your system. + +.. note:: + These spack commands called underneath are not perfect and are not guaranteed to find every compiler and every package available on your system. In fact, the commands can be non-deterministic, and you can get two different ``spack.yaml`` environment files from two separate invocations! Also, not all the packages found are relevant dependencies or sub-dependencies for GEOS. Of the packages that are relevant, they may not be the right version! + + This command should be used as a first approximation of your system environment, to determine the paths where more suitable compilers and packages are potentially located. + +Required package versions in spack.yaml +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In the LC configuration files mentioned in :ref:`SpackYaml` section, you will see a list of packages with the ``require`` keyword: + +.. code-block:: console + + hypre: + require: "@git.06da35b1a4b1066a093bc0c6c48aee12bee74cd4" + ... + +This tells Spack that GEOS always `requires `_ a specific commit of ``hypre``, a commit on the latest develop branch in this case. Ideally, package versions should be specified in the `GEOS Spack package file `_. However, when a version of a package is newer than what Spack knows about or an unversioned commit is needed, the Spack package syntax cannot express that requirement. As a result: + +.. warning:: + Every ``spack.yaml`` file **must have the list of packages with the "require" keyword** to ensure these packages are built with the right versions or commits. See LC configuration files mentioned in :ref:`SpackYaml` section for the list. + + + +Uberenv configuration file +-------------------------- -It is worth noting that GEOS has `two project json files `_ (``.uberenv_config.json`` and ``scripts/pygeosx_configs/pygeosx.json``) and two configuration directories for LC systems (``scripts/spack_configs`` and ``scripts/pygeosx_configs``). The ``.uberenv_config.json`` project json file and ``scripts/spack_configs`` directory is for building GEOS. The ``scripts/pygeosx_configs/pygeosx.json`` project json file and ``scripts/pygeosx_configs`` directory is for building ``pygeosx``. This is because ``pygeosx`` has a separate list of required compilers and packages to build from GEOS (e.g. ``pygeosx``'s numpy dependency recommends building with gcc and using openblas for BLAS/LAPACK). However, when not building ``pygeosx`` other dependencies depend on python, but an existing system version works just fine, so it can be put in GEOS's ``spack.yaml`` to prevent Spack from building it. By default, Uberenv will find and use ``.uberenv_config.json`` to build GEOS, but you can use the ``--project-json`` command line option to target ``scripts/pygeosx_configs/pygeosx.json`` to build ``pygeosx``: +Uberenv needs a `.uberenv_config.json `_ configuration file to function as a submodule. +Details on the various configuration options can be found in `Uberenv project configuration documentation `_. The most notable option for maintenance is ``spack_commit``, which is the Spack commit that Uberenv checkouts to build the dependencies. + + +pygeosx +------- + +.. warning:: + The spack build system for ``pygeosx`` is a work in progress. + +It is worth noting that GEOS has `two project json files `_ (``.uberenv_config.json`` and ``scripts/pygeosx_configs/pygeosx.json``) and two configuration directories for LC systems (``scripts/spack_configs`` and ``scripts/pygeosx_configs``). The ``.uberenv_config.json`` project json file and ``scripts/spack_configs`` directory is for building GEOS dependencies. The ``scripts/pygeosx_configs/pygeosx.json`` project json file and ``scripts/pygeosx_configs`` directory is for building ``pygeosx`` dependencies.This is because ``pygeosx`` has a separate list of required compilers and packages to build from GEOS (e.g. ``pygeosx``'s numpy dependency recommends building with gcc and using openblas for BLAS/LAPACK). When not building ``pygeosx``, other dependencies of GEOS still depend on python. An existing system version of python will work just fine, and can be put in GEOS's ``spack.yaml`` to prevent Spack from building its own verion of python. By default, Uberenv will find and use ``.uberenv_config.json`` to build GEOS, but you can use the ``--project-json`` command line option to target ``scripts/pygeosx_configs/pygeosx.json`` to build ``pygeosx``: .. code-block:: console @@ -36,27 +109,44 @@ Build Configuration .. warning:: The spack build system is undergoing updates. The ``petsc`` variant and others are still a work in progress. -The GEOS Spack package has a lot of options for controlling which dependencies you would like to build and how you'd like them built. The GEOS Spack package file is at ```scripts/spack_packages/packages/geosx/package.py `_.`` The variants for the package are as follows - -.. literalinclude:: ../../../../scripts/spack_packages/packages/geosx/package.py - :language: python - :start-after: # SPHINX_BEGIN_VARIANTS - :end-before: # SPHINX_END_VARIANTS +The GEOS Spack package has a lot of options, or what Spack calls variants, for controlling which dependencies you would like to build and how you'd like them built. The `GEOS Spack package file `_ has variants that are marked with ``variant()`` in the file. For example if you wanted to build with GCC 8.3.1, without Caliper and with Hypre as the Linear Algebra Interface, your spec would be ``%gcc@8.3.1 ~caliper lai=hypre``. -The GEOS Spack package lists out the libraries that GEOS depends ons. Currently these dependencies are +The GEOS Spack package lists out the libraries that GEOS depends ons. These dependencies are marked with ``depends_on()`` in the file. + +Using the Spack spec syntax, you can inturn specify variants for each of the dependencies of GEOS. For example, you could modify the spec above to build RAJA in debug mode by using ``%gcc@8.3.1 ~caliper lai=hypre ^raja build_type=Debug``. When building with Uberenv, Spack should print out a table containing the full spec for every dependency it will build. If you would like to look at the variants for say RAJA in more detail, you can find the package file at ``uberenv_libs/spack/var/spack/repos/builtin/packages/raja/package.py``, by using `file finder `_ on the `Spack Github website `_, or by searching for the package at https://packages.spack.io/. + + +.. _HostConfig: -.. literalinclude:: ../../../../scripts/spack_packages/packages/geosx/package.py - :language: python - :start-after: # SPHINX_BEGIN_DEPENDS - :end-before: # SPHINX_END_DEPENDS +Host-Config Generation +---------------------- + +The logic for generating the host-configs can be found in the `GEOS spack recipe `_. The GEOS host-config is generated by the ``geos_hostconfig()`` function, while the LvArray host-config is generated by the ``lvarray_hostconfig()`` function. After successfully building all the third-party dependencies, Spack will call these two functions to populate two host-configs based on information it knows about the dependencies. + +.. note:: + The host-config generation is currently based on LC systems, and the generated host-config may be missing or have incorrect details for your system (e.g. choice of ``MPIEXEC_NUMPROC_FLAG``). Please modify the python functions and/or host-configs generated as needed. + + +LC TPL Build Script +------------------- + +On LC systems, it is necessary to update the third-party library installations after a change to the configuration. The ``setupLC-TPL-uberenv.bash`` `script `_ is used to build the third-party libraries on multiple LC systems using uberenv: + +.. code-block:: console + + ./setupLC-TPL-uberenv.bash /path/to/shared/installation/directory + +This command will also generate a LvArray and GEOS host-config for each specified machine and compiler combination. + +.. note:: + The terminal output from the command may fail to update. In that case, you can track the progress of the builds by looking at the generated \*.log file associated with each machine and compiler combination (e.g. ruby-gcc-12.log). -Using the Spack spec syntax you can inturn specify variants for each of the dependencies of GEOS. So for example if you could modify the spec above to build RAJA in debug by using ``%gcc@8.3.1 ~caliper lai=hypre ^raja build_type=Debug``. When building with Uberenv Spack should print out a table containing the full spec for every dependency it will build. If you would like to look at the variants for say RAJA in more detail you can find the package file at ``uberenv_libs/spack/var/spack/repos/builtin/packages/raja/package.py``. Adding a Dependency (Advanced) ------------------------------ -Adding a dependency to GEOS is straight forward if the dependency already builds with Spack. If that is the case then all you need to do is add a ``depends_on('cool-new-library')`` to the GEOS ``package.py`` file. If however the dependency doesn't have a Spack package, you will have to add one by creating a ``cool-new-library/package.yaml`` file in the ``scripts/spack_packages/packages`` directory and adding the logic to build it there. +Adding a dependency to GEOS is straight forward **if** the dependency already builds with Spack. If that is the case, then all you need to do is add a ``depends_on('cool-new-library')`` to the GEOS ``package.py`` file. If however the dependency doesn't have a Spack package, you will have to add one by creating a ``cool-new-library/package.py`` file in the ``scripts/spack_packages/packages`` directory and adding the logic to build it there. For instructions on how to create a package recipe from scratch, Spack has provided a `Spack Packing Guide `_. -Oftentimes (unfortunately), even when a package already exists, it might not work out of the box for your system. In this case copy over the existing ``package.py`` file from the Spack repository into ``scripts/spack_packages/packages/cool-new-library/package.py``, as if you were adding a new package, and perform your modifications there. Once you have the package working, copy the package back into the Spack repository (running Uberenv should do this for you) and commit+push your changes to Spack. +Oftentimes (unfortunately), even when a package already exists in Spack, it might not work out of the box for your system. In this case copy over the existing ``package.py`` file from the Spack repository into ``scripts/spack_packages/packages/cool-new-library/package.py``, as if you were adding a new package, and perform your modifications there. Once you have the package working, copy the package back into the Spack repository and commit+push your changes to Spack.