diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-06-27 15:38:34 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-06-27 15:38:34 +0100 |
commit | 44e393f9fe9a86bd99ebc5cfcddfe8eb50c8813e (patch) | |
tree | acbea1a0149b064c8de14502e11777192a012b44 /contrib/kann/CMakeLists.txt | |
parent | b066f62bfafd0e3dc0ebb181e0990fede4f32d47 (diff) | |
download | rspamd-44e393f9fe9a86bd99ebc5cfcddfe8eb50c8813e.tar.gz rspamd-44e393f9fe9a86bd99ebc5cfcddfe8eb50c8813e.zip |
[Project] Add kann library to start torch removal
Diffstat (limited to 'contrib/kann/CMakeLists.txt')
-rw-r--r-- | contrib/kann/CMakeLists.txt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/contrib/kann/CMakeLists.txt b/contrib/kann/CMakeLists.txt new file mode 100644 index 000000000..d7bd73d28 --- /dev/null +++ b/contrib/kann/CMakeLists.txt @@ -0,0 +1,22 @@ +SET(LIBKANNSRC kautodiff.c kann.c) + +IF(ENABLE_FULL_DEBUG MATCHES "OFF") + if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3") + endif () +ENDIF() + +ADD_LIBRARY(rspamd-kann SHARED ${LIBKANNSRC}) + +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") + TARGET_LINK_LIBRARIES(rspamd-kann ${BLAS_REQUIRED_LIBRARIES}) + ADD_DEFINITIONS(-DHAVE_CBLAS) +ENDIF(WITH_BLAS) + +INSTALL(TARGETS rspamd-kann LIBRARY DESTINATION ${RSPAMD_LIBDIR})
\ No newline at end of file |