Skip to content
Next Next commit
Updates from macOS testing
  • Loading branch information
mathomp4 committed Apr 16, 2026
commit 2bd36084811c77aad51ab885b1ca70db8003e610
11 changes: 11 additions & 0 deletions repos/spack_repo/builtin/packages/libiconv/loop_wchar_9eb508.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --git a/lib/loop_wchar.h b/lib/loop_wchar.h
--- a/lib/loop_wchar.h
+++ b/lib/loop_wchar.h
@@ -36,7 +36,6 @@
# include <wchar.h>
# define BUF_SIZE 64 /* assume MB_LEN_MAX <= 64 */
/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
- extern size_t mbrtowc ();
# ifdef mbstate_t
# define mbrtowc(pwc, s, n, ps) (mbrtowc)(pwc, s, n, 0)
# define mbsinit(ps) 1
38 changes: 18 additions & 20 deletions repos/spack_repo/builtin/packages/libiconv/package.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright Spack Project Developers. See COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import re

from spack_repo.builtin.build_systems.autotools import AutotoolsPackage
from spack_repo.builtin.build_systems.gnu import GNUMirrorPackage
Expand Down Expand Up @@ -37,29 +36,19 @@ class Libiconv(AutotoolsPackage, GNUMirrorPackage):
# We cannot set up a warning for gets(), since gets() is not part
# of C11 any more and thus might not exist.
patch("gets.patch", when="@1.14")

# Error for declaration of mbrtowc without a prototype.
# https://gitweb.git.savannah.gnu.org/gitweb/?p=libiconv.git;a=commit;h=e46dee2f581c11
patch(
"loop_wchar_9eb508.patch",
when="@:1.17",
sha256="e0145a14e9fed1d9f07003a4772db916faa8cbb7c5273880a38d7c2e64d4103c",
)

provides("iconv")

conflicts("@1.14", when="%gcc@5:")

# Don't build on Darwin to avoid problems with _iconv vs _libiconv; use native package - see
# https://stackoverflow.com/questions/57734434/libiconv-or-iconv-undefined-symbol-on-mac-osx
conflicts("platform=darwin")

# For spack external find
executables = ["^iconv$"]

@classmethod
def determine_version(cls, exe):
# We only need to find libiconv on macOS to avoid problems with _iconv vs _libiconv - see
# https://stackoverflow.com/questions/57734434/libiconv-or-iconv-undefined-symbol-on-mac-osx
macos_pattern = re.compile("\(GNU libiconv (\w+\.\w+)\)") # noqa: W605
version_string = Executable(exe)("--version", output=str, error=str)
match = macos_pattern.search(version_string)
version = None
if match:
version = match.group(1)
return version

def configure_args(self):
args = ["--enable-extra-encodings"]

Expand All @@ -77,6 +66,15 @@ def configure_args(self):
if self.spec.satisfies("@1.17:%nvhpc"):
args.append("gl_cv_cc_wallow=none")

# Intel oneAPI icx incorrectly marks glibc's error() as noreturn,
# causing the gnulib gl_cv_func_working_error configure test to
# infinite-loop and consume unbounded memory.
# Fix available in icx 2026, but this workaround is needed for
# all versions of icx up to 2025.
# https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/All-versions-of-icx-miscompile-error-0-resulting-in-segfaults/m-p/1744208
if self.spec.satisfies("%oneapi@:2025"):
args.append("gl_cv_func_working_error=yes")
Comment thread
climbfuji marked this conversation as resolved.

# A hack to patch config.guess in the libcharset sub directory
copy("./build-aux/config.guess", "libcharset/build-aux/config.guess")
return args
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/ctest/CMakeLists.txt b/ctest/CMakeLists.txt
index 4496eff82..093c83541 100644
--- a/ctest/CMakeLists.txt
+++ b/ctest/CMakeLists.txt
@@ -5,6 +5,8 @@ if (NOT NOFORTRAN)
enable_language(Fortran)
endif()

+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNOCHANGE")
+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DADD${BU} -DCBLAS")
if (BINARY32 AND CMAKE_C_PLATFORM_ID MATCHES "MinGW" AND CMAKE_Fortran_COMPILER_VERSION VERSION_EQUAL 14.2)
list(REMOVE_ITEM ${CMAKE_Fortran_FLAGS} -O3 -O2 -O1 -Os)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--- a/f_check 2025-12-03 06:29:33.000000000 +0000
+++ b/f_check 2025-12-03 06:32:11.000000000 +0000
@@ -86,7 +86,11 @@
vendor=CRAY
openmp='-fopenmp'
;;
- *GNU*|*GCC*)
+ *Arm\ F90*|*F90\ Flang*|*F90\ AOCC*)
+ vendor=FLANG
+ openmp='-fopenmp'
+ ;;
+ *GNU*|*GCC*)

