@ -20,6 +20,7 @@ include(ExternalProject)
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
option ( STORM_DEVELOPER "Sets whether the development mode is used" OFF )
option ( STORM_USE_POPCNT "Sets whether the popcnt instruction is going to be used." ON )
MARK_AS_ADVANCED ( STORM_USE_POPCNT )
option ( USE_BOOST_STATIC_LIBRARIES "Sets whether the Boost libraries should be linked statically." ON )
option ( STORM_USE_INTELTBB "Sets whether the Intel TBB libraries should be used." OFF )
option ( STORM_USE_GUROBI "Sets whether Gurobi should be used." OFF )
@ -29,8 +30,10 @@ option(USE_LIBCXX "Sets whether the standard library is libc++." OFF)
option ( USE_CARL "Sets whether carl should be included." ON )
option ( USE_XERCES "Sets whether xerces should be used." OFF )
option ( FORCE_COLOR "Force color output" OFF )
mark_as_advanced ( FORCE_COLOR )
option ( STORM_PYTHON "Builds the API for Python" OFF )
option ( STORM_COMPILE_WITH_CCACHE "Compile using CCache" ON )
option ( STORM_COMPILE_WITH_CCACHE "Compile using CCache [if found]" ON )
mark_as_advanced ( STORM_COMPILE_WITH_CCACHE )
option ( STORM_LOG_DISABLE_DEBUG "Disable log and trace message support" OFF )
set ( BOOST_ROOT "" CACHE STRING "A hint to the root directory of Boost (optional)." )
set ( GUROBI_ROOT "" CACHE STRING "A hint to the root directory of Gurobi (optional)." )
@ -40,6 +43,12 @@ set(MSAT_ROOT "" CACHE STRING "The hint to the root directory of MathSAT (option
set ( ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "Additional directories added to the include directories." )
set ( ADDITIONAL_LINK_DIRS "" CACHE STRING "Additional directories added to the link directories." )
# S e t s o m e C M A K E V a r i a b l e s a s a d v a n c e d
mark_as_advanced ( CMAKE_OSX_ARCHITECTURES )
mark_as_advanced ( CMAKE_OSX_SYSROOT )
mark_as_advanced ( CMAKE_OSX_DEPLOYMENT_TARGET )
# I f t h e S T O R M _ D E V E L O P E R o p t i o n w a s t u r n e d o n , w e w i l l t a r g e t a d e b u g v e r s i o n .
if ( STORM_DEVELOPER )
message ( STATUS "StoRM - Using development mode" )
@ -50,6 +59,7 @@ message(STATUS "StoRM - Building ${CMAKE_BUILD_TYPE} version.")
if ( STORM_COMPILE_WITH_CCACHE )
find_program ( CCACHE_FOUND ccache )
mark_as_advanced ( CCACHE_FOUND )
if ( CCACHE_FOUND )
message ( STATUS "StoRM - Using ccache" )
set_property ( GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache )
@ -198,517 +208,7 @@ message(STATUS "StoRM - Using Compiler Configuration: ${STORM_COMPILED_BY}")
# I n 3 r d p a r t y , t a r g e t s a r e b e i n g d e f i n e d t h a t c a n b e u s e d
# i n t h e t h e s y s t e m d o e s n o t h a v e a l i b r a r y
add_subdirectory ( resources/3rdparty )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # l 3 p p
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# l 3 p p i s s e t u p a s e x t e r n a l p r o j e c t
include_directories ( ${ l3pp_INCLUDE } )
add_dependencies ( resources l3pp )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # g m m
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# A d d t h e s h i p p e d v e r s i o n o f G M M t o t h e i n c l u d e p a t h e s
set ( GMMXX_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/resources/3rdparty/gmm-5.0/include" )
include_directories ( ${ GMMXX_INCLUDE_DIR } )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # E i g e n
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# A d d t h e s h i p p e d v e r s i o n o f E i g e n t o t h e i n c l u d e p a t h e s
set ( EIGEN_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/resources/3rdparty/eigen-3.3-beta1" )
include_directories ( ${ EIGEN_INCLUDE_DIR } )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # g m p
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# G M P i s optional ( unless MathSAT is used, see below )
find_package ( GMP QUIET )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # B o o s t
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# B o o s t O p t i o n v a r i a b l e s
set ( Boost_USE_STATIC_LIBS ${ USE_BOOST_STATIC_LIBRARIES } )
set ( Boost_USE_MULTITHREADED ON )
set ( Boost_USE_STATIC_RUNTIME OFF )
find_package ( Boost 1.56.0 QUIET REQUIRED )
if ( ( NOT Boost_LIBRARY_DIRS ) OR ( "${Boost_LIBRARY_DIRS}" STREQUAL "" ) )
set ( Boost_LIBRARY_DIRS "${Boost_INCLUDE_DIRS}/stage/lib" )
endif ( )
link_directories ( ${ Boost_LIBRARY_DIRS } )
include_directories ( ${ Boost_INCLUDE_DIRS } )
list ( APPEND STORM_LINK_LIBRARIES ${ Boost_LIBRARIES } )
message ( STATUS "StoRM - Using Boost ${Boost_VERSION} (lib ${Boost_LIB_VERSION})" )
# message ( STATUS "StoRM - BOOST_INCLUDE_DIRS is ${Boost_INCLUDE_DIRS}" )
# message ( STATUS "StoRM - BOOST_LIBRARY_DIRS is ${Boost_LIBRARY_DIRS}" )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # E x p r T k
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# U s e t h e s h i p p e d v e r s i o n o f E x p r T K
message ( STATUS "StoRM - Including ExprTk" )
include_directories ( "${PROJECT_SOURCE_DIR}/resources/3rdparty/exprtk" )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # M o d e r n J S O N
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# u s e t h e s h i p p e d v e r s i o n o f m o d e r n j s o n
message ( STATUS "StoRM - Including ModernJSON" )
include_directories ( "${PROJECT_SOURCE_DIR}/resources/3rdparty/modernjson/src/" )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # Z3 ( optional )
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
find_package ( Z3 QUIET )
# Z 3 D e f i n e s
set ( STORM_HAVE_Z3 ${ Z3_FOUND } )
if ( Z3_FOUND )
message ( STATUS "StoRM - Linking with Z3" )
include_directories ( ${ Z3_INCLUDE_DIRS } )
list ( APPEND STORM_LINK_LIBRARIES ${ Z3_LIBRARIES } )
endif ( Z3_FOUND )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # g l p k
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
find_package ( GLPK QUIET )
if ( GLPK_FOUND )
message ( STATUS "StoRM - Using system version of GLPK" )
else ( )
message ( STATUS "StoRM - Using shipped version of GLPK" )
set ( GLPK_LIBRARIES ${ CMAKE_BINARY_DIR } /resources/3rdparty/glpk-4.57/lib/libglpk ${ DYNAMIC_EXT } )
set ( GLPK_INCLUDE_DIR ${ CMAKE_BINARY_DIR } /resources/3rdparty/glpk-4.57/include )
set ( GLPK_VERSION_STRING 4.57 )
add_dependencies ( resources glpk )
endif ( )
# S i n c e t h e r e i s a s h i p p e d v e r s i o n , a l w a y s u s e G L P K
set ( STORM_HAVE_GLPK ON )
message ( STATUS "StoRM - Linking with glpk ${GLPK_VERSION_STRING}" )
include_directories ( ${ GLPK_INCLUDE_DIR } )
list ( APPEND STORM_LINK_LIBRARIES ${ GLPK_LIBRARIES } )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # Gurobi ( optional )
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
if ( STORM_USE_GUROBI )
find_package ( Gurobi QUIET REQUIRED )
set ( STORM_HAVE_GUROBI ${ GUROBI_FOUND } )
if ( GUROBI_FOUND )
message ( STATUS "StoRM - Linking with Gurobi" )
include_directories ( ${ GUROBI_INCLUDE_DIRS } )
list ( APPEND STORM_LINK_LIBRARIES ${ GUROBI_LIBRARY } )
# link_directories ( "${GUROBI_ROOT}/lib" )
else ( )
# message ( FATAL_ERROR "StoRM - Gurobi was requested, but not found!" )
endif ( )
else ( )
set ( STORM_HAVE_GUROBI OFF )
endif ( )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # C U D D
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# D o n o t u s e s y s t e m C U D D , S t o R M h a s a m o d i f i e d v e r s i o n
set ( CUDD_INCLUDE_DIR ${ CMAKE_BINARY_DIR } /resources/3rdparty/cudd-3.0.0/include )
set ( CUDD_SHARED_LIBRARY ${ CMAKE_BINARY_DIR } /resources/3rdparty/cudd-3.0.0/lib/libcudd ${ DYNAMIC_EXT } )
set ( CUDD_STATIC_LIBRARY ${ CMAKE_BINARY_DIR } /resources/3rdparty/cudd-3.0.0/lib/libcudd ${ STATIC_EXT } )
set ( CUDD_VERSION_STRING 3.0.0 )
list ( APPEND STORM_LINK_LIBRARIES ${ CUDD_SHARED_LIBRARY } )
add_dependencies ( resources cudd3 )
message ( STATUS "StoRM - Linking with CUDD ${CUDD_VERSION_STRING}" )
# message ( "StoRM - CUDD include dir: ${CUDD_INCLUDE_DIR}" )
include_directories ( ${ CUDD_INCLUDE_DIR } )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # C L N
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
find_package ( CLN QUIET )
set ( STORM_USE_CLN_NUMBERS OFF )
if ( CLN_FOUND )
set ( STORM_HAVE_CLN ON )
set ( STORM_USE_CLN_NUMBERS ON )
message ( STATUS "StoRM - Linking with CLN ${CLN_VERSION_STRING}" )
include_directories ( "${CLN_INCLUDE_DIR}" )
list ( APPEND STORM_LINK_LIBRARIES ${ CLN_LIBRARIES } )
else ( )
set ( STORM_HAVE_CLN OFF )
if ( NOT GMP_FOUND )
message ( FATAL_ERROR "StoRM - Neither CLN nor GMP found" )
endif ( )
endif ( )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # c a r l
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
set ( STORM_HAVE_CARL OFF )
if ( USE_CARL )
find_package ( carl QUIET REQUIRED )
if ( carl_FOUND )
set ( STORM_HAVE_CARL ON )
message ( STATUS "StoRM - Linking with carl ${carl_VERSION_STRING}" )
include_directories ( "${carl_INCLUDE_DIR}" )
list ( APPEND STORM_LINK_LIBRARIES ${ carl_LIBRARIES } )
else ( )
message ( FATAL_ERROR "StoRM - CARL was requested but not found" )
endif ( )
endif ( )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # S M T - R A T
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# N o f i n d r o u t i n e y e t
# find_package ( smtrat QUIET )
# N o t y e t s u p p o r t e d
set ( smtrat_FOUND OFF )
set ( STORM_HAVE_SMTRAT OFF )
if ( smtrat_FOUND )
set ( STORM_HAVE_SMTRAT ON )
message ( STATUS "StoRM - Linking with smtrat." )
include_directories ( "${smtrat_INCLUDE_DIR}" )
list ( APPEND STORM_LINK_LIBRARIES ${ smtrat_LIBRARIES } )
endif ( )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # G i N a C
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
find_package ( GiNaC QUIET )
if ( GINAC_FOUND )
set ( STORM_HAVE_GINAC ON )
message ( STATUS "StoRM - Linking with GiNaC ${GINAC_VERSION_STRING}" )
# R i g h t n o w o n l y l i n k w i t h G i N a C f o r c a r l
# include_directories ( "${GINAC_INCLUDE_DIR}" )
list ( APPEND STORM_LINK_LIBRARIES ${ GINAC_LIBRARIES } )
else ( )
set ( STORM_HAVE_GINAC OFF )
# T O D O : C h e c k i f C A R L a c t u a l l y r e q u i r e s t h e u s e o f G i N a C
endif ( )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # MathSAT ( optional )
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
if ( "${MSAT_ROOT}" STREQUAL "" )
set ( ENABLE_MSAT OFF )
else ( )
set ( ENABLE_MSAT ON )
endif ( )
# M a t h S A T D e f i n e s
set ( STORM_HAVE_MSAT ${ ENABLE_MSAT } )
if ( ENABLE_MSAT )
message ( STATUS "StoRM - Linking with MathSAT" )
link_directories ( "${MSAT_ROOT}/lib" )
include_directories ( "${MSAT_ROOT}/include" )
list ( APPEND STORM_LINK_LIBRARIES "mathsat" )
if ( GMP_FOUND )
include_directories ( "${GMP_INCLUDE_DIR}" )
list ( APPEND STORM_LINK_LIBRARIES "gmp" )
elseif ( MPIR_FOUND )
include_directories ( "${GMP_INCLUDE_DIR}" )
list ( APPEND STORM_LINK_LIBRARIES "mpir" "mpirxx" )
else ( GMP_FOUND )
message ( FATAL_ERROR "GMP is required for MathSAT, but was not found!" )
endif ( GMP_FOUND )
endif ( ENABLE_MSAT )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # X e r c e s
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
find_package ( Xerces QUIET REQUIRED )
if ( XERCES_FOUND )
message ( STATUS "StoRM - Use system version of xerces" )
else ( )
message ( STATUS "StoRM - Use shipped version of xerces" )
set ( XERCES_ROOT ${ CMAKE_BINARY_DIR } /resources/3rdparty/xercesc-3.1.2 )
set ( XERCESC_INCLUDE ${ XERCES_ROOT } /include )
set ( XERCES_LIBRARY_PATH ${ XERCES_ROOT } /lib )
set ( XERCESC_LIBRARIES ${ XERCES_LIBRARY_PATH } /libxerces-c.a )
add_dependencies ( resources xercesc )
endif ( )
message ( STATUS "StoRM - Linking with xercesc" )
set ( STORM_HAVE_XERCES ON )
include_directories ( ${ XERCESC_INCLUDE } )
list ( APPEND STORM_LINK_LIBRARIES ${ XERCESC_LIBRARIES } )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # S y l v a n
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
message ( STATUS "StoRM - Using shipped version of sylvan" )
message ( STATUS "StoRM - Linking with sylvan" )
include_directories ( "${Sylvan_INCLUDE_DIR}" )
list ( APPEND STORM_LINK_LIBRARIES ${ Sylvan_LIBRARY } )
add_dependencies ( resources sylvan )
if ( ${ OPERATING_SYSTEM } MATCHES "Linux" )
find_package ( Hwloc QUIET REQUIRED )
if ( Hwloc_FOUND )
message ( STATUS "StoRM - Linking with hwloc ${Hwloc_VERSION}" )
list ( APPEND STORM_LINK_LIBRARIES ${ Hwloc_LIBRARIES } )
else ( )
message ( FATAL_ERROR "HWLOC is required but was not found." )
endif ( )
endif ( )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # G o o g l e T e s t g t e s t
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
add_dependencies ( test-resources googletest )
list ( APPEND STORM_TEST_LINK_LIBRARIES ${ GTEST_LIBRARIES } )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # I n t e l T h r e a d i n g B u i l d i n g Blocks ( optional )
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
set ( STORM_HAVE_INTELTBB OFF )
if ( STORM_USE_INTELTBB )
# P o i n t t o s h i p p e d T B B d i r e c t o r y
set ( TBB_INSTALL_DIR "${PROJECT_SOURCE_DIR}/resources/3rdparty/tbb42_20140122_merged-win-lin-mac" )
find_package ( TBB QUIET REQUIRED )
if ( TBB_FOUND )
message ( STATUS "StoRM - Found Intel TBB with interface version ${TBB_INTERFACE_VERSION}." )
message ( STATUS "StoRM - Linking with Intel TBB in ${TBB_LIBRARY_DIRS}." )
set ( STORM_HAVE_INTELTBB ON )
link_directories ( ${ TBB_LIBRARY_DIRS } )
include_directories ( ${ TBB_INCLUDE_DIRS } )
list ( APPEND STORM_LINK_LIBRARIES tbb tbbmalloc )
else ( TBB_FOUND )
message ( FATAL_ERROR "StoRM - TBB was requested, but not found!" )
endif ( TBB_FOUND )
endif ( STORM_USE_INTELTBB )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # T h r e a d s
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
find_package ( Threads QUIET REQUIRED )
if ( NOT Threads_FOUND )
message ( FATAL_ERROR "StoRM - Threads was requested, but not found!" )
endif ( )
include_directories ( ${ THREADS_INCLUDE_DIRS } )
list ( APPEND STORM_LINK_LIBRARIES ${ CMAKE_THREAD_LIBS_INIT } )
if ( STORM_USE_COTIRE )
target_link_libraries ( storm_unity ${ CMAKE_THREAD_LIBS_INIT } )
endif ( STORM_USE_COTIRE )
if ( MSVC )
# A d d t h e D e b u g H e l p e r D L L
set ( CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} Dbghelp.lib" )
target_link_libraries ( storm "Dbghelp.lib" )
endif ( MSVC )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # C U D A L i b r a r y g e n e r a t i o n
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
if ( "${CUDA_ROOT}" STREQUAL "" )
set ( ENABLE_CUDA OFF )
else ( )
set ( ENABLE_CUDA ON )
endif ( )
# C U D A D e f i n e s
if ( ENABLE_CUDA )
set ( STORM_CPP_CUDA_DEF "define" )
else ( )
set ( STORM_CPP_CUDA_DEF "undef" )
endif ( )
# C U D A D e f i n e s
set ( STORM_CPP_CUDAFORSTORM_DEF "undef" )
if ( ENABLE_CUDA )
# T e s t f o r t y p e a l i g n m e n t
try_run ( STORM_CUDA_RUN_RESULT_TYPEALIGNMENT STORM_CUDA_COMPILE_RESULT_TYPEALIGNMENT
$ { P R O J E C T _ B I N A R Y _ D I R } " $ { P R O J E C T _ S O U R C E _ D I R } / c u d a / C M a k e A l i g n m e n t C h e c k . c p p "
C O M P I L E _ O U T P U T _ V A R I A B L E O U T P U T _ T E S T _ V A R
)
if ( NOT STORM_CUDA_COMPILE_RESULT_TYPEALIGNMENT )
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}" )
elseif ( STORM_CUDA_RUN_RESULT_TYPEALIGNMENT EQUAL 0 )
message ( STATUS "StoRM (CudaPlugin) - Result of Type Alignment Check: OK." )
else ( )
message ( FATAL_ERROR "StoRM (CudaPlugin) - Result of Type Alignment Check: FAILED (Code ${STORM_CUDA_RUN_RESULT_TYPEALIGNMENT})" )
endif ( )
# T e s t f o r F l o a t 6 4 b i t A l i g n m e n t
try_run ( STORM_CUDA_RUN_RESULT_FLOATALIGNMENT STORM_CUDA_COMPILE_RESULT_FLOATALIGNMENT
$ { P R O J E C T _ B I N A R Y _ D I R } " $ { P R O J E C T _ S O U R C E _ D I R } / c u d a / C M a k e F l o a t A l i g n m e n t C h e c k . c p p "
C O M P I L E _ O U T P U T _ V A R I A B L E O U T P U T _ T E S T _ V A R
)
if ( NOT STORM_CUDA_COMPILE_RESULT_FLOATALIGNMENT )
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}" )
elseif ( STORM_CUDA_RUN_RESULT_FLOATALIGNMENT EQUAL 2 )
message ( STATUS "StoRM (CudaPlugin) - Result of Float Type Alignment Check: 64bit alignment active." )
set ( STORM_CUDAPLUGIN_FLOAT_64BIT_ALIGN_DEF "define" )
elseif ( STORM_CUDA_RUN_RESULT_FLOATALIGNMENT EQUAL 3 )
message ( STATUS "StoRM (CudaPlugin) - Result of Float Type Alignment Check: 64bit alignment disabled." )
set ( STORM_CUDAPLUGIN_FLOAT_64BIT_ALIGN_DEF "undef" )
else ( )
message ( FATAL_ERROR "StoRM (CudaPlugin) - Result of Float Type Alignment Check: FAILED (Code ${STORM_CUDA_RUN_RESULT_FLOATALIGNMENT})" )
endif ( )
#
# M a k e a v e r s i o n f i l e c o n t a i n i n g t h e c u r r e n t v e r s i o n f r o m g i t .
#
include ( GetGitRevisionDescription )
git_describe_checkout ( STORM_GIT_VERSION_STRING )
# P a r s e t h e g i t T a g i n t o v a r i a b l e s
string ( REGEX REPLACE "^([0-9]+)\\..*" "\\1" STORM_CUDAPLUGIN_VERSION_MAJOR "${STORM_GIT_VERSION_STRING}" )
string ( REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" STORM_CUDAPLUGIN_VERSION_MINOR "${STORM_GIT_VERSION_STRING}" )
string ( REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" STORM_CUDAPLUGIN_VERSION_PATCH "${STORM_GIT_VERSION_STRING}" )
string ( REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-([0-9]+)\\-.*" "\\1" STORM_CUDAPLUGIN_VERSION_COMMITS_AHEAD "${STORM_GIT_VERSION_STRING}" )
string ( REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-([a-z0-9]+).*" "\\1" STORM_CUDAPLUGIN_VERSION_HASH "${STORM_GIT_VERSION_STRING}" )
string ( REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-[a-z0-9]+\\-(.*)" "\\1" STORM_CUDAPLUGIN_VERSION_APPENDIX "${STORM_GIT_VERSION_STRING}" )
if ( "${STORM_CUDAPLUGIN_VERSION_APPENDIX}" MATCHES "^.*dirty.*$" )
set ( STORM_CUDAPLUGIN_VERSION_DIRTY 1 )
else ( )
set ( STORM_CUDAPLUGIN_VERSION_DIRTY 0 )
endif ( )
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})" )
# C o n f i g u r e a h e a d e r f i l e t o p a s s s o m e o f t h e C M a k e s e t t i n g s t o t h e s o u r c e c o d e
configure_file (
" $ { P R O J E C T _ S O U R C E _ D I R } / c u d a / s t o r m - c u d a p l u g i n - c o n f i g . h . i n "
" $ { P R O J E C T _ B I N A R Y _ D I R } / i n c l u d e / s t o r m - c u d a p l u g i n - c o n f i g . h "
)
# c r e a t e l i b r a r y
find_package ( CUDA REQUIRED )
set ( CUSP_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/resources/3rdparty/cusplibrary" )
find_package ( Cusp REQUIRED )
find_package ( Thrust REQUIRED )
set ( STORM_CUDA_LIB_NAME "storm-cuda" )
file ( GLOB_RECURSE STORM_CUDA_KERNEL_FILES ${ PROJECT_SOURCE_DIR } /cuda/kernels/*.cu )
file ( GLOB_RECURSE STORM_CUDA_HEADER_FILES ${ PROJECT_SOURCE_DIR } /cuda/kernels/*.h )
source_group ( kernels FILES ${ STORM_CUDA_KERNEL_FILES } ${ STORM_CUDA_HEADER_FILES } )
include_directories ( ${ PROJECT_SOURCE_DIR } /cuda/kernels/ )
# set ( CUDA_PROPAGATE_HOST_FLAGS OFF )
set ( CUDA_NVCC_FLAGS "-arch=sm_30" )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # C U S P
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
if ( CUSP_FOUND )
include_directories ( ${ CUSP_INCLUDE_DIR } )
cuda_include_directories ( ${ CUSP_INCLUDE_DIR } )
message ( STATUS "StoRM (CudaPlugin) - Found CUSP Version ${CUSP_VERSION} in location ${CUSP_INCLUDE_DIR}" )
else ( )
message ( FATAL_ERROR "StoRM (CudaPlugin) - Could not find CUSP!" )
endif ( )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# # T h r u s t
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
if ( THRUST_FOUND )
include_directories ( ${ THRUST_INCLUDE_DIR } )
cuda_include_directories ( ${ THRUST_INCLUDE_DIR } )
message ( STATUS "StoRM (CudaPlugin) - Found Thrust Version ${THRUST_VERSION} in location ${THRUST_INCLUDE_DIR}" )
else ( )
message ( FATAL_ERROR "StoRM (CudaPlugin) - Could not find Thrust! Check your CUDA installation." )
endif ( )
include_directories ( ${ CUDA_INCLUDE_DIRS } )
include_directories ( ${ ADDITIONAL_INCLUDE_DIRS } )
cuda_add_library ( ${ STORM_CUDA_LIB_NAME }
$ { S T O R M _ C U D A _ K E R N E L _ F I L E S } $ { S T O R M _ C U D A _ H E A D E R _ F I L E S }
)
message ( STATUS "StoRM - Linking with CUDA" )
list ( APPEND STORM_LINK_LIBRARIES ${ STORM_CUDA_LIB_NAME } )
include_directories ( "${PROJECT_SOURCE_DIR}/cuda/kernels/" )
endif ( )
include ( resources/3rdparty/CMakeLists.txt )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
@ -746,7 +246,7 @@ endif(LINK_LIBCXXABI)
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
find_package ( Doxygen REQUIRED )
find_package ( Doxygen )
# A d d a t a r g e t t o g e n e r a t e A P I d o c u m e n t a t i o n w i t h D o x y g e n
if ( DOXYGEN_FOUND )
set ( CMAKE_DOXYGEN_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/doc" )
xxxxxxxxxx