diff options
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Openblas.cmake | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cmake/Openblas.cmake b/cmake/Openblas.cmake index 2155b2955..7615408b2 100644 --- a/cmake/Openblas.cmake +++ b/cmake/Openblas.cmake @@ -51,6 +51,22 @@ int main(int argc, char **argv) COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} LINK_LIBRARIES ${BLAS_REQUIRED_LIBRARIES} OUTPUT_VARIABLE SGEMM_ERR) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/saxpy.c" " +#include <stddef.h> +extern void cblas_saxpy(const int __N, + const float __alpha, const float *__X, const int __incX, float *__Y, const int __incY); +int main(int argc, char **argv) +{ + cblas_saxpy(0, 0, NULL, 0, NULL, 0); + return 0; +} +") + try_compile(HAVE_CBLAS_SAXPY + ${CMAKE_CURRENT_BINARY_DIR} + "${CMAKE_CURRENT_BINARY_DIR}/saxpy.c" + COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + LINK_LIBRARIES ${BLAS_REQUIRED_LIBRARIES} + OUTPUT_VARIABLE SAXPY_ERR) # Cmake is just brain damaged #CHECK_LIBRARY_EXISTS(${BLAS_REQUIRED_LIBRARIES} cblas_sgemm "" HAVE_CBLAS_SGEMM) @@ -60,5 +76,11 @@ int main(int argc, char **argv) else() MESSAGE(STATUS "Blas has -NOT- CBLAS sgemm, use internal workaround: ${SGEMM_ERR}") endif() + if(HAVE_CBLAS_SAXPY) + MESSAGE(STATUS "Blas has CBLAS saxpy") + ADD_COMPILE_OPTIONS(-DHAVE_CBLAS_SAXPY) + else() + MESSAGE(STATUS "Blas has -NOT- CBLAS saxpy, use internal workaround: ${SAXPY_ERR}") + endif() ADD_COMPILE_OPTIONS(-DHAVE_CBLAS) ENDIF(WITH_BLAS)
\ No newline at end of file |