HandleMKL.cmake 645 B

1234567891011121314151617
  1. ###############################################################################
  2. # Find MKL
  3. find_package(MKL)
  4. if(MKL_FOUND AND GTSAM_WITH_EIGEN_MKL)
  5. set(GTSAM_USE_EIGEN_MKL 1) # This will go into config.h
  6. set(EIGEN_USE_MKL_ALL 1) # This will go into config.h - it makes Eigen use MKL
  7. list(APPEND GTSAM_ADDITIONAL_LIBRARIES ${MKL_LIBRARIES})
  8. # --no-as-needed is required with gcc according to the MKL link advisor
  9. if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
  10. set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-as-needed")
  11. endif()
  12. else()
  13. set(GTSAM_USE_EIGEN_MKL 0)
  14. set(EIGEN_USE_MKL_ALL 0)
  15. endif()