Browse Source

carl conf imported, other dependencies declared als import target and exported to storm conf

tempestpy_adaptions
Sebastian Junges 8 years ago
parent
commit
b4ce43ca0a
  1. 2
      CMakeLists.txt
  2. 64
      resources/3rdparty/CMakeLists.txt
  3. 14
      resources/3rdparty/include_cudd.cmake
  4. 9
      resources/3rdparty/include_glpk.cmake
  5. 0
      resources/3rdparty/include_xerces.cmake.save
  6. 49
      resources/3rdparty/include_xerces.cmake.save.1
  7. 43
      resources/cmake/find_modules/FindCLN.cmake
  8. 54
      resources/cmake/find_modules/FindGiNaC.cmake
  9. 3
      resources/cmake/macros/export.cmake
  10. 3
      resources/cmake/macros/imported.cmake
  11. 2
      src/CMakeLists.txt
  12. 6
      src/storm/CMakeLists.txt

2
CMakeLists.txt

@ -366,8 +366,10 @@ if(STORM_PYTHON)
add_subdirectory(stormpy)
endif()
set(STORM_TARGETS "")
add_subdirectory(src)
message("STORM_TARGETS: ${STORM_TARGETS}")
include(export)
include(StormCPackConfig.cmake)

64
resources/3rdparty/CMakeLists.txt