v="${data#*GCC: *\) }"
v="${v%%\"*}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/f_check 2024-04-04 20:26:04.000000000 +0000
+++ b/f_check 2025-12-03 01:13:59.000000000 +0000
@@ -86,7 +86,7 @@
vendor=CRAY
openmp='-fopenmp'
;;
- *Arm\ F90*)
+ *Arm\ F90*|*F90\ Flang*|*F90\ AOCC*)
vendor=FLANG
openmp='-fopenmp'
;;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/Makefile.system b/Makefile.system
index 38646c3c6..e81ccf083 100644
--- a/Makefile.system
+++ b/Makefile.system
@@ -436,7 +436,7 @@ ifeq (x$(XCVER), x 15)
CCOMMON_OPT += -Wl,-ld_classic
FCOMMON_OPT += -Wl,-ld_classic
endif
-ifeq (x$(XCVER), x 16)
+ifeq ($(shell [ $(XCVER) -ge 16 ] && echo yes),yes)
ifeq ($(F_COMPILER), GFORTRAN)
override CEXTRALIB := $(filter-out(-lto_library, $(CEXTRALIB)))
endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/f_check 2024-08-08 20:41:46.000000000 +0000
+++ b/f_check 2025-12-03 01:12:10.000000000 +0000
@@ -86,7 +86,7 @@
vendor=CRAY
openmp='-fopenmp'
;;
- *Arm\ F90*|*F90\ Flang*)
+ *Arm\ F90*|*F90\ Flang*|*F90\ AOCC*)
vendor=FLANG
openmp='-fopenmp'
;;
151 changes: 117 additions & 34 deletions repos/spack_repo/builtin/packages/openblas/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from spack_repo.builtin.build_systems.cmake import CMakePackage
from spack_repo.builtin.build_systems.makefile import MakefilePackage

from spack.llnl.util import tty
from spack.package import *


Expand All @@ -21,11 +22,15 @@ class Openblas(CMakePackage, MakefilePackage):
)
git = "https://github.com/OpenMathLib/OpenBLAS.git"

maintainers("mathomp4")

libraries = ["libopenblas", "openblas"]

license("BSD-3-Clause")

