Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 8 additions & 22 deletions scripts/spack/packages/axom/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import socket
from os.path import join as pjoin

from spack.package import *
from spack.util.executable import which_string
from spack_repo.builtin.build_systems.cached_cmake import (
CachedCMakePackage,
cmake_cache_option,
Expand All @@ -18,6 +16,9 @@
from spack_repo.builtin.build_systems.cuda import CudaPackage
from spack_repo.builtin.build_systems.rocm import ROCmPackage

from spack.package import *


def get_spec_path(spec, package_name, path_replacements={}, use_bin=False):
"""Extracts the prefix path for the given spack package
path_replacements is a dictionary with string replacements for the path.
Expand Down Expand Up @@ -70,10 +71,6 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage):
version("0.3.0", tag="v0.3.0", commit="20068ccab4b4f70055918b4f17960ec3ed6dbce8")
version("0.2.9", tag="v0.2.9", commit="9e9a54ede3326817c05f35922738516e43b5ec3d")

depends_on("c", type="build")
depends_on("cxx", type="build")
depends_on("fortran", type="build", when="+fortran")

# https://github.com/spack/spack/issues/31829
patch("examples-oneapi.patch", when="@0.6.1 +examples %oneapi")

Expand Down Expand Up @@ -128,6 +125,10 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage):
# Dependencies
# -----------------------------------------------------------------------
# Basics
depends_on("c", type="build")
depends_on("cxx", type="build")
depends_on("fortran", type="build", when="+fortran")

depends_on("[email protected]:", type="build")
depends_on("[email protected]:", type="build", when="@0.7.0:")
depends_on("[email protected]:", type="build", when="+rocm")
Expand Down Expand Up @@ -429,9 +430,7 @@ def initconfig_hardware_entries(self):
if spec.satisfies("+fortran") and self.is_fortran_compiler("xlf"):
# Grab lib directory for the current fortran compiler
libdir = pjoin(os.path.dirname(os.path.dirname(self.compiler.fc)), "lib")
description = (
"Adds a missing rpath for libraries " "associated with the fortran compiler"
)
description = "Adds a missing rpath for libraries associated with the fortran compiler"

linker_flags = "${BLT_EXE_LINKER_FLAGS} -Wl,-rpath," + libdir

Expand Down Expand Up @@ -496,19 +495,6 @@ def initconfig_mpi_entries(self):
entries.append(cmake_cache_option("ENABLE_MPI", True))
if spec["mpi"].name == "spectrum-mpi":
entries.append(cmake_cache_string("BLT_MPI_COMMAND_APPEND", "mpibind"))

# Replace /usr/bin/srun path with srun flux wrapper path on TOSS 4
# TODO: Remove this logic by adding `using_flux` case in
# spack/lib/spack/spack/build_systems/cached_cmake.py:196 and remove hard-coded
# path to srun in same file.
if "toss_4" in self._get_sys_type(spec):
srun_wrapper = which_string("srun")
mpi_exec_index = [
index for index, entry in enumerate(entries) if "MPIEXEC_EXECUTABLE" in entry
]
if mpi_exec_index:
del entries[mpi_exec_index[0]]
entries.append(cmake_cache_path("MPIEXEC_EXECUTABLE", srun_wrapper))
else:
entries.append(cmake_cache_option("ENABLE_MPI", False))

Expand Down