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

Fix OpenBLAS detection under Arch Linux #1173

Merged
merged 1 commit into from
Aug 25, 2023
Merged

Conversation

marmistrz
Copy link
Contributor

@marmistrz marmistrz commented Aug 11, 2023

/usr/include/openblas is used under ARch Linux

@marmistrz
Copy link
Contributor Author

@ggerganov ping

@marmistrz marmistrz changed the title Use an alternative location for OpenBLAS includes Fix OpenBLAS detection under Arch Linux Aug 19, 2023
CMakeLists.txt Outdated
set(BLA_STATIC 1)
set(BLA_VENDOR ${WHISPER_BLAS_VENDOR})
set(BLAS_STATIC 1)
set(BLAS_VENDOR ${WHISPER_BLAS_VENDOR})
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching that, reverted the offending lines.

@marmistrz
Copy link
Contributor Author

Actually, I need to remove BLA_STATIC and BLA_INTEGER_SIZE 8 to have OpenBLAS found under Arch Linux. The library is shipping only as an .so library. For some reason, CMake doesn't detect /usr/lib/libopenblas_64.so, only /usr/lib/libopenblas.so,

@sscotti
Copy link

sscotti commented Aug 21, 2023 via email

Copy link
Collaborator

@bobqianic bobqianic Aug 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whisper.cpp/CMakeLists.txt

Lines 156 to 165 in b551dd3

if(BLAS_FOUND)
message(STATUS "BLAS compatible library found")
message(STATUS "Libraries ${BLAS_LIBRARIES}")
find_path(BLAS_INCLUDE_DIRS cblas.h /usr/include/openblas /usr/local/include/openblas $ENV{BLAS_HOME}/include)
set(WHISPER_EXTRA_FLAGS ${WHISPER_EXTRA_FLAGS} -DGGML_USE_OPENBLAS)
include_directories(${BLAS_INCLUDE_DIRS})
set(WHISPER_EXTRA_LIBS ${WHISPER_EXTRA_LIBS} ${BLAS_LIBRARIES})
else()
message(WARNING "BLAS library was not found")
endif()

I'm a bit puzzled by L159. If CMake can already detect BLAS and set the BLAS_FOUND variable to true, then why do we need find_path()?

Result Variables
^^^^^^^^^^^^^^^^

This module defines the following variables:

``BLAS_FOUND``
  library implementing the BLAS interface is found
``BLAS_LINKER_FLAGS``
  uncached list of required linker flags (excluding ``-l`` and ``-L``).
``BLAS_LIBRARIES``
  uncached list of libraries (using full path name) to link against
  to use BLAS (may be empty if compiler implicitly links BLAS)
``BLAS95_LIBRARIES``
  uncached list of libraries (using full path name) to link against
  to use BLAS95 interface
``BLAS95_FOUND``
  library implementing the BLAS95 interface is found

set(BLA_SIZEOF_INTEGER 8)

This line raises a concern for me. Using 8 implies we're only searching for the 64-bit package. We can't just assume that every user has installed the 64-bit version.

Copy link
Contributor Author

@marmistrz marmistrz Aug 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ggerganov ggerganov merged commit 66f2078 into ggerganov:master Aug 25, 2023
33 of 35 checks passed
jacobwu-b pushed a commit to jacobwu-b/Transcriptify-by-whisper.cpp that referenced this pull request Oct 24, 2023
jacobwu-b pushed a commit to jacobwu-b/Transcriptify-by-whisper.cpp that referenced this pull request Oct 24, 2023
vonstring pushed a commit to vonstring/whisper.cpp that referenced this pull request Nov 7, 2023
landtanin pushed a commit to landtanin/whisper.cpp that referenced this pull request Dec 16, 2023
iThalay pushed a commit to iThalay/whisper.cpp that referenced this pull request Sep 23, 2024
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 this pull request may close these issues.

4 participants