Browse Source

Added cmake option STORM_RESOURCES_BUILD_JOBCOUNT to have better control on how many jobs we shall use to build external stuff (like spot, carl, cudd, glpk, ?)

tempestpy_adaptions
Tim Quatmann 3 years ago
committed by Stefan Pranger
parent
commit
feadd3af77
  1. 12
      CMakeLists.txt
  2. 3
      resources/3rdparty/CMakeLists.txt
  3. 2
      resources/3rdparty/include_cudd.cmake
  4. 2
      resources/3rdparty/include_glpk.cmake
  5. 2
      resources/3rdparty/include_spot.cmake

12
CMakeLists.txt

@ -23,6 +23,7 @@ include(RegisterSourceGroup)
include(imported) include(imported)
include(CheckCXXSourceCompiles) include(CheckCXXSourceCompiles)
include(CheckCSourceCompiles) include(CheckCSourceCompiles)
include(ProcessorCount)
############################################################# #############################################################
## ##
@ -84,6 +85,17 @@ 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)
# Get an approximation of the number of available processors (used for parallel build of shipped resources)
ProcessorCount(STORM_RESOURCES_BUILD_JOBCOUNT_DEFAULT)
# To be safe, we only take a little more than half of the resources.
# This also correctly deals with the case where ProcessorCount is unable to find the correct number (and thus returns 0)
MATH(EXPR STORM_RESOURCES_BUILD_JOBCOUNT_DEFAULT "${STORM_RESOURCES_BUILD_JOBCOUNT_DEFAULT}/2 + 1")
set(STORM_RESOURCES_BUILD_JOBCOUNT "${STORM_RESOURCES_BUILD_JOBCOUNT_DEFAULT}" CACHE STRING "The number of jobs used when building external resources")
mark_as_advanced(STORM_RESOURCES_BUILD_JOBCOUNT)
if(NOT STORM_RESOURCES_BUILD_JOBCOUNT GREATER 0)
message(FATAL_ERROR "STORM_RESOURCES_BUILD_JOBCOUNT must be a positive number. Got '${STORM_RESOURCES_BUILD_JOBCOUNT}' instead." )
endif()
# 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)

3
resources/3rdparty/CMakeLists.txt

@ -5,6 +5,7 @@ set(STORM_3RDPARTY_SOURCE_DIR ${PROJECT_SOURCE_DIR}/resources/3rdparty)
set(STORM_3RDPARTY_BINARY_DIR ${PROJECT_BINARY_DIR}/resources/3rdparty) set(STORM_3RDPARTY_BINARY_DIR ${PROJECT_BINARY_DIR}/resources/3rdparty)
set(STORM_3RDPARTY_INCLUDE_DIR ${PROJECT_BINARY_DIR}/include/resources/3rdparty) set(STORM_3RDPARTY_INCLUDE_DIR ${PROJECT_BINARY_DIR}/include/resources/3rdparty)
message(STATUS "Storm - Building external resources with ${STORM_RESOURCES_BUILD_JOBCOUNT} job(s) in parallel.")
############################################################# #############################################################
## ##
@ -338,7 +339,7 @@ if (STORM_SHIPPED_CARL)
CONFIGURE_COMMAND "" CONFIGURE_COMMAND ""
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
BUILD_COMMAND make lib_carl BUILD_COMMAND make lib_carl
INSTALL_COMMAND make install
INSTALL_COMMAND make install -j${STORM_RESOURCES_BUILD_JOBCOUNT}
LOG_BUILD ON LOG_BUILD ON
LOG_INSTALL ON LOG_INSTALL ON
BUILD_BYPRODUCTS ${STORM_3RDPARTY_BINARY_DIR}/carl/lib/libcarl${DYNAMIC_EXT} BUILD_BYPRODUCTS ${STORM_3RDPARTY_BINARY_DIR}/carl/lib/libcarl${DYNAMIC_EXT}

2
resources/3rdparty/include_cudd.cmake

