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
14 changes: 7 additions & 7 deletions .github/actions/setup-randblas-deps-windows/setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,17 @@ function Clone-Pinned {

#------------------------------------------------------------------ pins ------
# Immutable refs only: a tag or a full commit hash, never a branch. These match
# install/install.sh and the refs RandLAPACK validated, so the two installers
# installers/install.sh and the refs RandLAPACK validated, so the two installers
# and CI cannot disagree about what they built.
#
# BLAS++ and LAPACK++ previously came from personal forks carrying one-line
# MSVC fixes. Both merged upstream on 2026-08-06 (icl-utk-edu/blaspp#132,
# icl-utk-edu/lapackpp#87), so both now come from icl-utk-edu, pinned to the
# merge commits: the latest release of each, v2025.05.28, predates the fixes.
# Pinned to the commits that merged new-Apple-Accelerate support on 2026-08-27
# (icl-utk-edu/blaspp#134, icl-utk-edu/lapackpp#88); they also contain the MSVC
# portability fixes (blaspp#132, lapackpp#87). The latest release of each,
# v2025.05.28, predates all of these.
$BlasppUrl = "https://github.com/icl-utk-edu/blaspp.git"
$BlasppRef = "30571853f980d3a2a1737124ea4789e025a5e045"
$BlasppRef = "2d8d4e937ac46fffab33d4174a4fc7659726dbda"
$LapackppUrl = "https://github.com/icl-utk-edu/lapackpp.git"
$LapackppRef = "40b9d0daf29b6f1f3fa58bc3f22bd6cfb2c67fe4"
$LapackppRef = "b9439cf3c26d1655d88e7f510ae8b4f82fbeb687"
$Random123Url = "https://github.com/DEShawResearch/Random123.git"
$Random123Ref = "v1.14.0"
$GTestUrl = "https://github.com/google/googletest.git"
Expand Down
31 changes: 22 additions & 9 deletions .github/actions/setup-randblas-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ runs:
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/../blaspp-install
key: blaspp-mklfix2-${{ runner.os }}-${{ runner.arch }}-${{ inputs.cc }}-${{ inputs.blas-backend }}-${{ steps.blaspp-rev.outputs.sha }}
key: blaspp-accel1-${{ runner.os }}-${{ runner.arch }}-${{ inputs.cc }}-${{ inputs.blas-backend }}-${{ steps.blaspp-rev.outputs.sha }}

- name: build blaspp
if: steps.blaspp-cache.outputs.cache-hit != 'true'
Expand All @@ -118,18 +118,24 @@ runs:
mkdir blaspp-build
cd blaspp-build
blas_arg=""
# ILP64 only for MKL: it makes MKL_INT 64-bit, which RandBLAS's MKL
# ILP64 for MKL: it makes MKL_INT 64-bit, which RandBLAS's MKL
# spgemm path (test_spgemm, compiled only under RandBLAS_HAS_MKL)
# requires to match its int64_t sparse indices. Other backends stay
# LP64 -- blaspp's public API is int64_t regardless, so RandBLAS is
# unaffected, and this avoids needing ILP64 OpenBLAS/Accelerate libs.
# requires to match its int64_t sparse indices. ILP64 for Accelerate:
# BLAS++ supports Apple's new interface (icl-utk-edu/blaspp#134), and
# macOS >= 13.3 ships ILP64 inside the framework, so these lanes cover
# new-Accelerate ILP64 (issue #150) at no extra dependency cost.
# OpenBLAS stays LP64 -- blaspp's public API is int64_t regardless, so
# RandBLAS is unaffected, and an ILP64 OpenBLAS is a separate library
# BLAS++ cannot discover (issue #194).
blas_int_arg=""
case "${{ inputs.blas-backend }}" in
openblas) blas_arg="-Dblas=openblas" ;;
mkl) blas_arg="-Dblas=mkl"; blas_int_arg="-Dblas_int=int64" ;;
accelerate) blas_arg="-Dblas=accelerate" ;;
accelerate) blas_arg="-Dblas=accelerate"; blas_int_arg="-Dblas_int=int64" ;;
auto) blas_arg="" ;;
esac
# A silent fall-back to Apple's legacy interface would test the wrong
# BLAS; the generated defines.h is checked after the install below.
cmake \
-DCMAKE_C_COMPILER="${CC}" \
-DCMAKE_CXX_COMPILER="${CXX}" \
Expand All @@ -145,14 +151,20 @@ runs:
jobs="$(nproc)"
fi
make -j"${jobs}" install
if [[ "${{ inputs.blas-backend }}" == "accelerate" ]]; then
grep -q ACCELERATE_NEW_LAPACK ../blaspp-install/include/blas/defines.h \
|| { echo "::error::BLAS++ did not select Apple's new Accelerate interface"; exit 1; }
grep -q '^#define BLAS_ILP64' ../blaspp-install/include/blas/defines.h \
|| { echo "::error::BLAS++ did not select Accelerate ILP64"; exit 1; }
fi

