Browse Source

cmake version detection fix for when storm is not built from git

tempestpy_adaptions
dehnert 8 years ago
parent
commit
1598f0db1e
  1. 79
      CMakeLists.txt
  2. 62
      resources/3rdparty/CMakeLists.txt
  3. 21
      src/storm/utility/storm-version.h
  4. 6
      storm-version.cpp.in

79
CMakeLists.txt

@ -18,7 +18,7 @@ include(imported)
############################################################# #############################################################
## ##
## CMake options of Storm
## CMake options of storm
## ##
############################################################# #############################################################
option(STORM_DEVELOPER "Sets whether the development mode is used." OFF) option(STORM_DEVELOPER "Sets whether the development mode is used." OFF)
@ -44,7 +44,7 @@ option(STORM_COMPILE_WITH_CCACHE "Compile using CCache [if found]" ON)
mark_as_advanced(STORM_COMPILE_WITH_CCACHE) mark_as_advanced(STORM_COMPILE_WITH_CCACHE)
option(STORM_LOG_DISABLE_DEBUG "Disable log and trace message support" OFF) option(STORM_LOG_DISABLE_DEBUG "Disable log and trace message support" OFF)
option(STORM_USE_CLN_NUMBERS "Sets whether CLN or GMP numbers should be used" ON) option(STORM_USE_CLN_NUMBERS "Sets whether CLN or GMP numbers should be used" ON)
option(BUILD_SHARED_LIBS "Build the Storm library dynamically" OFF)
option(BUILD_SHARED_LIBS "Build the storm library dynamically" OFF)
set(BOOST_ROOT "" CACHE STRING "A hint to the root directory of Boost (optional).") 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).") set(GUROBI_ROOT "" CACHE STRING "A hint to the root directory of Gurobi (optional).")
set(Z3_ROOT "" CACHE STRING "A hint to the root directory of Z3 (optional).") set(Z3_ROOT "" CACHE STRING "A hint to the root directory of Z3 (optional).")
@ -55,6 +55,11 @@ set(ADDITIONAL_LINK_DIRS "" CACHE STRING "Additional directories added to the li
set(USE_XERCESC ${XML_SUPPORT}) set(USE_XERCESC ${XML_SUPPORT})
mark_as_advanced(USE_XERCESC) mark_as_advanced(USE_XERCESC)
# Sets the source from which storm is obtained. Can be either "git" or "archive". This
# influences, among other things, the version information.
set(STORM_SOURCE "git" CACHE STRING "The source from which storm is obtained: either 'git' or 'archive'.")
mark_as_advanced(STORM_SOURCE)
# Set some CMAKE Variables as advanced # Set some CMAKE Variables as advanced
mark_as_advanced(CMAKE_OSX_ARCHITECTURES) mark_as_advanced(CMAKE_OSX_ARCHITECTURES)
mark_as_advanced(CMAKE_OSX_SYSROOT) mark_as_advanced(CMAKE_OSX_SYSROOT)
@ -84,17 +89,17 @@ if (STORM_DEVELOPER)
else() else()
set(STORM_LOG_DISABLE_DEBUG ON) set(STORM_LOG_DISABLE_DEBUG ON)
endif() endif()
message(STATUS "Storm - Building ${CMAKE_BUILD_TYPE} version.")
message(STATUS "storm - Building ${CMAKE_BUILD_TYPE} version.")
if(STORM_COMPILE_WITH_CCACHE) if(STORM_COMPILE_WITH_CCACHE)
find_program(CCACHE_FOUND ccache) find_program(CCACHE_FOUND ccache)
mark_as_advanced(CCACHE_FOUND) mark_as_advanced(CCACHE_FOUND)
if(CCACHE_FOUND) if(CCACHE_FOUND)
message(STATUS "Storm - Using ccache")
message(STATUS "storm - Using ccache")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
else() else()
message(STATUS "Storm - Could not find ccache.")
message(STATUS "storm - Could not find ccache.")
endif() endif()
endif() endif()
@ -120,7 +125,7 @@ else()
set(OPERATING_SYSTEM "Linux") set(OPERATING_SYSTEM "Linux")
set(LINUX 1) set(LINUX 1)
ENDIF() ENDIF()
message(STATUS "Storm - Detected operating system ${OPERATING_SYSTEM}.")
message(STATUS "storm - Detected operating system ${OPERATING_SYSTEM}.")
set(DYNAMIC_EXT ".so") set(DYNAMIC_EXT ".so")
set(STATIC_EXT ".a") set(STATIC_EXT ".a")
@ -298,12 +303,12 @@ if ("${CMAKE_GENERATOR}" STREQUAL "Xcode")
endif() endif()
# Display information about build configuration. # Display information about build configuration.
message(STATUS "Storm - Using compiler configuration ${STORM_COMPILER_ID} ${STORM_COMPILER_VERSION}.")
message(STATUS "storm - Using compiler configuration ${STORM_COMPILER_ID} ${STORM_COMPILER_VERSION}.")
if (STORM_DEVELOPER) if (STORM_DEVELOPER)
message(STATUS "Storm - CXX Flags: ${CMAKE_CXX_FLAGS}")
message(STATUS "Storm - CXX Debug Flags: ${CMAKE_CXX_FLAGS_DEBUG}")
message(STATUS "Storm - CXX Release Flags: ${CMAKE_CXX_FLAGS_RELEASE}")
message(STATUS "Storm - Build type: ${CMAKE_BUILD_TYPE}")
message(STATUS "storm - CXX Flags: ${CMAKE_CXX_FLAGS}")
message(STATUS "storm - CXX Debug Flags: ${CMAKE_CXX_FLAGS_DEBUG}")
message(STATUS "storm - CXX Release Flags: ${CMAKE_CXX_FLAGS_RELEASE}")
message(STATUS "storm - Build type: ${CMAKE_BUILD_TYPE}")
endif() endif()
############################################################# #############################################################
@ -343,27 +348,45 @@ endif(DOXYGEN_FOUND)
############################################################# #############################################################
## ##
## CMake-generated Config File for Storm
## CMake-generated Config File for storm
## ##
############################################################# #############################################################
# Make a version file containing the current version from git.
include(GetGitRevisionDescription)
git_describe_checkout(STORM_GIT_VERSION_STRING)
message(STATUS "Storm -- Git version string is ${STORM_GIT_VERSION_STRING}.")
# Parse the git Tag into variables
string(REGEX REPLACE "^([0-9]+)\\..*" "\\1" STORM_CPP_VERSION_MAJOR "${STORM_GIT_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" STORM_CPP_VERSION_MINOR "${STORM_GIT_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" STORM_CPP_VERSION_PATCH "${STORM_GIT_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-([0-9]+)\\-.*" "\\1" STORM_CPP_VERSION_COMMITS_AHEAD "${STORM_GIT_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-([a-z0-9]+).*" "\\1" STORM_CPP_VERSION_HASH "${STORM_GIT_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-[a-z0-9]+\\-(.*)" "\\1" STORM_CPP_VERSION_APPENDIX "${STORM_GIT_VERSION_STRING}")
if ("${STORM_CPP_VERSION_APPENDIX}" MATCHES "^.*dirty.*$")
set(STORM_CPP_VERSION_DIRTY 1)
# If a version was provided, we use it. This is useful, for example, when storm is built
# from a tarball.
if (STORM_SOURCE STREQUAL "archive")
if (NOT DEFINED STORM_CPP_VERSION_MAJOR OR NOT DEFINED STORM_CPP_VERSION_MINOR OR NOT DEFINED STORM_CPP_VERSION_PATCH)
message(FATAL_ERROR "storm - Building from archive requires setting a version via cmake.")
endif()
message(STATUS "storm - Version is ${STORM_CPP_VERSION_MAJOR}.${STORM_CPP_VERSION_MINOR}.${STORM_CPP_VERSION_PATCH} (building from archive).")
set(STORM_CPP_VERSION_COMMITS_AHEAD boost::none)
set(STORM_CPP_VERSION_HASH boost::none)
set(STORM_CPP_VERSION_DIRTY boost::none)
else() else()
set(STORM_CPP_VERSION_DIRTY 0)
if (DEFINED STORM_CPP_VERSION_MAJOR OR DEFINED STORM_CPP_VERSION_MINOR OR DEFINED STORM_CPP_VERSION_PATCH)
message(FATAL_ERROR "storm - Building from git does not support setting a version via cmake.")
endif()
# Make a version file containing the current version from git.
include(GetGitRevisionDescription)
get_git_head_revision(STORM_CPP_VERSION_REFSPEC STORM_CPP_GIT_HASH)
set(STORM_CPP_GIT_HASH "std::string(\"${STORM_CPP_GIT_HASH}\")")
git_describe_checkout(STORM_GIT_VERSION_STRING)
# Parse the git Tag into variables
string(REGEX REPLACE "^([0-9]+)\\..*" "\\1" STORM_CPP_VERSION_MAJOR "${STORM_GIT_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" STORM_CPP_VERSION_MINOR "${STORM_GIT_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" STORM_CPP_VERSION_PATCH "${STORM_GIT_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-([0-9]+)\\-.*" "\\1" STORM_CPP_VERSION_COMMITS_AHEAD "${STORM_GIT_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-([a-z0-9]+).*" "\\1" STORM_CPP_TAG_HASH "${STORM_GIT_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\-[0-9]+\\-[a-z0-9]+\\-(.*)" "\\1" STORM_CPP_VERSION_APPENDIX "${STORM_GIT_VERSION_STRING}")
if ("${STORM_CPP_VERSION_APPENDIX}" MATCHES "^.*dirty.*$")
set(STORM_CPP_VERSION_DIRTY 1)
else()
set(STORM_CPP_VERSION_DIRTY 0)
endif()
message(STATUS "storm - Version is ${STORM_CPP_VERSION_MAJOR}.${STORM_CPP_VERSION_MINOR}.${STORM_CPP_VERSION_PATCH} (${STORM_CPP_VERSION_COMMITS_AHEAD} commits ahead of tag) build from ${STORM_CPP_GIT_HASH} (dirty: ${STORM_CPP_VERSION_DIRTY}) (building from git).")
endif() endif()
message(STATUS "Storm - Version is ${STORM_CPP_VERSION_MAJOR}.${STORM_CPP_VERSION_MINOR}.${STORM_CPP_VERSION_PATCH} (${STORM_CPP_VERSION_COMMITS_AHEAD} commits ahead of Tag) build from ${STORM_CPP_VERSION_HASH} (Dirty: ${STORM_CPP_VERSION_DIRTY}).")
# Configure a header file to pass some of the CMake settings to the source code # Configure a header file to pass some of the CMake settings to the source code
configure_file ( configure_file (
@ -397,4 +420,4 @@ add_subdirectory(src)
include(export) include(export)
include(StormCPackConfig.cmake)
include(stormCPackConfig.cmake)

62
resources/3rdparty/CMakeLists.txt

@ -76,7 +76,7 @@ foreach(BOOSTLIB ${Boost_LIBRARIES})
list(APPEND STORM_DEP_TARGETS target-boost-${CNTVAR}_SHARED) list(APPEND STORM_DEP_TARGETS target-boost-${CNTVAR}_SHARED)
MATH(EXPR CNTVAR "${CNTVAR}+1") MATH(EXPR CNTVAR "${CNTVAR}+1")
endforeach() endforeach()
message(STATUS "Storm - Using boost ${Boost_VERSION} (library version ${Boost_LIB_VERSION}).")
message(STATUS "storm - Using boost ${Boost_VERSION} (library version ${Boost_LIB_VERSION}).")
# set the information for the config header # set the information for the config header
set(STORM_BOOST_INCLUDE_DIR "${Boost_INCLUDE_DIRS}") set(STORM_BOOST_INCLUDE_DIR "${Boost_INCLUDE_DIRS}")
@ -87,7 +87,7 @@ set(STORM_BOOST_INCLUDE_DIR "${Boost_INCLUDE_DIRS}")
############################################################# #############################################################
# Use the shipped version of ExprTK # Use the shipped version of ExprTK
message (STATUS "Storm - Including ExprTk.")
message (STATUS "storm - Including ExprTk.")
add_imported_library_interface(ExprTk "${PROJECT_SOURCE_DIR}/resources/3rdparty/exprtk") add_imported_library_interface(ExprTk "${PROJECT_SOURCE_DIR}/resources/3rdparty/exprtk")
list(APPEND STORM_DEP_TARGETS ExprTk) list(APPEND STORM_DEP_TARGETS ExprTk)
@ -98,7 +98,7 @@ list(APPEND STORM_DEP_TARGETS ExprTk)
############################################################# #############################################################
# Use the shipped version of Sparsepp # Use the shipped version of Sparsepp
message (STATUS "Storm - Including Sparsepp.")
message (STATUS "storm - Including Sparsepp.")
include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/sparsepp") include_directories("${PROJECT_SOURCE_DIR}/resources/3rdparty/sparsepp")
# Add sparsepp.h to the headers that are copied to the include directory in thebuild directory. # Add sparsepp.h to the headers that are copied to the include directory in thebuild directory.
@ -117,7 +117,7 @@ list(APPEND STORM_RESOURCES_HEADERS "${CMAKE_BINARY_DIR}/include/resources/3rdpa
############################################################# #############################################################
#use the shipped version of modernjson #use the shipped version of modernjson
message (STATUS "Storm - Including ModernJSON.")
message (STATUS "storm - Including ModernJSON.")
add_imported_library_interface(ModernJSON "${PROJECT_SOURCE_DIR}/resources/3rdparty/modernjson/src/") add_imported_library_interface(ModernJSON "${PROJECT_SOURCE_DIR}/resources/3rdparty/modernjson/src/")
list(APPEND STORM_DEP_TARGETS ModernJSON) list(APPEND STORM_DEP_TARGETS ModernJSON)
@ -133,7 +133,7 @@ find_package(Z3 QUIET)
set(STORM_HAVE_Z3 ${Z3_FOUND}) set(STORM_HAVE_Z3 ${Z3_FOUND})
if(Z3_FOUND) if(Z3_FOUND)
message (STATUS "Storm - Linking with Z3.")
message (STATUS "storm - Linking with Z3.")
add_imported_library(z3 SHARED ${Z3_LIBRARIES} ${Z3_INCLUDE_DIRS}) add_imported_library(z3 SHARED ${Z3_LIBRARIES} ${Z3_INCLUDE_DIRS})
list(APPEND STORM_DEP_TARGETS z3_SHARED) list(APPEND STORM_DEP_TARGETS z3_SHARED)
endif(Z3_FOUND) endif(Z3_FOUND)
@ -156,7 +156,7 @@ if (STORM_USE_GUROBI)
find_package(Gurobi QUIET REQUIRED) find_package(Gurobi QUIET REQUIRED)
set(STORM_HAVE_GUROBI ${GUROBI_FOUND}) set(STORM_HAVE_GUROBI ${GUROBI_FOUND})
if (GUROBI_FOUND) if (GUROBI_FOUND)
message (STATUS "Storm - Linking with Gurobi.")
message (STATUS "storm - Linking with Gurobi.")
add_imported_library(Gurobi "" ${GUROBI_LIBRARY} ${GUROBI_INCLUDE_DIRS}) add_imported_library(Gurobi "" ${GUROBI_LIBRARY} ${GUROBI_INCLUDE_DIRS})
list(APPEND STORM_DEP_TARGETS Gurobi) list(APPEND STORM_DEP_TARGETS Gurobi)
endif() endif()
@ -192,8 +192,8 @@ if(USE_CARL)
if(carl_FOUND AND NOT STORM_FORCE_SHIPPED_CARL) if(carl_FOUND AND NOT STORM_FORCE_SHIPPED_CARL)
set(STORM_SHIPPED_CARL OFF) set(STORM_SHIPPED_CARL OFF)
set(STORM_HAVE_CARL ON) set(STORM_HAVE_CARL ON)
message(STATUS "Storm - Use system version of carl.")
message(STATUS "Storm - Linking with carl ${carl_VERSION} (CARL_USE_CLN_NUMBERS: ${CARL_USE_CLN_NUMBERS}).")
message(STATUS "storm - Use system version of carl.")
message(STATUS "storm - Linking with carl ${carl_VERSION} (CARL_USE_CLN_NUMBERS: ${CARL_USE_CLN_NUMBERS}).")
set(STORM_HAVE_CLN ${CARL_USE_CLN_NUMBERS}) set(STORM_HAVE_CLN ${CARL_USE_CLN_NUMBERS})
else() else()
set(STORM_SHIPPED_CARL ON) set(STORM_SHIPPED_CARL ON)
@ -220,7 +220,7 @@ if(USE_CARL)
endif() endif()
message("END CARL CONFIG PROCESS") message("END CARL CONFIG PROCESS")
message(STATUS "Storm - Using shipped version of carl.")
message(STATUS "storm - Using shipped version of carl.")
ExternalProject_Add( ExternalProject_Add(
carl carl
SOURCE_DIR ${STORM_3RDPARTY_BINARY_DIR}/carl SOURCE_DIR ${STORM_3RDPARTY_BINARY_DIR}/carl
@ -263,7 +263,7 @@ if(USE_SMTRAT)
find_package(smtrat QUIET REQUIRED) find_package(smtrat QUIET REQUIRED)
if(smtrat_FOUND) if(smtrat_FOUND)
set(STORM_HAVE_SMTRAT ON) set(STORM_HAVE_SMTRAT ON)
message(STATUS "Storm - Linking with smtrat.")
message(STATUS "storm - Linking with smtrat.")
include_directories("${smtrat_INCLUDE_DIR}") include_directories("${smtrat_INCLUDE_DIR}")
list(APPEND STORM_LINK_LIBRARIES ${smtrat_LIBRARIES}) list(APPEND STORM_LINK_LIBRARIES ${smtrat_LIBRARIES})
else() else()
@ -283,7 +283,7 @@ if(USE_HYPRO)
find_package(hypro QUIET REQUIRED) find_package(hypro QUIET REQUIRED)
if(hypro_FOUND) if(hypro_FOUND)
set(STORM_HAVE_HYPRO ON) set(STORM_HAVE_HYPRO ON)
message(STATUS "Storm - Linking with hypro.")
message(STATUS "storm - Linking with hypro.")
include_directories("${hypro_INCLUDE_DIR}") include_directories("${hypro_INCLUDE_DIR}")
list(APPEND STORM_LINK_LIBRARIES ${hypro_LIBRARIES}) list(APPEND STORM_LINK_LIBRARIES ${hypro_LIBRARIES})
else() else()
@ -317,7 +317,7 @@ endif()
# MathSAT Defines # MathSAT Defines
set(STORM_HAVE_MSAT ${ENABLE_MSAT}) set(STORM_HAVE_MSAT ${ENABLE_MSAT})
if (ENABLE_MSAT) if (ENABLE_MSAT)
message (STATUS "Storm - Linking with MathSAT.")
message (STATUS "storm - Linking with MathSAT.")
link_directories("${MSAT_ROOT}/lib") link_directories("${MSAT_ROOT}/lib")
include_directories("${MSAT_ROOT}/include") include_directories("${MSAT_ROOT}/include")
list(APPEND STORM_LINK_LIBRARIES "mathsat") list(APPEND STORM_LINK_LIBRARIES "mathsat")
@ -365,8 +365,8 @@ ExternalProject_Get_Property(sylvan source_dir)
ExternalProject_Get_Property(sylvan binary_dir) ExternalProject_Get_Property(sylvan binary_dir)
set(Sylvan_INCLUDE_DIR "${source_dir}/src") set(Sylvan_INCLUDE_DIR "${source_dir}/src")
set(Sylvan_LIBRARY "${binary_dir}/src/libsylvan${STATIC_EXT}") set(Sylvan_LIBRARY "${binary_dir}/src/libsylvan${STATIC_EXT}")
message(STATUS "Storm - Using shipped version of sylvan.")
message(STATUS "Storm - Linking with sylvan.")
message(STATUS "storm - Using shipped version of sylvan.")
message(STATUS "storm - Linking with sylvan.")
add_imported_library(sylvan STATIC ${Sylvan_LIBRARY} ${Sylvan_INCLUDE_DIR}) add_imported_library(sylvan STATIC ${Sylvan_LIBRARY} ${Sylvan_INCLUDE_DIR})
add_dependencies(sylvan_STATIC sylvan) add_dependencies(sylvan_STATIC sylvan)
if(STORM_SHIPPED_CARL) if(STORM_SHIPPED_CARL)
@ -376,7 +376,7 @@ list(APPEND STORM_DEP_TARGETS sylvan_STATIC)
find_package(Hwloc QUIET REQUIRED) find_package(Hwloc QUIET REQUIRED)
if(HWLOC_FOUND) if(HWLOC_FOUND)
message(STATUS "Storm - Linking with hwloc ${HWLOC_VERSION}.")
message(STATUS "storm - Linking with hwloc ${HWLOC_VERSION}.")
add_imported_library(hwloc STATIC ${HWLOC_LIBRARIES} "") add_imported_library(hwloc STATIC ${HWLOC_LIBRARIES} "")
list(APPEND STORM_DEP_TARGETS hwloc_STATIC) list(APPEND STORM_DEP_TARGETS hwloc_STATIC)
else() else()
@ -432,14 +432,14 @@ if (STORM_USE_INTELTBB)
find_package(TBB QUIET REQUIRED) find_package(TBB QUIET REQUIRED)
if (TBB_FOUND) 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}.")
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) set(STORM_HAVE_INTELTBB ON)
link_directories(${TBB_LIBRARY_DIRS}) link_directories(${TBB_LIBRARY_DIRS})
include_directories(${TBB_INCLUDE_DIRS}) include_directories(${TBB_INCLUDE_DIRS})
list(APPEND STORM_LINK_LIBRARIES tbb tbbmalloc) list(APPEND STORM_LINK_LIBRARIES tbb tbbmalloc)
else(TBB_FOUND) else(TBB_FOUND)
message(FATAL_ERROR "Storm - TBB was requested, but not found.")
message(FATAL_ERROR "storm - TBB was requested, but not found.")
endif(TBB_FOUND) endif(TBB_FOUND)
endif(STORM_USE_INTELTBB) endif(STORM_USE_INTELTBB)
@ -451,7 +451,7 @@ endif(STORM_USE_INTELTBB)
find_package(Threads QUIET REQUIRED) find_package(Threads QUIET REQUIRED)
if (NOT Threads_FOUND) if (NOT Threads_FOUND)
message(FATAL_ERROR "Storm - Threads was requested, but not found.")
message(FATAL_ERROR "storm - Threads was requested, but not found.")
endif() endif()
include_directories(${THREADS_INCLUDE_DIRS}) include_directories(${THREADS_INCLUDE_DIRS})
list(APPEND STORM_LINK_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) list(APPEND STORM_LINK_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
@ -491,11 +491,11 @@ if(ENABLE_CUDA)
COMPILE_OUTPUT_VARIABLE OUTPUT_TEST_VAR COMPILE_OUTPUT_VARIABLE OUTPUT_TEST_VAR
) )
if(NOT STORM_CUDA_COMPILE_RESULT_TYPEALIGNMENT) 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}")
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) elseif(STORM_CUDA_RUN_RESULT_TYPEALIGNMENT EQUAL 0)
message(STATUS "StoRM (CudaPlugin) - Result of Type Alignment Check: OK.") message(STATUS "StoRM (CudaPlugin) - Result of Type Alignment Check: OK.")
else() else()
message(FATAL_ERROR "Storm (CudaPlugin) - Result of Type Alignment Check: FAILED (Code ${STORM_CUDA_RUN_RESULT_TYPEALIGNMENT})")
message(FATAL_ERROR "storm (CudaPlugin) - Result of Type Alignment Check: FAILED (Code ${STORM_CUDA_RUN_RESULT_TYPEALIGNMENT})")
endif() endif()
# Test for Float 64bit Alignment # Test for Float 64bit Alignment
@ -504,15 +504,15 @@ if(ENABLE_CUDA)
COMPILE_OUTPUT_VARIABLE OUTPUT_TEST_VAR COMPILE_OUTPUT_VARIABLE OUTPUT_TEST_VAR
) )
if(NOT STORM_CUDA_COMPILE_RESULT_FLOATALIGNMENT) 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}")
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) elseif(STORM_CUDA_RUN_RESULT_FLOATALIGNMENT EQUAL 2)
message(STATUS "Storm (CudaPlugin) - Result of Float Type Alignment Check: 64bit alignment active.")
message(STATUS "storm (CudaPlugin) - Result of Float Type Alignment Check: 64bit alignment active.")
set(STORM_CUDAPLUGIN_FLOAT_64BIT_ALIGN_DEF "define") set(STORM_CUDAPLUGIN_FLOAT_64BIT_ALIGN_DEF "define")
elseif(STORM_CUDA_RUN_RESULT_FLOATALIGNMENT EQUAL 3) elseif(STORM_CUDA_RUN_RESULT_FLOATALIGNMENT EQUAL 3)
message(STATUS "Storm (CudaPlugin) - Result of Float Type Alignment Check: 64bit alignment disabled.")
message(STATUS "storm (CudaPlugin) - Result of Float Type Alignment Check: 64bit alignment disabled.")
set(STORM_CUDAPLUGIN_FLOAT_64BIT_ALIGN_DEF "undef") set(STORM_CUDAPLUGIN_FLOAT_64BIT_ALIGN_DEF "undef")
else() else()
message(FATAL_ERROR "Storm (CudaPlugin) - Result of Float Type Alignment Check: FAILED (Code ${STORM_CUDA_RUN_RESULT_FLOATALIGNMENT})")
message(FATAL_ERROR "storm (CudaPlugin) - Result of Float Type Alignment Check: FAILED (Code ${STORM_CUDA_RUN_RESULT_FLOATALIGNMENT})")
endif() endif()
# #
# Make a version file containing the current version from git. # Make a version file containing the current version from git.
@ -531,7 +531,7 @@ if(ENABLE_CUDA)
else() else()
set(STORM_CUDAPLUGIN_VERSION_DIRTY 0) set(STORM_CUDAPLUGIN_VERSION_DIRTY 0)
endif() 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})")
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})")
# Configure a header file to pass some of the CMake settings to the source code # Configure a header file to pass some of the CMake settings to the source code
@ -565,9 +565,9 @@ if(ENABLE_CUDA)
if(CUSP_FOUND) if(CUSP_FOUND)
include_directories(${CUSP_INCLUDE_DIR}) include_directories(${CUSP_INCLUDE_DIR})
cuda_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}.")
message(STATUS "storm (CudaPlugin) - Found CUSP Version ${CUSP_VERSION} in location ${CUSP_INCLUDE_DIR}.")
else() else()
message(FATAL_ERROR "Storm (CudaPlugin) - Could not find CUSP.")
message(FATAL_ERROR "storm (CudaPlugin) - Could not find CUSP.")
endif() endif()
############################################################# #############################################################
@ -578,9 +578,9 @@ if(ENABLE_CUDA)
if(THRUST_FOUND) if(THRUST_FOUND)
include_directories(${THRUST_INCLUDE_DIR}) include_directories(${THRUST_INCLUDE_DIR})
cuda_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}.")
message(STATUS "storm (CudaPlugin) - Found Thrust Version ${THRUST_VERSION} in location ${THRUST_INCLUDE_DIR}.")
else() else()
message(FATAL_ERROR "Storm (CudaPlugin) - Could not find Thrust. Check your CUDA installation.")
message(FATAL_ERROR "storm (CudaPlugin) - Could not find Thrust. Check your CUDA installation.")
endif() endif()
include_directories(${CUDA_INCLUDE_DIRS}) include_directories(${CUDA_INCLUDE_DIRS})
@ -590,7 +590,7 @@ if(ENABLE_CUDA)
${STORM_CUDA_KERNEL_FILES} ${STORM_CUDA_HEADER_FILES} ${STORM_CUDA_KERNEL_FILES} ${STORM_CUDA_HEADER_FILES}
) )
message (STATUS "Storm - Linking with CUDA.")
message (STATUS "storm - Linking with CUDA.")
list(APPEND STORM_LINK_LIBRARIES ${STORM_CUDA_LIB_NAME}) list(APPEND STORM_LINK_LIBRARIES ${STORM_CUDA_LIB_NAME})
include_directories("${PROJECT_SOURCE_DIR}/cuda/kernels/") include_directories("${PROJECT_SOURCE_DIR}/cuda/kernels/")
endif() endif()