@ -54,7 +54,7 @@ ExternalProject_Add(
PATCH_COMMAND ${AUTORECONF} PATCH_COMMAND ${AUTORECONF}
CONFIGURE_COMMAND ${STORM_3RDPARTY_SOURCE_DIR}/cudd-3.0.0/configure --enable-shared --enable-obj --with-pic=yes --prefix=${STORM_3RDPARTY_BINARY_DIR}/cudd-3.0.0 --libdir=${CUDD_LIB_DIR} CC=${CMAKE_C_COMPILER} CXX=${CUDD_CXX_COMPILER} ${CUDD_INCLUDE_FLAGS} CONFIGURE_COMMAND ${STORM_3RDPARTY_SOURCE_DIR}/cudd-3.0.0/configure --enable-shared --enable-obj --with-pic=yes --prefix=${STORM_3RDPARTY_BINARY_DIR}/cudd-3.0.0 --libdir=${CUDD_LIB_DIR} CC=${CMAKE_C_COMPILER} CXX=${CUDD_CXX_COMPILER} ${CUDD_INCLUDE_FLAGS}
BUILD_COMMAND make ${STORM_CUDD_FLAGS} BUILD_COMMAND make ${STORM_CUDD_FLAGS}
INSTALL_COMMAND make install
INSTALL_COMMAND make install -j${STORM_RESOURCES_BUILD_JOBCOUNT}
BUILD_IN_SOURCE 0 BUILD_IN_SOURCE 0
LOG_CONFIGURE ON LOG_CONFIGURE ON
LOG_BUILD ON LOG_BUILD ON

2
resources/3rdparty/include_glpk.cmake

@ -17,7 +17,7 @@ else()
SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/glpk-4.65 SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/glpk-4.65
CONFIGURE_COMMAND ${STORM_3RDPARTY_SOURCE_DIR}/glpk-4.65/configure --prefix=${STORM_3RDPARTY_BINARY_DIR}/glpk-4.65 --libdir=${GLPK_LIB_DIR} CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} ${GLPK_INCLUDE_FLAGS} CONFIGURE_COMMAND ${STORM_3RDPARTY_SOURCE_DIR}/glpk-4.65/configure --prefix=${STORM_3RDPARTY_BINARY_DIR}/glpk-4.65 --libdir=${GLPK_LIB_DIR} CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} ${GLPK_INCLUDE_FLAGS}
BUILD_COMMAND make "CFLAGS=-O3 -w" BUILD_COMMAND make "CFLAGS=-O3 -w"
INSTALL_COMMAND make install
INSTALL_COMMAND make install -j${STORM_RESOURCES_BUILD_JOBCOUNT}
BUILD_IN_SOURCE 0 BUILD_IN_SOURCE 0
LOG_CONFIGURE ON LOG_CONFIGURE ON
LOG_BUILD ON LOG_BUILD ON

2
resources/3rdparty/include_spot.cmake

@ -30,7 +30,7 @@ if(STORM_USE_SPOT_SHIPPED AND NOT STORM_HAVE_SPOT)
SOURCE_DIR ${STORM_3RDPARTY_BINARY_DIR}/spot_src SOURCE_DIR ${STORM_3RDPARTY_BINARY_DIR}/spot_src
PREFIX ${STORM_3RDPARTY_BINARY_DIR}/spot PREFIX ${STORM_3RDPARTY_BINARY_DIR}/spot
CONFIGURE_COMMAND ${STORM_3RDPARTY_BINARY_DIR}/spot_src/configure --prefix=${STORM_3RDPARTY_BINARY_DIR}/spot --disable-python CONFIGURE_COMMAND ${STORM_3RDPARTY_BINARY_DIR}/spot_src/configure --prefix=${STORM_3RDPARTY_BINARY_DIR}/spot --disable-python
BUILD_COMMAND make -j1
BUILD_COMMAND make -j${STORM_RESOURCES_BUILD_JOBCOUNT}
INSTALL_COMMAND make install INSTALL_COMMAND make install
LOG_CONFIGURE ON LOG_CONFIGURE ON
LOG_BUILD ON LOG_BUILD ON

Loading…
Cancel
Save