Skip to content

macOS: default the installer to Accelerate (new interface) with ILP64 - #172

Merged
mmelnich merged 4 commits into
mainfrom
new-accelerate-installer
Aug 27, 2026
Merged

macOS: default the installer to Accelerate (new interface) with ILP64#172
mmelnich merged 4 commits into
mainfrom
new-accelerate-installer

Conversation

@mmelnich

@mmelnich mmelnich commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #155, which retired the legacy-Accelerate accommodations in the library and CI. This PR does the installer half: with new-Accelerate support merged upstream on 2026-08-27 (icl-utk-edu/blaspp#134, icl-utk-edu/lapackpp#88), the reasons macOS defaulted to Homebrew OpenBLAS — the legacy gesdd bug, the missing routines, the missing ILP64 — are gone. The default macOS build now uses Accelerate through Apple's new interface and needs no Homebrew BLAS. (ILP64 turned out to be blocked upstream — see below.)

Closes #165 except its ILP64 item, which is split into #173: this PR's own install-macos lane discovered that LAPACK++ does not compile against Accelerate ILP64 (lapack_int becomes Apple's long while the wrappers assume int64_t; filed upstream as icl-utk-edu/lapackpp#89). Accelerate is therefore constrained to LP64 for now — the same width the old OpenBLAS default produced on macOS, so nothing regresses. RandBLAS mirror: BallisticLA/RandBLAS#198 (unaffected: RandBLAS does not need LAPACK++, and its Accelerate ILP64 lanes are green).

Changes

  • Pins: installers/install.sh and .github/actions/setup-randlapack-deps-windows/setup.ps1 advance BLAS++ to 2d8d4e9 (the fix include paths #134 merge) and LAPACK++ to b9439cf (the Update rl_rbki.hh #88 merge).
  • Backend default: --blas=auto on macOS resolves to accelerate (previously openblas). --blas=openblas remains fully supported.
  • Correctness guard: a build in which BLAS++ silently fell back to Apple's LEGACY interface is refused immediately after the BLAS++ build, by checking the generated defines.h for ACCELERATE_NEW_LAPACK — the legacy gesdd computes wrong singular values, so this must be a hard error, not a warning. The numerical gesdd conftest stays as the second net. On macOS < 13.3 the error message points at --blas=openblas.
  • Width: the gesdd warning is removed. Accelerate stays LP64 for now, and an explicit --blas-int=ilp64 is refused with a message citing New Accelerate ILP64 does not compile: lapack_int (long) vs int64_t (long long) in the ILP64 alias paths icl-utk-edu/lapackpp#89 / macOS: Accelerate ILP64 blocked on a LAPACK++ compile bug (icl-utk-edu/lapackpp#89) #173 (previously the refusal cited the long-gone interface gap).
  • Portability fix found by this PR's CI: macOS ships bash 3.2, where expanding an empty array under set -u is an "unbound variable" error; with the old OpenBLAS default the affected arrays were never empty on macOS, so the default flip exposed it (it was already reachable with an explicit --blas=accelerate or --blas=mkl on any Mac). All possibly-empty array expansions now use the bash-3.2-safe guard, and the install-script lanes print install.log on failure so errors of this class are never silent again.
  • install-script CI (macOS): the default lane deliberately does NOT brew install openblas anymore, and asserts the summary reports accelerate, LP64; a new explicit --blas=openblas leg (with its own project dir and test-suite run) keeps that route exercised.
  • Rename, mirroring the review on macOS: enable Accelerate ILP64 through Apple's new interface RandBLAS#198: the install/ folder is now installers/. The root install.sh wrapper keeps working (bash install.sh unchanged for users) and now execs installers/install.sh; references updated in INSTALL.md, INSTALL_SCRIPT.md, INSTALL_WINDOWS.md, docs/CI.md, the install-script workflow, and the Windows guard scripts.
  • Docs: INSTALL.md, INSTALL_SCRIPT.md (§6.1 table, §6.2 width table, §6.4 rewritten), docs/CI.md.

BLAS++ and LAPACK++ merged new-Apple-Accelerate support on 2026-08-27
(icl-utk-edu/blaspp#134, icl-utk-edu/lapackpp#88). The new interface
(macOS >= 13.3, LAPACK 3.12 on current SDKs) fixes the legacy gesdd bug,
carries the routines BQRRP needs, and ships ILP64 -- so the reasons the
macOS default was Homebrew OpenBLAS are gone, and the default build no
longer needs any Homebrew BLAS.

- Advance the BLAS++/LAPACK++ pins past the merges, in install.sh and
  the Windows CI provisioner.
- install.sh: macOS auto now resolves to accelerate; the gesdd warning
  and the ilp64-with-Accelerate refusals are removed (the standard
  prefer-ILP64 width policy applies). A build in which BLAS++ silently
  fell back to the LEGACY interface is refused right after the BLAS++
  build, by checking defines.h for ACCELERATE_NEW_LAPACK; the numerical
  gesdd conftest remains as the second net.
- install-script CI (macOS): the default lane runs without Homebrew
  OpenBLAS and asserts the summary reports accelerate + ILP64; an
  explicit --blas=openblas leg keeps that route exercised.
- INSTALL.md, INSTALL_SCRIPT.md, docs/CI.md updated to match.

Closes #165.

Verified on Linux/MKL against the new pins: full installer run end to
end (BLAS++ 2d8d4e9 + LAPACK++ b9439cf), then 313/313 tests.
The install-macos lane died at the LAPACK++ configure with no error
text. Cause: macOS ships bash 3.2, where expanding an empty array under
'set -u' is an 'unbound variable' error (fixed in bash 4.4), and the
error went to install.log, which CI never printed. With the old
OpenBLAS default, LAPACKPP_BACKEND_FLAGS was always non-empty on macOS;
accelerate (and mkl) leave it empty, so the default flip exposed the
crash -- it was already reachable with an explicit --blas=accelerate on
any Mac.

Every possibly-empty array expansion now uses the bash-3.2-safe
${arr[@]+"${arr[@]}"} idiom, and the install-script lanes gained an
if-failure step that tails install.log, so this class of failure is
never silent again.
Discovered by this PR's install-macos lane: BLAS++ ILP64 on new
Accelerate works, but LAPACK++ does not compile in that configuration
-- its lapack_int becomes Apple's 'long' while the wrappers' ILP64
no-copy paths assume int64_t ('long long' on Darwin). Filed upstream as
icl-utk-edu/lapackpp#89; the RandLAPACK side is tracked in #173.

Accelerate therefore builds LP64 (what the old OpenBLAS default
produced on macOS as well, so no width regression), and an explicit
--blas-int=ilp64 is refused with a message citing the block. Docs and
the CI assertion updated to match.
Same rename in both repos so the installer layout stays symmetric. The
root install.sh wrapper still works and now execs installers/install.sh.
References updated in INSTALL.md, INSTALL_SCRIPT.md, INSTALL_WINDOWS.md,
docs/CI.md, the install-script workflow, and the Windows guard scripts.
@mmelnich
mmelnich merged commit 7223caf into main Aug 27, 2026
11 checks passed
@mmelnich
mmelnich deleted the new-accelerate-installer branch August 27, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS: Accelerate is neither ILP64-capable nor gesdd-correct until BLAS++ adopts Apple's new interface

1 participant