diff --git a/CMakeLists.txt b/CMakeLists.txt index c955d742..b837d7a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -136,22 +136,33 @@ if (WHISPER_OPENBLAS) endif() if (WHISPER_BLAS) - set(BLA_STATIC 1) - set(BLA_VENDOR ${WHISPER_BLAS_VENDOR}) -# set(BLA_PREFER_PKGCONFIG 1) - set(BLA_SIZEOF_INTEGER 8) - find_package(BLAS) + if (WIN32) + if(DEFINED ENV{OPENBLAS_PATH}) + set(BLAS_LIBRARIES $ENV{OPENBLAS_PATH}/lib/libopenblas.dll.a) + message(STATUS "Libraries ${BLAS_LIBRARIES}") + set(WHISPER_EXTRA_FLAGS ${WHISPER_EXTRA_FLAGS} -DGGML_USE_OPENBLAS) + include_directories($ENV{OPENBLAS_PATH}/include) + set(WHISPER_EXTRA_LIBS ${WHISPER_EXTRA_LIBS} ${BLAS_LIBRARIES}) + else () + message(WARNING "BLAS library was not found. Environment variable OPENBLAS_PATH not defined.") + endif () + else () + set(BLA_STATIC 1) + set(BLA_VENDOR ${WHISPER_BLAS_VENDOR}) + # set(BLA_PREFER_PKGCONFIG 1) + set(BLA_SIZEOF_INTEGER 8) + find_package(BLAS) - if(BLAS_FOUND) - message(STATUS "BLAS compatible library found") - message(STATUS "Libraries ${BLAS_LIBRARIES}") - 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() + if(BLAS_FOUND) + message(STATUS "BLAS compatible library found") + message(STATUS "Libraries ${BLAS_LIBRARIES}") + 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() + endif () endif () if (WHISPER_CUBLAS)