rspamd/cmake/Openblas.cmake
Petr Vaněk bbf8bb172d cmake: Unify ENABLE_OPENBLAS and ENABLE_BLAS
ENABLE_OPENBLAS is removed because it was not used to check if the
openblas library should be used. The ENABLE_BLAS is moved from
CMakeLists.txt to cmake/Openblas.cmake to have all related variables in
one file and to reduce a complexity of CMakeLists.txt slightly.
2019-11-26 19:16:12 +01:00

26 lines
908 B
CMake

option (ENABLE_BLAS "Enable openblas for fast neural network processing [default: OFF]" OFF)
IF(ENABLE_BLAS MATCHES "ON")
ProcessPackage(BLAS OPTIONAL_INCLUDE LIBRARY openblas blas
INCLUDE cblas.h INCLUDE_SUFFIXES include/openblas
include/blas
ROOT ${BLAS_ROOT_DIR}
LIB_OUTPUT BLAS_REQUIRED_LIBRARIES)
ENDIF()
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)