21
src/storm/utility/storm-version.h

@ -3,8 +3,9 @@
#include <string> #include <string>
#include <sstream> #include <sstream>
namespace storm
{
#include <boost/optional.hpp>
namespace storm {
namespace utility { namespace utility {
struct StormVersion { struct StormVersion {
@ -18,13 +19,13 @@ namespace storm
const static unsigned versionPatch; const static unsigned versionPatch;
/// The short hash of the git commit this build is based on /// The short hash of the git commit this build is based on
const static std::string gitRevisionHash;
const static boost::optional<std::string> gitRevisionHash;
/// How many commits passed since the tag was last set. /// How many commits passed since the tag was last set.
const static unsigned commitsAhead;
const static boost::optional<unsigned> commitsAhead;
/// 0 iff there no files were modified in the checkout, 1 otherwise. /// 0 iff there no files were modified in the checkout, 1 otherwise.
const static unsigned dirty;
const static boost::optional<unsigned> dirty;
/// The system which has compiled Storm. /// The system which has compiled Storm.
const static std::string systemName; const static std::string systemName;
@ -47,11 +48,13 @@ namespace storm
static std::string longVersionString() { static std::string longVersionString() {
std::stringstream sstream; std::stringstream sstream;
sstream << "version: " << versionMajor << "." << versionMinor << "." << versionPatch; sstream << "version: " << versionMajor << "." << versionMinor << "." << versionPatch;
if (commitsAhead != 0) {
sstream << " (+" << commitsAhead << " commits)";
if (commitsAhead && commitsAhead.get() > 0) {
sstream << " (+" << commitsAhead.get() << " commits)";
}
if (gitRevisionHash) {
sstream << " build from revision " << gitRevisionHash.get();
} }
sstream << " build from revision " << gitRevisionHash;
if (dirty == 1) {
if (dirty && dirty.get() == 1) {
sstream << " (DIRTY)"; sstream << " (DIRTY)";
} }
sstream << "." << std::endl; sstream << "." << std::endl;

6
storm-version.cpp.in

@ -8,9 +8,9 @@ namespace storm {
const unsigned StormVersion::versionMajor = @STORM_CPP_VERSION_MAJOR@; const unsigned StormVersion::versionMajor = @STORM_CPP_VERSION_MAJOR@;
const unsigned StormVersion::versionMinor = @STORM_CPP_VERSION_MINOR@; const unsigned StormVersion::versionMinor = @STORM_CPP_VERSION_MINOR@;
const unsigned StormVersion::versionPatch = @STORM_CPP_VERSION_PATCH@; const unsigned StormVersion::versionPatch = @STORM_CPP_VERSION_PATCH@;
const std::string StormVersion::gitRevisionHash = "@STORM_CPP_VERSION_HASH@";
const unsigned StormVersion::commitsAhead = @STORM_CPP_VERSION_COMMITS_AHEAD@;
const unsigned StormVersion::dirty = @STORM_CPP_VERSION_DIRTY@;
const boost::optional<std::string> StormVersion::gitRevisionHash = @STORM_CPP_GIT_HASH@;
const boost::optional<unsigned> StormVersion::commitsAhead = @STORM_CPP_VERSION_COMMITS_AHEAD@;
const boost::optional<unsigned> StormVersion::dirty = @STORM_CPP_VERSION_DIRTY@;
const std::string StormVersion::systemName = "@CMAKE_SYSTEM_NAME@"; const std::string StormVersion::systemName = "@CMAKE_SYSTEM_NAME@";
const std::string StormVersion::systemVersion = "@CMAKE_SYSTEM_VERSION@"; const std::string StormVersion::systemVersion = "@CMAKE_SYSTEM_VERSION@";
const std::string StormVersion::cxxCompiler = "@STORM_COMPILER_ID@ @CMAKE_CXX_COMPILER_VERSION@"; const std::string StormVersion::cxxCompiler = "@STORM_COMPILER_ID@ @CMAKE_CXX_COMPILER_VERSION@";
Loading…
Cancel
Save