Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
--- a/cmake/LibFind.cmake
+++ b/cmake/LibFind.cmake
@@ -254,7 +254,7 @@ function (find_package_component PKG)
find_library (${PKGCOMP}_LIBRARY
NAMES ${${PKGCOMP}_LIBRARY_NAMES}
PATHS ${${PKGCOMP}_PREFIX}
- PATH_SUFFIXES lib
+ PATH_SUFFIXES lib lib/${CMAKE_LIBRARY_ARCHITECTURE}
NO_DEFAULT_PATH)

# If found, check if library is static or dynamic
@@ -266,7 +266,7 @@ function (find_package_component PKG)
find_shared_library (${PKGCOMP}_SHARED_LIBRARY
NAMES ${${PKGCOMP}_LIBRARY_NAMES}
PATHS ${${PKGCOMP}_PREFIX}
- PATH_SUFFIXES lib
+ PATH_SUFFIXES lib lib/${CMAKE_LIBRARY_ARCHITECTURE}
NO_DEFAULT_PATH)
if (${PKGCOMP}_SHARED_LIBRARY)
set (${PKGCOMP}_LIBRARY ${${PKGCOMP}_SHARED_LIBRARY})
@@ -278,7 +278,7 @@ function (find_package_component PKG)
find_static_library (${PKGCOMP}_STATIC_LIBRARY
NAMES ${${PKGCOMP}_LIBRARY_NAMES}
PATHS ${${PKGCOMP}_PREFIX}
- PATH_SUFFIXES lib
+ PATH_SUFFIXES lib lib/${CMAKE_LIBRARY_ARCHITECTURE}
NO_DEFAULT_PATH)
if (${PKGCOMP}_STATIC_LIBRARY)
set (${PKGCOMP}_LIBRARY ${${PKGCOMP}_STATIC_LIBRARY})
@@ -307,7 +307,9 @@ function (find_package_component PKG)
mark_as_advanced (${PKGCOMP}_INCLUDE_DIR ${PKGCOMP}_LIBRARY)

# HACK For bug in CMake v3.0:
- set (${PKGCOMP}_FOUND ${${PKGCOMPUP}_FOUND})
+ if (NOT DEFINED ${PKGCOMP}_FOUND AND DEFINED ${PKGCOMPUP}_FOUND)
+ set (${PKGCOMP}_FOUND ${${PKGCOMPUP}_FOUND})
+ endif ()

# Set return variables
if (${PKGCOMP}_FOUND)
17 changes: 17 additions & 0 deletions repos/spack_repo/builtin/packages/parallelio/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ class Parallelio(CMakePackage):

license("Apache-2.0")

version("2.6.10", sha256="a65bd3c75f5ee6e8c4c5b922b9c6fa2598af9586468d8dbf51caf010261b4128")
version("2.6.9", sha256="22f34258f0e8b9e8271383bc7c6c657f4bbee560d33f87e3c0db53e0da8c8f3b")
version("2.6.8", sha256="ed6c92129b8a5e2d77587fd9656abc0aa7cf82a26a5ad21f8c6a9a79afa2c301")
version("2.6.7", sha256="b346592cb24bf5f98583574c0679020ef3026005cd8f3efa87545d0982581037")
version("2.6.6", sha256="e32e018a521d38c9424940c7cfa7e9b1931b605f3511ee7ab3a718b69faeeb04")
version("2.6.5", sha256="6ae51aa3f76e597a3a840a292ae14eca21359b1a4ea75e476a93aa2088c0677a")
version("2.6.4", sha256="cba53e4ca62ff76195b6f76374fbd1530fba18649c975ae2628ddec7fe55fb31")
Expand Down Expand Up @@ -54,11 +57,16 @@ class Parallelio(CMakePackage):
# netcdf4 filters are only available with the parallel build of netcdf.
patch("pio_260.patch", when="@2.6.0")

# This patch enhances searchability for dependencies installed externally, such as
# libraries installed via apt in usr/lib/<arch>.
patch("cmake-libfind-arch.patch", when="@2.6.0:2.6.9")

depends_on("c", type="build") # generated
depends_on("cxx", type="build") # generated
depends_on("fortran", type="build") # generated

depends_on("cmake@3.7:", type="build")
depends_on("pkgconfig", type="build", when="@2.6.9:")
depends_on("mpi", when="+mpi")
depends_on("mpi-serial", when="~mpi")
depends_on("netcdf-c +mpi", type="link", when="+mpi")
Expand All @@ -67,6 +75,12 @@ class Parallelio(CMakePackage):
depends_on("parallel-netcdf", type="link", when="+pnetcdf")
depends_on("netcdf-c ~parallel-netcdf", type="link", when="~pnetcdf")

conflicts(
"^netcdf-c@4.9.3:",
when="@:2.6.4",
msg="netcdf-c@4.9.3+ is incompatible with parallelio versions prior to 2.6.5",
)

resource(
name="genf90",
git="https://github.com/PARALLELIO/genf90.git",
Expand Down Expand Up @@ -105,6 +119,9 @@ def cmake_args(self):
define("PIO_ENABLE_EXAMPLES", False),
define_from_variant("WITH_PNETCDF", "pnetcdf"),
]
if spec.satisfies("%nag"):
# NAG cannot pass Spack's padded build rpath through its linker.
args.append(define("CMAKE_SKIP_RPATH", True))
if spec.satisfies("+ncint"):
args.extend([define("PIO_ENABLE_NETCDF_INTEGRATION", True)])
if spec.satisfies("+pnetcdf"):
Expand Down
7 changes: 5 additions & 2 deletions repos/spack_repo/builtin/packages/py_pyyaml/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@ class PyPyyaml(PythonPackage):

variant("libyaml", default=True, description="Use libYAML bindings")

with when("+libyaml"):
depends_on("c", type="build")
depends_on("libyaml", type="link")
depends_on("py-cython", when="@6:", type="build")

depends_on("python@2.7,3.5:", type=("build", "link", "run"))
depends_on("python@3.6:", when="@6:", type=("build", "link", "run"))
depends_on("libyaml", when="+libyaml", type="link")
# setuptools versions are not documented upstream, the when= constraint
# should probably be set to a lower version.
depends_on("py-setuptools@62:", type="build", when="@6.0.3:")
depends_on("py-setuptools", type="build")
depends_on("py-cython", when="@6:+libyaml", type="build")

# Includes "longintrepr.h" instead of Python.h
conflicts("^python@3.11:", when="@:5.3")
Expand Down
75 changes: 73 additions & 2 deletions repos/spack_repo/builtin/packages/roms/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,51 @@ class Roms(MakefilePackage):
"roms_application",
default="benchmark",
description="Makefile to include its associated header file",
values=("upwelling", "benchmark"),
values=(
"basin",
"benchmark",
"bio_toy",
"bl_test",
"canyon",
"channel",
"channel_neck",
"coupling_test",
"damee_4",
"dogbone",
"double_gyre",
"estuary_test",
"flt_test",
"grav_adj",
"inlet_test",
"kelvin",
"lab_canyon",
"lake_jersey",
"lake_signell",
"lmd_test",
"mixed_layer",
"overflow",
"riverplume1",
"riverplume2",
"seamount",
"sed_test1",
"sed_toy",
"shoreface",
"soliton",
"test_chan",
"test_head",
"upwelling",
"wc13",
"weddell",
"windbasin",
"none",
),
multi=False,
)
variant(
"custom_application",
default="none",
description="Path to custom application header file (use roms_application=none with this)",
)
variant(
"debug",
default=False,
Expand All @@ -57,6 +99,23 @@ class Roms(MakefilePackage):
# Note: you cannot set USE_OpenMP and USE_MPI at the same time
conflicts("+mpi+openmp")

@run_before("edit")
def validate_application_config(self):
"""Validate application configuration before starting build"""
custom_app = self.spec.variants["custom_application"].value
roms_app = self.spec.variants["roms_application"].value

# Validate that custom_application and roms_application are not both set
if custom_app != "none" and roms_app != "none":
raise InstallError(
"Cannot specify both custom_application and a built-in roms_application. "
"Set roms_application=none when using custom_application."
)

# Validate the custom header file exists
if custom_app != "none" and not os.path.isfile(custom_app):
raise InstallError("Custom application header file not found: {0}".format(custom_app))

def _copy_arch_file(self, lib):
"""AOCC compiler takes gfortran's makefile as reference"""
copy(
Expand Down Expand Up @@ -112,7 +171,19 @@ def edit(self, spec, prefix):

makefile = FileFilter("makefile")

app_type = self.selected_roms_application
# Handle custom application header file
custom_app = self.spec.variants["custom_application"].value

if custom_app != "none":
# Extract application name from filename (remove .h extension)
custom_app_name = os.path.splitext(os.path.basename(custom_app))[0]

# Copy custom header to ROMS/Include directory
copy(custom_app, join_path("ROMS", "Include", "{0}.h".format(custom_app_name)))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concern is that this an arbitrary path that is not under source control or under the provenance umbrella of spack.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @aidanheerdegen , I suspect this discussion should be elsewhere? Perhaps in https://github.com/ACCESS-NRI/CoastRI-ROMS ?


app_type = custom_app_name
else:
app_type = self.selected_roms_application

makefile.filter(
r"ROMS_APPLICATION.*?=.*", "ROMS_APPLICATION = {0}".format(app_type.upper())
Expand Down
Loading