version("develop", branch="develop")
version("0.3.32", sha256="f8a1138e01fddca9e4c29f9684fd570ba39dedc9ca76055e1425d5d4b1a4a766")
version("0.3.30", sha256="27342cff518646afb4c2b976d809102e368957974c250a25ccc965e53063c95d")
version("0.3.29", sha256="38240eee1b29e2bde47ebb5d61160207dc68668a54cac62c076bb5032013b1eb")
version("0.3.28", sha256="f1003466ad074e9b0c8d421a204121100b0751c96fc6fcf3d1456bd12f8a00a1")
version("0.3.27", sha256="aa2d68b1564fe2b13bc292672608e9cdeeeb6dc34995512e65c3b10f4599e897")
Expand All @@ -36,32 +41,67 @@ class Openblas(CMakePackage, MakefilePackage):
version("0.3.22", sha256="7fa9685926ba4f27cfe513adbf9af64d6b6b63f9dcabb37baefad6a65ff347a7")
version("0.3.21", sha256="f36ba3d7a60e7c8bcc54cd9aaa9b1223dd42eaf02c811791c37e8ca707c241ca")
version("0.3.20", sha256="8495c9affc536253648e942908e88e097f2ec7753ede55aca52e5dead3029e3c")
version("0.3.19", sha256="947f51bfe50c2a0749304fbe373e00e7637600b0a47b78a51382aeb30ca08562")
version("0.3.18", sha256="1632c1e8cca62d8bed064b37747e331a1796fc46f688626337362bf0d16aeadb")
version("0.3.17", sha256="df2934fa33d04fd84d839ca698280df55c690c86a5a1133b3f7266fce1de279f")
version("0.3.16", sha256="fa19263c5732af46d40d3adeec0b2c77951b67687e670fb6ba52ea3950460d79")
version("0.3.15", sha256="30a99dec977594b387a17f49904523e6bc8dd88bd247266e83485803759e4bbe")
version("0.3.14", sha256="d381935d26f9cae8e4bbd7d7f278435adf8e3a90920edf284bb9ad789ee9ad60")
version("0.3.13", sha256="79197543b17cc314b7e43f7a33148c308b0807cd6381ee77f77e15acf3e6459e")
version("0.3.12", sha256="65a7d3a4010a4e3bd5c0baa41a234797cd3a1735449a4a5902129152601dc57b")
version("0.3.11", sha256="bc4617971179e037ae4e8ebcd837e46db88422f7b365325bd7aba31d1921a673")
version("0.3.10", sha256="0484d275f87e9b8641ff2eecaa9df2830cbe276ac79ad80494822721de6e1693")
version("0.3.9", sha256="17d4677264dfbc4433e97076220adc79b050e4f8a083ea3f853a53af253bc380")
version("0.3.8", sha256="8f86ade36f0dbed9ac90eb62575137388359d97d8f93093b38abe166ad7ef3a8")
version("0.3.7", sha256="bde136122cef3dd6efe2de1c6f65c10955bbb0cc01a520c2342f5287c28f9379")
version("0.3.6", sha256="e64c8fe083832ffbc1459ab6c72f71d53afd3b36e8497c922a15a06b72e9002f")
version("0.3.5", sha256="0950c14bd77c90a6427e26210d6dab422271bc86f9fc69126725833ecdaa0e85")
version("0.3.4", sha256="4b4b4453251e9edb5f57465bf2b3cf67b19d811d50c8588cdf2ea1f201bb834f")
version("0.3.3", sha256="49d88f4494ae780e3d7fa51769c00d982d7cdb73e696054ac3baa81d42f13bab")
version("0.3.2", sha256="e8ba64f6b103c511ae13736100347deb7121ba9b41ba82052b1a018a65c0cb15")
version("0.3.1", sha256="1f5e956f35f3acdd3c74516e955d797a320c2e0135e31d838cbdb3ea94d0eb33")
version("0.3.0", sha256="cf51543709abe364d8ecfb5c09a2b533d2b725ea1a66f203509b21a8e9d8f1a1")
version("0.2.20", sha256="5ef38b15d9c652985774869efd548b8e3e972e1e99475c673b25537ed7bcf394")
version("0.2.19", sha256="9c40b5e4970f27c5f6911cb0a28aa26b6c83f17418b69f8e5a116bb983ca8557")
version("0.2.18", sha256="7d9f8d4ea4a65ab68088f3bb557f03a7ac9cb5036ef2ba30546c3a28774a4112")
version("0.2.17", sha256="0fe836dfee219ff4cadcc3567fb2223d9e0da5f60c7382711fb9e2c35ecf0dbf")
version("0.2.16", sha256="766f350d0a4be614812d535cead8c816fc3ad3b9afcd93167ea5e4df9d61869b")
version("0.2.15", sha256="73c40ace5978282224e5e122a41c8388c5a19e65a6f2329c2b7c0b61bacc9044")

