Skip to content

macOS: enable Accelerate ILP64 through Apple's new interface - #198

Merged
mmelnich merged 2 commits into
mainfrom
new-accelerate-ilp64
Aug 27, 2026
Merged

macOS: enable Accelerate ILP64 through Apple's new interface#198
mmelnich merged 2 commits into
mainfrom
new-accelerate-ilp64

Conversation

@mmelnich

@mmelnich mmelnich commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

BLAS++ and LAPACK++ merged new-Apple-Accelerate support on 2026-08-27 (icl-utk-edu/blaspp#134, icl-utk-edu/lapackpp#88). With the new interface, requesting blas_int=int64 defines ACCELERATE_LAPACK_ILP64 (in BLAS++'s include/blas/config.h), so on macOS >= 13.3 the ILP64 width is real and verifiable through the generated defines.h, exactly like MKL. This PR lifts RandBLAS's macOS ILP64 restriction and puts the new interface under CI.

Closes #189. Closes #150.

Changes

  • Pins: installers/install.sh and the Windows CI provisioner advance BLAS++ to 2d8d4e9 (the Argument handling for print_buff_to_stream #134 merge) and LAPACK++ to b9439cf (the Add learning resources for people new to C++ #88 merge).
  • Installer: the --blas-int=ilp64 + Accelerate refusal is gone. The standard width policy (prefer ILP64 where the backend provides it) now covers Accelerate: auto resolves to ILP64 on macOS >= 13.3, falls back to LP64 with the usual warning on older macOS, and an explicit ilp64 request fails the BLAS++ configure there rather than silently downgrading.
  • core CI: the macOS Accelerate lanes build blaspp with -Dblas_int=int64 (mirroring the MKL treatment) and hard-fail if the installed defines.h lacks ACCELERATE_NEW_LAPACK or BLAS_ILP64, so a silent fall-back to the legacy interface cannot masquerade as coverage. Dependency cache keys are bumped because existing caches hold LP64 legacy-interface builds. Note these lanes clone blaspp/lapackpp HEAD by design, so they pick the new interface up immediately.
  • install-script CI (macOS): the default run now asserts the summary reports accelerate, ILP64; the old "ILP64 is refused" test becomes an explicit --blas-int=lp64 install + test-suite run, so the 32-bit width on Accelerate stays exercised now that no lane hits it by default.
  • INSTALL.md: tested-configuration and integer-width tables updated.
  • Rename, per review: the install/ folder is now installers/, with references updated in INSTALL.md, the install-script workflow, the Windows provisioning comments, and the script's own usage text (the web docs and README carry no references to the folder). RandLAPACK gets the same rename on macOS: default the installer to Accelerate (new interface) with ILP64 RandLAPACK#172 so the two repos stay symmetric.

BLAS++ and LAPACK++ merged new-Accelerate support on 2026-08-27
(icl-utk-edu/blaspp#134, icl-utk-edu/lapackpp#88). Requesting int64 with
the new interface defines ACCELERATE_LAPACK_ILP64, so the width is real
and verifiable through the generated defines.h, like MKL.

- Advance the BLAS++/LAPACK++ pins past the merges, in install.sh and
  the Windows CI provisioner.
- install.sh: stop refusing --blas-int=ilp64 with Accelerate. The width
  default (ilp64 where available) now applies to Accelerate too; on
  macOS older than 13.3 the int64 probe fails, so auto falls back to
  LP64 with the usual warning and an explicit ilp64 request fails the
  BLAS++ configure rather than silently downgrading.
- core CI: the macOS Accelerate lanes build blaspp with blas_int=int64
  and hard-fail if defines.h lacks ACCELERATE_NEW_LAPACK or BLAS_ILP64,
  so a silent fall-back to the legacy interface cannot go unnoticed.
  Dependency cache keys bumped (the old caches hold LP64 builds).
- install-script CI: the macOS lane asserts the default resolves to
  accelerate + ILP64; the old ILP64-refusal test becomes an explicit
  --blas-int=lp64 leg so the 32-bit width stays exercised.
- INSTALL.md: tested-configuration and width tables updated.

Closes #189. Closes #150.

Verified on Linux/MKL against the new pins: full installer run end to
end, then 504/504 tests.

@rileyjmurray rileyjmurray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

While we're here, please rename the install folder to installers. Update references to that folder wherever appropriate (readme? install.md? web docs?).

Other than that, looks good.

References updated in INSTALL.md, the install-script workflow, the
Windows provisioning comments, and the script's own usage text.
@mmelnich

Copy link
Copy Markdown
Contributor Author

Renamed in 5d8327f: install/ is now installers/, with references updated in INSTALL.md, the install-script workflow, the Windows provisioning comments, and the script's own usage text. The web docs and README carry no references to the folder, so nothing to change there. RandLAPACK got the same rename on its open installer PR (BallisticLA/RandLAPACK#172, 186925c) so the two repos stay symmetric; its root install.sh wrapper keeps working and now execs installers/install.sh.

@rileyjmurray

Copy link
Copy Markdown
Contributor

We can merge once CI passes

@mmelnich
mmelnich merged commit 7ccd246 into main Aug 27, 2026
26 checks passed
@mmelnich
mmelnich deleted the new-accelerate-ilp64 branch August 27, 2026 16:49
mmelnich added a commit to BallisticLA/RandLAPACK that referenced this pull request Aug 27, 2026
…#172)

## 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/blaspp#134),
[icl-utk-edu/lapackpp#88](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 #134 merge) and LAPACK++ to `b9439cf` (the #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
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 BallisticLA/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.
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: no ILP64 route, because BLAS++ implements only Apple's legacy Accelerate interface CI: have macOS builds that use "new Accelerate"

2 participants