@ -21,7 +21,7 @@ endif()
# Do not take a branch, needs internet connection.
ExternalProject_Add(
l3pp
l3pp_ext
GIT_REPOSITORY https://github.com/hbruintjes/l3pp.git
GIT_TAG e4f8d7fe6c328849aff34d2dfd6fd592c14070d5
SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/l3pp
@ -31,10 +31,10 @@ ExternalProject_Add(
INSTALL_COMMAND ""
LOG_INSTALL ON
)
ExternalProject_Get_Property(l3pp source_dir)
ExternalProject_Get_Property(l3pp_ext source_dir)
set(l3pp_INCLUDE "${source_dir}/")
include_directories(${l3pp_INCLUDE})
add_dependencies(resources l3pp)
add_imported_library_interface(l3pp "${l3pp_INCLUDE}")
list(APPEND STORM_DEP_TARGETS l3pp)
#############################################################
##
@ -42,9 +42,8 @@ add_dependencies(resources l3pp)
##
#############################################################
# Add the shipped version of GMM to the include pathes
set(GMMXX_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/resources/3rdparty/gmm-5.0/include")
include_directories(${GMMXX_INCLUDE_DIR})
add_imported_library_interface(gmm "${PROJECT_SOURCE_DIR}/resources/3rdparty/gmm-5.0/include")
list(APPEND STORM_DEP_TARGETS gmm)
#############################################################
##
@ -52,9 +51,8 @@ include_directories(${GMMXX_INCLUDE_DIR})
##
#############################################################
# Add the shipped version of Eigen to the include pathes
set(EIGEN_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/resources/3rdparty/eigen-3.3-beta1")
include_directories(${EIGEN_INCLUDE_DIR})
add_imported_library_interface(Eigen33 "${PROJECT_SOURCE_DIR}/resources/3rdparty/eigen-3.3-beta1")
list(APPEND STORM_DEP_TARGETS Eigen33)
#############################################################
@ -96,7 +94,7 @@ set(STORM_BOOST_INCLUDE_DIR "${Boost_INCLUDE_DIRS}")
# Use the shipped version of ExprTK
message (STATUS "Storm - Including ExprTk.")
add_imported_library_interface(ExprTk "${PROJECT_SOURCE_DIR}/resources/3rdparty/exprtk")
list(APPEND STORM_LINK_LIBRARIES ExprTk)
list(APPEND STORM_DEP_TARGETS ExprTk)
#############################################################
##
@ -126,7 +124,7 @@ list(APPEND STORM_RESOURCES_HEADERS "${CMAKE_BINARY_DIR}/include/resources/3rdpa
#use the shipped version of modernjson
message (STATUS "Storm - Including ModernJSON.")
add_imported_library_interface(ModernJSON "${PROJECT_SOURCE_DIR}/resources/3rdparty/modernjson/src/")
list(APPEND STORM_LINK_LIBRARIES ModernJSON)
list(APPEND STORM_DEP_TARGETS ModernJSON)
#############################################################
##
@ -164,9 +162,8 @@ if (STORM_USE_GUROBI)
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")
add_imported_library(Gurobi "" ${GUROBI_LIBRARY} ${GUROBI_INCLUDE_DIRS})
list(APPEND STORM_DEP_TARGETS Gurobi)
endif()
else()
set(STORM_HAVE_GUROBI OFF)
@ -186,25 +183,7 @@ include(${STORM_3RDPARTY_SOURCE_DIR}/include_cudd.cmake)
#############################################################
include(${STORM_3RDPARTY_SOURCE_DIR}/include_cpptemplate.cmake)
#############################################################
##
## CLN
##
#############################################################
find_package(CLN QUIET)
if(CLN_FOUND)
set(STORM_HAVE_CLN 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()
#############################################################
##
@ -219,8 +198,7 @@ if(USE_CARL)
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}).")
include_directories("${carl_INCLUDE_DIR}")
list(APPEND STORM_LINK_LIBRARIES lib_carl)
set(STORM_HAVE_CLN ${CARL_USE_CLN_NUMBERS})
else()
message(STATUS "Storm - Using shipped version of carl.")
set(CARL_BUILD_COMMAND make lib_carl)
@ -233,7 +211,7 @@ if(USE_CARL)
GIT_TAG master
INSTALL_DIR ${STORM_3RDPARTY_BINARY_DIR}/carl
SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/carl
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DBOOST_INCLUDEDIR=${Boost_INCLUDE_DIRS} -DBOOST_LIBRARYDIR=${Boost_LIBRARY_DIRS} -DBoost_NO_SYSTEM_PATHS=1 -DEXPORT_TO_CMAKE=0 -DUSE_CLN_NUMBERS=1 -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=1 -DCMAKE_INSTALL_PREFIX:PATH=${STORM_3RDPARTY_BINARY_DIR}/carl -DBINDINGS_PYTHON=${STORM_PYTHON} -DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DBOOST_INCLUDEDIR=${Boost_INCLUDE_DIRS} -DBOOST_LIBRARYDIR=${Boost_LIBRARY_DIRS} -DBoost_NO_SYSTEM_PATHS=1 -DEXPORT_TO_CMAKE=0 -DUSE_CLN_NUMBERS=1 -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=1 -DCMAKE_INSTALL_PREFIX:PATH=${STORM_3RDPARTY_BINARY_DIR}/carl
BUILD_IN_SOURCE 0
BUILD_COMMAND ${CARL_BUILD_COMMAND}
INSTALL_COMMAND ""
@ -244,15 +222,14 @@ if(USE_CARL)
)
include(${STORM_3RDPARTY_BINARY_DIR}/carl/carlConfig.cmake)
message("CARL_USE_CLN_NUMBERS: ${CARL_USE_CLN_NUMBERS}")
set(STORM_HAVE_CLN ${CARL_USE_CLN_NUMBERS})
add_dependencies(resources carl)
set(carl_INCLUDE_DIR "${STORM_3RDPARTY_BINARY_DIR}/carl/include")
include_directories("${carl_INCLUDE_DIR}")
list(APPEND STORM_LINK_LIBRARIES ${STORM_3RDPARTY_BINARY_DIR}/carl/lib/libcarl${DYNAMIC_EXT})
set(STORM_HAVE_CARL ON)
endif()
list(APPEND STORM_DEP_TARGETS lib_carl)
endif()
set(STORM_CARL_INCLUDE_DIR "${carl_INCLUDE_DIR}")
#############################################################
@ -370,15 +347,14 @@ set(Sylvan_INCLUDE_DIR "${source_dir}/src")
set(Sylvan_LIBRARY "${binary_dir}/src/libsylvan${STATIC_EXT}")
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)
add_imported_library(sylvan STATIC ${Sylvan_LIBRARY} ${Sylvan_INCLUDE_DIR})
list(APPEND STORM_DEP_TARGETS sylvan_STATIC)
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})
add_imported_library(hwloc "" ${Hwloc_LIBRARIES})
else()
message(FATAL_ERROR "HWLOC is required but was not found.")
endif()

14
resources/3rdparty/include_cudd.cmake

@ -37,12 +37,16 @@ set(CUDD_INCLUDE_DIR ${STORM_3RDPARTY_BINARY_DIR}/cudd-3.0.0/include)
set(CUDD_SHARED_LIBRARY ${CUDD_LIB_DIR}/libcudd${DYNAMIC_EXT})
set(CUDD_STATIC_LIBRARY ${CUDD_LIB_DIR}/libcudd${STATIC_EXT})
set(CUDD_VERSION_STRING 3.0.0)
add_imported_library(cudd SHARED ${CUDD_SHARED_LIBRARY} ${CUDD_INCLUDE_DIR})
add_imported_library(cudd STATIC ${CUDD_STATIC_LIBRARY} ${CUDD_INCLUDE_DIR})
add_dependencies(resources cudd3)
if(BUILD_SHARED_LIBS)
list(APPEND STORM_LINK_LIBRARIES ${CUDD_SHARED_LIBRARY})
list(APPEND STORM_DEP_TARGETS cudd_SHARED)
else()
list(APPEND STORM_LINK_LIBRARIES ${CUDD_STATIC_LIBRARY})
list(APPEND STORM_LINK_LIBRARIES cudd_STATIC)
endif()
add_dependencies(resources cudd3)
message(STATUS "Storm - Linking with CUDD ${CUDD_VERSION_STRING}.")
include_directories(${CUDD_INCLUDE_DIR})
message(STATUS "Storm - Linking with CUDD ${CUDD_VERSION_STRING}.")

9
resources/3rdparty/include_glpk.cmake

@ -4,7 +4,7 @@ if(GLPK_FOUND)
else()
message (STATUS "Storm - Using shipped version of glpk.")
set(GLPK_LIB_DIR ${STORM_3RDPARTY_BINARY_DIR}/glpk-4.57/lib)
ExternalProject_Add(glpk
ExternalProject_Add(glpk_ext
DOWNLOAD_COMMAND ""
PREFIX ${STORM_3RDPARTY_BINARY_DIR}/glpk-4.57
SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/glpk-4.57
@ -20,11 +20,12 @@ else()
set(GLPK_LIBRARIES ${GLPK_LIB_DIR}/libglpk${DYNAMIC_EXT})
set(GLPK_INCLUDE_DIR ${STORM_3RDPARTY_BINARY_DIR}/glpk-4.57/include)
set(GLPK_VERSION_STRING 4.57)
add_dependencies(resources glpk)
add_dependencies(resources glpk_ext)
endif()
# Since there is a shipped version, always use GLPK
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})
add_imported_library(glpk SHARED ${GLPK_LIBRARIES} ${GLPK_INCLUDE_DIR})
list(APPEND STORM_DEP_TARGETS glpk_SHARED)

0
resources/3rdparty/include_xerces.cmake.save

49
resources/3rdparty/include_xerces.cmake.save.1

