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.

553 lines
19 KiB

  1. add_custom_target(resources)
  2. add_custom_target(test-resources)
  3. set(STORM_3RDPARTY_SOURCE_DIR ${PROJECT_SOURCE_DIR}/resources/3rdparty)
  4. set(STORM_3RDPARTY_BINARY_DIR ${PROJECT_BINARY_DIR}/resources/3rdparty)
  5. ####
  6. #### Find autoreconf for cudd update step
  7. find_program(AUTORECONF autoreconf)
  8. mark_as_advanced(AUTORECONF)
  9. #############################################################
  10. ##
  11. ## l3pp
  12. ##
  13. #############################################################
  14. ExternalProject_Add(
  15. l3pp
  16. GIT_REPOSITORY https://github.com/hbruintjes/l3pp.git
  17. GIT_TAG master
  18. SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/l3pp
  19. CONFIGURE_COMMAND ""
  20. BUILD_COMMAND ""
  21. INSTALL_COMMAND ""
  22. LOG_INSTALL ON
  23. )
  24. ExternalProject_Get_Property(l3pp source_dir)
  25. set(l3pp_INCLUDE "${source_dir}/")
  26. include_directories(${l3pp_INCLUDE})
  27. add_dependencies(resources l3pp)
  28. #############################################################
  29. ##
  30. ## gmm
  31. ##
  32. #############################################################
  33. # Add the shipped version of GMM to the include pathes
  34. set(GMMXX_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/resources/3rdparty/gmm-5.0/include")
  35. include_directories(${GMMXX_INCLUDE_DIR})
  36. #############################################################
  37. ##
  38. ## Eigen
  39. ##
  40. #############################################################
  41. # Add the shipped version of Eigen to the include pathes
  42. set(EIGEN_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/resources/3rdparty/eigen-3.3-beta1")
  43. include_directories(${EIGEN_INCLUDE_DIR})
  44. #############################################################
  45. ##
  46. ## Boost
  47. ##
  48. #############################################################
  49. # Boost Option variables
  50. set(Boost_USE_STATIC_LIBS ${USE_BOOST_STATIC_LIBRARIES})
  51. set(Boost_USE_MULTITHREADED ON)
  52. set(Boost_USE_STATIC_RUNTIME OFF)
  53. find_package(Boost 1.56.0 QUIET REQUIRED)
  54. if ((NOT Boost_LIBRARY_DIRS) OR ("${Boost_LIBRARY_DIRS}" STREQUAL ""))
  55. set(Boost_LIBRARY_DIRS "${Boost_INCLUDE_DIRS}/stage/lib")
  56. endif ()
  57. link_directories(${Boost_LIBRARY_DIRS})
  58. include_directories(${Boost_INCLUDE_DIRS})
  59. list(APPEND STORM_LINK_LIBRARIES ${Boost_LIBRARIES})
  60. message(STATUS "StoRM - Using Boost ${Boost_VERSION} (lib ${Boost_LIB_VERSION})")
  61. #message(STATUS "StoRM - BOOST_INCLUDE_DIRS is ${Boost_INCLUDE_DIRS}")
  62. #message(STATUS "StoRM - BOOST_LIBRARY_DIRS is ${Boost_LIBRARY_DIRS}")
  63. #############################################################
  64. ##
  65. ## ExprTk
  66. ##
  67. #############################################################
  68. # Use the shipped version of ExprTK
  69. message (STATUS "StoRM - Including ExprTk")
  70. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/exprtk")
  71. #############################################################
  72. ##
  73. ## ModernJSON
  74. ##
  75. #############################################################
  76. #use the shipped version of modernjson
  77. message (STATUS "StoRM - Including ModernJSON")
  78. include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/modernjson/src/")
  79. #############################################################
  80. ##
  81. ## Z3 (optional)
  82. ##
  83. #############################################################
  84. find_package(Z3 QUIET)
  85. # Z3 Defines
  86. set(STORM_HAVE_Z3 ${Z3_FOUND})
  87. if(Z3_FOUND)
  88. message (STATUS "StoRM - Linking with Z3")
  89. include_directories(${Z3_INCLUDE_DIRS})
  90. list(APPEND STORM_LINK_LIBRARIES ${Z3_LIBRARIES})
  91. endif(Z3_FOUND)
  92. #############################################################
  93. ##
  94. ## glpk
  95. ##
  96. #############################################################
  97. include(${STORM_3RDPARTY_SOURCE_DIR}/include_glpk.cmake)
  98. #############################################################
  99. ##
  100. ## Gurobi (optional)
  101. ##
  102. #############################################################
  103. if (STORM_USE_GUROBI)
  104. find_package(Gurobi QUIET REQUIRED)
  105. set(STORM_HAVE_GUROBI ${GUROBI_FOUND})
  106. if (GUROBI_FOUND)
  107. message (STATUS "StoRM - Linking with Gurobi")
  108. include_directories(${GUROBI_INCLUDE_DIRS})
  109. list(APPEND STORM_LINK_LIBRARIES ${GUROBI_LIBRARY})
  110. #link_directories("${GUROBI_ROOT}/lib")
  111. else()
  112. #message(FATAL_ERROR "StoRM - Gurobi was requested, but not found!")
  113. endif()
  114. else()
  115. set(STORM_HAVE_GUROBI OFF)
  116. endif()
  117. #############################################################
  118. ##
  119. ## CUDD
  120. ##
  121. #############################################################
  122. include(${STORM_3RDPARTY_SOURCE_DIR}/include_cudd.cmake)
  123. #############################################################
  124. ##
  125. ## CLN
  126. ##
  127. #############################################################
  128. find_package(CLN QUIET)
  129. if(CLN_FOUND)
  130. set(STORM_HAVE_CLN ON)
  131. message(STATUS "StoRM - Linking with CLN ${CLN_VERSION_STRING}")
  132. include_directories("${CLN_INCLUDE_DIR}")
  133. list(APPEND STORM_LINK_LIBRARIES ${CLN_LIBRARIES})
  134. else()
  135. set(STORM_HAVE_CLN OFF)
  136. if(NOT GMP_FOUND)
  137. message(FATAL_ERROR "StoRM - Neither CLN nor GMP found")
  138. endif()
  139. endif()
  140. #############################################################
  141. ##
  142. ## carl
  143. ##
  144. #############################################################
  145. set(STORM_HAVE_CARL OFF)
  146. if(USE_CARL)
  147. find_package(carl QUIET)
  148. if(carl_FOUND)
  149. set(STORM_HAVE_CARL ON)
  150. message(STATUS "StoRM - Use system version of carl")
  151. message(STATUS "StoRM - Linking with carl ${carl_VERSION_STRING}")
  152. include_directories("${carl_INCLUDE_DIR}")
  153. list(APPEND STORM_LINK_LIBRARIES ${carl_LIBRARIES})
  154. else()
  155. message(STATUS "StoRM - Using shipped version of carl")
  156. #
  157. ExternalProject_Add(
  158. carl
  159. GIT_REPOSITORY https://github.com/smtrat/carl
  160. GIT_TAG master
  161. INSTALL_DIR ${STORM_3RDPARTY_BINARY_DIR}/carl
  162. SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/carl
  163. CMAKE_ARGS -DCXX=${CMAKE_CXX_COMPILER} -DEXPORT_TO_CMAKE=0 -DUSE_CLN_NUMBERS=1 -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=1 -DCMAKE_INSTALL_PREFIX:PATH=${STORM_3RDPARTY_BINARY_DIR}/carl
  164. BUILD_IN_SOURCE 0
  165. BUILD_COMMAND make lib_carl
  166. INSTALL_COMMAND make install
  167. LOG_UPDATE ON
  168. LOG_CONFIGURE ON
  169. LOG_BUILD ON
  170. LOG_INSTALL ON
  171. )
  172. include_directories(${STORM_3RDPARTY_BINARY_DIR}/carl/include)
  173. list(APPEND STORM_LINK_LIBRARIES ${STORM_3RDPARTY_BINARY_DIR}/carl/lib/libcarl${DYNAMIC_EXT})
  174. set(STORM_HAVE_CARL ON)
  175. endif()
  176. endif()
  177. #############################################################
  178. ##
  179. ## SMT-RAT
  180. ##
  181. #############################################################
  182. # No find routine yet
  183. #find_package(smtrat QUIET)
  184. # Not yet supported
  185. set(smtrat_FOUND OFF)
  186. set(STORM_HAVE_SMTRAT OFF)
  187. if(smtrat_FOUND)
  188. set(STORM_HAVE_SMTRAT ON)
  189. message(STATUS "StoRM - Linking with smtrat.")
  190. include_directories("${smtrat_INCLUDE_DIR}")
  191. list(APPEND STORM_LINK_LIBRARIES ${smtrat_LIBRARIES})
  192. endif()
  193. #############################################################
  194. ##
  195. ## GiNaC
  196. ##
  197. #############################################################
  198. find_package(GiNaC QUIET)
  199. if(GINAC_FOUND)
  200. set(STORM_HAVE_GINAC ON)
  201. message(STATUS "StoRM - Linking with GiNaC ${GINAC_VERSION_STRING}")
  202. # Right now only link with GiNaC for carl
  203. #include_directories("${GINAC_INCLUDE_DIR}")
  204. list(APPEND STORM_LINK_LIBRARIES ${GINAC_LIBRARIES})
  205. else()
  206. set(STORM_HAVE_GINAC OFF)
  207. #TODO: Check if CARL actually requires the use of GiNaC
  208. endif()
  209. #############################################################
  210. ##
  211. ## gmp
  212. ##
  213. #############################################################
  214. # GMP is optional (unless MathSAT is used, see below)
  215. find_package(GMP QUIET)
  216. #############################################################
  217. ##
  218. ## MathSAT (optional)
  219. ##
  220. #############################################################
  221. if ("${MSAT_ROOT}" STREQUAL "")
  222. set(ENABLE_MSAT OFF)
  223. else()
  224. set(ENABLE_MSAT ON)
  225. endif()
  226. # MathSAT Defines
  227. set(STORM_HAVE_MSAT ${ENABLE_MSAT})
  228. if (ENABLE_MSAT)
  229. message (STATUS "StoRM - Linking with MathSAT")
  230. link_directories("${MSAT_ROOT}/lib")
  231. include_directories("${MSAT_ROOT}/include")
  232. list(APPEND STORM_LINK_LIBRARIES "mathsat")
  233. if(GMP_FOUND)
  234. include_directories("${GMP_INCLUDE_DIR}")
  235. list(APPEND STORM_LINK_LIBRARIES "gmp")
  236. elseif(MPIR_FOUND)
  237. include_directories("${GMP_INCLUDE_DIR}")
  238. list(APPEND STORM_LINK_LIBRARIES "mpir" "mpirxx")
  239. else(GMP_FOUND)
  240. message(FATAL_ERROR "GMP is required for MathSAT, but was not found!")
  241. endif(GMP_FOUND)
  242. endif(ENABLE_MSAT)
  243. #############################################################
  244. ##
  245. ## Xerces
  246. ##
  247. #############################################################
  248. include(${STORM_3RDPARTY_SOURCE_DIR}/include_xerces.cmake)
  249. #############################################################
  250. ##
  251. ## Sylvan
  252. ##
  253. #############################################################
  254. ExternalProject_Add(
  255. sylvan
  256. DOWNLOAD_COMMAND ""
  257. PREFIX "sylvan"
  258. SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/sylvan
  259. CMAKE_ARGS -DSYLVAN_BUILD_TEST=Off -DSYLVAN_BUILD_EXAMPLES=Off -DCMAKE_BUILD_TYPE=Release
  260. BINARY_DIR "${PROJECT_BINARY_DIR}/sylvan"
  261. BUILD_IN_SOURCE 0
  262. INSTALL_COMMAND ""
  263. INSTALL_DIR "${STORM_3RDPARTY_BINARY_DIR}/sylvan"
  264. LOG_CONFIGURE ON
  265. LOG_BUILD ON
  266. )
  267. ExternalProject_Get_Property(sylvan source_dir)
  268. ExternalProject_Get_Property(sylvan binary_dir)
  269. set(Sylvan_INCLUDE_DIR "${source_dir}/src")
  270. set(Sylvan_LIBRARY "${binary_dir}/src/libsylvan.a")
  271. message(STATUS "StoRM - Using shipped version of sylvan")
  272. message(STATUS "StoRM - Linking with sylvan")
  273. include_directories("${Sylvan_INCLUDE_DIR}")
  274. list(APPEND STORM_LINK_LIBRARIES ${Sylvan_LIBRARY})
  275. add_dependencies(resources sylvan)
  276. if(${OPERATING_SYSTEM} MATCHES "Linux")
  277. find_package(Hwloc QUIET REQUIRED)
  278. if(Hwloc_FOUND)
  279. message(STATUS "StoRM - Linking with hwloc ${Hwloc_VERSION}")
  280. list(APPEND STORM_LINK_LIBRARIES ${Hwloc_LIBRARIES})
  281. else()
  282. message(FATAL_ERROR "HWLOC is required but was not found.")
  283. endif()
  284. endif()
  285. #############################################################
  286. ##
  287. ## Google Test gtest
  288. ##
  289. #############################################################
  290. ExternalProject_Add(
  291. googletest
  292. #For downloads (may be useful later!)
  293. #SVN_REPOSITORY http://googletest.googlecode.com/svn/trunk/
  294. #TIMEOUT 10
  295. DOWNLOAD_COMMAND ""
  296. SOURCE_DIR "${STORM_3RDPARTY_SOURCE_DIR}/gtest-1.7.0"
  297. # Force the same output paths for debug and release builds so that
  298. # we know in which place the binaries end up when using the Xcode generator
  299. CMAKE_ARGS -Dgtest_force_shared_crt=ON -DCXX=${CMAKE_CXX_COMPILER} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=${STORM_3RDPARTY_BINARY_DIR}/gtest-1.7.0 -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=${STORM_3RDPARTY_BINARY_DIR}/gtest-1.7.0
  300. # Disable install step
  301. INSTALL_COMMAND ""
  302. BINARY_DIR "${STORM_3RDPARTY_BINARY_DIR}/gtest-1.7.0"
  303. INSTALL_DIR "${STORM_3RDPARTY_BINARY_DIR}/gtest-1.7.0"
  304. # Wrap download, configure and build steps in a script to log output
  305. LOG_CONFIGURE ON
  306. LOG_BUILD ON)
  307. # Specify include dir
  308. ExternalProject_Get_Property(googletest source_dir)
  309. set(GTEST_INCLUDE_DIR ${source_dir}/include)
  310. # Specify MainTest's link libraries
  311. ExternalProject_Get_Property(googletest binary_dir)
  312. set(GTEST_LIBRARIES ${binary_dir}/libgtest.a ${binary_dir}/libgtest_main.a)
  313. add_dependencies(test-resources googletest)
  314. list(APPEND STORM_TEST_LINK_LIBRARIES ${GTEST_LIBRARIES})
  315. #############################################################
  316. ##
  317. ## Intel Threading Building Blocks (optional)
  318. ##
  319. #############################################################
  320. set(STORM_HAVE_INTELTBB OFF)
  321. if (STORM_USE_INTELTBB)
  322. # Point to shipped TBB directory
  323. set(TBB_INSTALL_DIR "${PROJECT_SOURCE_DIR}/resources/3rdparty/tbb42_20140122_merged-win-lin-mac")
  324. find_package(TBB QUIET REQUIRED)
  325. if (TBB_FOUND)
  326. message(STATUS "StoRM - Found Intel TBB with interface version ${TBB_INTERFACE_VERSION}.")
  327. message(STATUS "StoRM - Linking with Intel TBB in ${TBB_LIBRARY_DIRS}.")
  328. set(STORM_HAVE_INTELTBB ON)
  329. link_directories(${TBB_LIBRARY_DIRS})
  330. include_directories(${TBB_INCLUDE_DIRS})
  331. list(APPEND STORM_LINK_LIBRARIES tbb tbbmalloc)
  332. else(TBB_FOUND)
  333. message(FATAL_ERROR "StoRM - TBB was requested, but not found!")
  334. endif(TBB_FOUND)
  335. endif(STORM_USE_INTELTBB)
  336. #############################################################
  337. ##
  338. ## Threads
  339. ##
  340. #############################################################
  341. find_package(Threads QUIET REQUIRED)
  342. if (NOT Threads_FOUND)
  343. message(FATAL_ERROR "StoRM - Threads was requested, but not found!")
  344. endif()
  345. include_directories(${THREADS_INCLUDE_DIRS})
  346. list(APPEND STORM_LINK_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
  347. if (STORM_USE_COTIRE)
  348. target_link_libraries(storm_unity ${CMAKE_THREAD_LIBS_INIT})
  349. endif(STORM_USE_COTIRE)
  350. if (MSVC)
  351. # Add the DebugHelper DLL
  352. set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} Dbghelp.lib")
  353. target_link_libraries(storm "Dbghelp.lib")
  354. endif(MSVC)
  355. #############################################################
  356. ##
  357. ## CUDA Library generation
  358. ##
  359. #############################################################
  360. if ("${CUDA_ROOT}" STREQUAL "")
  361. set(ENABLE_CUDA OFF)
  362. else()
  363. set(ENABLE_CUDA ON)
  364. endif()
  365. # CUDA Defines
  366. if (ENABLE_CUDA)
  367. set(STORM_CPP_CUDA_DEF "define")
  368. else()
  369. set(STORM_CPP_CUDA_DEF "undef")
  370. endif()
  371. # CUDA Defines
  372. set(STORM_CPP_CUDAFORSTORM_DEF "undef")
  373. if(ENABLE_CUDA)
  374. # Test for type alignment
  375. try_run(STORM_CUDA_RUN_RESULT_TYPEALIGNMENT STORM_CUDA_COMPILE_RESULT_TYPEALIGNMENT
  376. ${PROJECT_BINARY_DIR} "${PROJECT_SOURCE_DIR}/cuda/CMakeAlignmentCheck.cpp"
  377. COMPILE_OUTPUT_VARIABLE OUTPUT_TEST_VAR
  378. )
  379. if(NOT STORM_CUDA_COMPILE_RESULT_TYPEALIGNMENT)
  380. message(FATAL_ERROR "StoRM (CudaPlugin) - Could not test type alignment, there was an Error while compiling the file ${PROJECT_SOURCE_DIR}/cuda/CMakeAlignmentCheck.cpp: ${OUTPUT_TEST_VAR}")
  381. elseif(STORM_CUDA_RUN_RESULT_TYPEALIGNMENT EQUAL 0)
  382. message(STATUS "StoRM (CudaPlugin) - Result of Type Alignment Check: OK.")
  383. else()
  384. message(FATAL_ERROR "StoRM (CudaPlugin) - Result of Type Alignment Check: FAILED (Code ${STORM_CUDA_RUN_RESULT_TYPEALIGNMENT})")
  385. endif()
  386. # Test for Float 64bit Alignment
  387. try_run(STORM_CUDA_RUN_RESULT_FLOATALIGNMENT STORM_CUDA_COMPILE_RESULT_FLOATALIGNMENT
  388. ${PROJECT_BINARY_DIR} "${PROJECT_SOURCE_DIR}/cuda/CMakeFloatAlignmentCheck.cpp"
  389. COMPILE_OUTPUT_VARIABLE OUTPUT_TEST_VAR
  390. )
  391. if(NOT STORM_CUDA_COMPILE_RESULT_FLOATALIGNMENT)
  392. message(FATAL_ERROR "StoRM (CudaPlugin) - Could not test float type alignment, there was an Error while compiling the file ${PROJECT_SOURCE_DIR}/cuda/CMakeFloatAlignmentCheck.cpp: ${OUTPUT_TEST_VAR}")
  393. elseif(STORM_CUDA_RUN_RESULT_FLOATALIGNMENT EQUAL 2)
  394. message(STATUS "StoRM (CudaPlugin) - Result of Float Type Alignment Check: 64bit alignment active.")
  395. set(STORM_CUDAPLUGIN_FLOAT_64BIT_ALIGN_DEF "define")
  396. elseif(STORM_CUDA_RUN_RESULT_FLOATALIGNMENT EQUAL 3)
  397. message(STATUS "StoRM (CudaPlugin) - Result of Float Type Alignment Check: 64bit alignment disabled.")
  398. set(STORM_CUDAPLUGIN_FLOAT_64BIT_ALIGN_DEF "undef")
  399. else()
  400. message(FATAL_ERROR "StoRM (CudaPlugin) - Result of Float Type Alignment Check: FAILED (Code ${STORM_CUDA_RUN_RESULT_FLOATALIGNMENT})")
  401. endif()
  402. #
  403. # Make a version file containing the current version from git.
  404. #
  405. include(GetGitRevisionDescription)
  406. git_describe_checkout(STORM_GIT_VERSION_STRING)
  407. # Parse the git Tag into variables
  408. string(REGEX REPLACE "^([0-9]+)\\..*" "\\1" STORM_CUDAPLUGIN_VERSION_MAJOR "${STORM_GIT_VERSION_STRING}")
  409. string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" STORM_CUDAPLUGIN_VERSION_MINOR "${STORM_GIT_VERSION_STRING}")
  410. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" STORM_CUDAPLUGIN_VERSION_PATCH "${STORM_GIT_VERSION_STRING}")
  411. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-([0-9]+)\\-.*" "\\1" STORM_CUDAPLUGIN_VERSION_COMMITS_AHEAD "${STORM_GIT_VERSION_STRING}")
  412. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-([a-z0-9]+).*" "\\1" STORM_CUDAPLUGIN_VERSION_HASH "${STORM_GIT_VERSION_STRING}")
  413. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-[a-z0-9]+\\-(.*)" "\\1" STORM_CUDAPLUGIN_VERSION_APPENDIX "${STORM_GIT_VERSION_STRING}")
  414. if ("${STORM_CUDAPLUGIN_VERSION_APPENDIX}" MATCHES "^.*dirty.*$")
  415. set(STORM_CUDAPLUGIN_VERSION_DIRTY 1)
  416. else()
  417. set(STORM_CUDAPLUGIN_VERSION_DIRTY 0)
  418. endif()
  419. message(STATUS "StoRM (CudaPlugin) - Version information: ${STORM_CUDAPLUGIN_VERSION_MAJOR}.${STORM_CUDAPLUGIN_VERSION_MINOR}.${STORM_CUDAPLUGIN_VERSION_PATCH} (${STORM_CUDAPLUGIN_VERSION_COMMITS_AHEAD} commits ahead of Tag) build from ${STORM_CUDAPLUGIN_VERSION_HASH} (Dirty: ${STORM_CUDAPLUGIN_VERSION_DIRTY})")
  420. # Configure a header file to pass some of the CMake settings to the source code
  421. configure_file (
  422. "${PROJECT_SOURCE_DIR}/cuda/storm-cudaplugin-config.h.in"
  423. "${PROJECT_BINARY_DIR}/include/storm-cudaplugin-config.h"
  424. )
  425. #create library
  426. find_package(CUDA REQUIRED)
  427. set(CUSP_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/resources/3rdparty/cusplibrary")
  428. find_package(Cusp REQUIRED)
  429. find_package(Thrust REQUIRED)
  430. set(STORM_CUDA_LIB_NAME "storm-cuda")
  431. file(GLOB_RECURSE STORM_CUDA_KERNEL_FILES ${PROJECT_SOURCE_DIR}/cuda/kernels/*.cu)
  432. file(GLOB_RECURSE STORM_CUDA_HEADER_FILES ${PROJECT_SOURCE_DIR}/cuda/kernels/*.h)
  433. source_group(kernels FILES ${STORM_CUDA_KERNEL_FILES} ${STORM_CUDA_HEADER_FILES})
  434. include_directories(${PROJECT_SOURCE_DIR}/cuda/kernels/)
  435. #set(CUDA_PROPAGATE_HOST_FLAGS OFF)
  436. set(CUDA_NVCC_FLAGS "-arch=sm_30")
  437. #############################################################
  438. ##
  439. ## CUSP
  440. ##
  441. #############################################################
  442. if(CUSP_FOUND)
  443. include_directories(${CUSP_INCLUDE_DIR})
  444. cuda_include_directories(${CUSP_INCLUDE_DIR})
  445. message(STATUS "StoRM (CudaPlugin) - Found CUSP Version ${CUSP_VERSION} in location ${CUSP_INCLUDE_DIR}")
  446. else()
  447. message(FATAL_ERROR "StoRM (CudaPlugin) - Could not find CUSP!")
  448. endif()
  449. #############################################################
  450. ##
  451. ## Thrust
  452. ##
  453. #############################################################
  454. if(THRUST_FOUND)
  455. include_directories(${THRUST_INCLUDE_DIR})
  456. cuda_include_directories(${THRUST_INCLUDE_DIR})
  457. message(STATUS "StoRM (CudaPlugin) - Found Thrust Version ${THRUST_VERSION} in location ${THRUST_INCLUDE_DIR}")
  458. else()
  459. message(FATAL_ERROR "StoRM (CudaPlugin) - Could not find Thrust! Check your CUDA installation.")
  460. endif()
  461. include_directories(${CUDA_INCLUDE_DIRS})
  462. include_directories(${ADDITIONAL_INCLUDE_DIRS})
  463. cuda_add_library(${STORM_CUDA_LIB_NAME}
  464. ${STORM_CUDA_KERNEL_FILES} ${STORM_CUDA_HEADER_FILES}
  465. )
  466. message (STATUS "StoRM - Linking with CUDA")
  467. list(APPEND STORM_LINK_LIBRARIES ${STORM_CUDA_LIB_NAME})
  468. include_directories("${PROJECT_SOURCE_DIR}/cuda/kernels/")
  469. endif()