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