diff --git a/modules/cblas.cmake b/modules/cblas.cmake index 2a6b8db..b5db822 100644 --- a/modules/cblas.cmake +++ b/modules/cblas.cmake @@ -65,12 +65,16 @@ if(ENABLE_CBLAS) endfunction() set(CBLAS_FOUND FALSE) - - set(CBLAS_INCLUDE_DIR "undefined") - _find_include_dir(cblas.h /usr CBLAS_INCLUDE_DIR) - set(CBLAS_LIBRARIES "undefined") - _find_library(cblas cblas_dgemm CBLAS_LIBRARIES) + set(CBLAS_INCLUDE_DIR "undefined") + + if(APPLE) + _find_include_dir(Accelerate/Accelerate.h /usr CBLAS_INCLUDE_DIR) + _find_library(Accelerate cblas_dgemm CBLAS_LIBRARIES) + else() + _find_include_dir(cblas.h /usr CBLAS_INCLUDE_DIR) + _find_library(cblas cblas_dgemm CBLAS_LIBRARIES) + endif() if(NOT ${CBLAS_INCLUDE_DIR} STREQUAL "undefined" AND NOT ${CBLAS_LIBRARIES} STREQUAL "undefined") set(CBLAS_FOUND TRUE) diff --git a/test/cxx_cblas/src/example.cxx b/test/cxx_cblas/src/example.cxx index 19a710e..23469cc 100644 --- a/test/cxx_cblas/src/example.cxx +++ b/test/cxx_cblas/src/example.cxx @@ -1,7 +1,11 @@ #include #include +#ifdef __APPLE__ +#include "Accelerate/Accelerate.h" +#else #include "cblas.h" +#endif int main() { diff --git a/test/test.py b/test/test.py index a4ee494..577eba6 100644 --- a/test/test.py +++ b/test/test.py @@ -169,7 +169,6 @@ def test_fc_blas_static(): configure_build_and_exe('fc_blas', 'python setup.py --fc=gfortran --static --cmake-options="-DMATH_LIB_SEARCH_ORDER=\'OPENBLAS;ATLAS;MKL;SYSTEM_NATIVE\'"') -@skip_on_osx def test_cxx_cblas(): configure_build_and_exe('cxx_cblas', 'python setup.py --cxx=g++ --cblas')