Skip to content

Allow benchmark targets to link against a user-specified OpenBLAS library#5875

Closed
naoto-aoki-fy wants to merge 1 commit into
OpenMathLib:developfrom
naoto-aoki-fy:develop
Closed

Allow benchmark targets to link against a user-specified OpenBLAS library#5875
naoto-aoki-fy wants to merge 1 commit into
OpenMathLib:developfrom
naoto-aoki-fy:develop

Conversation

@naoto-aoki-fy

Copy link
Copy Markdown

Summary

This pull request makes the benchmark Makefile support linking benchmark binaries against a configurable OpenBLAS library.

It introduces the OPENBLAS_LIB variable, which defaults to the existing ../$(LIBNAME) path, and replaces hard-coded references to ../$(LIBNAME) in benchmark link targets with this variable.

Motivation

The benchmark targets currently depend directly on ../$(LIBNAME), which makes it difficult to link them against OpenBLAS packages provided by Linux distributions or other externally installed OpenBLAS libraries.

By making the library path configurable, downstream packagers and users can more easily build benchmark binaries against a distro-provided OpenBLAS package, including shared-library installations. For example, benchmarks can be built with an externally provided library by passing OPENBLAS_LIB on the make command line:

make OPENBLAS_LIB=-lopenblaso

The default behavior is preserved when OPENBLAS_LIB is not overridden.

Changes

  • Add OPENBLAS_LIB ?= ../$(LIBNAME) to benchmark/Makefile
  • Replace hard-coded ../$(LIBNAME) dependencies with $(OPENBLAS_LIB) across .goto benchmark targets
  • Allow benchmark builds to override the OpenBLAS link target, for example with make OPENBLAS_LIB=-lopenblaso
  • Keep the existing default linkage behavior unchanged when OPENBLAS_LIB is not overridden

Notes

This change is intended to improve build flexibility for benchmark targets, especially for packaging environments that prefer linking against system-provided OpenBLAS libraries.

- Add OPENBLAS_LIB with the existing library path as the default
- Replace direct ../$(LIBNAME) dependencies across benchmark .goto targets
@naoto-aoki-fy

naoto-aoki-fy commented Jul 2, 2026

Copy link
Copy Markdown
Author

I noticed a mistake, so I'll close this for now.

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.

1 participant