# Deprecate versions before 2022
with default_args(deprecated=True):
version(
"0.3.19", sha256="947f51bfe50c2a0749304fbe373e00e7637600b0a47b78a51382aeb30ca08562"
)
version(
"0.3.18", sha256="1632c1e8cca62d8bed064b37747e331a1796fc46f688626337362bf0d16aeadb"
)
version(
"0.3.17", sha256="df2934fa33d04fd84d839ca698280df55c690c86a5a1133b3f7266fce1de279f"
)
version(
"0.3.16", sha256="fa19263c5732af46d40d3adeec0b2c77951b67687e670fb6ba52ea3950460d79"
)
version(
"0.3.15", sha256="30a99dec977594b387a17f49904523e6bc8dd88bd247266e83485803759e4bbe"
)
version(
"0.3.14", sha256="d381935d26f9cae8e4bbd7d7f278435adf8e3a90920edf284bb9ad789ee9ad60"
)
version(
"0.3.13", sha256="79197543b17cc314b7e43f7a33148c308b0807cd6381ee77f77e15acf3e6459e"
)
version(
"0.3.12", sha256="65a7d3a4010a4e3bd5c0baa41a234797cd3a1735449a4a5902129152601dc57b"
)
version(
"0.3.11", sha256="bc4617971179e037ae4e8ebcd837e46db88422f7b365325bd7aba31d1921a673"
)
version(
"0.3.10", sha256="0484d275f87e9b8641ff2eecaa9df2830cbe276ac79ad80494822721de6e1693"
)
version("0.3.9", sha256="17d4677264dfbc4433e97076220adc79b050e4f8a083ea3f853a53af253bc380")
version("0.3.8", sha256="8f86ade36f0dbed9ac90eb62575137388359d97d8f93093b38abe166ad7ef3a8")
version("0.3.7", sha256="bde136122cef3dd6efe2de1c6f65c10955bbb0cc01a520c2342f5287c28f9379")
version("0.3.6", sha256="e64c8fe083832ffbc1459ab6c72f71d53afd3b36e8497c922a15a06b72e9002f")
version("0.3.5", sha256="0950c14bd77c90a6427e26210d6dab422271bc86f9fc69126725833ecdaa0e85")
version("0.3.4", sha256="4b4b4453251e9edb5f57465bf2b3cf67b19d811d50c8588cdf2ea1f201bb834f")
version("0.3.3", sha256="49d88f4494ae780e3d7fa51769c00d982d7cdb73e696054ac3baa81d42f13bab")
version("0.3.2", sha256="e8ba64f6b103c511ae13736100347deb7121ba9b41ba82052b1a018a65c0cb15")
version("0.3.1", sha256="1f5e956f35f3acdd3c74516e955d797a320c2e0135e31d838cbdb3ea94d0eb33")
version("0.3.0", sha256="cf51543709abe364d8ecfb5c09a2b533d2b725ea1a66f203509b21a8e9d8f1a1")
version(
"0.2.20", sha256="5ef38b15d9c652985774869efd548b8e3e972e1e99475c673b25537ed7bcf394"
)
version(
"0.2.19", sha256="9c40b5e4970f27c5f6911cb0a28aa26b6c83f17418b69f8e5a116bb983ca8557"
)
version(
"0.2.18", sha256="7d9f8d4ea4a65ab68088f3bb557f03a7ac9cb5036ef2ba30546c3a28774a4112"
)
version(
"0.2.17", sha256="0fe836dfee219ff4cadcc3567fb2223d9e0da5f60c7382711fb9e2c35ecf0dbf"
)
version(
"0.2.16", sha256="766f350d0a4be614812d535cead8c816fc3ad3b9afcd93167ea5e4df9d61869b"
)
version(
"0.2.15", sha256="73c40ace5978282224e5e122a41c8388c5a19e65a6f2329c2b7c0b61bacc9044"
)

