Browse Source

gcc and clang working on Debian Stretch again

tempestpy_adaptions
dehnert 8 years ago
committed by sjunges
parent
commit
97a7689c67
  1. 10
      CMakeLists.txt
  2. 17
      resources/3rdparty/CMakeLists.txt
  3. 29
      resources/3rdparty/include_cpptemplate.cmake
  4. 2
      resources/3rdparty/include_cudd.cmake
  5. 6
      resources/3rdparty/include_glpk.cmake
  6. 8
      resources/3rdparty/include_xerces.cmake
  7. 4
      src/storm/CMakeLists.txt

10
CMakeLists.txt

@ -223,8 +223,14 @@ if (STORM_COMPILER_CLANG OR STORM_COMPILER_APPLECLANG)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -stdlib=${CLANG_STDLIB} -ftemplate-depth=1024")
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffast-math -fno-finite-math-only")
if(LINUX)
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -rdynamic")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")
elseif(MACOSX)
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-export_dynamic")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-export_dynamic")
endif()
elseif (STORM_COMPILER_GCC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fprefetch-loop-arrays -ffast-math -fno-finite-math-only")
@ -235,8 +241,8 @@ endif ()
if (STORM_USE_LTO)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto")
# Fix for problems that occured when using LTO on gcc. This should be removed when it's
# not needed anymore as it makes the the already long link-step potentially longer.
# Fix for problems that occurred when using LTO on gcc. This should be removed when it
# is not needed anymore as it makes the the already long link-step potentially longer.
if (STORM_COMPILER_GCC)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto-partition=none")
endif()

17
resources/3rdparty/CMakeLists.txt

@ -190,13 +190,6 @@ endif()
#############################################################
include(${STORM_3RDPARTY_SOURCE_DIR}/include_cudd.cmake)
#############################################################
##
## cpptemplate
##
#############################################################
include(${STORM_3RDPARTY_SOURCE_DIR}/include_cpptemplate.cmake)
#############################################################
##
## carl
@ -377,7 +370,6 @@ ExternalProject_Add(
LOG_CONFIGURE ON
LOG_BUILD ON
BUILD_BYPRODUCTS ${STORM_3RDPARTY_BINARY_DIR}/sylvan/src/libsylvan${STATIC_EXT}
BUILD_ALWAYS 1
)
ExternalProject_Get_Property(sylvan source_dir)
@ -404,6 +396,15 @@ else()
endif()
endif()
#############################################################
##
## cpptemplate
##
#############################################################
include_directories(${STORM_3RDPARTY_SOURCE_DIR}/cpptemplate)
list(APPEND STORM_3RDPARTY_SOURCES ${STORM_3RDPARTY_SOURCE_DIR}/cpptemplate/cpptempl.cpp)
#############################################################
##
## Google Test gtest

29
resources/3rdparty/include_cpptemplate.cmake

@ -1,29 +0,0 @@
string(REPLACE " " ";" CMAKE_CXX_FLAGS_AS_LIST ${CMAKE_CXX_FLAGS})
if(CMAKE_BUILD_TYPE MATCHES DEBUG)
string(REPLACE " " ";" CMAKE_CXX_FLAGS_DEBUG_AS_LIST ${CMAKE_CXX_FLAGS_DEBUG})
list(APPEND CMAKE_CXX_FLAGS_AS_LIST ${CMAKE_CXX_FLAGS_DEBUG_AS_LIST})
else()
string(REPLACE " " ";" CMAKE_CXX_FLAGS_RELEASE_AS_LIST ${CMAKE_CXX_FLAGS_RELEASE})
list(APPEND CMAKE_CXX_FLAGS_AS_LIST ${CMAKE_CXX_FLAGS_RELEASE_AS_LIST})
endif()
set(CPPTEMPLATE_LIB_DIR ${STORM_3RDPARTY_BINARY_DIR}/cpptemplate)
ExternalProject_Add(
cpptemplate
DOWNLOAD_COMMAND ""
SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/cpptemplate
PREFIX ${STORM_3RDPARTY_BINARY_DIR}/cpptemplate
CONFIGURE_COMMAND ""
BUILD_COMMAND ${CMAKE_CXX_COMPILER} -c ${CMAKE_CXX_FLAGS_AS_LIST} ${CMAKE_CXX_FLAGS_RELEASE_AS_LIST} -fPIC -I${Boost_INCLUDE_DIRS} ${STORM_3RDPARTY_SOURCE_DIR}/cpptemplate/cpptempl.cpp -o ${CPPTEMPLATE_LIB_DIR}/cpptemplate${STATIC_EXT}
INSTALL_COMMAND ""
BUILD_IN_SOURCE 0
LOG_BUILD ON
BUILD_BYPRODUCTS ${CPPTEMPLATE_LIB_DIR}/cpptemplate${STATIC_EXT}
)
set(CPPTEMPLATE_INCLUDE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/cpptemplate)
set(CPPTEMPLATE_STATIC_LIBRARY ${STORM_3RDPARTY_BINARY_DIR}/cpptemplate/cpptemplate${STATIC_EXT})
add_dependencies(resources cpptemplate)
message(STATUS "storm - Linking with cpptemplate.")
add_imported_library(cpptempl STATIC ${CPPTEMPLATE_STATIC_LIBRARY} ${CPPTEMPLATE_INCLUDE_DIR})
list(APPEND STORM_DEP_TARGETS cpptempl_STATIC)

2
resources/3rdparty/include_cudd.cmake

@ -54,4 +54,4 @@ else()
list(APPEND STORM_DEP_TARGETS cudd_STATIC)
endif()
message(STATUS "storm - Linking with CUDD ${CUDD_VERSION_STRING}.")
message(STATUS "Storm - Linking with CUDD ${CUDD_VERSION_STRING}.")

6
resources/3rdparty/include_glpk.cmake

@ -1,8 +1,8 @@
find_package(GLPK QUIET)
if(GLPK_FOUND)
message (STATUS "storm - Using system version of glpk.")
message (STATUS "Storm - Using system version of glpk.")
else()
message (STATUS "storm - Using shipped version of glpk.")
message (STATUS "Storm - Using shipped version of glpk.")
set(GLPK_LIB_DIR ${STORM_3RDPARTY_BINARY_DIR}/glpk-4.57/lib)
ExternalProject_Add(glpk_ext
DOWNLOAD_COMMAND ""
@ -25,7 +25,7 @@ endif()
# Since there is a shipped version, always use GLPK
set(STORM_HAVE_GLPK ON)
message (STATUS "storm - Linking with glpk ${GLPK_VERSION_STRING}")
message (STATUS "Storm - Linking with glpk ${GLPK_VERSION_STRING}")
add_imported_library(glpk SHARED ${GLPK_LIBRARIES} ${GLPK_INCLUDE_DIR})
list(APPEND STORM_DEP_TARGETS glpk_SHARED)

8
resources/3rdparty/include_xerces.cmake

@ -1,9 +1,9 @@
if(USE_XERCESC)
find_package(XercesC QUIET)
if(XercesC_FOUND)
message(STATUS "storm - Use system version of xerces.")
message(STATUS "Storm - Use system version of xerces.")
else()
message(STATUS "storm - Use shipped version of xerces.")
message(STATUS "Storm - Use shipped version of xerces.")
set(XercesC_LIB_DIR ${STORM_3RDPARTY_BINARY_DIR}/xercesc-3.1.2/lib)
ExternalProject_Add(
xercesc
@ -31,7 +31,7 @@ if(USE_XERCESC)
add_dependencies(resources xercesc)
endif()
message (STATUS "storm - Linking with xercesc.")
message (STATUS "Storm - Linking with xercesc.")
set(STORM_HAVE_XERCES ON)
include_directories(${XercesC_INCLUDE_DIRS})
if(APPLE)
@ -44,5 +44,5 @@ if(USE_XERCESC)
list(APPEND STORM_GSPN_LINK_LIBRARIES ${XercesC_LIBRARIES} ${COREFOUNDATION_LIBRARY} ${CORESERVICES_LIBRARY} ${CURL_LIBRARIES})
else()
set(STORM_HAVE_XERCES OFF)
message (WARNING "torm - Building without Xerces disables parsing XML formats (for GSPNs)")
message (WARNING "Storm - Building without Xerces disables parsing XML formats (for GSPNs)")
endif(USE_XERCESC)

4
src/storm/CMakeLists.txt

@ -14,7 +14,7 @@ file(GLOB_RECURSE STORM_MAIN_FILE ${PROJECT_SOURCE_DIR}/src/storm/storm.cpp)
# Additional include files like the storm-config.h
file(GLOB_RECURSE STORM_BUILD_HEADERS ${PROJECT_BINARY_DIR}/include/*.h)
set(STORM_LIB_SOURCES ${STORM_SOURCES_WITHOUT_MAIN})
set(STORM_LIB_SOURCES ${STORM_3RDPARTY_SOURCES} ${STORM_SOURCES_WITHOUT_MAIN})
set(STORM_LIB_HEADERS ${STORM_HEADERS})
set(STORM_MAIN_SOURCES ${STORM_MAIN_FILE})
@ -49,7 +49,7 @@ set(STORM_TARGETS ${STORM_TARGETS} PARENT_SCOPE)
# Create storm.
add_executable(storm-main ${STORM_MAIN_SOURCES} ${STORM_MAIN_HEADERS})
target_link_libraries(storm-main storm)
target_link_libraries(storm-main PUBLIC storm)
set_target_properties(storm-main PROPERTIES OUTPUT_NAME "storm")
# Install storm headers to include directory.

Loading…
Cancel
Save