Skip to content

[lapack-reference] Does not contain instructions for using cblas #20952

@cgmb

Description

@cgmb

Describe the bug
The lapack-reference port does not contain working instructions for use of the cblas feature.

Environment

  • OS: Windows
  • Compiler: Microsoft Visual Studio 2019 Professional (14.29.30133)

To Reproduce

I created a minimal CMake project for one of the official cblas examples.
https://gist.github.com/cgmb/e2ec5f91a109bad62d739e63c3c185e3

Steps to reproduce the behavior:

  1. Download the sample project I linked above.
cmake -S. -Bbuild -DUSE_VCPKG_LAPACK=ON -DCMAKE_TOOLCHAIN_FILE=%VCPKG_PATH%/scripts/buildsystems/vcpkg.cmake -DVCPKG_PREFER_SYSTEM_LIBS=OFF -DVCPKG_TARGET_TRIPLET=x64-windows
cmake --build build
  1. Observe Build Failure:
Microsoft (R) Build Engine version 16.11.1+3e40a09f8 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Checking Build System
  Building Custom Rule C:/ws/vcpkg_cblas/CMakeLists.txt
  cblas_example.cpp
C:\ws\vcpkg_cblas\cblas_example.cpp(7,11): fatal error C1083: Cannot open include file: 'cblas.h': No such file or directory [C:\ws\vcpkg_cblas\build\ex.vcxproj]

Expected behavior
It should be possible to build this sample using the CMake targets that vcpkg suggests. At configure time, vcpkg states:

The package lapack-reference provides CMake targets:

    find_package(lapack CONFIG REQUIRED)
    target_link_libraries(main PRIVATE LAPACK::LAPACK)

    find_package(lapack-3.8.0 CONFIG REQUIRED)
    target_link_libraries(main PRIVATE blas lapack)

However, linking LAPACK::LAPACK is insufficient to find cblas. Replacing find_package(lapack CONFIG REQUIRED) with find_package(lapack-3.8.0 CONFIG REQUIRED) results in an even earlier failure (at configure time):

CMake Error at C:/Workspace/3rdparty/vcpkg/scripts/buildsystems/vcpkg.cmake:788 (_find_package):
  Could not find a package configuration file provided by "lapack-3.8.0" with
  any of the following names:

    lapack-3.8.0Config.cmake
    lapack-3.8.0-config.cmake

  Add the installation prefix of "lapack-3.8.0" to CMAKE_PREFIX_PATH or set
  "lapack-3.8.0_DIR" to a directory containing one of the above files.  If
  "lapack-3.8.0" provides a separate development package or SDK, be sure it
  has been installed.

Failure logs
Using find_package(lapack REQUIRED): lapack_failure_log.txt
Using find_package(lapack-3.8.0 CONFIG REQUIRED): lapack_380_failure_log.txt
This one is not a failure log, but it's a successful build using the upstream tarball of Netlib LAPACK manually built from source: lapack_success_log.txt

Metadata

Metadata

Assignees

Labels

category:port-bugThe issue is with a library, which is something the port should already support

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions