-
Notifications
You must be signed in to change notification settings - Fork 12.2k
make : find include dir for OpenBLAS header file #1795
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
Conversation
You added this before in #992 and it was removed in #1536, but I'm not sure why. |
The way that I use BLAS_INCLUDE_DIRS here is to allow users to assign the path using A better way might be to provide a custom FindBlas cmake that appends the cflags from pkg-config directly, what do you think? |
@katsu560 does this patch works on your system? diff --git a/CMakeLists.txt b/CMakeLists.txt
index 19cd42d..b6c1fd3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -158,8 +158,27 @@ if (LLAMA_BLAS)
if ($(CMAKE_VERSION) VERSION_GREATER_EQUAL 3.22)
set(BLA_SIZEOF_INTEGER 8)
endif()
+ find_package(PkgConfig REQUIRED)
+ if (${LLAMA_BLAS_VENDOR} MATCHES "Generic")
+ pkg_check_modules(DepBLAS REQUIRED blas)
+ if (DepBLAS_FOUND)
+ set(BLAS_INCLUDE_DIRS ${DepBLAS_INCLUDE_DIRS})
+ endif()
+ elseif (${LLAMA_BLAS_VENDOR} MATCHES "OpenBLAS")
+ pkg_check_modules(DepBLAS REQUIRED openblas)
+ if (DepBLAS_FOUND)
+ set(BLAS_INCLUDE_DIRS ${DepBLAS_INCLUDE_DIRS})
+ endif()
+ elseif (${LLAMA_BLAS_VENDOR} MATCHES "FLAME")
+ pkg_check_modules(DepBLAS REQUIRED blis)
+ if (DepBLAS_FOUND)
+ set(BLAS_INCLUDE_DIRS ${DepBLAS_INCLUDE_DIRS})
+ endif()
+ endif()
+
set(BLA_VENDOR ${LLAMA_BLAS_VENDOR})
find_package(BLAS)
|
Decided to merge #1830 instead of this one. |
Hi grencez, zenixls2 and Gerganov. Yes, the zenixls2' s patch works good on my system. But, Gerganov's latest code #1830 doesn't works for me.
So, I think that it is necessary zenixls2's patch. |
@zenixls2 |
Sure. Thanks for the confirmation. |
@ggerganov i think he answered in #1886 |
@ggerganov |
Hi, Gerganov. Thank you for sharing awesome thing.
Latest source meets following compile error on Linux environment.
Because BLAS cmake package can't find include header directory.
I added some code to CMakeLists.txt to resolve above issue.
Please confirm my pull-request.
Thanks.