variant(
"fortran",
Expand All @@ -73,6 +113,7 @@ class Openblas(CMakePackage, MakefilePackage):
variant("ilp64", default=False, description="Force 64-bit Fortran native integers")
variant("pic", default=True, description="Build position independent code")
variant("shared", default=True, description="Build shared libraries")
variant("static", default=False, description="Build static libraries")
variant(
"dynamic_dispatch",
default=True,
Expand Down Expand Up @@ -106,7 +147,8 @@ class Openblas(CMakePackage, MakefilePackage):

depends_on("c", type="build")
depends_on("cxx", type="build")
depends_on("fortran", type="build")
depends_on("fortran", when="+fortran", type="build")
depends_on("fortran", when="@:0.3.20", type="build")
depends_on("perl", when="@:0.3.20", type="build")

# https://github.com/OpenMathLib/OpenBLAS/pull/4879
Expand All @@ -119,7 +161,11 @@ class Openblas(CMakePackage, MakefilePackage):
patch("openblas-0.3.29-darwin-aarch64.patch", when="@0.3.29 platform=darwin")

# https://github.com/xianyi/OpenBLAS/pull/2519/files
patch("ifort-msvc.patch", when="%msvc")
patch("ifort-msvc.patch", when="@0.3.24:0.3.29 %msvc")

# Adds proper compiler definitions to allow symbol mangling
# consistent with the rest of blas when building blas tests
patch("blas_normalize_test_symbols.patch", when="%msvc")

# https://github.com/OpenMathLib/OpenBLAS/pull/3712
patch("cce.patch", when="@0.3.20 %cce")
Expand Down Expand Up @@ -155,6 +201,9 @@ class Openblas(CMakePackage, MakefilePackage):
# https://github.com/OpenMathLib/OpenBLAS/pull/1703
patch("openblas-0.3.2-cmake.patch", when="@0.3.1:0.3.2")

# https://github.com/OpenMathLib/OpenBLAS/issues/5473
patch("openblas-0.3.30-apple-LTO.patch", when="@0.3.30 platform=darwin")

# Disable experimental TLS code that lead to many threading issues
# https://github.com/OpenMathLib/OpenBLAS/issues/1735#issuecomment-422954465
# https://github.com/OpenMathLib/OpenBLAS/issues/1761#issuecomment-421039174
Expand Down Expand Up @@ -242,6 +291,25 @@ class Openblas(CMakePackage, MakefilePackage):
when="@0.3.27 %oneapi",
)

# Fix arm64 HAVE_SME setting for DYNAMIC_ARCH builds using CMake
patch(
"https://github.com/OpenMathLib/OpenBLAS/commit/cdebb4fd4b2bbbf856e5abdcedbe9a5cf348ef8e.patch?full_index=1",
sha256="0df81a8f5c1460d3db461e2309e5ac0b70c7745a97a10e617f109b4a5811e043",
when="@0.3.30 +dynamic_dispatch target=aarch64:",
)

# ilp64 and symbol suffixes are not supported with CMake build system
requires("~ilp64", when="build_system=cmake")
requires("symbol_suffix=none", when="build_system=cmake")

# AOCC compiler detection adjustments
patch("openblas-aocc-0.3.28-plus.patch", when="@0.3.28: %aocc@5.1.0:")
patch("openblas-0.3.27_aocc.patch", when="@0.3.27 %aocc@5.0.0:")
patch("openblas-0.3.21-0.3.26_aocc.patch", when="@0.3.21:0.3.26 %aocc@5.0.0:")

# Requires support for -mtune=generic
conflicts("%fortran=llvm@18")

# See https://github.com/spack/spack/issues/19932#issuecomment-733452619
# Notice: fixed on Amazon Linux GCC 7.3.1 (which is an unofficial version
# as GCC only has major.minor releases. But the bound :7.3.0 doesn't hurt)
Expand Down Expand Up @@ -305,7 +373,7 @@ def headers(self):
# headers either included in one of these two headers, or included in
# one of the source files implementing functions declared in these
# headers.
return find_headers(["cblas", "lapacke"], self.prefix.include)
return find_headers(["cblas", "lapacke"], self.prefix.include, recursive=True)

@property
def libs(self):
Expand Down Expand Up @@ -544,11 +612,24 @@ def make_defs(self):
if self.spec.satisfies("threads=openmp") or self.spec.satisfies("threads=pthreads"):
make_defs.append("NUM_THREADS=512")

# Fix https://github.com/OpenMathLib/OpenBLAS/issues/4212
# Following https://github.com/OpenMathLib/OpenBLAS/pull/4214
if self.spec.satisfies("platform=darwin target=aarch64: %gcc"):
make_defs.append("NO_SVE=1")

return make_defs

@property
def build_targets(self):
return ["-s"] + self.make_defs + ["all"]
def build(self, pkg: MakefilePackage, spec: Spec, prefix: Prefix) -> None:
"""Override 'make all' with sequential builds due to race conditions."""
# Due to the verbosity of the command line and number of object files
# created, we suppress makefile command echoing via `-s`.
args = ["-s"] + self.make_defs

# Make each target sequentially
with working_dir(self.build_directory):
for target in ["libs", "netlib", "shared"]:
tty.info("Building target", target)
make(*(args + [target]))

@run_after("build")
@on_package_attributes(run_tests=True)
Expand All @@ -557,8 +638,7 @@ def check_build(self):

@property
def install_targets(self):
make_args = ["install", "PREFIX={0}".format(self.prefix)]
return make_args + self.make_defs
return self.make_defs + [f"PREFIX={self.prefix}", "install"]

@run_after("install")
@on_package_attributes(run_tests=True)
Expand Down Expand Up @@ -607,6 +687,9 @@ def cmake_args(self):
if "+shared" in self.spec:
cmake_defs += [self.define("BUILD_SHARED_LIBS", "ON")]

if "+static" in self.spec:
cmake_defs += [self.define("BUILD_STATIC_LIBS", "ON")]

if self.spec.satisfies("threads=openmp"):
cmake_defs += [self.define("USE_OPENMP", "ON"), self.define("USE_THREAD", "ON")]
elif self.spec.satisfies("threads=pthreads"):
Expand Down
12 changes: 12 additions & 0 deletions repos/spack_repo/builtin/packages/openmpi/add_string.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/opal/mca/accelerator/rocm/accelerator_rocm_module.c b/opal/mca/accelerator/rocm/accelerator_rocm_module.c
index 8f1bb2c..5ef7f09 100644
--- a/opal/mca/accelerator/rocm/accelerator_rocm_module.c
+++ b/opal/mca/accelerator/rocm/accelerator_rocm_module.c
@@ -13,6 +13,7 @@
#include "opal/mca/accelerator/base/base.h"
#include "opal/constants.h"
#include "opal/util/output.h"
+#include <string.h>

/* Accelerator API's */
static int mca_accelerator_rocm_check_addr(const void *addr, int *dev_id, uint64_t *flags);
Loading