From 4026d7ba7c942428cb17def47e0b0e0d2b6a2e69 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Tue, 23 Dec 2025 13:33:59 -0500 Subject: [PATCH] Fix LIBNAMESUFFIX handling in CMake and update documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix cmake/system.cmake: LIBPREFIX was incorrectly overwritten when LIBNAMESUFFIX was defined, losing both "lib" prefix and "openblas" - Fix Makefile.rule docs: typo used LIBNAMESUFFIX instead of LIBNAMEPREFIX - Fix Makefile.rule docs: removed misleading underscores from examples - Fix docs/build_system.md: removed incorrect claim about automatic underscore separator The implementation does not add an underscore before the suffix - users who want a separator should include it in their LIBNAMESUFFIX value (e.g., LIBNAMESUFFIX=_omp). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- Makefile.rule | 14 +++++++------- cmake/system.cmake | 4 ++-- docs/build_system.md | 5 ++--- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Makefile.rule b/Makefile.rule index a3eb72dc0c..e2d8634b36 100644 --- a/Makefile.rule +++ b/Makefile.rule @@ -5,15 +5,15 @@ # This library's version VERSION = 0.3.30.dev -# If you set this prefix, the library name will be lib$(LIBNAMESUFFIX)openblas.a -# and lib$(LIBNAMESUFFIX)openblas.so, with a matching soname in the shared library -# +# If you set this prefix, the library name will be lib$(LIBNAMEPREFIX)openblas.a +# and lib$(LIBNAMEPREFIX)openblas.so, with a matching soname in the shared library +# # LIBNAMEPREFIX = scipy -# If you set the suffix, the library name will be libopenblas_$(LIBNAMESUFFIX).a -# and libopenblas_$(LIBNAMESUFFIX).so. Meanwhile, the soname in shared library -# is libopenblas_$(LIBNAMESUFFIX).so.0. -# LIBNAMESUFFIX = omp +# If you set the suffix, the library name will be libopenblas$(LIBNAMESUFFIX).a +# and libopenblas$(LIBNAMESUFFIX).so. Meanwhile, the soname in shared library +# is libopenblas$(LIBNAMESUFFIX).so.0. +# LIBNAMESUFFIX = _omp # You can specify the target architecture, otherwise it's # automatically detected. diff --git a/cmake/system.cmake b/cmake/system.cmake index 727afb660b..7364e60f2a 100644 --- a/cmake/system.cmake +++ b/cmake/system.cmake @@ -638,8 +638,8 @@ endif() set(LIBPREFIX "lib${LIBNAMEPREFIX}openblas") -if (DEFINED LIBNAMESUFFIX) - set(LIBPREFIX "${LIBNAMEPREFIX}_${LIBNAMESUFFIX}") +if (DEFINED LIBNAMESUFFIX AND NOT "${LIBNAMESUFFIX}" STREQUAL "") + set(LIBPREFIX "lib${LIBNAMEPREFIX}openblas${LIBNAMESUFFIX}") endif () if (NOT DEFINED SYMBOLPREFIX) diff --git a/docs/build_system.md b/docs/build_system.md index d5d76cc463..77f68c6544 100644 --- a/docs/build_system.md +++ b/docs/build_system.md @@ -143,9 +143,8 @@ ensures that there are a sufficient number of buffer sets available. no symbolic linking to variant names (default is `0`) - `LIBNAMEPREFIX`: prefix that, if given, will be inserted in the library name before `openblas` (e.g., `xxx` will result in `libxxxopenblas.so`) -- `LIBNAMESUFFIX`: suffix that, if given, will be inserted in the library name - after `openblas`, separated by an underscore (e.g., `yyy` will result in - `libopenblas_yyy.so`) +- `LIBNAMESUFFIX`: suffix that, if given, will be appended to the library name + after `openblas` (e.g., `_yyy` will result in `libopenblas_yyy.so`) - `SYMBOLPREFIX`: prefix that, if given, will be added to all symbol names *and* to the library name - `SYMBOLSUFFIX`: suffix that, if given, will be added to all symbol names