diff --git a/cmake/FindCOIN.cmake b/cmake/FindCOIN.cmake --- a/cmake/FindCOIN.cmake +++ b/cmake/FindCOIN.cmake @@ -54,6 +54,17 @@ HINTS ${COIN_ROOT_DIR}/lib ) +FIND_LIBRARY(COIN_ZLIB_LIBRARY + NAMES z libz + HINTS ${COIN_ROOT_DIR}/lib/coin + HINTS ${COIN_ROOT_DIR}/lib +) +FIND_LIBRARY(COIN_BZ2_LIBRARY + NAMES bz2 libbz2 + HINTS ${COIN_ROOT_DIR}/lib/coin + HINTS ${COIN_ROOT_DIR}/lib +) + INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(COIN DEFAULT_MSG COIN_INCLUDE_DIR @@ -71,9 +82,15 @@ IF(COIN_FOUND) SET(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR}) - SET(COIN_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY}") - SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY}") - SET(COIN_CBC_LIBRARIES ${COIN_LIBRARIES}) + SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_ZLIB_LIBRARY};${COIN_BZ2_LIBRARY}") + IF(COIN_ZLIB_LIBRARY) + SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_ZLIB_LIBRARY}") + ENDIF(COIN_ZLIB_LIBRARY) + IF(COIN_BZ2_LIBRARY) + SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_BZ2_LIBRARY}") + ENDIF(COIN_BZ2_LIBRARY) + 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}") + SET(COIN_LIBRARIES ${COIN_CBC_LIBRARIES}) ENDIF(COIN_FOUND) MARK_AS_ADVANCED( @@ -88,6 +105,8 @@ COIN_OSI_CLP_LIBRARY COIN_OSI_VOL_LIBRARY COIN_VOL_LIBRARY + COIN_ZLIB_LIBRARY + COIN_BZ2_LIBRARY ) IF(COIN_FOUND) diff --git a/cmake/FindCPLEX.cmake b/cmake/FindCPLEX.cmake --- a/cmake/FindCPLEX.cmake +++ b/cmake/FindCPLEX.cmake @@ -2,23 +2,25 @@ FIND_PATH(CPLEX_INCLUDE_DIR ilcplex/cplex.h - PATHS "C:/ILOG/CPLEX91/include" - PATHS "/opt/ilog/cplex91/include" + PATHS "C:/ILOG/CPLEX/include" + PATHS "/opt/ilog/cplex/include" HINTS ${CPLEX_ROOT_DIR}/include ) FIND_LIBRARY(CPLEX_LIBRARY - cplex91 - PATHS "C:/ILOG/CPLEX91/lib/msvc7/stat_mda" - PATHS "/opt/ilog/cplex91/bin" + cplex + PATHS "C:/ILOG/CPLEX/lib/msvc7/stat_mda" + PATHS "/opt/ilog/cplex/bin" HINTS ${CPLEX_ROOT_DIR}/bin + HINTS ${CPLEX_ROOT_DIR}/lib ) INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPLEX DEFAULT_MSG CPLEX_LIBRARY CPLEX_INCLUDE_DIR) FIND_PATH(CPLEX_BIN_DIR - cplex91.dll - PATHS "C:/ILOG/CPLEX91/bin/x86_win32" + cplex.dll + PATHS "C:/ILOG/CPLEX/bin/x86_win32" + HINTS ${CPLEX_ROOT_DIR}/bin ) IF(CPLEX_FOUND) diff --git a/lemon/cbc.cc b/lemon/cbc.cc --- a/lemon/cbc.cc +++ b/lemon/cbc.cc @@ -25,12 +25,7 @@ #include #include -#ifdef COIN_HAS_CLP #include "coin/OsiClpSolverInterface.hpp" -#endif -#ifdef COIN_HAS_OSL -#include "coin/OsiOslSolverInterface.hpp" -#endif #include "coin/CbcCutGenerator.hpp" #include "coin/CbcHeuristicLocal.hpp" @@ -270,13 +265,7 @@ if (_osi_solver) { delete _osi_solver; } -#ifdef COIN_HAS_CLP _osi_solver = new OsiClpSolverInterface(); -#elif COIN_HAS_OSL - _osi_solver = new OsiOslSolverInterface(); -#else -#error Cannot instantiate Osi solver -#endif _osi_solver->loadFromCoinModel(*_prob); @@ -328,13 +317,11 @@ CglFlowCover flowGen; _cbc_model->addCutGenerator(&flowGen, -1, "FlowCover"); -#ifdef COIN_HAS_CLP OsiClpSolverInterface* osiclp = dynamic_cast(_cbc_model->solver()); if (osiclp->getNumRows() < 300 && osiclp->getNumCols() < 500) { osiclp->setupForRepeatedUse(2, 0); } -#endif CbcRounding heuristic1(*_cbc_model); heuristic1.setWhen(3); diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -89,7 +89,7 @@ GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION) GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH} ) ENDIF() ENDIF() @@ -131,7 +131,7 @@ GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION) GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH} ) ENDIF() ENDIF()