Better MIP solver discovery and support linking to CLP/CBC on Windows (#614)
authorAlpar Juttner <alpar@cs.elte.hu>
Wed, 17 Oct 2018 17:24:14 +0200
changeset 1180389416f8a995
parent 1179 d7e25df22e88
child 1181 1e5da3fc4fbc
Better MIP solver discovery and support linking to CLP/CBC on Windows (#614)
CMakeLists.txt
cmake/FindCOIN.cmake
     1.1 --- a/CMakeLists.txt	Mon Oct 15 23:39:22 2018 +0200
     1.2 +++ b/CMakeLists.txt	Wed Oct 17 17:24:14 2018 +0200
     1.3 @@ -82,38 +82,37 @@
     1.4  
     1.5  IF(LEMON_ENABLE_GLPK) 
     1.6    FIND_PACKAGE(GLPK 4.33)
     1.7 +  IF(GLPK_FOUND)
     1.8 +    SET(LEMON_HAVE_LP TRUE)
     1.9 +    SET(LEMON_HAVE_MIP TRUE)
    1.10 +    SET(LEMON_HAVE_GLPK TRUE)
    1.11 +  ENDIF(GLPK_FOUND)
    1.12  ENDIF(LEMON_ENABLE_GLPK)
    1.13  IF(LEMON_ENABLE_ILOG)
    1.14    FIND_PACKAGE(ILOG)
    1.15 +  IF(ILOG_FOUND)
    1.16 +    SET(LEMON_HAVE_LP TRUE)
    1.17 +    SET(LEMON_HAVE_MIP TRUE)
    1.18 +    SET(LEMON_HAVE_CPLEX TRUE)
    1.19 +  ENDIF(ILOG_FOUND)
    1.20  ENDIF(LEMON_ENABLE_ILOG)
    1.21  IF(LEMON_ENABLE_COIN)
    1.22    FIND_PACKAGE(COIN)
    1.23 +  IF(COIN_FOUND)
    1.24 +    SET(LEMON_HAVE_LP TRUE)
    1.25 +    SET(LEMON_HAVE_MIP TRUE)
    1.26 +    SET(LEMON_HAVE_CLP TRUE)
    1.27 +    SET(LEMON_HAVE_CBC TRUE)
    1.28 +  ENDIF(COIN_FOUND)
    1.29  ENDIF(LEMON_ENABLE_COIN)
    1.30  IF(LEMON_ENABLE_SOPLEX)
    1.31    FIND_PACKAGE(SOPLEX)
    1.32 +  IF(SOPLEX_FOUND)
    1.33 +    SET(LEMON_HAVE_LP TRUE)
    1.34 +    SET(LEMON_HAVE_SOPLEX TRUE)
    1.35 +  ENDIF(SOPLEX_FOUND)
    1.36  ENDIF(LEMON_ENABLE_SOPLEX)
    1.37  
    1.38 -IF(GLPK_FOUND)
    1.39 -  SET(LEMON_HAVE_LP TRUE)
    1.40 -  SET(LEMON_HAVE_MIP TRUE)
    1.41 -  SET(LEMON_HAVE_GLPK TRUE)
    1.42 -ENDIF(GLPK_FOUND)
    1.43 -IF(ILOG_FOUND)
    1.44 -  SET(LEMON_HAVE_LP TRUE)
    1.45 -  SET(LEMON_HAVE_MIP TRUE)
    1.46 -  SET(LEMON_HAVE_CPLEX TRUE)
    1.47 -ENDIF(ILOG_FOUND)
    1.48 -IF(COIN_FOUND)
    1.49 -  SET(LEMON_HAVE_LP TRUE)
    1.50 -  SET(LEMON_HAVE_MIP TRUE)
    1.51 -  SET(LEMON_HAVE_CLP TRUE)
    1.52 -  SET(LEMON_HAVE_CBC TRUE)
    1.53 -ENDIF(COIN_FOUND)
    1.54 -IF(SOPLEX_FOUND)
    1.55 -  SET(LEMON_HAVE_LP TRUE)
    1.56 -  SET(LEMON_HAVE_SOPLEX TRUE)
    1.57 -ENDIF(SOPLEX_FOUND)
    1.58 -
    1.59  IF(ILOG_FOUND)
    1.60    SET(DEFAULT_LP "CPLEX")
    1.61    SET(DEFAULT_MIP "CPLEX")
     2.1 --- a/cmake/FindCOIN.cmake	Mon Oct 15 23:39:22 2018 +0200
     2.2 +++ b/cmake/FindCOIN.cmake	Wed Oct 17 17:24:14 2018 +0200
     2.3 @@ -65,6 +65,12 @@
     2.4    HINTS ${COIN_ROOT_DIR}/lib
     2.5  )
     2.6  
     2.7 +FIND_LIBRARY(COIN_PTHREADS_LIBRARY
     2.8 +  NAMES pthreads libpthreads
     2.9 +  HINTS ${COIN_ROOT_DIR}/lib/coin
    2.10 +  HINTS ${COIN_ROOT_DIR}/lib
    2.11 +)
    2.12 +
    2.13  INCLUDE(FindPackageHandleStandardArgs)
    2.14  FIND_PACKAGE_HANDLE_STANDARD_ARGS(COIN DEFAULT_MSG
    2.15    COIN_INCLUDE_DIR
    2.16 @@ -82,14 +88,17 @@
    2.17  
    2.18  IF(COIN_FOUND)
    2.19    SET(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR})
    2.20 -  SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_ZLIB_LIBRARY};${COIN_BZ2_LIBRARY}")
    2.21 +  SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY}")
    2.22    IF(COIN_ZLIB_LIBRARY)
    2.23      SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_ZLIB_LIBRARY}")
    2.24    ENDIF(COIN_ZLIB_LIBRARY)
    2.25     IF(COIN_BZ2_LIBRARY)
    2.26      SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_BZ2_LIBRARY}")
    2.27    ENDIF(COIN_BZ2_LIBRARY)
    2.28 -  SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_ZLIB_LIBRARY};${COIN_BZ2_LIBRARY};${COIN_CLP_LIBRARIES}")
    2.29 +   IF(COIN_PTHREADS_LIBRARY)
    2.30 +    SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_PTHREADS_LIBRARY}")
    2.31 +  ENDIF(COIN_PTHREADS_LIBRARY)
    2.32 +  SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_CLP_LIBRARIES}")
    2.33    SET(COIN_LIBRARIES ${COIN_CBC_LIBRARIES})
    2.34  ENDIF(COIN_FOUND)
    2.35