@ -0,0 +1,49 @@
if(USE_XERCESC)
set(XERCESC_FIND_QUIETLY ON)
set(XERCESC_STATIC OFF)
find_package(XercesC QUIET REQUIRED)
if(XERCESC_FOUND)
message(STATUS "Storm - Use system version of xerces.")
else()
message(STATUS "Storm - Use shipped version of xerces.")
set(XERCESC_LIB_DIR ${STORM_3RDPARTY_BINARY_DIR}/xercesc-3.1.2/lib)
ExternalProject_Add(
xercesc
SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/xercesc-3.1.2
CONFIGURE_COMMAND ${STORM_3RDPARTY_SOURCE_DIR}/xercesc-3.1.2/configure --prefix=${STORM_3RDPARTY_BINARY_DIR}/xercesc-3.1.2 --libdir=${XERCESC_LIB_DIR} CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} CFLAGS=-O3 CXXFLAGS=-O3
PREFIX ${STORM_3RDPARTY_BINARY_DIR}/xercesc-3.1.2
BUILD_COMMAND make
BUILD_IN_SOURCE 0
LOG_CONFIGURE ON
LOG_BUILD ON
LOG_INSTALL ON
BUILD_BYPRODUCTS ${XERCESC_LIB_DIR}/libxerces-c${DYNAMIC_EXT} ${XERCESC_LIB_DIR}/libxerces-c${STATIC_EXT}
)
set(XERCESC_ROOT ${STORM_3RDPARTY_BINARY_DIR}/xercesc-3.1.2)
set(XERCESC_INCLUDE ${XERCESC_ROOT}/include)
set(XERCESC_LIBRARY_PATH ${XERCESC_LIB_DIR})
if(BUILD_STATIC)
set(XERCESC_LIBRARIES ${XERCESC_LIBRARY_PATH}/libxerces-c${STATIC_EXT})
else()
set(XERCESC_LIBRARIES ${XERCESC_LIBRARY_PATH}/libxerces-c${DYNAMIC_EXT})
endif()
add_dependencies(resources xercesc)
endif()
message (STATUS "Storm - Linking with xercesc.")
set(STORM_HAVE_XERCES ON)
include_directories(${XERCESC_INCLUDE})
if(APPLE)
FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation )
FIND_LIBRARY(CORESERVICES_LIBRARY CoreServices )
mark_as_advanced(COREFOUNDATION_LIBRARY)
mark_as_advanced(CORESERVICES_LIBRARY)
endif()
find_package(CURL)
list(APPEND STORM_GSPN_LINK_LIBRARIES ${XERCESC_LIBRARIES} ${COREFOUNDATION_LIBRARY} ${CORESERVICES_LIBRARY} ${CURL_LIBRARIES})
else()
message (WARNING "Storm - Building without Xerces disables parsing XML formats (for GSPNs)")
endif(USE_XERCESC)

43
resources/cmake/find_modules/FindCLN.cmake

@ -1,43 +0,0 @@
# - Try to find libcln
# Once done this will define
# CLN_FOUND - System has cln
# CLN_INCLUDE_DIR - The cln include directory
# CLN_LIBRARIES - The libraries needed to use cln
# CLN_VERSION_STRING - The version of cln ("major.minor.patch")
# use pkg-config to get the directories and then use these values
# in the find_path() and find_library() calls
find_package(PkgConfig QUIET)
PKG_CHECK_MODULES(PC_CLN QUIET cln)
find_path(CLN_INCLUDE_DIR NAMES cln/cln.h
HINTS
${PC_CLN_INCLUDEDIR}
${PC_CLN_INCLUDE_DIRS}
PATH_SUFFIXES cln
)
find_library(CLN_LIBRARIES NAMES cln
HINTS
${PC_CLN_LIBDIR}
${PC_CLN_LIBRARY_DIRS}
)
if(PC_CLN_VERSION)
set(CLN_VERSION_STRING ${PC_CLN_VERSION})
elseif(CLN_INCLUDE_DIR AND EXISTS "${CLN_INCLUDE_DIR}/version.h")
file(STRINGS "${CLN_INCLUDE_DIR}/version.h" cln_version
REGEX "^#define[\t ]+CL_VERSION[\t ]+.+")
string(REGEX REPLACE "^#define[\t ]+CL_VERSION[\t ]+(.+)" "\\1"
CLN_VERSION_STRING "${cln_version}")
unset(cln_version)
endif()
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CLN
REQUIRED_VARS CLN_LIBRARIES CLN_INCLUDE_DIR
VERSION_VAR CLN_VERSION_STRING)
mark_as_advanced(CLN_INCLUDE_DIR CLN_LIBRARIES)

54
resources/cmake/find_modules/FindGiNaC.cmake

