Skip to content

A missing OpenBLAS fails at link time with no hint that GEMM_PROVIDER=native exists #198

Description

@geisten

A newcomer on a machine without OpenBLAS gets a linker error with no hint about the fix, after the build has already compiled every object.

Where

mk/target-linux.mk / mk/target-pi5.mk default to GEMM_PROVIDER ?= openblas. The native provider exists and needs no OpenBLAS at all, but nothing points the user at it.

Reproduce

docker run --rm -v "$PWD:/src" -w /src alpine:3.21 sh -c \
  'apk add --no-cache build-base linux-headers && make test-unit'

Ends with:

ld: cannot find -lopenblas: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [mk/common.mk:318: bin/linux/release/tests/test_3plane_unit] Error 1

Note make lib succeeds on the same box — archiving does not link — so the failure shows up only once the user runs the tests, minutes in.

Suggested fix

Check for the library where the openblas fragment resolves it, and fail early with a message that names both ways out:

OpenBLAS not found. Install it (apk add openblas-dev / apt install libopenblas-dev),
or build without it:  make GEMM_PROVIDER=native

Done when

The container above fails with that message instead of a linker error, and the message appears before any compilation. make GEMM_PROVIDER=native test-unit in the same container still works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions