Skip to content
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

Using OpenBLAS for optimized LAPACK functions via lapack-reference #25176

Closed
larsoner opened this issue Jun 10, 2022 · 9 comments
Closed

Using OpenBLAS for optimized LAPACK functions via lapack-reference #25176

larsoner opened this issue Jun 10, 2022 · 9 comments
Assignees
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist Stale

Comments

@larsoner
Copy link


Is your feature request related to a problem? Please describe.

I would like to build a project using OpenBLAS for BLAS + LAPACK functions. It seems like this should be possible with something like:

  "dependencies": [
    "openblas",
    {
      "name": "lapack-reference",
      "features": [
        "blas-select"
      ]
    }

But this results in cmake:

-- Looking for sgemm_
-- Looking for sgemm_ - found
-- Found BLAS: D:/a/openmeeg/openmeeg/build/vcpkg_installed/x64-windows/lib/openblas.lib  
-- Using VCPKG FindLAPACK from package 'lapack-reference'
-- Looking for cheev_
-- Looking for cheev_ - not found
CMake Error at build/vcpkg_installed/x64-windows/share/lapack/FindLAPACK.cmake:522 (message):
Error:   A required library with LAPACK API not found.  Please specify library
  location.

Proposed solution
I am not sure, but it seems like the OpenBLAS port should have an option to expose its LAPACK capabilities so that it can be selected as a backend, and/or lapack-reference should know how to find OpenBLAS's LAPACK capabilities.

Describe alternatives you've considered
I'm going to try using clapack as a workaround for now, but it probably is not as optimized as OpenBLAS, so it'll be slower for end users.

@larsoner
Copy link
Author

... and #21479 is possibly relevant

@larsoner
Copy link
Author

And trying my alternative:

  "dependencies": [
    "openblas",
    "clapack",
  ...

Results in:

-- Looking for sgemm_
-- Looking for sgemm_ - found
-- Found BLAS: D:/a/openmeeg/openmeeg/build/vcpkg_installed/x64-windows/lib/openblas.lib  
-- Using VCPKG FindLAPACK from package 'clapack'
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE  
-- LAPACK_DLL_DIR: D:/a/openmeeg/openmeeg/build/vcpkg_installed/x64-windows/include/../bin;D:/a/openmeeg/openmeeg/build/vcpkg_installed/x64-windows/include/../bin
-- Found LAPACK: optimized;D:/a/openmeeg/openmeeg/build/vcpkg_installed/x64-windows/lib/lapack.lib;optimized;D:/a/openmeeg/openmeeg/build/vcpkg_installed/x64-windows/lib/libf2c.lib;optimized;D:/a/openmeeg/openmeeg/build/vcpkg_installed/x64-windows/lib/openblas.lib;debug;D:/a/openmeeg/openmeeg/build/vcpkg_installed/x64-windows/debug/lib/lapackd.lib;debug;D:/a/openmeeg/openmeeg/build/vcpkg_installed/x64-windows/debug/lib/libf2cd.lib;debug;D:/a/openmeeg/openmeeg/build/vcpkg_installed/x64-windows/debug/lib/openblas.lib  
CMake Error at cmake/FindBLASImplementation.cmake:114 (set_target_properties):
Error:   Property INTERFACE_LINK_LIBRARIES may not contain link-type keyword
-- Looking for LAPACKE_dlange
  "optimized".  The INTERFACE_LINK_LIBRARIES property may contain
  configuration-sensitive generator-expressions which may be used to specify
  per-configuration rules.

I also tried just setting the dependencies as "blas", "lapack" because this seems like the most straightforward case, but I still get:

The following packages will be built and installed:
    blas[core]:x64-windows -> 1#1
    hdf5[core,szip,zlib]:x64-windows -> 1.12.1#4
    lapack[core]:x64-windows -> 2022-02-22
  * lapack-reference[blas-select,core,noblas]:x64-windows -> 3.10.0
    matio[core,hdf5,mat73,zlib]:x64-windows -> 1.5.19#1
  * openblas[core]:x64-windows -> 0.3.20
...
-- Found BLAS: D:/a/openmeeg/openmeeg/build/vcpkg_installed/x64-windows/lib/openblas.lib  
-- Using VCPKG FindLAPACK from package 'lapack-reference'
-- Looking for cheev_
-- Looking for cheev_ - not found
CMake Error at build/vcpkg_installed/x64-windows/share/lapack/FindLAPACK.cmake:522 (message):
Error:   A required library with LAPACK API not found.  Please specify library
-- Configuring incomplete, errors occurred!
  location.
See also "D:/a/openmeeg/openmeeg/build/CMakeFiles/CMakeOutput.log".
Call Stack (most recent call first):
See also "D:/a/openmeeg/openmeeg/build/CMakeFiles/CMakeError.log".
  build/vcpkg_installed/x64-windows/share/lapack/vcpkg-cmake-wrapper.cmake:9 (_find_package)
  vcpkg/scripts/buildsystems/vcpkg.cmake:778 (include)
  cmake/FindBLASImplementation.cmake:79 (find_package)
  cmake/thirdParties.cmake:1 (include)
  CMakeLists.txt:20 (include)

@JackBoosY
Copy link
Contributor

Maybe #21479 can fix this issue?

@JackBoosY JackBoosY added the category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist label Jun 13, 2022
@larsoner
Copy link
Author

It might. FWIW I tried that PR and it failed for me locally. If it helps, I can try again and post the traceback.

@JackBoosY
Copy link
Contributor

JackBoosY commented Jun 14, 2022

It might. FWIW I tried that PR and it failed for me locally. If it helps, I can try again and post the traceback.

It's still WIP, Robert doesn't have more time to handle that PR currently.

@paolomunarini
Copy link

paolomunarini commented Jun 23, 2022

Hello, I'm having the same issue only when installing with the following custom triplet:

set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_PLATFORM_TOOLSET v140)

Copy link

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

@github-actions github-actions bot added the Stale label Dec 26, 2023
@larsoner
Copy link
Author

It would be nice if #24327 or similar took care of this, but I'm not sure it will.

@JonLiu1993 JonLiu1993 removed the Stale label Dec 26, 2023
Copy link

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

@github-actions github-actions bot added the Stale label Jun 27, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist Stale
Projects
None yet
Development

No branches or pull requests

4 participants