Skip to content

Win-amd64 wheel sets incorrect OpenBLAS_LIBRARIES in OpenBLASConfig.cmake #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dweindl opened this issue Jun 6, 2025 · 6 comments · Fixed by #204
Closed

Win-amd64 wheel sets incorrect OpenBLAS_LIBRARIES in OpenBLASConfig.cmake #202

dweindl opened this issue Jun 6, 2025 · 6 comments · Fixed by #204

Comments

@dweindl
Copy link

dweindl commented Jun 6, 2025

Hi, thanks for creating the OpenBLAS wheels!

I noticed a small issue with the CMake package configuration on Windows:
In the latest PyPI scipy_openblas64 wheel for win_amd64, the library is located at lib/libscipy_openblas64_.dll. However, OpenBLASConfig.cmake expects the library at bin/libscipy_openblas64_.dll:

$ unzip -l scipy_openblas64-0.3.29.265.1-py3-none-win_amd64.whl | grep dll
 20411392  2025-06-06 13:38   scipy_openblas64/lib/libscipy_openblas64_.dll
$ unzip -p scipy_openblas64-0.3.29.265.1-py3-none-win_amd64.whl scipy_openblas64/lib/cmake/openblas/OpenBLASConfig.cmake | grep dll
SET(OpenBLAS_LIBRARIES ${_OpenBLAS_ROOT_DIR}/bin/libscipy_openblas64_.dll)

The library is moved from bin/ to lib/ here:

mv local/scipy_openblas64/bin/*.dll local/scipy_openblas64/lib

But the CMake package configuration is just copied without updating the changed library path here:

if exist openblasconfig.cmake copy /Y openblasconfig.cmake "%DEST_DIR%\lib\cmake\openblas\"

EDIT: And OpenBLAS_LIBRARIES should actually point to the .lib file, not the .dll.

@mattip mattip changed the title Windows wheel sets incorrect OpenBLAS_LIBRARIES in OpenBLASConfig.cmake Win-arm64 wheel sets incorrect OpenBLAS_LIBRARIES in OpenBLASConfig.cmake Jun 8, 2025
@dweindl
Copy link
Author

dweindl commented Jun 8, 2025

But the CMake package configuration is just copied without updating the changed library path here:

openblas-libs/tools/build_steps_win_arm64.bat

Line 142 in 82e3f04

Sorry, this was the wrong reference. It's not about the arm64 wheels, but the amd64 wheels. The OpenBLAS_LIBRARIES path would have to be updated after unpacking the build archive:

unzip -d local/scipy_openblas64 builds/openblas*.zip

In fact, the arm64 wheel does not have any OpenBLASConfig.cmake at all (only OpenBLASConfigVersion.cmake).

@mattip mattip changed the title Win-arm64 wheel sets incorrect OpenBLAS_LIBRARIES in OpenBLASConfig.cmake Win-amd64 wheel sets incorrect OpenBLAS_LIBRARIES in OpenBLASConfig.cmake Jun 8, 2025
@mattip
Copy link
Collaborator

mattip commented Jun 8, 2025

If I understand correctly, the last line in OpenBLASConfig.cmake in the scipy-openblas32 wheel should be

 SET(OpenBLAS_VERSION "0.3.29.dev")
 file(REAL_PATH "../../.." _OpenBLAS_ROOT_DIR BASE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} )
 SET(OpenBLAS_INCLUDE_DIRS ${_OpenBLAS_ROOT_DIR}/include)
-SET(OpenBLAS_LIBRARIES ${_OpenBLAS_ROOT_DIR}/bin/libscipy_openblas.dll)
+SET(OpenBLAS_LIBRARIES ${_OpenBLAS_ROOT_DIR}/lib/libscipy_openblas.lib)

and in scipy-openblas64 should be

 SET(OpenBLAS_VERSION "0.3.29.dev")
 file(REAL_PATH "../../.." _OpenBLAS_ROOT_DIR BASE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} )
 SET(OpenBLAS_INCLUDE_DIRS ${_OpenBLAS_ROOT_DIR}/include)
-SET(OpenBLAS_LIBRARIES ${_OpenBLAS_ROOT_DIR}/bin/libscipy_openblas64_.dll)
+SET(OpenBLAS_LIBRARIES ${_OpenBLAS_ROOT_DIR}/lib/libscipy_openblas64_.lib)

With that change, can you use CMake in the NumPy/SciPy build?

@dweindl
Copy link
Author

dweindl commented Jun 8, 2025

With that change, can you use CMake in the NumPy/SciPy build?

I did not attempt building NumPy/SciPy, but another project (https://github.com/AMICI-dev/AMICI/). Nevertheless, with these changes, the CMake configuration of scipy-openblas64 is usable for me on win-amd64.

I did not / cannot test scipy-openblas32, but looking at the current PyPI wheel, this change looks good.

@rgommers
Copy link
Collaborator

rgommers commented Jun 8, 2025

@dweindl if you want to use scipy-openblas64 to locally build against that is fine, but please don't declare a dependency on it (see gh-203).

@mattip mattip mentioned this issue Jun 8, 2025
1 task
@mattip
Copy link
Collaborator

mattip commented Jun 9, 2025

Will be fixed by a 0.3.265.2 release in a bit. Does posix (linux, macOS) work?

@dweindl
Copy link
Author

dweindl commented Jun 9, 2025

Thanks @mattip, and thanks for the warning @rgommers.

scipy_openblas64-0.3.29.265.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64 worked for me. I did not test the macOS wheels.

For the Windows arm64 wheels, OpenBLASConfig.cmake is missing completely, though.

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 a pull request may close this issue.

3 participants