xref: /aosp_15_r20/external/eigen/bench/btl/libs/BLAS/CMakeLists.txt (revision bf2c37156dfe67e5dfebd6d394bad8b2ab5804d4)
1
2find_package(ATLAS)
3if (ATLAS_FOUND)
4  btl_add_bench(btl_atlas main.cpp)
5  if(BUILD_btl_atlas)
6    target_link_libraries(btl_atlas ${ATLAS_LIBRARIES})
7    set_target_properties(btl_atlas PROPERTIES COMPILE_FLAGS "-DCBLASNAME=ATLAS -DHAS_LAPACK=1")
8  endif()
9endif ()
10
11find_package(MKL)
12if (MKL_FOUND)
13  btl_add_bench(btl_mkl main.cpp)
14  if(BUILD_btl_mkl)
15    target_link_libraries(btl_mkl ${MKL_LIBRARIES})
16    set_target_properties(btl_mkl PROPERTIES COMPILE_FLAGS "-DCBLASNAME=INTEL_MKL -DHAS_LAPACK=1")
17  endif()
18endif ()
19
20
21find_package(OPENBLAS)
22if (OPENBLAS_FOUND)
23  btl_add_bench(btl_openblas main.cpp)
24  if(BUILD_btl_openblas)
25    target_link_libraries(btl_openblas ${OPENBLAS_LIBRARIES} )
26    set_target_properties(btl_openblas PROPERTIES COMPILE_FLAGS "-DCBLASNAME=OPENBLAS")
27  endif()
28endif ()
29
30find_package(ACML)
31if (ACML_FOUND)
32  btl_add_bench(btl_acml main.cpp)
33  if(BUILD_btl_acml)
34    target_link_libraries(btl_acml ${ACML_LIBRARIES} )
35    set_target_properties(btl_acml PROPERTIES COMPILE_FLAGS "-DCBLASNAME=ACML -DHAS_LAPACK=1")
36  endif()
37endif ()
38
39if(Eigen_SOURCE_DIR AND CMAKE_Fortran_COMPILER_WORKS)
40  # we are inside Eigen and blas/lapack interface is compilable
41  include_directories(${Eigen_SOURCE_DIR})
42  btl_add_bench(btl_eigenblas main.cpp)
43  if(BUILD_btl_eigenblas)
44    target_link_libraries(btl_eigenblas eigen_blas eigen_lapack )
45    set_target_properties(btl_eigenblas PROPERTIES COMPILE_FLAGS "-DCBLASNAME=EigenBLAS")
46  endif()
47endif()
48