You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenBLASConfig.cmake from the Makefile build on Windows has no OpenBLAS::OpenBLAS target: echo lines are missing the redirect #6084
On Windows (WINNT/CYGWIN_NT), make install writes an OpenBLASConfig.cmake that has no OpenBLAS::OpenBLAS imported target. OpenBLAS_LIBRARIES points at the DLL, so MSVC can't link against it.
The cause is in Makefile.install. The lines that are meant to define the imported target, including its IMPORTED_IMPLIB, are @echoed without the >> "$(DESTDIR)$(OPENBLAS_CMAKE_DIR)/$(OPENBLAS_CMAKE_CONFIG)" redirect that every other line in that block has. They go to the build log instead of the config file:
lib/cmake/openblas/OpenBLASConfig.cmake in the OpenBLAS-0.3.34-x64.zip release asset (and identically, apart from the version, in OpenBLAS-0.3.33-x64.zip) contains only:
The same archive ships a valid x64 MSVC import library at lib/libopenblas.lib (dumpbin /headers shows machine 8664, DLL name libopenblas.dll), but nothing in the config refers to it.
Impact
target_link_libraries(foo OpenBLAS::OpenBLAS) fails because the target doesn't exist.
Tools that use OpenBLAS_LIBRARIES (for example, Meson's CMake dependency lookup) pass the DLL to link.exe, which fails with:
bin\libopenblas.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x480
MinGW consumers aren't affected, because GNU ld can link directly against a DLL.
The woa64 assets are built with CMake and are unaffected: their config exports OpenBLAS::OpenBLAS with IMPORTED_IMPLIB set to lib/openblas.lib.
Suggested fix
Add the missing redirect to the four @echo lines above:
On non-Windows platforms the target would then also need IMPORTED_LOCATION set, or the add_library/target_include_directories lines could be moved inside the Windows conditional.
Side note
The surrounding block is guarded by ifneq ($(origin _OpenBLAS_ROOT_DIR),"undefined"). $(origin ...) returns the bare word undefined, never the quoted string, so this condition is always true and the else branch never runs. It may not matter in practice, but it looks unintended.
Environment
OpenBLAS release assets OpenBLAS-0.3.34-x64.zip and OpenBLAS-0.3.33-x64.zip
The same code is present in Makefile.install on develop.
Ironic that this seems to have come from a PR labeled "Improve OpenBLASConfig.cmake contents" (#5035) - looks like I forgot to copypaste the redirect onto the individual echo statements in those four lines. :(
I'll create a PR with your suggested fixes tomorrow, thank you.
Ah, thanks for confirming this -- I was a bit puzzled about why this was and the only reason I didn't submit a PR was that I wasn't sure if this was intentional or not!
Activity
martin-frbg commentedon Oct 1, 2026
Ironic that this seems to have come from a PR labeled "Improve OpenBLASConfig.cmake contents" (#5035) - looks like I forgot to copypaste the redirect onto the individual echo statements in those four lines. :(
I'll create a PR with your suggested fixes tomorrow, thank you.
ndabas commentedon Oct 1, 2026
Ah, thanks for confirming this -- I was a bit puzzled about why this was and the only reason I didn't submit a PR was that I wasn't sure if this was intentional or not!
martin-frbg commentedon Oct 2, 2026
You can still submit a PR if you like - you're probably more familiar with CMake config file syntax than me...
ndabas commentedon Oct 2, 2026
Sure, I'll go ahead and submit a PR, I see a couple of other minor fixes to improve stability of CI on Windows -- I can probably add that in as well.