From 41f6f7a1fb9f7d0b30c16111a1a5eb95b74148e9 Mon Sep 17 00:00:00 2001 From: mattip Date: Thu, 20 Nov 2025 19:19:23 +0200 Subject: [PATCH 01/22] always use gfortran from conda on macos, update to gfortran-15 --- pyproject.toml | 2 +- tools/build_steps.sh | 17 ++++++++--------- tools/gfortran_utils.sh | 14 +++++++------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c956d4c..eb3981c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta" [project] name = "scipy-openblas64" # v0.3.30-349-gf6df9beb -version = "0.3.30.349.0" +version = "0.3.30.349.1" requires-python = ">=3.7" description = "Provides OpenBLAS for python packaging" readme = "README.md" diff --git a/tools/build_steps.sh b/tools/build_steps.sh index 6aacb01..ed1ede3 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -39,7 +39,14 @@ function before_build { # get_macpython_environment ${MB_PYTHON_VERSION} venv python3.9 -m venv venv source venv/bin/activate - alias gfortran=gfortran-15 + # Use gfortran from conda + # Since install_fortran uses `uname -a` to determine arch, + # force the architecture when using rosetta + unalias gfortran || true + arch -${PLAT} bash -s << " EOF" + source ${ROOT_DIR}/gfortran-install/gfortran_utils.sh + install_gfortran + EOF # Deployment target set by gfortran_utils echo "Deployment target $MACOSX_DEPLOYMENT_TARGET" @@ -150,14 +157,6 @@ function do_build_lib { Darwin-x86_64) local bitness=64 local target="CORE2" - # Use gfortran-11 - unalias gfortran - # Since install_fortran uses `uname -a` to determine arch, - # force the architecture - arch -${PLAT} bash -s << EOF -source ${ROOT_DIR}/gfortran-install/gfortran_utils.sh -install_gfortran -EOF export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH CFLAGS="$CFLAGS -arch x86_64" export SDKROOT=${SDKROOT:-$(xcrun --show-sdk-path)} diff --git a/tools/gfortran_utils.sh b/tools/gfortran_utils.sh index b7127f5..e9da7fb 100644 --- a/tools/gfortran_utils.sh +++ b/tools/gfortran_utils.sh @@ -105,29 +105,29 @@ if [ "$(uname)" == "Darwin" ]; then export MACOSX_DEPLOYMENT_TARGET=$mac_target # Keep this for now as some builds might depend on this being # available before install_gfortran is called - export GFORTRAN_SHA=c469a420d2d003112749dcdcbe3c684eef42127e # Set SDKROOT env variable if not set export SDKROOT=${SDKROOT:-$(xcrun --show-sdk-path)} function download_and_unpack_gfortran { local arch=$1 local type=$2 - curl -L -O https://github.com/isuruf/gcc/releases/download/gcc-11.3.0-2/gfortran-darwin-${arch}-${type}.tar.gz + curl -L -O https://github.com/isuruf/gcc/releases/download/gcc-15.2.0/gfortran-darwin-${arch}-${type}.tar.gz case ${arch}-${type} in arm64-native) - export GFORTRAN_SHA=0d5c118e5966d0fb9e7ddb49321f63cac1397ce8 + export GFORTRAN_SHA=999a91eef894d32f99e3b641520bef9f475055067f301f0f1947b8b716b5922a ;; arm64-cross) - export GFORTRAN_SHA=527232845abc5af21f21ceacc46fb19c190fe804 + export GFORTRAN_SHA=39ef2590629c2f238f1a67469fa429d8d6362425b277abb57fd2f3c982568a3f ;; x86_64-native) - export GFORTRAN_SHA=c469a420d2d003112749dcdcbe3c684eef42127e + export GFORTRAN_SHA=fb03c1f37bf0258ada6e3e41698e3ad416fff4dad448fd746e01d8ccf1efdc0f ;; x86_64-cross) - export GFORTRAN_SHA=107604e57db97a0ae3e7ca7f5dd722959752f0b3 + export GFORTRAN_SHA=0a19ca91019a75501e504eed1cad2be6ea92ba457ec815beb0dd28652eb0ce3f ;; + *) echo Did not recognize arch-plat $arch-$plat; return 1 ;; esac - if [[ "$(shasum gfortran-darwin-${arch}-${type}.tar.gz)" != "${GFORTRAN_SHA} gfortran-darwin-${arch}-${type}.tar.gz" ]]; then + if [[ "$(sha256sum gfortran-darwin-${arch}-${type}.tar.gz)" != "${GFORTRAN_SHA} gfortran-darwin-${arch}-${type}.tar.gz" ]]; then echo "shasum mismatch for gfortran-darwin-${arch}-${type}" exit 1 fi From c83949153775c3172c63944193d52ca67b2f4978 Mon Sep 17 00:00:00 2001 From: mattip Date: Thu, 20 Nov 2025 19:28:44 +0200 Subject: [PATCH 02/22] remove unused submodule gfortran-install --- .gitmodules | 3 --- gfortran-install | 1 - 2 files changed, 4 deletions(-) delete mode 160000 gfortran-install diff --git a/.gitmodules b/.gitmodules index 7b8f5ca..546361d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ [submodule "OpenBLAS"] path = OpenBLAS url = https://github.com/xianyi/OpenBLAS.git -[submodule "gfortran-install"] - path = gfortran-install - url = https://github.com/MacPython/gfortran-install.git diff --git a/gfortran-install b/gfortran-install deleted file mode 160000 index 3dd38d9..0000000 --- a/gfortran-install +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3dd38d9ce78b3890598cb0eff18a7bec50c06f5e From eef7a055988283ce60911d92407d34ffb07f7e67 Mon Sep 17 00:00:00 2001 From: mattip Date: Thu, 20 Nov 2025 19:29:04 +0200 Subject: [PATCH 03/22] use tools/gfortran_install.sh --- tools/build_steps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index ed1ede3..b0f82bc 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -44,7 +44,7 @@ function before_build { # force the architecture when using rosetta unalias gfortran || true arch -${PLAT} bash -s << " EOF" - source ${ROOT_DIR}/gfortran-install/gfortran_utils.sh + source tools/gfortran_utils.sh install_gfortran EOF # Deployment target set by gfortran_utils From d5a78e29a8569ba42dcbb5f434df20de971843de Mon Sep 17 00:00:00 2001 From: mattip Date: Thu, 20 Nov 2025 20:21:27 +0200 Subject: [PATCH 04/22] use tools/sha256sum.py since macos image does not have sha256sum --- tools/gfortran_utils.sh | 2 +- tools/sha256sum.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 tools/sha256sum.py diff --git a/tools/gfortran_utils.sh b/tools/gfortran_utils.sh index e9da7fb..25d1e74 100644 --- a/tools/gfortran_utils.sh +++ b/tools/gfortran_utils.sh @@ -127,7 +127,7 @@ if [ "$(uname)" == "Darwin" ]; then ;; *) echo Did not recognize arch-plat $arch-$plat; return 1 ;; esac - if [[ "$(sha256sum gfortran-darwin-${arch}-${type}.tar.gz)" != "${GFORTRAN_SHA} gfortran-darwin-${arch}-${type}.tar.gz" ]]; then + if [[ "$(python3 tools/sha256sum.py gfortran-darwin-${arch}-${type}.tar.gz)" != "${GFORTRAN_SHA} gfortran-darwin-${arch}-${type}.tar.gz" ]]; then echo "shasum mismatch for gfortran-darwin-${arch}-${type}" exit 1 fi diff --git a/tools/sha256sum.py b/tools/sha256sum.py new file mode 100755 index 0000000..da39d6e --- /dev/null +++ b/tools/sha256sum.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 + +import hashlib +import sys + +filename = sys.argv[1] +sha256_hash = hashlib.sha256() +with open(filename,"rb") as f: + # Read and update hash string value in blocks + for byte_block in iter(lambda: f.read(32768),b""): + sha256_hash.update(byte_block) + print(sha256_hash.hexdigest()) + From 85f1210ecd49b4def5b95dcb05f71ea9858b092f Mon Sep 17 00:00:00 2001 From: mattip Date: Thu, 20 Nov 2025 21:28:45 +0200 Subject: [PATCH 05/22] reflow and fix gfortran_install.sh --- tools/gfortran_utils.sh | 59 ++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/tools/gfortran_utils.sh b/tools/gfortran_utils.sh index 25d1e74..1d4c270 100644 --- a/tools/gfortran_utils.sh +++ b/tools/gfortran_utils.sh @@ -109,26 +109,29 @@ if [ "$(uname)" == "Darwin" ]; then export SDKROOT=${SDKROOT:-$(xcrun --show-sdk-path)} function download_and_unpack_gfortran { - local arch=$1 - local type=$2 + local arch=$1 + local type=$2 curl -L -O https://github.com/isuruf/gcc/releases/download/gcc-15.2.0/gfortran-darwin-${arch}-${type}.tar.gz - case ${arch}-${type} in - arm64-native) - export GFORTRAN_SHA=999a91eef894d32f99e3b641520bef9f475055067f301f0f1947b8b716b5922a - ;; - arm64-cross) - export GFORTRAN_SHA=39ef2590629c2f238f1a67469fa429d8d6362425b277abb57fd2f3c982568a3f - ;; - x86_64-native) - export GFORTRAN_SHA=fb03c1f37bf0258ada6e3e41698e3ad416fff4dad448fd746e01d8ccf1efdc0f - ;; - x86_64-cross) - export GFORTRAN_SHA=0a19ca91019a75501e504eed1cad2be6ea92ba457ec815beb0dd28652eb0ce3f - ;; - *) echo Did not recognize arch-plat $arch-$plat; return 1 ;; - esac - if [[ "$(python3 tools/sha256sum.py gfortran-darwin-${arch}-${type}.tar.gz)" != "${GFORTRAN_SHA} gfortran-darwin-${arch}-${type}.tar.gz" ]]; then - echo "shasum mismatch for gfortran-darwin-${arch}-${type}" + case ${arch}-${type} in + arm64-native) + local GFORTRAN_SHA=999a91eef894d32f99e3b641520bef9f475055067f301f0f1947b8b716b5922a + ;; + arm64-cross) + local export GFORTRAN_SHA=39ef2590629c2f238f1a67469fa429d8d6362425b277abb57fd2f3c982568a3f + ;; + x86_64-native) + local export GFORTRAN_SHA=fb03c1f37bf0258ada6e3e41698e3ad416fff4dad448fd746e01d8ccf1efdc0f + ;; + x86_64-cross) + local export GFORTRAN_SHA=0a19ca91019a75501e504eed1cad2be6ea92ba457ec815beb0dd28652eb0ce3f + ;; + *) echo Did not recognize arch-plat $arch-$plat; return 1 ;; + esac + local filesha=$(python3 tools/sha256sum.py gfortran-darwin-${arch}-${type}.tar.gz) + if [[ "$filesha" != "${GFORTRAN_SHA}" ]]; then + echo shasum mismatch for gfortran-darwin-${arch}-${type} + echo expected $GFORTRAN_SHA, + echo got $filesha exit 1 fi sudo mkdir -p /opt/ @@ -137,18 +140,18 @@ if [ "$(uname)" == "Darwin" ]; then sudo tar -xvf gfortran-darwin-${arch}-${type}.tar.gz sudo rm gfortran-darwin-${arch}-${type}.tar.gz popd - if [[ "${type}" == "native" ]]; then - # Link these into /usr/local so that there's no need to add rpath or -L - for f in libgfortran.dylib libgfortran.5.dylib libgcc_s.1.dylib libgcc_s.1.1.dylib libquadmath.dylib libquadmath.0.dylib; do - ln -sf /opt/gfortran-darwin-${arch}-${type}/lib/$f /usr/local/lib/$f + if [[ "${type}" == "native" ]]; then + # Link these into /usr/local so that there's no need to add rpath or -L + for f in libgfortran.dylib libgfortran.5.dylib libgcc_s.1.dylib libgcc_s.1.1.dylib libquadmath.dylib libquadmath.0.dylib; do + ln -sf /opt/gfortran-darwin-${arch}-${type}/lib/$f /usr/local/lib/$f done - # Add it to PATH - ln -sf /opt/gfortran-darwin-${arch}-${type}/bin/gfortran /usr/local/bin/gfortran - fi + # Add it to PATH + ln -sf /opt/gfortran-darwin-${arch}-${type}/bin/gfortran /usr/local/bin/gfortran + fi } function install_arm64_cross_gfortran { - download_and_unpack_gfortran arm64 cross + download_and_unpack_gfortran arm64 cross export FC_ARM64="$(find /opt/gfortran-darwin-arm64-cross/bin -name "*-gfortran")" local libgfortran="$(find /opt/gfortran-darwin-arm64-cross/lib -name libgfortran.dylib)" local libdir=$(dirname $libgfortran) @@ -157,6 +160,7 @@ if [ "$(uname)" == "Darwin" ]; then if [[ "${PLAT:-}" == "arm64" ]]; then export FC=$FC_ARM64 fi + check_gfortran } function install_gfortran { download_and_unpack_gfortran $(uname -m) native @@ -170,6 +174,7 @@ if [ "$(uname)" == "Darwin" ]; then # Get lib with gfortran suffix get_gf_lib_for_suf "gf_${GFORTRAN_SHA:0:7}" $@ } + else function install_gfortran { # No-op - already installed on manylinux image From 69ecd819e47782da21a21cbd94a5423d32646697 Mon Sep 17 00:00:00 2001 From: mattip Date: Fri, 21 Nov 2025 08:11:02 +0200 Subject: [PATCH 06/22] specify MACOSX_DEPLOYMENT_TARGET=10.13 on macos-x86_64, cleanup --- tools/build_steps.sh | 1 + tools/gfortran_utils.sh | 97 ++--------------------------------------- 2 files changed, 5 insertions(+), 93 deletions(-) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index b0f82bc..2c009d1 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -161,6 +161,7 @@ function do_build_lib { CFLAGS="$CFLAGS -arch x86_64" export SDKROOT=${SDKROOT:-$(xcrun --show-sdk-path)} local dynamic_list="CORE2 NEHALEM SANDYBRIDGE HASWELL SKYLAKEX" + MACOSX_DEPLOYMENT_TARGET="10.13" ;; *-i686) local bitness=32 diff --git a/tools/gfortran_utils.sh b/tools/gfortran_utils.sh index 1d4c270..a407a57 100644 --- a/tools/gfortran_utils.sh +++ b/tools/gfortran_utils.sh @@ -16,68 +16,6 @@ # Bash utilities for use with gfortran -ARCHIVE_SDIR="${ARCHIVE_SDIR:-archives}" - -GF_UTIL_DIR=$(dirname "${BASH_SOURCE[0]}") - -function get_distutils_platform { - # Report platform as in form of distutils get_platform. - # This is like the platform tag that pip will use. - # Modify fat architecture tags on macOS to reflect compiled architecture - - # Deprecate this function once get_distutils_platform_ex is used in all - # downstream projects - local plat=$1 - case $plat in - i686|x86_64|arm64|universal2|intel|aarch64|s390x|ppc64le) ;; - *) echo Did not recognize plat $plat; return 1 ;; - esac - local uname=${2:-$(uname)} - if [ "$uname" != "Darwin" ]; then - if [ "$plat" == "intel" ]; then - echo plat=intel not allowed for Manylinux - return 1 - fi - echo "manylinux1_$plat" - return - fi - # macOS 32-bit arch is i386 - [ "$plat" == "i686" ] && plat="i386" - local target=$(echo $MACOSX_DEPLOYMENT_TARGET | tr .- _) - echo "macosx_${target}_${plat}" -} - -function get_distutils_platform_ex { - # Report platform as in form of distutils get_platform. - # This is like the platform tag that pip will use. - # Modify fat architecture tags on macOS to reflect compiled architecture - # For non-darwin, report manylinux version - local plat=$1 - local mb_ml_ver=${MB_ML_VER:-1} - case $plat in - i686|x86_64|arm64|universal2|intel|aarch64|s390x|ppc64le) ;; - *) echo Did not recognize plat $plat; return 1 ;; - esac - local uname=${2:-$(uname)} - if [ "$uname" != "Darwin" ]; then - if [ "$plat" == "intel" ]; then - echo plat=intel not allowed for Manylinux - return 1 - fi - echo "manylinux${mb_ml_ver}_${plat}" - return - fi - # macOS 32-bit arch is i386 - [ "$plat" == "i686" ] && plat="i386" - local target=$(echo $MACOSX_DEPLOYMENT_TARGET | tr .- _) - echo "macosx_${target}_${plat}" -} - -function get_macosx_target { - # Report MACOSX_DEPLOYMENT_TARGET as given by distutils get_platform. - python3 -c "import sysconfig as s; print(s.get_config_vars()['MACOSX_DEPLOYMENT_TARGET'])" -} - function check_gfortran { # Check that gfortran exists on the path if [ -z "$(which gfortran)" ]; then @@ -86,27 +24,7 @@ function check_gfortran { fi } -function get_gf_lib_for_suf { - local suffix=$1 - local prefix=$2 - local plat=${3:-$PLAT} - local uname=${4:-$(uname)} - if [ -z "$prefix" ]; then echo Prefix not defined; exit 1; fi - local plat_tag=$(get_distutils_platform_ex $plat $uname) - if [ -n "$suffix" ]; then suffix="-$suffix"; fi - local fname="$prefix-${plat_tag}${suffix}.tar.gz" - local out_fname="${ARCHIVE_SDIR}/$fname" - [ -s $out_fname ] || (echo "$out_fname is empty"; exit 24) - echo "$out_fname" -} - if [ "$(uname)" == "Darwin" ]; then - mac_target=${MACOSX_DEPLOYMENT_TARGET:-$(get_macosx_target)} - export MACOSX_DEPLOYMENT_TARGET=$mac_target - # Keep this for now as some builds might depend on this being - # available before install_gfortran is called - # Set SDKROOT env variable if not set - export SDKROOT=${SDKROOT:-$(xcrun --show-sdk-path)} function download_and_unpack_gfortran { local arch=$1 @@ -142,8 +60,10 @@ if [ "$(uname)" == "Darwin" ]; then popd if [[ "${type}" == "native" ]]; then # Link these into /usr/local so that there's no need to add rpath or -L - for f in libgfortran.dylib libgfortran.5.dylib libgcc_s.1.dylib libgcc_s.1.1.dylib libquadmath.dylib libquadmath.0.dylib; do - ln -sf /opt/gfortran-darwin-${arch}-${type}/lib/$f /usr/local/lib/$f + for f in libgfortran.dylib libgfortran.5.dylib \ + libgcc_s.1.dylib libgcc_s.1.1.dylib libquadmath.dylib \ + libquadmath.0.dylib libgfortran.spec; do + ln -sf /opt/gfortran-darwin-${arch}-${type}/lib/$f /usr/local/lib/$f done # Add it to PATH ln -sf /opt/gfortran-darwin-${arch}-${type}/bin/gfortran /usr/local/bin/gfortran @@ -170,19 +90,10 @@ if [ "$(uname)" == "Darwin" ]; then fi } - function get_gf_lib { - # Get lib with gfortran suffix - get_gf_lib_for_suf "gf_${GFORTRAN_SHA:0:7}" $@ - } - else function install_gfortran { # No-op - already installed on manylinux image check_gfortran } - function get_gf_lib { - # Get library with no suffix - get_gf_lib_for_suf "" $@ - } fi From 93794028c4c799442c8b6f94434326e12659a353 Mon Sep 17 00:00:00 2001 From: mattip Date: Fri, 21 Nov 2025 08:18:55 +0200 Subject: [PATCH 07/22] use gcc11 on macos-x86_64 so we can use MACOSX_DEPLOYMENT_TARGET='10.9' --- tools/build_steps.sh | 4 +--- tools/gfortran_utils.sh | 7 +++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index 2c009d1..cc82788 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -47,8 +47,6 @@ function before_build { source tools/gfortran_utils.sh install_gfortran EOF - # Deployment target set by gfortran_utils - echo "Deployment target $MACOSX_DEPLOYMENT_TARGET" # Build the objconv tool (cd ${ROOT_DIR}/objconv && bash ../tools/build_objconv.sh) @@ -161,7 +159,7 @@ function do_build_lib { CFLAGS="$CFLAGS -arch x86_64" export SDKROOT=${SDKROOT:-$(xcrun --show-sdk-path)} local dynamic_list="CORE2 NEHALEM SANDYBRIDGE HASWELL SKYLAKEX" - MACOSX_DEPLOYMENT_TARGET="10.13" + MACOSX_DEPLOYMENT_TARGET="10.9" ;; *-i686) local bitness=32 diff --git a/tools/gfortran_utils.sh b/tools/gfortran_utils.sh index a407a57..086cb87 100644 --- a/tools/gfortran_utils.sh +++ b/tools/gfortran_utils.sh @@ -29,7 +29,7 @@ if [ "$(uname)" == "Darwin" ]; then function download_and_unpack_gfortran { local arch=$1 local type=$2 - curl -L -O https://github.com/isuruf/gcc/releases/download/gcc-15.2.0/gfortran-darwin-${arch}-${type}.tar.gz + local gccver=gcc-15.2.0 case ${arch}-${type} in arm64-native) local GFORTRAN_SHA=999a91eef894d32f99e3b641520bef9f475055067f301f0f1947b8b716b5922a @@ -38,13 +38,16 @@ if [ "$(uname)" == "Darwin" ]; then local export GFORTRAN_SHA=39ef2590629c2f238f1a67469fa429d8d6362425b277abb57fd2f3c982568a3f ;; x86_64-native) - local export GFORTRAN_SHA=fb03c1f37bf0258ada6e3e41698e3ad416fff4dad448fd746e01d8ccf1efdc0f + #override gccver + gccver=gcc-11.3.0.2 + local export GFORTRAN_SHA=981367dd0ad4335613e91bbee453d60b6669f5d7e976d18c7bdb7f1966f26ae4 ;; x86_64-cross) local export GFORTRAN_SHA=0a19ca91019a75501e504eed1cad2be6ea92ba457ec815beb0dd28652eb0ce3f ;; *) echo Did not recognize arch-plat $arch-$plat; return 1 ;; esac + curl -L -O https://github.com/isuruf/gcc/releases/download/${gccver}/gfortran-darwin-${arch}-${type}.tar.gz local filesha=$(python3 tools/sha256sum.py gfortran-darwin-${arch}-${type}.tar.gz) if [[ "$filesha" != "${GFORTRAN_SHA}" ]]; then echo shasum mismatch for gfortran-darwin-${arch}-${type} From 18c6e049893fd5d1d4d5ca06804f4d53885051e0 Mon Sep 17 00:00:00 2001 From: mattip Date: Fri, 21 Nov 2025 09:03:36 +0200 Subject: [PATCH 08/22] define FF rather than mess with PATH to get gfortran --- tools/gfortran_utils.sh | 55 +++++++++++++++-------------------------- 1 file changed, 20 insertions(+), 35 deletions(-) diff --git a/tools/gfortran_utils.sh b/tools/gfortran_utils.sh index 086cb87..afa8ab8 100644 --- a/tools/gfortran_utils.sh +++ b/tools/gfortran_utils.sh @@ -32,65 +32,50 @@ if [ "$(uname)" == "Darwin" ]; then local gccver=gcc-15.2.0 case ${arch}-${type} in arm64-native) - local GFORTRAN_SHA=999a91eef894d32f99e3b641520bef9f475055067f301f0f1947b8b716b5922a + export GFORTRAN_SHA=999a91eef894d32f99e3b641520bef9f475055067f301f0f1947b8b716b5922a ;; arm64-cross) - local export GFORTRAN_SHA=39ef2590629c2f238f1a67469fa429d8d6362425b277abb57fd2f3c982568a3f + export GFORTRAN_SHA=39ef2590629c2f238f1a67469fa429d8d6362425b277abb57fd2f3c982568a3f ;; x86_64-native) #override gccver gccver=gcc-11.3.0.2 - local export GFORTRAN_SHA=981367dd0ad4335613e91bbee453d60b6669f5d7e976d18c7bdb7f1966f26ae4 + export GFORTRAN_SHA=981367dd0ad4335613e91bbee453d60b6669f5d7e976d18c7bdb7f1966f26ae4 ;; x86_64-cross) - local export GFORTRAN_SHA=0a19ca91019a75501e504eed1cad2be6ea92ba457ec815beb0dd28652eb0ce3f + export GFORTRAN_SHA=0a19ca91019a75501e504eed1cad2be6ea92ba457ec815beb0dd28652eb0ce3f ;; *) echo Did not recognize arch-plat $arch-$plat; return 1 ;; esac curl -L -O https://github.com/isuruf/gcc/releases/download/${gccver}/gfortran-darwin-${arch}-${type}.tar.gz local filesha=$(python3 tools/sha256sum.py gfortran-darwin-${arch}-${type}.tar.gz) if [[ "$filesha" != "${GFORTRAN_SHA}" ]]; then - echo shasum mismatch for gfortran-darwin-${arch}-${type} - echo expected $GFORTRAN_SHA, + echo shasum mismatch for ${gccver}/gfortran-darwin-${arch}-${type} + echo expected $GFORTRAN_SHA echo got $filesha exit 1 fi - sudo mkdir -p /opt/ - sudo cp "gfortran-darwin-${arch}-${type}.tar.gz" /opt/gfortran-darwin-${arch}-${type}.tar.gz - pushd /opt - sudo tar -xvf gfortran-darwin-${arch}-${type}.tar.gz - sudo rm gfortran-darwin-${arch}-${type}.tar.gz - popd - if [[ "${type}" == "native" ]]; then - # Link these into /usr/local so that there's no need to add rpath or -L - for f in libgfortran.dylib libgfortran.5.dylib \ - libgcc_s.1.dylib libgcc_s.1.1.dylib libquadmath.dylib \ - libquadmath.0.dylib libgfortran.spec; do - ln -sf /opt/gfortran-darwin-${arch}-${type}/lib/$f /usr/local/lib/$f - done - # Add it to PATH - ln -sf /opt/gfortran-darwin-${arch}-${type}/bin/gfortran /usr/local/bin/gfortran + if [[ ! -e /opt/gfortran ]]; then + sudo mkdir -p /opt/gfortran + sudo chmod 777 -p /opt/gfortran fi - } - - function install_arm64_cross_gfortran { - download_and_unpack_gfortran arm64 cross - export FC_ARM64="$(find /opt/gfortran-darwin-arm64-cross/bin -name "*-gfortran")" - local libgfortran="$(find /opt/gfortran-darwin-arm64-cross/lib -name libgfortran.dylib)" + cp "gfortran-darwin-${arch}-${type}.tar.gz" /opt/gfortran/gfortran-darwin-${arch}-${type}.tar.gz + pushd /opt/gfortran + tar -xvf gfortran-darwin-${arch}-${type}.tar.gz + rm gfortran-darwin-${arch}-${type}.tar.gz + popd + export FC="$(find /opt/gfortran/gfortran-darwin-${arch}-${type}/bin -name "*-gfortran")" + local libgfortran="$(find /opt/gfortran/gfortran-darwin-${arch}-${cross}/lib -name libgfortran.dylib)" local libdir=$(dirname $libgfortran) - - export FC_ARM64_LDFLAGS="-L$libdir -Wl,-rpath,$libdir" - if [[ "${PLAT:-}" == "arm64" ]]; then - export FC=$FC_ARM64 - fi - check_gfortran + export FFLAGS="-L$libdir -Wl,-rpath,$libdir" } + function install_gfortran { download_and_unpack_gfortran $(uname -m) native - check_gfortran if [[ "${PLAT:-}" == "universal2" || "${PLAT:-}" == "arm64" ]]; then - install_arm64_cross_gfortran + download_and_unpack_gfortran arm64 cross fi + check_gfortran } else From 96de0849813e17bcefc7e42ae0e2c3a0d76aa445 Mon Sep 17 00:00:00 2001 From: mattip Date: Fri, 21 Nov 2025 09:32:01 +0200 Subject: [PATCH 09/22] typo, increase bash verbosity --- tools/build_steps.sh | 1 + tools/gfortran_utils.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index cc82788..b491857 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -44,6 +44,7 @@ function before_build { # force the architecture when using rosetta unalias gfortran || true arch -${PLAT} bash -s << " EOF" + set -xe source tools/gfortran_utils.sh install_gfortran EOF diff --git a/tools/gfortran_utils.sh b/tools/gfortran_utils.sh index afa8ab8..298e104 100644 --- a/tools/gfortran_utils.sh +++ b/tools/gfortran_utils.sh @@ -48,6 +48,7 @@ if [ "$(uname)" == "Darwin" ]; then *) echo Did not recognize arch-plat $arch-$plat; return 1 ;; esac curl -L -O https://github.com/isuruf/gcc/releases/download/${gccver}/gfortran-darwin-${arch}-${type}.tar.gz + ls -lh gfortran-darwin-${arch}-${type}.tar.gz local filesha=$(python3 tools/sha256sum.py gfortran-darwin-${arch}-${type}.tar.gz) if [[ "$filesha" != "${GFORTRAN_SHA}" ]]; then echo shasum mismatch for ${gccver}/gfortran-darwin-${arch}-${type} @@ -65,7 +66,7 @@ if [ "$(uname)" == "Darwin" ]; then rm gfortran-darwin-${arch}-${type}.tar.gz popd export FC="$(find /opt/gfortran/gfortran-darwin-${arch}-${type}/bin -name "*-gfortran")" - local libgfortran="$(find /opt/gfortran/gfortran-darwin-${arch}-${cross}/lib -name libgfortran.dylib)" + local libgfortran="$(find /opt/gfortran/gfortran-darwin-${arch}-${type}/lib -name libgfortran.dylib)" local libdir=$(dirname $libgfortran) export FFLAGS="-L$libdir -Wl,-rpath,$libdir" } From 21d2cc8ff79c3bc2b4bc1f2b8d9f8153732b7e45 Mon Sep 17 00:00:00 2001 From: mattip Date: Fri, 21 Nov 2025 09:41:06 +0200 Subject: [PATCH 10/22] typos --- tools/gfortran_utils.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/gfortran_utils.sh b/tools/gfortran_utils.sh index 298e104..3718d6a 100644 --- a/tools/gfortran_utils.sh +++ b/tools/gfortran_utils.sh @@ -39,7 +39,7 @@ if [ "$(uname)" == "Darwin" ]; then ;; x86_64-native) #override gccver - gccver=gcc-11.3.0.2 + gccver=gcc-11.3.0-2 export GFORTRAN_SHA=981367dd0ad4335613e91bbee453d60b6669f5d7e976d18c7bdb7f1966f26ae4 ;; x86_64-cross) @@ -58,7 +58,7 @@ if [ "$(uname)" == "Darwin" ]; then fi if [[ ! -e /opt/gfortran ]]; then sudo mkdir -p /opt/gfortran - sudo chmod 777 -p /opt/gfortran + sudo chmod 777 /opt/gfortran fi cp "gfortran-darwin-${arch}-${type}.tar.gz" /opt/gfortran/gfortran-darwin-${arch}-${type}.tar.gz pushd /opt/gfortran From 2580a9969b3e881bb29b5b085cf22544c6d6e6c1 Mon Sep 17 00:00:00 2001 From: mattip Date: Fri, 21 Nov 2025 09:51:09 +0200 Subject: [PATCH 11/22] improve check_gfortran --- tools/gfortran_utils.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/gfortran_utils.sh b/tools/gfortran_utils.sh index 3718d6a..6b703c1 100644 --- a/tools/gfortran_utils.sh +++ b/tools/gfortran_utils.sh @@ -18,9 +18,15 @@ function check_gfortran { # Check that gfortran exists on the path - if [ -z "$(which gfortran)" ]; then + if [[ -v FC && -e "$FC" ]]; then + echo using gfortran from FC + echo $FC --version + elif [ -z "$(which gfortran)" ]; then echo Missing gfortran exit 1 + else + echo using gfortran on the PATH + echo gfortran --version fi } From ab388104204158c8e7cbcdfcf7669376028a207c Mon Sep 17 00:00:00 2001 From: mattip Date: Fri, 21 Nov 2025 09:59:24 +0200 Subject: [PATCH 12/22] no -v in bash on macOS --- tools/gfortran_utils.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gfortran_utils.sh b/tools/gfortran_utils.sh index 6b703c1..b801d94 100644 --- a/tools/gfortran_utils.sh +++ b/tools/gfortran_utils.sh @@ -18,7 +18,7 @@ function check_gfortran { # Check that gfortran exists on the path - if [[ -v FC && -e "$FC" ]]; then + if [[ -n "$FC" && -e "$FC" ]]; then echo using gfortran from FC echo $FC --version elif [ -z "$(which gfortran)" ]; then From bcf9294a364082b20ad353e2c5731800d5770b6a Mon Sep 17 00:00:00 2001 From: mattip Date: Fri, 21 Nov 2025 11:50:46 +0200 Subject: [PATCH 13/22] macos: always use native gfortran, re-export env variables from gfortran_utils --- tools/build_steps.sh | 20 +++++--------------- tools/gfortran_utils.sh | 3 --- tools/local_build.sh | 8 ++++++-- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index b491857..bf07a3a 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -26,17 +26,6 @@ function get_os { function before_build { # Manylinux Python version set in build_lib if [ -n "$IS_OSX" ]; then - if [ ! -e /usr/local/lib ]; then - sudo mkdir -p /usr/local/lib - sudo chmod 777 /usr/local/lib - touch /usr/local/lib/.dir_exists - fi - if [ ! -e /usr/local/include ]; then - sudo mkdir -p /usr/local/include - sudo chmod 777 /usr/local/include - touch /usr/local/include/.dir_exists - fi - # get_macpython_environment ${MB_PYTHON_VERSION} venv python3.9 -m venv venv source venv/bin/activate # Use gfortran from conda @@ -48,6 +37,11 @@ function before_build { source tools/gfortran_utils.sh install_gfortran EOF + # re-export these, since we ran in a shell + export FC="$(find /opt/gfortran/gfortran-darwin-${PLAT}-native/bin -name "*-gfortran")" + local libgfortran="$(find /opt/gfortran/gfortran-darwin-${PLAT}-native/lib -name libgfortran.dylib)" + local libdir=$(dirname $libgfortran) + export FFLAGS="-L$libdir -Wl,-rpath,$libdir" # Build the objconv tool (cd ${ROOT_DIR}/objconv && bash ../tools/build_objconv.sh) @@ -61,13 +55,9 @@ function clean_code { [ -z "$build_commit" ] && echo "build_commit not defined" && exit 1 pushd OpenBLAS git fetch origin --tags - echo after git fetch origin git checkout $build_commit - echo after git checkout $build_commit git clean -fxd - echo after git clean git submodule update --init --recursive - echo after git submodule update popd } diff --git a/tools/gfortran_utils.sh b/tools/gfortran_utils.sh index b801d94..74ac108 100644 --- a/tools/gfortran_utils.sh +++ b/tools/gfortran_utils.sh @@ -79,9 +79,6 @@ if [ "$(uname)" == "Darwin" ]; then function install_gfortran { download_and_unpack_gfortran $(uname -m) native - if [[ "${PLAT:-}" == "universal2" || "${PLAT:-}" == "arm64" ]]; then - download_and_unpack_gfortran arm64 cross - fi check_gfortran } diff --git a/tools/local_build.sh b/tools/local_build.sh index 4754c2c..a436b26 100755 --- a/tools/local_build.sh +++ b/tools/local_build.sh @@ -5,8 +5,12 @@ set -e # Set extra env if [[ $(uname) == "Darwin" ]]; then - # Force x86_64 - export PLAT=x86_64 + # export PLAT=x86_64 + export PLAT=arm64 + # Force installation of gfortran + export IS_MACOS=1 + export IS_OSX=1 + elif [[ $(uname -m) == "x86_64" ]]; then echo got x86_64 export PLAT=x86_64 From af083b77d630430e2ee0caff118a69c54af326e4 Mon Sep 17 00:00:00 2001 From: mattip Date: Fri, 21 Nov 2025 12:08:43 +0200 Subject: [PATCH 14/22] revert removal of check for /usr/local/include and /usr/local/lib --- tools/build_steps.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index bf07a3a..c9ec16a 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -24,8 +24,18 @@ function get_os { function before_build { - # Manylinux Python version set in build_lib + if [ ! -e /usr/local/lib ]; then + sudo mkdir -p /usr/local/lib + sudo chmod 777 /usr/local/lib + touch /usr/local/lib/.dir_exists + fi + if [ ! -e /usr/local/include ]; then + sudo mkdir -p /usr/local/include + sudo chmod 777 /usr/local/include + touch /usr/local/include/.dir_exists + fi if [ -n "$IS_OSX" ]; then + # get_macpython_environment ${MB_PYTHON_VERSION} venv python3.9 -m venv venv source venv/bin/activate # Use gfortran from conda From aebe89c475fa51668511c76e8a9622fc07b60e37 Mon Sep 17 00:00:00 2001 From: mattip Date: Fri, 21 Nov 2025 12:27:52 +0200 Subject: [PATCH 15/22] hardcode path to libgfortran.dylib --- tools/build_steps.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index c9ec16a..d0cc7df 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -48,10 +48,9 @@ function before_build { install_gfortran EOF # re-export these, since we ran in a shell - export FC="$(find /opt/gfortran/gfortran-darwin-${PLAT}-native/bin -name "*-gfortran")" - local libgfortran="$(find /opt/gfortran/gfortran-darwin-${PLAT}-native/lib -name libgfortran.dylib)" - local libdir=$(dirname $libgfortran) - export FFLAGS="-L$libdir -Wl,-rpath,$libdir" + export FC=$(find /opt/gfortran/gfortran-darwin-${PLAT}-native/bin -name "*-gfortran") + local libdir=/opt/gfortran/gfortran-darwin-${PLAT}-native/lib + export FFLAGS="-L${libdir} -Wl,-rpath,${libdir}" # Build the objconv tool (cd ${ROOT_DIR}/objconv && bash ../tools/build_objconv.sh) From f64e97b7af8b99feea96952653c019f9790748e1 Mon Sep 17 00:00:00 2001 From: mattip Date: Mon, 24 Nov 2025 12:41:44 +0200 Subject: [PATCH 16/22] use image's gfortran-15 on macos-arm64, remove tarball name mangling --- tools/build_steps.sh | 53 ++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index d0cc7df..8d5c1b8 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -38,20 +38,6 @@ function before_build { # get_macpython_environment ${MB_PYTHON_VERSION} venv python3.9 -m venv venv source venv/bin/activate - # Use gfortran from conda - # Since install_fortran uses `uname -a` to determine arch, - # force the architecture when using rosetta - unalias gfortran || true - arch -${PLAT} bash -s << " EOF" - set -xe - source tools/gfortran_utils.sh - install_gfortran - EOF - # re-export these, since we ran in a shell - export FC=$(find /opt/gfortran/gfortran-darwin-${PLAT}-native/bin -name "*-gfortran") - local libdir=/opt/gfortran/gfortran-darwin-${PLAT}-native/lib - export FFLAGS="-L${libdir} -Wl,-rpath,${libdir}" - # Build the objconv tool (cd ${ROOT_DIR}/objconv && bash ../tools/build_objconv.sh) fi @@ -115,9 +101,9 @@ function build_lib { local manylinux=${MB_ML_VER:-1} if [ -n "$IS_OSX" ]; then # Do build, add gfortran hash to end of name - do_build_lib "$plat" "gf_${GFORTRAN_SHA:0:7}" "$interface64" "$nightly" + do_build_lib "$plat" "$interface64" "$nightly" else - do_build_lib "$plat" "" "$interface64" "$nightly" + do_build_lib "$plat" "$interface64" "$nightly" fi } @@ -134,8 +120,6 @@ function do_build_lib { # Build openblas lib # Input arg # plat - one of i686, x86_64, arm64 - # suffix (optional) - suffix for output archive name - # Suffix added with hyphen prefix # interface64 (optional) - whether to build ILP64 openblas # with 64_ symbol suffix # nightly (optional) - whether to build for nightlies @@ -143,9 +127,8 @@ function do_build_lib { # Depends on globals # BUILD_PREFIX - install suffix e.g. "/usr/local" local plat=$1 - local suffix=$2 - local interface64=$3 - local nightly=$4 + local interface64=$2 + local nightly=$3 case $(get_os)-$plat in Linux-x86_64) local bitness=64 @@ -155,6 +138,20 @@ function do_build_lib { Darwin-x86_64) local bitness=64 local target="CORE2" + # Use gfortran from conda + # Since install_fortran uses `uname -a` to determine arch, + # force the architecture when using rosetta + unalias gfortran || true + arch -${PLAT} bash -s << " EOF" + set -xe + source tools/gfortran_utils.sh + install_gfortran + EOF + # re-export these, since we ran in a shell + export FC=$(find /opt/gfortran/gfortran-darwin-${PLAT}-native/bin -name "*-gfortran") + local libdir=/opt/gfortran/gfortran-darwin-${PLAT}-native/lib + export FFLAGS="-L${libdir} -Wl,-rpath,${libdir}" + export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH CFLAGS="$CFLAGS -arch x86_64" export SDKROOT=${SDKROOT:-$(xcrun --show-sdk-path)} @@ -176,6 +173,16 @@ function do_build_lib { fi ;; Darwin-arm64) + export FC=gfortran-15 + which $FC + # guess? + local libdir=/opt/homebrew/Cellar/gcc/15.2.0/lib/gcc/current + if [! -d $libdir]; then + echo where is libfortran.a? + find /opt -name libgfortran.a + exit 1 + fi + export FFLAGS="-L${libdir} -Wl,-rpath,${libdir}" local bitness=64 local target="VORTEX" CFLAGS="$CFLAGS -ftrapping-math -mmacos-version-min=11.0" @@ -244,8 +251,6 @@ function do_build_lib { fi mv $BUILD_PREFIX/lib/pkgconfig/openblas*.pc $BUILD_PREFIX/lib/pkgconfig/scipy-openblas.pc local plat_tag=$(get_plat_tag $plat) - local suff="" - [ -n "$suffix" ] && suff="-$suffix" if [ "$interface64" = "1" ]; then # OpenBLAS does not install the symbol suffixed static library, # do it ourselves @@ -258,7 +263,7 @@ function do_build_lib { rm $BUILD_PREFIX/lib/pkgconfig/scipy-openblas.pc.bak fi - local out_name="openblas${symbolsuffix}-${version}-${plat_tag}${suff}.tar.gz" + local out_name="openblas${symbolsuffix}-${version}-${plat_tag}.tar.gz" tar zcvf libs/$out_name \ $BUILD_PREFIX/include/*blas* \ $BUILD_PREFIX/include/*lapack* \ From 5f0c1f2cc9d94a3ff465612957c20af5a6f65375 Mon Sep 17 00:00:00 2001 From: mattip Date: Mon, 24 Nov 2025 14:19:55 +0200 Subject: [PATCH 17/22] typo --- tools/build_steps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index 8d5c1b8..b211725 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -177,7 +177,7 @@ function do_build_lib { which $FC # guess? local libdir=/opt/homebrew/Cellar/gcc/15.2.0/lib/gcc/current - if [! -d $libdir]; then + if [ ! -d $libdir]; then echo where is libfortran.a? find /opt -name libgfortran.a exit 1 From 43f5e557367a601b190c18124e7cfafa66d16f84 Mon Sep 17 00:00:00 2001 From: mayeut Date: Mon, 24 Nov 2025 14:30:30 +0200 Subject: [PATCH 18/22] fixes --- tools/build_steps.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index b211725..fdd578d 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -192,6 +192,7 @@ function do_build_lib { ;; *-s390x) local bitness=64 + local target="ZARCH_GENERIC" ;; *-ppc64le) local bitness=64 @@ -221,7 +222,10 @@ function do_build_lib { git config --global --add safe.directory '*' pushd OpenBLAS patch_source + # force failure when fortran compiler is no detected + sed -i.bak -e 's/info OpenBLAS: Detecting fortran compiler failed/error OpenBLAS: Detecting fortran compiler failed/g' Makefile echo start building + if [ "$plat" == "loongarch64" ]; then # https://github.com/OpenMathLib/OpenBLAS/blob/develop/.github/workflows/loongarch64.yml#L65 echo -n > utest/test_dsdot.c From 5a0c095de3346e243225c0bb60fa5e495af99693 Mon Sep 17 00:00:00 2001 From: mattip Date: Mon, 24 Nov 2025 17:01:03 +0200 Subject: [PATCH 19/22] typo --- tools/build_steps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index fdd578d..82f8e10 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -177,7 +177,7 @@ function do_build_lib { which $FC # guess? local libdir=/opt/homebrew/Cellar/gcc/15.2.0/lib/gcc/current - if [ ! -d $libdir]; then + if [ ! -d $libdir ]; then echo where is libfortran.a? find /opt -name libgfortran.a exit 1 From 8c0ea320887c9155273dba50651537a72c9e0a5b Mon Sep 17 00:00:00 2001 From: mattip Date: Mon, 24 Nov 2025 20:28:40 +0200 Subject: [PATCH 20/22] do more debug --- tools/build_steps.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index 82f8e10..872b47b 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -177,7 +177,7 @@ function do_build_lib { which $FC # guess? local libdir=/opt/homebrew/Cellar/gcc/15.2.0/lib/gcc/current - if [ ! -d $libdir ]; then + if [ ! -e $libdir/libgfortran.a ]; then echo where is libfortran.a? find /opt -name libgfortran.a exit 1 @@ -234,14 +234,14 @@ function do_build_lib { fi if [ -n "$dynamic_list" ]; then CFLAGS="$CFLAGS -fvisibility=protected -Wno-uninitialized" \ - make BUFFERSIZE=20 DYNAMIC_ARCH=1 QUIET_MAKE=1 \ + make BUFFERSIZE=20 DYNAMIC_ARCH=1 \ USE_OPENMP=0 NUM_THREADS=64 \ DYNAMIC_LIST="$dynamic_list" \ BINARY="$bitness" $interface_flags \ TARGET="$target" else CFLAGS="$CFLAGS -fvisibility=protected -Wno-uninitialized" \ - make BUFFERSIZE=20 DYNAMIC_ARCH=1 QUIET_MAKE=1 \ + make BUFFERSIZE=20 DYNAMIC_ARCH=1 \ USE_OPENMP=0 NUM_THREADS=64 \ BINARY="$bitness" $interface_flags \ TARGET="$target" From 6d6c0ca6fc07ac6f310fac83ee0bb959bbac3d2a Mon Sep 17 00:00:00 2001 From: mattip Date: Mon, 24 Nov 2025 21:38:26 +0200 Subject: [PATCH 21/22] use GFORTRAN_LIBDIR like upstream --- tools/build_steps.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index 872b47b..e7d20b9 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -183,6 +183,7 @@ function do_build_lib { exit 1 fi export FFLAGS="-L${libdir} -Wl,-rpath,${libdir}" + export GFORTRAN_LIBDIR=$($FC -print-file-name=libgfortran.dylib | xargs dirname) local bitness=64 local target="VORTEX" CFLAGS="$CFLAGS -ftrapping-math -mmacos-version-min=11.0" From 84206da71c8d20178bd80a8b6e3f098e7b2c8bc4 Mon Sep 17 00:00:00 2001 From: mattip Date: Mon, 24 Nov 2025 22:36:59 +0200 Subject: [PATCH 22/22] add LDFLAGS too --- tools/build_steps.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/build_steps.sh b/tools/build_steps.sh index e7d20b9..de1017c 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -184,6 +184,7 @@ function do_build_lib { fi export FFLAGS="-L${libdir} -Wl,-rpath,${libdir}" export GFORTRAN_LIBDIR=$($FC -print-file-name=libgfortran.dylib | xargs dirname) + export LDFLAGS="-L/opt/homebrew/opt/llvm/lib -L$GFORTRAN_LIBDIR" local bitness=64 local target="VORTEX" CFLAGS="$CFLAGS -ftrapping-math -mmacos-version-min=11.0"