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.

555 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.57.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 -DCMAKE_CXX_COMPILER=${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. add_dependencies(resources xercesc)
  173. include_directories(${STORM_3RDPARTY_BINARY_DIR}/carl/include)
  174. list(APPEND STORM_LINK_LIBRARIES ${STORM_3RDPARTY_BINARY_DIR}/carl/lib/libcarl${DYNAMIC_EXT})
  175. set(STORM_HAVE_CARL ON)
  176. endif()
  177. endif()
  178. #############################################################
  179. ##
  180. ## SMT-RAT
  181. ##
  182. #############################################################
  183. # No find routine yet
  184. #find_package(smtrat QUIET)
  185. # Not yet supported
  186. set(smtrat_FOUND OFF)
  187. set(STORM_HAVE_SMTRAT OFF)
  188. if(smtrat_FOUND)
  189. set(STORM_HAVE_SMTRAT ON)
  190. message(STATUS "StoRM - Linking with smtrat.")
  191. include_directories("${smtrat_INCLUDE_DIR}")
  192. list(APPEND STORM_LINK_LIBRARIES ${smtrat_LIBRARIES})
  193. endif()
  194. #############################################################
  195. ##
  196. ## GiNaC
  197. ##
  198. #############################################################
  199. find_package(GiNaC QUIET)
  200. if(GINAC_FOUND)
  201. set(STORM_HAVE_GINAC ON)
  202. message(STATUS "StoRM - Linking with GiNaC ${GINAC_VERSION_STRING}")
  203. # Right now only link with GiNaC for carl
  204. #include_directories("${GINAC_INCLUDE_DIR}")
  205. list(APPEND STORM_LINK_LIBRARIES ${GINAC_LIBRARIES})
  206. else()
  207. set(STORM_HAVE_GINAC OFF)
  208. #TODO: Check if CARL actually requires the use of GiNaC
  209. endif()
  210. #############################################################
  211. ##
  212. ## gmp
  213. ##
  214. #############################################################
  215. # GMP is optional (unless MathSAT is used, see below)
  216. find_package(GMP QUIET)
  217. #############################################################
  218. ##
  219. ## MathSAT (optional)
  220. ##
  221. #############################################################
  222. if ("${MSAT_ROOT}" STREQUAL "")
  223. set(ENABLE_MSAT OFF)
  224. else()
  225. set(ENABLE_MSAT ON)
  226. endif()
  227. # MathSAT Defines
  228. set(STORM_HAVE_MSAT ${ENABLE_MSAT})
  229. if (ENABLE_MSAT)
  230. message (STATUS "StoRM - Linking with MathSAT")
  231. link_directories("${MSAT_ROOT}/lib")
  232. include_directories("${MSAT_ROOT}/include")
  233. list(APPEND STORM_LINK_LIBRARIES "mathsat")
  234. if(GMP_FOUND)
  235. include_directories("${GMP_INCLUDE_DIR}")
  236. list(APPEND STORM_LINK_LIBRARIES "gmp")
  237. elseif(MPIR_FOUND)
  238. include_directories("${GMP_INCLUDE_DIR}")
  239. list(APPEND STORM_LINK_LIBRARIES "mpir" "mpirxx")
  240. else(GMP_FOUND)
  241. message(FATAL_ERROR "GMP is required for MathSAT, but was not found!")
  242. endif(GMP_FOUND)
  243. endif(ENABLE_MSAT)
  244. #############################################################
  245. ##
  246. ## Xerces
  247. ##
  248. #############################################################
  249. include(${STORM_3RDPARTY_SOURCE_DIR}/include_xerces.cmake)
  250. #############################################################
  251. ##
  252. ## Sylvan
  253. ##
  254. #############################################################
  255. ExternalProject_Add(
  256. sylvan
  257. DOWNLOAD_COMMAND ""
  258. PREFIX "sylvan"
  259. SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/sylvan
  260. CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DSYLVAN_BUILD_TEST=Off -DSYLVAN_BUILD_EXAMPLES=Off -DCMAKE_BUILD_TYPE=Release
  261. BINARY_DIR "${PROJECT_BINARY_DIR}/sylvan"
  262. BUILD_IN_SOURCE 0
  263. INSTALL_COMMAND ""
  264. INSTALL_DIR "${STORM_3RDPARTY_BINARY_DIR}/sylvan"
  265. LOG_CONFIGURE ON
  266. LOG_BUILD ON
  267. )
  268. ExternalProject_Get_Property(sylvan source_dir)
  269. ExternalProject_Get_Property(sylvan binary_dir)
  270. set(Sylvan_INCLUDE_DIR "${source_dir}/src")
  271. set(Sylvan_LIBRARY "${binary_dir}/src/libsylvan.a")
  272. message(STATUS "StoRM - Using shipped version of sylvan")
  273. message(STATUS "StoRM - Linking with sylvan")
  274. include_directories("${Sylvan_INCLUDE_DIR}")
  275. list(APPEND STORM_LINK_LIBRARIES ${Sylvan_LIBRARY})
  276. add_dependencies(resources sylvan)
  277. if(${OPERATING_SYSTEM} MATCHES "Linux")
  278. find_package(Hwloc QUIET REQUIRED)
  279. if(Hwloc_FOUND)
  280. message(STATUS "StoRM - Linking with hwloc ${Hwloc_VERSION}")
  281. list(APPEND STORM_LINK_LIBRARIES ${Hwloc_LIBRARIES})
  282. else()
  283. message(FATAL_ERROR "HWLOC is required but was not found.")
  284. endif()
  285. endif()
  286. #############################################################
  287. ##
  288. ## Google Test gtest
  289. ##
  290. #############################################################
  291. ExternalProject_Add(
  292. googletest
  293. #For downloads (may be useful later!)
  294. #SVN_REPOSITORY http://googletest.googlecode.com/svn/trunk/
  295. #TIMEOUT 10
  296. DOWNLOAD_COMMAND ""
  297. SOURCE_DIR "${STORM_3RDPARTY_SOURCE_DIR}/gtest-1.7.0"
  298. # Force the same output paths for debug and release builds so that
  299. # we know in which place the binaries end up when using the Xcode generator
  300. CMAKE_ARGS -Dgtest_force_shared_crt=ON -DCMAKE_CXX_COMPILER=${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
  301. # Disable install step
  302. INSTALL_COMMAND ""
  303. BINARY_DIR "${STORM_3RDPARTY_BINARY_DIR}/gtest-1.7.0"
  304. INSTALL_DIR "${STORM_3RDPARTY_BINARY_DIR}/gtest-1.7.0"
  305. # Wrap download, configure and build steps in a script to log output
  306. LOG_CONFIGURE ON
  307. LOG_BUILD ON)
  308. # Specify include dir
  309. ExternalProject_Get_Property(googletest source_dir)
  310. set(GTEST_INCLUDE_DIR ${source_dir}/include)
  311. # Specify MainTest's link libraries
  312. ExternalProject_Get_Property(googletest binary_dir)
  313. set(GTEST_LIBRARIES ${binary_dir}/libgtest.a ${binary_dir}/libgtest_main.a)
  314. add_dependencies(test-resources googletest)
  315. list(APPEND STORM_TEST_LINK_LIBRARIES ${GTEST_LIBRARIES})
  316. #############################################################
  317. ##
  318. ## Intel Threading Building Blocks (optional)
  319. ##
  320. #############################################################
  321. set(STORM_HAVE_INTELTBB OFF)
  322. if (STORM_USE_INTELTBB)
  323. # Point to shipped TBB directory
  324. set(TBB_INSTALL_DIR "${PROJECT_SOURCE_DIR}/resources/3rdparty/tbb42_20140122_merged-win-lin-mac")
  325. find_package(TBB QUIET REQUIRED)
  326. if (TBB_FOUND)
  327. message(STATUS "StoRM - Found Intel TBB with interface version ${TBB_INTERFACE_VERSION}.")
  328. message(STATUS "StoRM - Linking with Intel TBB in ${TBB_LIBRARY_DIRS}.")
  329. set(STORM_HAVE_INTELTBB ON)
  330. link_directories(${TBB_LIBRARY_DIRS})
  331. include_directories(${TBB_INCLUDE_DIRS})
  332. list(APPEND STORM_LINK_LIBRARIES tbb tbbmalloc)
  333. else(TBB_FOUND)
  334. message(FATAL_ERROR "StoRM - TBB was requested, but not found!")
  335. endif(TBB_FOUND)
  336. endif(STORM_USE_INTELTBB)
  337. #############################################################
  338. ##
  339. ## Threads
  340. ##
  341. #############################################################
  342. find_package(Threads QUIET REQUIRED)
  343. if (NOT Threads_FOUND)
  344. message(FATAL_ERROR "StoRM - Threads was requested, but not found!")
  345. endif()
  346. include_directories(${THREADS_INCLUDE_DIRS})
  347. list(APPEND STORM_LINK_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
  348. if (STORM_USE_COTIRE)
  349. target_link_libraries(storm_unity ${CMAKE_THREAD_LIBS_INIT})
  350. endif(STORM_USE_COTIRE)
  351. if (MSVC)
  352. # Add the DebugHelper DLL
  353. set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} Dbghelp.lib")
  354. target_link_libraries(storm "Dbghelp.lib")
  355. endif(MSVC)
  356. #############################################################
  357. ##
  358. ## CUDA Library generation
  359. ##
  360. #############################################################
  361. if ("${CUDA_ROOT}" STREQUAL "")
  362. set(ENABLE_CUDA OFF)
  363. else()
  364. set(ENABLE_CUDA ON)
  365. endif()
  366. # CUDA Defines
  367. if (ENABLE_CUDA)
  368. set(STORM_CPP_CUDA_DEF "define")
  369. else()
  370. set(STORM_CPP_CUDA_DEF "undef")
  371. endif()
  372. # CUDA Defines
  373. set(STORM_CPP_CUDAFORSTORM_DEF "undef")
  374. if(ENABLE_CUDA)
  375. # Test for type alignment
  376. try_run(STORM_CUDA_RUN_RESULT_TYPEALIGNMENT STORM_CUDA_COMPILE_RESULT_TYPEALIGNMENT
  377. ${PROJECT_BINARY_DIR} "${PROJECT_SOURCE_DIR}/cuda/CMakeAlignmentCheck.cpp"
  378. COMPILE_OUTPUT_VARIABLE OUTPUT_TEST_VAR
  379. )
  380. if(NOT STORM_CUDA_COMPILE_RESULT_TYPEALIGNMENT)
  381. 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}")
  382. elseif(STORM_CUDA_RUN_RESULT_TYPEALIGNMENT EQUAL 0)
  383. message(STATUS "StoRM (CudaPlugin) - Result of Type Alignment Check: OK.")
  384. else()
  385. message(FATAL_ERROR "StoRM (CudaPlugin) - Result of Type Alignment Check: FAILED (Code ${STORM_CUDA_RUN_RESULT_TYPEALIGNMENT})")
  386. endif()
  387. # Test for Float 64bit Alignment
  388. try_run(STORM_CUDA_RUN_RESULT_FLOATALIGNMENT STORM_CUDA_COMPILE_RESULT_FLOATALIGNMENT
  389. ${PROJECT_BINARY_DIR} "${PROJECT_SOURCE_DIR}/cuda/CMakeFloatAlignmentCheck.cpp"
  390. COMPILE_OUTPUT_VARIABLE OUTPUT_TEST_VAR
  391. )
  392. if(NOT STORM_CUDA_COMPILE_RESULT_FLOATALIGNMENT)
  393. 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}")
  394. elseif(STORM_CUDA_RUN_RESULT_FLOATALIGNMENT EQUAL 2)
  395. message(STATUS "StoRM (CudaPlugin) - Result of Float Type Alignment Check: 64bit alignment active.")
  396. set(STORM_CUDAPLUGIN_FLOAT_64BIT_ALIGN_DEF "define")
  397. elseif(STORM_CUDA_RUN_RESULT_FLOATALIGNMENT EQUAL 3)
  398. message(STATUS "StoRM (CudaPlugin) - Result of Float Type Alignment Check: 64bit alignment disabled.")
  399. set(STORM_CUDAPLUGIN_FLOAT_64BIT_ALIGN_DEF "undef")
  400. else()
  401. message(FATAL_ERROR "StoRM (CudaPlugin) - Result of Float Type Alignment Check: FAILED (Code ${STORM_CUDA_RUN_RESULT_FLOATALIGNMENT})")
  402. endif()
  403. #
  404. # Make a version file containing the current version from git.
  405. #
  406. include(GetGitRevisionDescription)
  407. git_describe_checkout(STORM_GIT_VERSION_STRING)
  408. # Parse the git Tag into variables
  409. string(REGEX REPLACE "^([0-9]+)\\..*" "\\1" STORM_CUDAPLUGIN_VERSION_MAJOR "${STORM_GIT_VERSION_STRING}")
  410. string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" STORM_CUDAPLUGIN_VERSION_MINOR "${STORM_GIT_VERSION_STRING}")
  411. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" STORM_CUDAPLUGIN_VERSION_PATCH "${STORM_GIT_VERSION_STRING}")
  412. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-([0-9]+)\\-.*" "\\1" STORM_CUDAPLUGIN_VERSION_COMMITS_AHEAD "${STORM_GIT_VERSION_STRING}")
  413. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-([a-z0-9]+).*" "\\1" STORM_CUDAPLUGIN_VERSION_HASH "${STORM_GIT_VERSION_STRING}")
  414. string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-[a-z0-9]+\\-(.*)" "\\1" STORM_CUDAPLUGIN_VERSION_APPENDIX "${STORM_GIT_VERSION_STRING}")
  415. if ("${STORM_CUDAPLUGIN_VERSION_APPENDIX}" MATCHES "^.*dirty.*$")
  416. set(STORM_CUDAPLUGIN_VERSION_DIRTY 1)
  417. else()
  418. set(STORM_CUDAPLUGIN_VERSION_DIRTY 0)
  419. endif()
  420. 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})")
  421. # Configure a header file to pass some of the CMake settings to the source code
  422. configure_file (
  423. "${PROJECT_SOURCE_DIR}/cuda/storm-cudaplugin-config.h.in"
  424. "${PROJECT_BINARY_DIR}/include/storm-cudaplugin-config.h"
  425. )
  426. #create library
  427. find_package(CUDA REQUIRED)
  428. set(CUSP_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/resources/3rdparty/cusplibrary")
  429. find_package(Cusp REQUIRED)
  430. find_package(Thrust REQUIRED)
  431. set(STORM_CUDA_LIB_NAME "storm-cuda")
  432. file(GLOB_RECURSE STORM_CUDA_KERNEL_FILES ${PROJECT_SOURCE_DIR}/cuda/kernels/*.cu)
  433. file(GLOB_RECURSE STORM_CUDA_HEADER_FILES ${PROJECT_SOURCE_DIR}/cuda/kernels/*.h)
  434. source_group(kernels FILES ${STORM_CUDA_KERNEL_FILES} ${STORM_CUDA_HEADER_FILES})
  435. include_directories(${PROJECT_SOURCE_DIR}/cuda/kernels/)
  436. #set(CUDA_PROPAGATE_HOST_FLAGS OFF)
  437. set(CUDA_NVCC_FLAGS "-arch=sm_30")
  438. #############################################################
  439. ##
  440. ## CUSP
  441. ##
  442. #############################################################
  443. if(CUSP_FOUND)
  444. include_directories(${CUSP_INCLUDE_DIR})
  445. cuda_include_directories(${CUSP_INCLUDE_DIR})
  446. message(STATUS "StoRM (CudaPlugin) - Found CUSP Version ${CUSP_VERSION} in location ${CUSP_INCLUDE_DIR}")
  447. else()
  448. message(FATAL_ERROR "StoRM (CudaPlugin) - Could not find CUSP!")
  449. endif()
  450. #############################################################
  451. ##
  452. ## Thrust
  453. ##
  454. #############################################################
  455. if(THRUST_FOUND)
  456. include_directories(${THRUST_INCLUDE_DIR})
  457. cuda_include_directories(${THRUST_INCLUDE_DIR})
  458. message(STATUS "StoRM (CudaPlugin) - Found Thrust Version ${THRUST_VERSION} in location ${THRUST_INCLUDE_DIR}")
  459. else()
  460. message(FATAL_ERROR "StoRM (CudaPlugin) - Could not find Thrust! Check your CUDA installation.")
  461. endif()
  462. include_directories(${CUDA_INCLUDE_DIRS})
  463. include_directories(${ADDITIONAL_INCLUDE_DIRS})
  464. cuda_add_library(${STORM_CUDA_LIB_NAME}
  465. ${STORM_CUDA_KERNEL_FILES} ${STORM_CUDA_HEADER_FILES}
  466. )
  467. message (STATUS "StoRM - Linking with CUDA")
  468. list(APPEND STORM_LINK_LIBRARIES ${STORM_CUDA_LIB_NAME})
  469. include_directories("${PROJECT_SOURCE_DIR}/cuda/kernels/")
  470. endif()