Browse Source

cmake: Fixed compilation of shipped glpk under mac os

tempestpy_adaptions
Tim Quatmann 5 years ago
parent
commit
d67f1b4898
  1. 2
      resources/3rdparty/include_cudd.cmake
  2. 21
      resources/3rdparty/include_glpk.cmake

2
resources/3rdparty/include_cudd.cmake

@ -28,7 +28,7 @@ if (NOT STORM_PORTABLE)
set(STORM_CUDD_FLAGS "${STORM_CUDD_FLAGS} -march=native") set(STORM_CUDD_FLAGS "${STORM_CUDD_FLAGS} -march=native")
endif() endif()
# Set sysroot to circumvent problems in macOS "Mojave" where the header files are no longer in /usr/include
# Set sysroot to circumvent problems in macOS "Mojave" (or higher) where the header files are no longer in /usr/include
set(CUDD_INCLUDE_FLAGS "") set(CUDD_INCLUDE_FLAGS "")
if (CMAKE_OSX_SYSROOT) if (CMAKE_OSX_SYSROOT)
set(CUDD_INCLUDE_FLAGS "CPPFLAGS=--sysroot=${CMAKE_OSX_SYSROOT}") set(CUDD_INCLUDE_FLAGS "CPPFLAGS=--sysroot=${CMAKE_OSX_SYSROOT}")

21
resources/3rdparty/include_glpk.cmake

@ -3,13 +3,20 @@ 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.65/lib)
# Set sysroot to circumvent problems in macOS "Mojave" (or higher) where the header files are no longer in /usr/include
set(GLPK_INCLUDE_FLAGS "")
if (CMAKE_OSX_SYSROOT)
set(GLPK_INCLUDE_FLAGS "CPPFLAGS=--sysroot=${CMAKE_OSX_SYSROOT}")
endif()
ExternalProject_Add(glpk_ext ExternalProject_Add(glpk_ext
DOWNLOAD_COMMAND "" DOWNLOAD_COMMAND ""
PREFIX ${STORM_3RDPARTY_BINARY_DIR}/glpk-4.57
SOURCE_DIR ${STORM_3RDPARTY_SOURCE_DIR}/glpk-4.57
CONFIGURE_COMMAND ${STORM_3RDPARTY_SOURCE_DIR}/glpk-4.57/configure --prefix=${STORM_3RDPARTY_BINARY_DIR}/glpk-4.57 --libdir=${GLPK_LIB_DIR} CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER}
BUILD_COMMAND make "CFLAGS=-O2 -w"
PREFIX ${STORM_3RDPARTY_BINARY_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}
BUILD_COMMAND make "CFLAGS=-O3 -w"
INSTALL_COMMAND make install INSTALL_COMMAND make install
BUILD_IN_SOURCE 0 BUILD_IN_SOURCE 0
LOG_CONFIGURE ON LOG_CONFIGURE ON
@ -18,8 +25,8 @@ else()
BUILD_BYPRODUCTS ${GLPK_LIB_DIR}/libglpk${DYNAMIC_EXT} ${GLPK_LIB_DIR}/libglpk${STATIC_EXT} BUILD_BYPRODUCTS ${GLPK_LIB_DIR}/libglpk${DYNAMIC_EXT} ${GLPK_LIB_DIR}/libglpk${STATIC_EXT}
) )
set(GLPK_LIBRARIES ${GLPK_LIB_DIR}/libglpk${DYNAMIC_EXT}) 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)
set(GLPK_INCLUDE_DIR ${STORM_3RDPARTY_BINARY_DIR}/glpk-4.65/include)
set(GLPK_VERSION_STRING 4.65)
add_dependencies(resources glpk_ext) add_dependencies(resources glpk_ext)
endif() endif()

Loading…
Cancel
Save