I am using the llama.cpp project to evaluate LLMs. But on Windows I am running into a problem with CMake: The find_package(BLAS) invocation does not find OpenBLAS.
Steps to reproduce
Unpack the fOpenBLAS-0.3.23-x64.zipf inside the projects ./build directory.
CMake Debug Log at C:/Users/CountZero/miniconda3/Lib/site-packages/cmake/data/share/cmake-3.26/Modules/FindBLAS.cmake:343 (find_library):
find_library called with the following settings:
VAR: BLAS_openblas_LIBRARY
NAMES: "openblas"
Documentation: Path to a library.
Framework
Only Search Frameworks: 0
Search Frameworks Last: 0
Search Frameworks First: 0
AppBundle
Only Search AppBundle: 0
Search AppBundle Last: 0
Search AppBundle First: 0
CMAKE_FIND_USE_CMAKE_PATH: 1
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
CMAKE_FIND_USE_INSTALL_PREFIX: 1
find_library considered the following locations:
C:/llama.cpp/build/()openblas(\.lib)
The item was not found.
Call Stack (most recent call first):
C:/Users/CountZero/miniconda3/Lib/site-packages/cmake/data/share/cmake-3.26/Modules/FindBLAS.cmake:775 (check_blas_libraries)
CMakeLists.txt:173 (find_package)
-- Could NOT find BLAS (missing: BLAS_LIBRARIES)
@ben.boeckel Yes, setting the BLAS_ROOT variable to ../../OpenBLAS causes CMake to search at the right location:
CMake Debug Log at C:/Users/CountZero/miniconda3/Lib/site-packages/cmake/data/share/cmake-3.26/Modules/FindBLAS.cmake:343 (find_library):
find_library called with the following settings:
VAR: BLAS_openblas_LIBRARY
NAMES: "openblas"
Documentation: Path to a library.
Framework
Only Search Frameworks: 0
Search Frameworks Last: 0
Search Frameworks First: 0
AppBundle
Only Search AppBundle: 0
Search AppBundle Last: 0
Search AppBundle First: 0
CMAKE_FIND_USE_CMAKE_PATH: 1
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
CMAKE_FIND_USE_INSTALL_PREFIX: 1
find_library considered the following locations:
C:/absolute/path/to/OpenBLAS/lib/()openblas(\.lib)
C:/absolute/path/to/OpenBLAS/()openblas(\.lib)
[...]
But CMake still fails to “find” the OpenBLAS library:
[...]
The item was not found.
Call Stack (most recent call first):
C:/Users/CountZero/miniconda3/Lib/site-packages/cmake/data/share/cmake-3.26/Modules/FindBLAS.cmake:775 (check_blas_libraries)
CMakeLists.txt:181 (find_package)
-- Could NOT find BLAS (missing: BLAS_LIBRARIES)
CMake Debug Log at CMakeLists.txt:181 (find_package):
find_package considered the following paths for FindBLAS.cmake:
The file was found at
C:/Users/CountZero/miniconda3/Lib/site-packages/cmake/data/share/cmake-3.26/Modules/FindBLAS.cmake
The module is considered not found due to BLAS_FOUND being FALSE.
CMake Warning at CMakeLists.txt:238 (message):
BLAS not found, please refer to
https://cmake.org/cmake/help/latest/module/FindBLAS.html#blas-lapack-vendors
to set correct LLAMA_BLAS_VENDOR