You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
2.8 KiB

  1. PROJECT(BTL)
  2. CMAKE_MINIMUM_REQUIRED(VERSION 2.6.2)
  3. set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${Eigen_SOURCE_DIR}/cmake)
  4. include(MacroOptionalAddSubdirectory)
  5. OPTION(BTL_NOVEC "Disable SSE/Altivec optimizations when possible" OFF)
  6. SET(CMAKE_INCLUDE_CURRENT_DIR ON)
  7. string(REGEX MATCH icpc IS_ICPC ${CMAKE_CXX_COMPILER})
  8. IF(CMAKE_COMPILER_IS_GNUCXX OR IS_ICPC)
  9. SET(CMAKE_CXX_FLAGS "-g0 -O3 -DNDEBUG ${CMAKE_CXX_FLAGS}")
  10. SET(CMAKE_Fortran_FLAGS "-g0 -O3 -DNDEBUG ${CMAKE_Fortran_FLAGS}")
  11. IF(BTL_NOVEC)
  12. SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DEIGEN_DONT_VECTORIZE")
  13. ENDIF(BTL_NOVEC)
  14. ENDIF(CMAKE_COMPILER_IS_GNUCXX OR IS_ICPC)
  15. IF(MSVC)
  16. SET(CMAKE_CXX_FLAGS " /O2 /Ot /GL /fp:fast -DNDEBUG")
  17. # SET(CMAKE_Fortran_FLAGS "-g0 -O3 -DNDEBUG")
  18. IF(BTL_NOVEC)
  19. SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DEIGEN_DONT_VECTORIZE")
  20. ENDIF(BTL_NOVEC)
  21. ENDIF(MSVC)
  22. if(IS_ICPC)
  23. set(CMAKE_CXX_FLAGS "-fast ${CMAKE_CXX_FLAGS}")
  24. set(CMAKE_Fortran_FLAGS "-fast ${CMAKE_Fortran_FLAGS}")
  25. endif(IS_ICPC)
  26. include_directories(
  27. ${PROJECT_SOURCE_DIR}/actions
  28. ${PROJECT_SOURCE_DIR}/generic_bench
  29. ${PROJECT_SOURCE_DIR}/generic_bench/utils
  30. ${PROJECT_SOURCE_DIR}/libs/STL)
  31. # find_package(MKL)
  32. # if (MKL_FOUND)
  33. # add_definitions(-DHAVE_MKL)
  34. # set(DEFAULT_LIBRARIES ${MKL_LIBRARIES})
  35. # endif (MKL_FOUND)
  36. find_library(EIGEN_BTL_RT_LIBRARY rt)
  37. # if we cannot find it easily, then we don't need it!
  38. if(NOT EIGEN_BTL_RT_LIBRARY)
  39. set(EIGEN_BTL_RT_LIBRARY "")
  40. endif()
  41. MACRO(BTL_ADD_BENCH targetname)
  42. foreach(_current_var ${ARGN})
  43. set(_last_var ${_current_var})
  44. endforeach(_current_var)
  45. set(_sources ${ARGN})
  46. list(LENGTH _sources _argn_length)
  47. list(REMOVE_ITEM _sources ON OFF TRUE FALSE)
  48. list(LENGTH _sources _src_length)
  49. if (${_argn_length} EQUAL ${_src_length})
  50. set(_last_var ON)
  51. endif (${_argn_length} EQUAL ${_src_length})
  52. OPTION(BUILD_${targetname} "Build benchmark ${targetname}" ${_last_var})
  53. IF(BUILD_${targetname})
  54. ADD_EXECUTABLE(${targetname} ${_sources})
  55. ADD_TEST(${targetname} "${targetname}")
  56. target_link_libraries(${targetname} ${DEFAULT_LIBRARIES} ${EIGEN_BTL_RT_LIBRARY})
  57. ENDIF(BUILD_${targetname})
  58. ENDMACRO(BTL_ADD_BENCH)
  59. macro(btl_add_target_property target prop value)
  60. if(BUILD_${target})
  61. get_target_property(previous ${target} ${prop})
  62. if(NOT previous)
  63. set(previous "")
  64. endif()
  65. set_target_properties(${target} PROPERTIES ${prop} "${previous} ${value}")
  66. endif()
  67. endmacro(btl_add_target_property)
  68. ENABLE_TESTING()
  69. add_subdirectory(libs/eigen3)
  70. add_subdirectory(libs/eigen2)
  71. add_subdirectory(libs/tensors)
  72. add_subdirectory(libs/BLAS)
  73. add_subdirectory(libs/ublas)
  74. add_subdirectory(libs/gmm)
  75. add_subdirectory(libs/mtl4)
  76. add_subdirectory(libs/blitz)
  77. add_subdirectory(libs/tvmet)
  78. add_subdirectory(libs/STL)
  79. add_subdirectory(libs/blaze)
  80. add_subdirectory(data)