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 "${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") 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_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-export_dynamic")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-export_dynamic") set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-export_dynamic")
endif()
elseif (STORM_COMPILER_GCC) elseif (STORM_COMPILER_GCC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") 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") 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) if (STORM_USE_LTO)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto") 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) if (STORM_COMPILER_GCC)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto-partition=none") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto-partition=none")
endif() endif()

17
resources/3rdparty/CMakeLists.txt

@ -190,13 +190,6 @@ endif()
############################################################# #############################################################
include(${STORM_3RDPARTY_SOURCE_DIR}/include_cudd.cmake) include(${STORM_3RDPARTY_SOURCE_DIR}/include_cudd.cmake)
#############################################################
##
## cpptemplate
##
#############################################################
include(${STORM_3RDPARTY_SOURCE_DIR}/include_cpptemplate.cmake)
############################################################# #############################################################
## ##
## carl ## carl
@ -377,7 +370,6 @@ ExternalProject_Add(
LOG_CONFIGURE ON LOG_CONFIGURE ON
LOG_BUILD ON LOG_BUILD ON
BUILD_BYPRODUCTS ${STORM_3RDPARTY_BINARY_DIR}/sylvan/src/libsylvan${STATIC_EXT} BUILD_BYPRODUCTS ${STORM_3RDPARTY_BINARY_DIR}/sylvan/src/libsylvan${STATIC_EXT}
BUILD_ALWAYS 1
) )
ExternalProject_Get_Property(sylvan source_dir) ExternalProject_Get_Property(sylvan source_dir)
@ -404,6 +396,15 @@ else()
endif() endif()
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 ## 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) list(APPEND STORM_DEP_TARGETS cudd_STATIC)
endif() 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) find_package(GLPK QUIET)
if(GLPK_FOUND) if(GLPK_FOUND)
message (STATUS "storm - Using system version of glpk.")
message (STATUS "Storm - Using system version of glpk.")
else() 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) set(GLPK_LIB_DIR ${STORM_3RDPARTY_BINARY_DIR}/glpk-4.57/lib)
ExternalProject_Add(glpk_ext ExternalProject_Add(glpk_ext
DOWNLOAD_COMMAND "" DOWNLOAD_COMMAND ""
@ -25,7 +25,7 @@ endif()
# Since there is a shipped version, always use GLPK # Since there is a shipped version, always use GLPK
set(STORM_HAVE_GLPK ON) 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}) add_imported_library(glpk SHARED ${GLPK_LIBRARIES} ${GLPK_INCLUDE_DIR})
list(APPEND STORM_DEP_TARGETS glpk_SHARED) list(APPEND STORM_DEP_TARGETS glpk_SHARED)

8
resources/3rdparty/include_xerces.cmake

@ -1,9 +1,9 @@
if(USE_XERCESC) if(USE_XERCESC)
find_package(XercesC QUIET) find_package(XercesC QUIET)
if(XercesC_FOUND) if(XercesC_FOUND)
message(STATUS "storm - Use system version of xerces.")
message(STATUS "Storm - Use system version of xerces.")
else() 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) set(XercesC_LIB_DIR ${STORM_3RDPARTY_BINARY_DIR}/xercesc-3.1.2/lib)
ExternalProject_Add( ExternalProject_Add(
xercesc xercesc
@ -31,7 +31,7 @@ if(USE_XERCESC)
add_dependencies(resources xercesc) add_dependencies(resources xercesc)
endif() endif()
message (STATUS "storm - Linking with xercesc.")
message (STATUS "Storm - Linking with xercesc.")
set(STORM_HAVE_XERCES ON) set(STORM_HAVE_XERCES ON)
include_directories(${XercesC_INCLUDE_DIRS}) include_directories(${XercesC_INCLUDE_DIRS})
if(APPLE) if(APPLE)
@ -44,5 +44,5 @@ if(USE_XERCESC)
list(APPEND STORM_GSPN_LINK_LIBRARIES ${XercesC_LIBRARIES} ${COREFOUNDATION_LIBRARY} ${CORESERVICES_LIBRARY} ${CURL_LIBRARIES}) list(APPEND STORM_GSPN_LINK_LIBRARIES ${XercesC_LIBRARIES} ${COREFOUNDATION_LIBRARY} ${CORESERVICES_LIBRARY} ${CURL_LIBRARIES})
else() else()
set(STORM_HAVE_XERCES OFF) 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) 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 # Additional include files like the storm-config.h
file(GLOB_RECURSE STORM_BUILD_HEADERS ${PROJECT_BINARY_DIR}/include/*.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_LIB_HEADERS ${STORM_HEADERS})
set(STORM_MAIN_SOURCES ${STORM_MAIN_FILE}) set(STORM_MAIN_SOURCES ${STORM_MAIN_FILE})
@ -49,7 +49,7 @@ set(STORM_TARGETS ${STORM_TARGETS} PARENT_SCOPE)
# Create storm. # Create storm.
add_executable(storm-main ${STORM_MAIN_SOURCES} ${STORM_MAIN_HEADERS}) 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") set_target_properties(storm-main PROPERTIES OUTPUT_NAME "storm")
# Install storm headers to include directory. # Install storm headers to include directory.

Loading…
Cancel
Save