summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-14 17:48:46 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-14 17:48:46 +0100
commite229b6dd55b04b155b17fcb8c09b9f7e602c4913 (patch)
tree40163e7cfe4ec72308b359fa13e464bd70e538a2 /CMakeLists.txt
parent784746733a95d847e741a2d74153e99349b52fee (diff)
downloadrspamd-e229b6dd55b04b155b17fcb8c09b9f7e602c4913.tar.gz
rspamd-e229b6dd55b04b155b17fcb8c09b9f7e602c4913.zip
[Fix] Add configurable number of threads for OpenBLAS
Issue: #3082
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt21
1 files changed, 21 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3416702c8..99fbc8f2d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -643,6 +643,27 @@ ProcessPackage(LIBZ LIBRARY z INCLUDE zlib.h INCLUDE_SUFFIXES include/zlib
ProcessPackage(SODIUM LIBRARY sodium INCLUDE sodium.h
INCLUDE_SUFFIXES include/libsodium include/sodium
ROOT ${LIBSODIUM_ROOT_DIR} MODULES libsodium>=1.0.0)
+ProcessPackage(BLAS OPTIONAL LIBRARY openblas blas
+ INCLUDE cblas.h INCLUDE_SUFFIXES include/openblas
+ include/blas
+ ROOT ${BLAS_ROOT_DIR}
+ LIB_OUTPUT BLAS_REQUIRED_LIBRARIES)
+IF(WITH_BLAS)
+ MESSAGE(STATUS "Use openblas to accelerate kann")
+ IF(NOT BLAS_INCLUDE)
+ FIND_FILE(HAVE_CBLAS_H HINTS "${RSPAMD_SEARCH_PATH}"
+ NAMES cblas.h
+ DOC "Path to cblas.h header")
+ IF(NOT HAVE_CBLAS_H)
+ MESSAGE(STATUS "Blas header cblas.h has not been found, use internal workaround")
+ ELSE()
+ ADD_DEFINITIONS(-DHAVE_CBLAS_H)
+ ENDIF()
+ ELSE()
+ ADD_DEFINITIONS(-DHAVE_CBLAS_H)
+ ENDIF()
+ ADD_DEFINITIONS(-DHAVE_CBLAS)
+ENDIF(WITH_BLAS)
IF(ENABLE_HYPERSCAN MATCHES "ON")
ProcessPackage(HYPERSCAN LIBRARY hs INCLUDE hs.h INCLUDE_SUFFIXES