COIN-OR::LEMON - Graph Library

Changeset 1230:caf16813b1e8 in lemon


Ignore:
Timestamp:
07/21/12 10:18:57 (7 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Message:

Better CPLEX discovery (#446)

Files:
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r1185 r1230  
    6363FIND_PACKAGE(Ghostscript)
    6464FIND_PACKAGE(GLPK 4.33)
    65 FIND_PACKAGE(CPLEX)
     65FIND_PACKAGE(ILOG)
    6666FIND_PACKAGE(COIN)
    6767
  • INSTALL

    r1148 r1230  
    109109-DGLPK_ROOT_DIR=DIRECTORY
    110110-DCOIN_ROOT_DIR=DIRECTORY
    111 -DCPLEX_ROOT_DIR=DIRECTORY
     111-DILOG_ROOT_DIR=DIRECTORY
    112112
    113113  Install root directory prefixes of optional third party libraries.
  • cmake/FindGLPK.cmake

    r685 r1230  
    6060  SET(LEMON_HAVE_GLPK TRUE)
    6161ENDIF(GLPK_FOUND)
     62
  • cmake/FindILOG.cmake

    r1119 r1230  
    1 SET(CPLEX_ROOT_DIR "" CACHE PATH "CPLEX root directory")
    2 
    3 FIND_PATH(CPLEX_INCLUDE_DIR
    4   ilcplex/cplex.h
    5   PATHS "C:/ILOG/CPLEX/include"
    6   PATHS "/opt/ilog/cplex/include"
    7   HINTS ${CPLEX_ROOT_DIR}/include
    8 )
    9 FIND_LIBRARY(CPLEX_LIBRARY
    10   cplex
    11   PATHS "C:/ILOG/CPLEX/lib/msvc7/stat_mda"
    12   PATHS "/opt/ilog/cplex/bin"
    13   HINTS ${CPLEX_ROOT_DIR}/bin
    14   HINTS ${CPLEX_ROOT_DIR}/lib
     1FIND_PATH(ILOG_ROOT_DIR
     2  NAMES cplex
     3  DOC "CPLEX STUDIO root directory"
     4  PATHS /opt/ibm/ILOG /usr/local/ibm/ILOG /usr/local/ILOG /usr/local/ilog
     5  PATHS "$ENV{HOME}/ILOG" "$ENV{HOME}/.local/ILOG"
     6  PATHS "$ENV{HOME}/ibm/ILOG" "$ENV{HOME}/.local/ibm/ILOG"
     7  PATHS "C:/Program Files/IBM/ILOG"
     8  PATH_SUFFIXES "CPLEX_Studio126" "CPLEX_Studio125"
     9  "CPLEX_Studio124" "CPLEX_Studio123" "CPLEX_Studio122"
     10  NO_DEFAULT_PATH
    1511)
    1612
    17 INCLUDE(FindPackageHandleStandardArgs)
    18 FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPLEX DEFAULT_MSG CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
     13IF(WIN32)
     14  IF(MSVC_VERSION STREQUAL "1400")
     15    SET(ILOG_WIN_COMPILER "windows_vs2005")
     16  ELSEIF(MSVC_VERSION STREQUAL "1500")
     17    SET(ILOG_WIN_COMPILER "windows_vs2008")
     18  ELSEIF(MSVC_VERSION STREQUAL "1600")
     19    SET(ILOG_WIN_COMPILER "windows_vs2010")
     20  ELSE()
     21    SET(ILOG_WIN_COMPILER "windows_vs2008")
     22  ENDIF()
     23  IF(CMAKE_CL_64)
     24    SET(ILOG_WIN_COMPILER "x64_${ILOG_WIN_COMPILER}")
     25    SET(ILOG_WIN_PLATFORM "x64_win32")
     26  ELSE()
     27    SET(ILOG_WIN_COMPILER "x86_${ILOG_WIN_COMPILER}")
     28    SET(ILOG_WIN_PLATFORM "x86_win32")
     29  ENDIF()
     30ENDIF()
    1931
    20 FIND_PATH(CPLEX_BIN_DIR
    21   cplex.dll
    22   PATHS "C:/ILOG/CPLEX/bin/x86_win32"
    23   HINTS ${CPLEX_ROOT_DIR}/bin
     32FIND_PATH(ILOG_CPLEX_ROOT_DIR
     33  NAMES include/ilcplex
     34  HINTS ${ILOG_ROOT_DIR}/cplex ${ILOG_ROOT_DIR}/cplex121
     35  ${ILOG_ROOT_DIR}/cplex122 ${ILOG_ROOT_DIR}/cplex123
     36  DOC "CPLEX root directory"
     37  NO_DEFAULT_PATH
    2438)
    2539
    26 IF(CPLEX_FOUND)
    27   SET(CPLEX_INCLUDE_DIRS ${CPLEX_INCLUDE_DIR})
    28   SET(CPLEX_LIBRARIES ${CPLEX_LIBRARY})
     40FIND_PATH(ILOG_CONCERT_ROOT_DIR
     41  NAMES include/ilconcert
     42  HINTS ${ILOG_ROOT_DIR}/concert ${ILOG_ROOT_DIR}/concert29
     43  DOC "CONCERT root directory"
     44  NO_DEFAULT_PATH
     45)
     46
     47FIND_PATH(ILOG_CPLEX_INCLUDE_DIR
     48  ilcplex/cplex.h
     49  HINTS ${ILOG_CPLEX_ROOT_DIR}/include
     50  NO_DEFAULT_PATH
     51)
     52
     53FIND_PATH(ILOG_CONCERT_INCLUDE_DIR
     54  ilconcert/ilobasic.h
     55  HINTS ${ILOG_CONCERT_ROOT_DIR}/include
     56  NO_DEFAULT_PATH
     57)
     58
     59FIND_LIBRARY(ILOG_CPLEX_LIBRARY
     60  cplex cplex121 cplex122 cplex123 cplex124
     61  HINTS ${ILOG_CPLEX_ROOT_DIR}/lib/x86_sles10_4.1/static_pic
     62  ${ILOG_CPLEX_ROOT_DIR}/lib/x86-64_sles10_4.1/static_pic
     63  ${ILOG_CPLEX_ROOT_DIR}/lib/x86_debian4.0_4.1/static_pic
     64  ${ILOG_CPLEX_ROOT_DIR}/lib/x86-64_debian4.0_4.1/static_pic
     65  ${ILOG_CPLEX_ROOT_DIR}/lib/${ILOG_WIN_COMPILER}/stat_mda
     66  NO_DEFAULT_PATH
     67  )
     68
     69FIND_LIBRARY(ILOG_CONCERT_LIBRARY
     70  concert
     71  HINTS ${ILOG_CONCERT_ROOT_DIR}/lib/x86_sles10_4.1/static_pic
     72  ${ILOG_CONCERT_ROOT_DIR}/lib/x86-64_sles10_4.1/static_pic
     73  ${ILOG_CONCERT_ROOT_DIR}/lib/x86_debian4.0_4.1/static_pic
     74  ${ILOG_CONCERT_ROOT_DIR}/lib/x86-64_debian4.0_4.1/static_pic
     75  ${ILOG_CONCERT_ROOT_DIR}/lib/${ILOG_WIN_COMPILER}/stat_mda
     76  NO_DEFAULT_PATH
     77  )
     78
     79FIND_FILE(ILOG_CPLEX_DLL
     80  cplex121.dll cplex122.dll cplex123.dll cplex124.dll
     81  HINTS ${ILOG_CPLEX_ROOT_DIR}/bin/${ILOG_WIN_PLATFORM}
     82  NO_DEFAULT_PATH
     83  )
     84
     85INCLUDE(FindPackageHandleStandardArgs)
     86FIND_PACKAGE_HANDLE_STANDARD_ARGS(ILOG
     87  DEFAULT_MSG ILOG_CPLEX_LIBRARY ILOG_CPLEX_INCLUDE_DIR
     88  )
     89
     90IF(ILOG_FOUND)
     91  SET(ILOG_INCLUDE_DIRS ${ILOG_CPLEX_INCLUDE_DIR} ${ILOG_CONCERT_INCLUDE_DIR})
     92  SET(ILOG_LIBRARIES ${ILOG_CPLEX_LIBRARY} ${ILOG_CONCERT_LIBRARY})
    2993  IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    30     SET(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread")
     94    # SET(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread")
     95    SET(ILOG_LIBRARIES ${ILOG_LIBRARIES} "m" "pthread")
    3196  ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    32 ENDIF(CPLEX_FOUND)
     97ENDIF(ILOG_FOUND)
    3398
    34 MARK_AS_ADVANCED(CPLEX_LIBRARY CPLEX_INCLUDE_DIR CPLEX_BIN_DIR)
     99MARK_AS_ADVANCED(
     100  ILOG_CPLEX_LIBRARY ILOG_CPLEX_INCLUDE_DIR ILOG_CPLEX_DLL
     101  ILOG_CONCERT_LIBRARY ILOG_CONCERT_INCLUDE_DIR ILOG_CONCERT_DLL
     102  )
    35103
    36 IF(CPLEX_FOUND)
     104IF(ILOG_FOUND)
    37105  SET(LEMON_HAVE_LP TRUE)
    38106  SET(LEMON_HAVE_MIP TRUE)
    39107  SET(LEMON_HAVE_CPLEX TRUE)
    40 ENDIF(CPLEX_FOUND)
     108ENDIF(ILOG_FOUND)
  • lemon/CMakeLists.txt

    r1133 r1230  
    3737IF(LEMON_HAVE_CPLEX)
    3838  SET(LEMON_SOURCES ${LEMON_SOURCES} cplex.cc)
    39   INCLUDE_DIRECTORIES(${CPLEX_INCLUDE_DIRS})
     39  INCLUDE_DIRECTORIES(${ILOG_INCLUDE_DIRS})
    4040ENDIF()
    4141
  • test/CMakeLists.txt

    r1162 r1230  
    6767  ENDIF()
    6868  IF(LEMON_HAVE_CPLEX)
    69     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
     69    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${ILOG_LIBRARIES})
    7070  ENDIF()
    7171  IF(LEMON_HAVE_CLP)
     
    9191    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    9292    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
    93       COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
     93      COMMAND ${CMAKE_COMMAND} -E copy ${ILOG_CPLEX_DLL} ${TARGET_PATH}
    9494    )
    9595  ENDIF()
     
    109109  ENDIF()
    110110  IF(LEMON_HAVE_CPLEX)
    111     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
     111    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${ILOG_LIBRARIES})
    112112  ENDIF()
    113113  IF(LEMON_HAVE_CBC)
     
    133133    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    134134    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
    135       COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
     135      COMMAND ${CMAKE_COMMAND} -E copy ${ILOG_CPLEX_DLL} ${TARGET_PATH}
    136136    )
    137137  ENDIF()
Note: See TracChangeset for help on using the changeset viewer.