- name: cache lapackpp install
if: inputs.install-lapackpp == 'true'
id: lapackpp-cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/../lapackpp-install
key: lapackpp-mklfix2-${{ runner.os }}-${{ runner.arch }}-${{ inputs.cc }}-${{ inputs.blas-backend }}-${{ steps.blaspp-rev.outputs.sha }}-${{ steps.lapackpp-rev.outputs.sha }}
key: lapackpp-accel1-${{ runner.os }}-${{ runner.arch }}-${{ inputs.cc }}-${{ inputs.blas-backend }}-${{ steps.blaspp-rev.outputs.sha }}-${{ steps.lapackpp-rev.outputs.sha }}

- name: build lapackpp
if: inputs.install-lapackpp == 'true' && steps.lapackpp-cache.outputs.cache-hit != 'true'
Expand All @@ -167,9 +179,10 @@ runs:
git clone --depth 1 https://github.com/icl-utk-edu/lapackpp.git
mkdir lapackpp-build
cd lapackpp-build
# Match the int width of the blaspp we link against (ILP64 only for MKL).
# Match the int width of the blaspp we link against (ILP64 for MKL
# and Accelerate, per the blaspp step above).
blas_int_arg=""
if [[ "${{ inputs.blas-backend }}" == "mkl" ]]; then
if [[ "${{ inputs.blas-backend }}" == "mkl" || "${{ inputs.blas-backend }}" == "accelerate" ]]; then
blas_int_arg="-Dblas_int=int64"
fi
cmake \
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/windows/toolchain-arch.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Toolchain architecture detection, shared by install/install.ps1 (user-facing
# Toolchain architecture detection, shared by installers/install.ps1 (user-facing
# preflight) and .github/actions/setup-randlapack-deps-windows/setup.ps1 (which
# also runs standalone in CI). Dot-source it; it defines functions only.
#
Expand Down
36 changes: 21 additions & 15 deletions .github/workflows/install-script.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Exercises install/install.sh itself -- the one artifact the core workflows
# Exercises installers/install.sh itself -- the one artifact the core workflows
# never run, since they hand-replicate the build recipe instead. What each lane
# proves:
# 1. a fresh checkout run non-interactively builds, and its tests pass;
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
- name: run the installer, capturing output for the escape-sequence check
run: |
set -euo pipefail
bash RandBLAS/install/install.sh --yes \
bash RandBLAS/installers/install.sh --yes \
--blas=${{ matrix.backend }} \
--project-dir "$GITHUB_WORKSPACE/RandNLA-project" \
2>&1 | tee installer.out
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
- name: re-run the installer in place (idempotency)
run: |
set -euo pipefail
bash RandBLAS/install/install.sh --yes \
bash RandBLAS/installers/install.sh --yes \
--blas=${{ matrix.backend }} \
--project-dir "$GITHUB_WORKSPACE/RandNLA-project" | tee rerun.out
grep -q 'already built' rerun.out \
Expand All @@ -147,7 +147,7 @@ jobs:
BLASPP_INSTALL_DIR="$GITHUB_WORKSPACE/RandNLA-project/install/blaspp-${{ matrix.backend }}-install" \
RANDOM123_INSTALL_DIR="$GITHUB_WORKSPACE/RandNLA-project/install/Random123-install" \
GTEST_ROOT="$GITHUB_WORKSPACE/RandNLA-project/install/googletest-install" \
bash RandBLAS-discovery/install/install.sh --yes \
bash RandBLAS-discovery/installers/install.sh --yes \
--blas=${{ matrix.backend }} \
--project-dir "$GITHUB_WORKSPACE/RandNLA-project-discovery" | tee discovery.out
grep -q 'external install' discovery.out \
Expand All @@ -169,30 +169,36 @@ jobs:
- name: install libomp
run: brew install libomp

# Accelerate is the default on macOS and is LP64-only: BLAS++ implements
# only Apple's legacy interface, so there is no ILP64 lane to run here.
# Accelerate is the default on macOS. The pinned BLAS++ supports Apple's
# new interface (icl-utk-edu/blaspp#134), which carries ILP64 on
# macOS >= 13.3, so the width default resolves to ILP64 here just like
# MKL on Linux -- and the summary line proves it, rather than trusting
# what was requested.
- name: run the installer
run: |
set -euo pipefail
bash RandBLAS/install/install.sh --yes \
bash RandBLAS/installers/install.sh --yes \
--project-dir "$GITHUB_WORKSPACE/RandNLA-project" | tee installer.out
grep -qE '^ Backend *accelerate' installer.out
grep -qE '^ Backend *accelerate, ILP64' installer.out

- name: run the test suite
run: ctest --test-dir RandNLA-project/build/RandBLAS-build --output-on-failure

- name: re-run the installer in place (idempotency)
run: |
bash RandBLAS/install/install.sh --yes \
bash RandBLAS/installers/install.sh --yes \
--project-dir "$GITHUB_WORKSPACE/RandNLA-project"

- name: asking for ILP64 on Accelerate is refused, not silently downgraded
# The explicit-LP64 route stays supported and stays tested: with every
# auto run now resolving to ILP64, this is the one place the legacy
# 32-bit-integer width on Accelerate is still exercised.
- name: explicit --blas-int=lp64 still builds LP64
run: |
if bash RandBLAS/install/install.sh --yes --blas=accelerate --blas-int=ilp64 \
--project-dir "$GITHUB_WORKSPACE/RandNLA-project-ilp64" > refuse.out 2>&1; then
echo "The installer accepted an impossible configuration."; cat refuse.out; exit 1
fi
grep -q 'not available with Accelerate' refuse.out
set -euo pipefail
bash RandBLAS/installers/install.sh --yes --blas=accelerate --blas-int=lp64 \
--project-dir "$GITHUB_WORKSPACE/RandNLA-project-lp64" | tee lp64.out
grep -qE '^ Backend *accelerate, LP64' lp64.out
ctest --test-dir RandNLA-project-lp64/build/RandBLAS-build --output-on-failure

packager:
# The contract conda-forge and Spack rely on: dependencies already
Expand Down
13 changes: 7 additions & 6 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ builds RandBLAS and every dependency it needs into a self-contained
and does not touch your shell configuration.

```bash
bash install/install.sh # Linux and macOS
bash installers/install.sh # Linux and macOS
```

```powershell
powershell -ExecutionPolicy Bypass -File install\install.ps1 # Windows
powershell -ExecutionPolicy Bypass -File installers\install.ps1 # Windows
```

**You supply the toolchain; the installer supplies everything above it.** You
Expand Down Expand Up @@ -472,8 +472,9 @@ Anything not listed may well work; it is simply untested.
| Ubuntu (latest) | gcc | OpenBLAS | LP64 | yes | release, debug+ASan, release+UBSan |
| Ubuntu (latest) | gcc | oneMKL | ILP64 | yes | enables the MKL sparse path |
| Ubuntu (latest) | clang | OpenBLAS | LP64 | yes | release, ASan, TSan |
| macOS 14 | Apple Clang | Accelerate | LP64 | **no** | Apple Clang ships no OpenMP runtime |
| macOS 15 | Homebrew LLVM | Accelerate | LP64 | yes | via Homebrew `libomp` |
| macOS 14 | Apple Clang | Accelerate (new interface) | ILP64 | **no** | Apple Clang ships no OpenMP runtime |
| macOS 15 | Homebrew LLVM | Accelerate (new interface) | ILP64 | yes | via Homebrew `libomp` |
| macOS (latest) | Apple Clang | Accelerate (new interface) | LP64 | **no** | installer lane, explicit `--blas-int=lp64` |
| Windows | MSVC | oneMKL | ILP64 | yes (`/openmp:llvm`) | x64 only |

Compiler floor: RandBLAS uses C++20 [concepts](https://en.cppreference.com/w/cpp/language/constraints),
Expand All @@ -498,7 +499,7 @@ provide it, and falls back to LP64 with a warning where it cannot**:
|---|---|---|
| oneMKL | ILP64 | `mkl_intel_ilp64` is a distinct library, so the choice is real and verifiable |
| OpenBLAS | LP64 | see below |
| Accelerate | LP64 | BLAS++ implements only Apple's legacy interface ([lapackpp#43](https://github.com/icl-utk-edu/lapackpp/issues/43)) |
| Accelerate | ILP64 | Apple's new interface (macOS ≥ 13.3) ships ILP64 inside the framework; BLAS++ supports it as of [blaspp#134](https://github.com/icl-utk-edu/blaspp/pull/134). On older macOS the `int64` probe fails and `auto` falls back to LP64 with a warning |

**OpenBLAS is the subtle one.** BLAS++ probes `int32` before `int64` and uses
`blas_int` only to filter library *names*. For MKL that is enough. For
Expand All @@ -508,7 +509,7 @@ nothing. If you have an ILP64 OpenBLAS (on Debian or Ubuntu,
`libopenblas64-dev`), point at it explicitly rather than hoping it is found:

```bash
bash install/install.sh --blas=custom --blas-int=ilp64 \
bash installers/install.sh --blas=custom --blas-int=ilp64 \
--blas-libraries=/usr/lib/x86_64-linux-gnu/libopenblas64.so
```

Expand Down
File renamed without changes.
47 changes: 21 additions & 26 deletions install/install.sh → installers/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ usage() {
# the latter silently starts printing unrelated code the moment anyone
# adds a line above it.
cat <<'USAGE'
Usage: bash install/install.sh [options]
Usage: bash installers/install.sh [options]

Backend selection:
--blas=BACKEND auto | openblas | mkl | accelerate | custom
(default: auto -- Accelerate on macOS, MKL on Linux
when MKLROOT is set, otherwise OpenBLAS)
--blas-int=WIDTH ilp64 | lp64. Default is ilp64 wherever the backend
can provide it, falling back to lp64 with a warning.
Accelerate is lp64-only and rejects ilp64.
Accelerate ILP64 requires macOS 13.3 or newer.
--blas-libraries=L Link line for --blas=custom, e.g.
"/opt/aocl/lib/libblis.so;/opt/aocl/lib/libflame.so"

Expand Down Expand Up @@ -438,13 +438,16 @@ source_is_current() { # <dest> <url> <ref>
# branch name. These match the refs RandLAPACK's Windows provisioner validated.
#==============================================================================
BLASPP_URL="https://github.com/icl-utk-edu/blaspp.git"
# The commit that merged the MSVC portability fix (blaspp PR #132, 2026-08-06).
# Not in a release yet -- the latest tag, v2025.05.28, predates it. Move to a
# tag once one includes it.
BLASPP_REF="30571853f980d3a2a1737124ea4789e025a5e045"
# The commit that merged new-Apple-Accelerate support (blaspp PR #134,
# 2026-08-27); also contains the MSVC portability fix (PR #132). Not in a
# release yet -- the latest tag, v2025.05.28, predates both. Move to a tag
# once one includes them.
BLASPP_REF="2d8d4e937ac46fffab33d4174a4fc7659726dbda"

LAPACKPP_URL="https://github.com/icl-utk-edu/lapackpp.git"
LAPACKPP_REF="40b9d0daf29b6f1f3fa58bc3f22bd6cfb2c67fe4"
# The commit that merged the LAPACK++ half of new-Accelerate support
# (lapackpp PR #88, 2026-08-27).
LAPACKPP_REF="b9439cf3c26d1655d88e7f510ae8b4f82fbeb687"

RANDOM123_URL="https://github.com/DEShawResearch/Random123.git"
RANDOM123_REF="v1.14.0"
Expand Down Expand Up @@ -487,26 +490,18 @@ fi
# int64_t regardless of the underlying width -- so this choice is about what
# the BLAS underneath can represent, not about RandBLAS's interface.
#
# Accelerate is the one backend with no ILP64 route at all. Apple has shipped
# an ILP64 interface since macOS 13.3, behind ACCELERATE_NEW_LAPACK and
# ACCELERATE_LAPACK_ILP64, but BLAS++ does not implement it: BLASFinder.cmake
# emits only "-framework Accelerate", the legacy LP64 path. Tracked upstream as
# icl-utk-edu/lapackpp#43.
# Accelerate: Apple has shipped an ILP64 interface since macOS 13.3, behind
# ACCELERATE_NEW_LAPACK and ACCELERATE_LAPACK_ILP64, and BLAS++ implements it
# as of the pinned commit (icl-utk-edu/blaspp#134: requesting int64 with the
# new interface defines ACCELERATE_LAPACK_ILP64 in blas/config.h). On macOS
# older than 13.3 the int64 probe fails and "auto" falls back to LP64 with the
# usual warning; an explicit --blas-int=ilp64 fails the build rather than
# silently downgrading.
WIDTH_ORDER=()
case "$BLAS_BACKEND" in
accelerate)
if [[ "$BLAS_INT_CHOICE" == "ilp64" ]]; then
die "--blas-int=ilp64 is not available with Accelerate: BLAS++ implements only Apple's legacy LP64 interface (see icl-utk-edu/lapackpp#43). Use --blas=openblas or --blas=mkl for ILP64."
fi
WIDTH_ORDER=(int32)
;;
*)
case "$BLAS_INT_CHOICE" in
ilp64) WIDTH_ORDER=(int64) ;;
lp64) WIDTH_ORDER=(int32) ;;
auto) WIDTH_ORDER=(int64 int32) ;; # ILP64 first, LP64 as fallback
esac
;;
case "$BLAS_INT_CHOICE" in
ilp64) WIDTH_ORDER=(int64) ;;
lp64) WIDTH_ORDER=(int32) ;;
auto) WIDTH_ORDER=(int64 int32) ;; # ILP64 first, LP64 as fallback
esac

# blaspp's own backend selector. Its matcher accepts "apple" or "accelerate".
Expand Down
Loading