@ -1,54 +0,0 @@
# - Try to find libginac
# Once done this will define
# GINAC_FOUND - System has ginac
# GINAC_INCLUDE_DIR - The ginac include directory
# GINAC_LIBRARIES - The libraries needed to use ginac
# GINAC_VERSION_STRING - The version of ginac ("major.minor.micro")
# use pkg-config to get the directories and then use these values
# in the find_path() and find_library() calls
find_package(PkgConfig QUIET)
PKG_CHECK_MODULES(PC_GINAC QUIET ginac)
find_path(GINAC_INCLUDE_DIR NAMES ginac.h
HINTS
${PC_GINAC_INCLUDEDIR}
${PC_GINAC_INCLUDE_DIRS}
PATH_SUFFIXES ginac
)
find_library(GINAC_LIBRARIES NAMES ginac
HINTS
${PC_GINAC_LIBDIR}
${PC_GINAC_LIBRARY_DIRS}
)
if(PC_GINAC_VERSION)
set(GINAC_VERSION_STRING ${PC_GINAC_VERSION})
elseif(GINAC_INCLUDE_DIR AND EXISTS "${GINAC_INCLUDE_DIR}/ginac.h")
file(STRINGS "${GINAC_INCLUDE_DIR}/ginac.h" ginac_major_version
REGEX "^#define[\t ]+GINACLIB_MAJOR_VERSION[\t ]+.+")
file(STRINGS "${GINAC_INCLUDE_DIR}/ginac.h" ginac_minor_version
REGEX "^#define[\t ]+GINACLIB_MINOR_VERSION[\t ]+.+")
file(STRINGS "${GINAC_INCLUDE_DIR}/ginac.h" ginac_micro_version
REGEX "^#define[\t ]+GINACLIB_MICRO_VERSION[\t ]+.+")
string(REGEX REPLACE "^#define[\t ]+GINACLIB_MAJOR_VERSION[\t ]+(.+)" "\\1"
ginac_major_version "${ginac_major_version}")
string(REGEX REPLACE "^#define[\t ]+GINACLIB_MINOR_VERSION[\t ]+(.+)" "\\1"
ginac_minor_version "${ginac_minor_version}")
string(REGEX REPLACE "^#define[\t ]+GINACLIB_MICRO_VERSION[\t ]+(.+)" "\\1"
ginac_micro_version "${ginac_micro_version}")
set(GINAC_VERSION_STRING "${ginac_major_version}.${ginac_minor_version}.${ginac_micro_version}")
unset(ginac_major_version)
unset(ginac_minor_version)
unset(ginac_micro_version)
endif()
# handle the QUIETLY and REQUIRED arguments and set GINAC_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GINAC
REQUIRED_VARS GINAC_LIBRARIES GINAC_INCLUDE_DIR
VERSION_VAR GINAC_VERSION_STRING)
mark_as_advanced(GINAC_INCLUDE_DIR GINAC_LIBRARIES)

3
resources/cmake/macros/export.cmake

@ -8,6 +8,9 @@ message(STATUS "Registered with cmake")
export(PACKAGE storm)
set(DEP_TARGETS "")
foreach(dt ${STORM_DEP_TARGETS})
export_target(DEP_TARGETS ${dt})
endforeach()
set(EXP_OPTIONS "")
foreach(option ${EXPORTED_OPTIONS})

3
resources/cmake/macros/imported.cmake

@ -7,7 +7,8 @@ macro(add_imported_library_interface name include)
endmacro(add_imported_library_interface)
macro(add_imported_library name type lib include)
# Workaround from https://cmake.org/Bug/view.php?id=15052
message("${name} include ${include}")
# Workaround from https://cmake.org/Bug/view.php?id=15052
file(MAKE_DIRECTORY "${include}")
if("${lib}" STREQUAL "")
if("${type}" STREQUAL "SHARED")

2
src/CMakeLists.txt

@ -6,3 +6,5 @@ add_subdirectory(storm-gspn-cli)
add_subdirectory(storm-dft)
add_subdirectory(storm-dft-cli)
add_subdirectory(test)
set(STORM_TARGETS ${STORM_TARGETS} PARENT_SCOPE)

6
src/storm/CMakeLists.txt

@ -39,8 +39,10 @@ add_library(storm SHARED ${STORM_LIB_SOURCES} ${STORM_LIB_HEADERS})
# Remove define symbol for shared libstorm.
set_target_properties(storm PROPERTIES DEFINE_SYMBOL "")
add_dependencies(storm resources)
target_link_libraries(storm ${STORM_LINK_LIBRARIES})
list(APPEND STORM_TARGETS storm CACHE STRING INTERNAL FORCE)
message("STORM_DEP_TARGETS: ${STORM_DEP_TARGETS}")
target_link_libraries(storm PUBLIC ${STORM_DEP_TARGETS} ${STORM_LINK_LIBRARIES})
list(APPEND STORM_TARGETS storm)
set(STORM_TARGETS ${STORM_TARGETS} PARENT_SCOPE)
# Create storm.
add_executable(storm-main ${STORM_MAIN_SOURCES} ${STORM_MAIN_HEADERS})

Loading…
Cancel
Save