Skip to content

Change OPENBLAS_API back to BLASFUNC when generating f77blas.h - #6116

Open
martin-frbg wants to merge 5 commits into
OpenMathLib:developfrom
martin-frbg:issue6112
Open

martin-frbg wants to merge 5 commits into
OpenMathLib:developfrom
martin-frbg:issue6112

Conversation

@martin-frbg

Copy link
Copy Markdown
Collaborator

fixes #6112

@martin-frbg martin-frbg added this to the 0.3.35 milestone Oct 9, 2026
@BenKnill

Copy link
Copy Markdown

Thanks for the quick fix. I checked the installed Make header at e8b92a8 with the include-only test from #6112 (#include <f77blas.h>, GCC 15.2), and also exercised its CMake header-generation change:

  • Make (x86-64, TARGET=HASWELL DYNAMIC_ARCH=0 NO_FORTRAN=1, then make install): one error remains, from the direct OPENBLAS_EXPORT on openblas_set_num_threads_:

    f77blas.h:52:16: error: expected ';' before 'void'
    

    Stripping OPENBLAS_EXPORT as the cblas.h recipe already does gives a header that compiles cleanly. In Makefile.install, that would be sed -e 's/OPENBLAS_API/BLASFUNC/g' -e 's/OPENBLAS_EXPORT //'.

  • CMake header generation (aarch64, CMake 4.2.3, GCC/gfortran 15.2; configure only, using an existing guest source tree overlaid with this PR's CMakeLists.txt and develop's common_interface.h): the unquoted ${COMMON_INTERFACE_H_CONTENTS} in the new string(REPLACE ...) splits the header at semicolons. The generated header has zero of the source's 468 semicolons and fails to compile. Quoting the input and stripping OPENBLAS_EXPORT preserves all 468 and passes the include-only test:

    string(REPLACE "OPENBLAS_API" "BLASFUNC" F77BLAS_H_CONTENTS0 "${COMMON_INTERFACE_H_CONTENTS}")
    string(REPLACE "OPENBLAS_EXPORT " "" F77BLAS_H_CONTENTS "${F77BLAS_H_CONTENTS0}")

This branch has not been deployed

No deployments
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.

Installed f77blas.h fails to compile on develop: undefined OPENBLAS_API and OPENBLAS_EXPORT

2 participants