Merge
authorAlpar Juttner <alpar@cs.elte.hu>
Wed, 29 Apr 2009 17:48:41 +0100
changeset 6408d289c89d43e
parent 639 f3792d5bb294
parent 635 72ac25ad276e
child 642 e01957e96c67
Merge
tools/dimacs-solver.cc
     1.1 --- a/CMakeLists.txt	Wed Apr 29 17:48:18 2009 +0100
     1.2 +++ b/CMakeLists.txt	Wed Apr 29 17:48:41 2009 +0100
     1.3 @@ -17,8 +17,6 @@
     1.4  FIND_PACKAGE(CPLEX)
     1.5  FIND_PACKAGE(COIN)
     1.6  
     1.7 -ADD_DEFINITIONS(-DHAVE_CONFIG_H)
     1.8 -
     1.9  IF(MSVC)
    1.10    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4355 /wd4800 /wd4996")
    1.11  # Suppressed warnings:
    1.12 @@ -29,7 +27,7 @@
    1.13  ENDIF(MSVC)
    1.14  
    1.15  INCLUDE(CheckTypeSize)
    1.16 -CHECK_TYPE_SIZE("long long" LONG_LONG)
    1.17 +CHECK_TYPE_SIZE("long long" LEMON_LONG_LONG)
    1.18  
    1.19  ENABLE_TESTING()
    1.20  
     2.1 --- a/Makefile.am	Wed Apr 29 17:48:18 2009 +0100
     2.2 +++ b/Makefile.am	Wed Apr 29 17:48:41 2009 +0100
     2.3 @@ -11,11 +11,12 @@
     2.4  	m4/lx_check_cplex.m4 \
     2.5  	m4/lx_check_glpk.m4 \
     2.6  	m4/lx_check_soplex.m4 \
     2.7 -	m4/lx_check_clp.m4 \
     2.8 -	m4/lx_check_cbc.m4 \
     2.9 +	m4/lx_check_coin.m4 \
    2.10  	CMakeLists.txt \
    2.11  	cmake/FindGhostscript.cmake \
    2.12 +	cmake/FindCPLEX.cmake \
    2.13  	cmake/FindGLPK.cmake \
    2.14 +	cmake/FindCOIN.cmake \
    2.15  	cmake/version.cmake.in \
    2.16  	cmake/version.cmake \
    2.17  	cmake/nsis/lemon.ico \
     3.1 --- a/cmake/FindCOIN.cmake	Wed Apr 29 17:48:18 2009 +0100
     3.2 +++ b/cmake/FindCOIN.cmake	Wed Apr 29 17:48:41 2009 +0100
     3.3 @@ -1,28 +1,48 @@
     3.4  SET(COIN_ROOT_DIR "" CACHE PATH "COIN root directory")
     3.5  
     3.6  FIND_PATH(COIN_INCLUDE_DIR coin/CoinUtilsConfig.h
     3.7 -  PATHS ${COIN_ROOT_DIR}/include)
     3.8 -
     3.9 -FIND_LIBRARY(COIN_CBC_LIBRARY libCbc
    3.10 -  PATHS ${COIN_ROOT_DIR}/lib)
    3.11 -FIND_LIBRARY(COIN_CBC_SOLVER_LIBRARY libCbcSolver
    3.12 -  PATHS ${COIN_ROOT_DIR}/lib)
    3.13 -FIND_LIBRARY(COIN_CGL_LIBRARY libCgl
    3.14 -  PATHS ${COIN_ROOT_DIR}/lib)
    3.15 -FIND_LIBRARY(COIN_CLP_LIBRARY libClp
    3.16 -  PATHS ${COIN_ROOT_DIR}/lib)
    3.17 -FIND_LIBRARY(COIN_COIN_UTILS_LIBRARY libCoinUtils
    3.18 -  PATHS ${COIN_ROOT_DIR}/lib)
    3.19 -FIND_LIBRARY(COIN_OSI_LIBRARY libOsi
    3.20 -  PATHS ${COIN_ROOT_DIR}/lib)
    3.21 -FIND_LIBRARY(COIN_OSI_CBC_LIBRARY libOsiCbc
    3.22 -  PATHS ${COIN_ROOT_DIR}/lib)
    3.23 -FIND_LIBRARY(COIN_OSI_CLP_LIBRARY libOsiClp
    3.24 -  PATHS ${COIN_ROOT_DIR}/lib)
    3.25 -FIND_LIBRARY(COIN_OSI_VOL_LIBRARY libOsiVol
    3.26 -  PATHS ${COIN_ROOT_DIR}/lib)
    3.27 -FIND_LIBRARY(COIN_VOL_LIBRARY libVol
    3.28 -  PATHS ${COIN_ROOT_DIR}/lib)
    3.29 +  HINTS ${COIN_ROOT_DIR}/include
    3.30 +)
    3.31 +FIND_LIBRARY(COIN_CBC_LIBRARY
    3.32 +  NAMES Cbc libCbc
    3.33 +  HINTS ${COIN_ROOT_DIR}/lib
    3.34 +)
    3.35 +FIND_LIBRARY(COIN_CBC_SOLVER_LIBRARY
    3.36 +  NAMES CbcSolver libCbcSolver
    3.37 +  HINTS ${COIN_ROOT_DIR}/lib
    3.38 +)
    3.39 +FIND_LIBRARY(COIN_CGL_LIBRARY
    3.40 +  NAMES Cgl libCgl
    3.41 +  HINTS ${COIN_ROOT_DIR}/lib
    3.42 +)
    3.43 +FIND_LIBRARY(COIN_CLP_LIBRARY
    3.44 +  NAMES Clp libClp
    3.45 +  HINTS ${COIN_ROOT_DIR}/lib
    3.46 +)
    3.47 +FIND_LIBRARY(COIN_COIN_UTILS_LIBRARY
    3.48 +  NAMES CoinUtils libCoinUtils
    3.49 +  HINTS ${COIN_ROOT_DIR}/lib
    3.50 +)
    3.51 +FIND_LIBRARY(COIN_OSI_LIBRARY
    3.52 +  NAMES Osi libOsi
    3.53 +  HINTS ${COIN_ROOT_DIR}/lib
    3.54 +)
    3.55 +FIND_LIBRARY(COIN_OSI_CBC_LIBRARY
    3.56 +  NAMES OsiCbc libOsiCbc
    3.57 +  HINTS ${COIN_ROOT_DIR}/lib
    3.58 +)
    3.59 +FIND_LIBRARY(COIN_OSI_CLP_LIBRARY
    3.60 +  NAMES OsiClp libOsiClp
    3.61 +  HINTS ${COIN_ROOT_DIR}/lib
    3.62 +)
    3.63 +FIND_LIBRARY(COIN_OSI_VOL_LIBRARY
    3.64 +  NAMES OsiVol libOsiVol
    3.65 +  HINTS ${COIN_ROOT_DIR}/lib
    3.66 +)
    3.67 +FIND_LIBRARY(COIN_VOL_LIBRARY
    3.68 +  NAMES Vol libVol
    3.69 +  HINTS ${COIN_ROOT_DIR}/lib
    3.70 +)
    3.71  
    3.72  INCLUDE(FindPackageHandleStandardArgs)
    3.73  FIND_PACKAGE_HANDLE_STANDARD_ARGS(COIN DEFAULT_MSG
    3.74 @@ -61,8 +81,8 @@
    3.75  )
    3.76  
    3.77  IF(COIN_FOUND)
    3.78 -  SET(HAVE_LP TRUE)
    3.79 -  SET(HAVE_MIP TRUE)
    3.80 -  SET(HAVE_CLP TRUE)
    3.81 -  SET(HAVE_CBC TRUE)
    3.82 +  SET(LEMON_HAVE_LP TRUE)
    3.83 +  SET(LEMON_HAVE_MIP TRUE)
    3.84 +  SET(LEMON_HAVE_CLP TRUE)
    3.85 +  SET(LEMON_HAVE_CBC TRUE)
    3.86  ENDIF(COIN_FOUND)
     4.1 --- a/cmake/FindCPLEX.cmake	Wed Apr 29 17:48:18 2009 +0100
     4.2 +++ b/cmake/FindCPLEX.cmake	Wed Apr 29 17:48:41 2009 +0100
     4.3 @@ -1,27 +1,38 @@
     4.4 +SET(CPLEX_ROOT_DIR "" CACHE PATH "CPLEX root directory")
     4.5 +
     4.6  FIND_PATH(CPLEX_INCLUDE_DIR
     4.7    ilcplex/cplex.h
     4.8 -  PATHS "C:/ILOG/CPLEX91/include")
     4.9 -
    4.10 +  PATHS "C:/ILOG/CPLEX91/include"
    4.11 +  PATHS "/opt/ilog/cplex91/include"
    4.12 +  HINTS ${CPLEX_ROOT_DIR}/include
    4.13 +)
    4.14  FIND_LIBRARY(CPLEX_LIBRARY
    4.15 -  NAMES cplex91
    4.16 -  PATHS "C:/ILOG/CPLEX91/lib/msvc7/stat_mda")
    4.17 +  cplex91
    4.18 +  PATHS "C:/ILOG/CPLEX91/lib/msvc7/stat_mda"
    4.19 +  PATHS "/opt/ilog/cplex91/bin"
    4.20 +  HINTS ${CPLEX_ROOT_DIR}/bin
    4.21 +)
    4.22  
    4.23  INCLUDE(FindPackageHandleStandardArgs)
    4.24  FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPLEX DEFAULT_MSG CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
    4.25  
    4.26  FIND_PATH(CPLEX_BIN_DIR
    4.27    cplex91.dll
    4.28 -  PATHS "C:/ILOG/CPLEX91/bin/x86_win32")
    4.29 +  PATHS "C:/ILOG/CPLEX91/bin/x86_win32"
    4.30 +)
    4.31  
    4.32  IF(CPLEX_FOUND)
    4.33    SET(CPLEX_INCLUDE_DIRS ${CPLEX_INCLUDE_DIR})
    4.34    SET(CPLEX_LIBRARIES ${CPLEX_LIBRARY})
    4.35 +  IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    4.36 +    SET(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread")
    4.37 +  ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    4.38  ENDIF(CPLEX_FOUND)
    4.39  
    4.40  MARK_AS_ADVANCED(CPLEX_LIBRARY CPLEX_INCLUDE_DIR CPLEX_BIN_DIR)
    4.41  
    4.42  IF(CPLEX_FOUND)
    4.43 -  SET(HAVE_LP TRUE)
    4.44 -  SET(HAVE_MIP TRUE)
    4.45 -  SET(HAVE_CPLEX TRUE)
    4.46 +  SET(LEMON_HAVE_LP TRUE)
    4.47 +  SET(LEMON_HAVE_MIP TRUE)
    4.48 +  SET(LEMON_HAVE_CPLEX TRUE)
    4.49  ENDIF(CPLEX_FOUND)
     5.1 --- a/cmake/FindGLPK.cmake	Wed Apr 29 17:48:18 2009 +0100
     5.2 +++ b/cmake/FindGLPK.cmake	Wed Apr 29 17:48:41 2009 +0100
     5.3 @@ -1,16 +1,50 @@
     5.4 +SET(GLPK_ROOT_DIR "" CACHE PATH "GLPK root directory")
     5.5 +
     5.6  SET(GLPK_REGKEY "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Glpk;InstallPath]")
     5.7  GET_FILENAME_COMPONENT(GLPK_ROOT_PATH ${GLPK_REGKEY} ABSOLUTE)
     5.8  
     5.9  FIND_PATH(GLPK_INCLUDE_DIR
    5.10    glpk.h
    5.11 -  PATHS ${GLPK_REGKEY}/include)
    5.12 +  PATHS ${GLPK_REGKEY}/include
    5.13 +  HINTS ${GLPK_ROOT_DIR}/include
    5.14 +)
    5.15 +FIND_LIBRARY(GLPK_LIBRARY
    5.16 +  glpk
    5.17 +  PATHS ${GLPK_REGKEY}/lib
    5.18 +  HINTS ${GLPK_ROOT_DIR}/lib
    5.19 +)
    5.20  
    5.21 -FIND_LIBRARY(GLPK_LIBRARY
    5.22 -  NAMES glpk
    5.23 -  PATHS ${GLPK_REGKEY}/lib)
    5.24 +IF(GLPK_INCLUDE_DIR AND GLPK_LIBRARY)
    5.25 +  FILE(READ ${GLPK_INCLUDE_DIR}/glpk.h GLPK_GLPK_H)
    5.26 +
    5.27 +  STRING(REGEX MATCH "define[ ]+GLP_MAJOR_VERSION[ ]+[0-9]+" GLPK_MAJOR_VERSION_LINE "${GLPK_GLPK_H}")
    5.28 +  STRING(REGEX REPLACE "define[ ]+GLP_MAJOR_VERSION[ ]+([0-9]+)" "\\1" GLPK_VERSION_MAJOR "${GLPK_MAJOR_VERSION_LINE}")
    5.29 +
    5.30 +  STRING(REGEX MATCH "define[ ]+GLP_MINOR_VERSION[ ]+[0-9]+" GLPK_MINOR_VERSION_LINE "${GLPK_GLPK_H}")
    5.31 +  STRING(REGEX REPLACE "define[ ]+GLP_MINOR_VERSION[ ]+([0-9]+)" "\\1" GLPK_VERSION_MINOR "${GLPK_MINOR_VERSION_LINE}")
    5.32 +
    5.33 +  SET(GLPK_VERSION_STRING "${GLPK_VERSION_MAJOR}.${GLPK_VERSION_MINOR}")
    5.34 +
    5.35 +  IF(GLPK_FIND_VERSION)
    5.36 +    IF(GLPK_FIND_VERSION_COUNT GREATER 2)
    5.37 +      MESSAGE(SEND_ERROR "unexpected version string")
    5.38 +    ENDIF(GLPK_FIND_VERSION_COUNT GREATER 2)
    5.39 +
    5.40 +    MATH(EXPR GLPK_REQUESTED_VERSION "${GLPK_FIND_VERSION_MAJOR}*100 + ${GLPK_FIND_VERSION_MINOR}")
    5.41 +    MATH(EXPR GLPK_FOUND_VERSION "${GLPK_VERSION_MAJOR}*100 + ${GLPK_VERSION_MINOR}")
    5.42 +
    5.43 +    IF(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION)
    5.44 +      SET(GLPK_PROPER_VERSION_FOUND FALSE)
    5.45 +    ELSE(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION)
    5.46 +      SET(GLPK_PROPER_VERSION_FOUND TRUE)
    5.47 +    ENDIF(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION)
    5.48 +  ELSE(GLPK_FIND_VERSION)
    5.49 +    SET(GLPK_PROPER_VERSION_FOUND TRUE)
    5.50 +  ENDIF(GLPK_FIND_VERSION)
    5.51 +ENDIF(GLPK_INCLUDE_DIR AND GLPK_LIBRARY)
    5.52  
    5.53  INCLUDE(FindPackageHandleStandardArgs)
    5.54 -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLPK DEFAULT_MSG GLPK_LIBRARY GLPK_INCLUDE_DIR)
    5.55 +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLPK DEFAULT_MSG GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_PROPER_VERSION_FOUND)
    5.56  
    5.57  IF(GLPK_FOUND)
    5.58    SET(GLPK_INCLUDE_DIRS ${GLPK_INCLUDE_DIR})
    5.59 @@ -21,7 +55,7 @@
    5.60  MARK_AS_ADVANCED(GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_BIN_DIR)
    5.61  
    5.62  IF(GLPK_FOUND)
    5.63 -  SET(HAVE_LP TRUE)
    5.64 -  SET(HAVE_MIP TRUE)
    5.65 -  SET(HAVE_GLPK TRUE)
    5.66 +  SET(LEMON_HAVE_LP TRUE)
    5.67 +  SET(LEMON_HAVE_MIP TRUE)
    5.68 +  SET(LEMON_HAVE_GLPK TRUE)
    5.69  ENDIF(GLPK_FOUND)
     6.1 --- a/configure.ac	Wed Apr 29 17:48:18 2009 +0100
     6.2 +++ b/configure.ac	Wed Apr 29 17:48:41 2009 +0100
     6.3 @@ -25,7 +25,7 @@
     6.4  dnl Check the existence of long long type.
     6.5  AC_CHECK_TYPE(long long, [long_long_found=yes], [long_long_found=no])
     6.6  if test x"$long_long_found" = x"yes"; then
     6.7 -  AC_DEFINE([HAVE_LONG_LONG], [1], [Define to 1 if you have long long.])
     6.8 +  AC_DEFINE([LEMON_HAVE_LONG_LONG], [1], [Define to 1 if you have long long.])
     6.9  fi
    6.10  
    6.11  dnl Checks for programs.
     7.1 --- a/lemon/CMakeLists.txt	Wed Apr 29 17:48:18 2009 +0100
     7.2 +++ b/lemon/CMakeLists.txt	Wed Apr 29 17:48:41 2009 +0100
     7.3 @@ -18,7 +18,7 @@
     7.4    bits/windows.cc
     7.5  )
     7.6  
     7.7 -IF(HAVE_GLPK)
     7.8 +IF(LEMON_HAVE_GLPK)
     7.9    SET(LEMON_SOURCES ${LEMON_SOURCES} glpk.cc)
    7.10    INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIRS})
    7.11    IF(WIN32)
    7.12 @@ -26,22 +26,22 @@
    7.13      INSTALL(FILES ${GLPK_BIN_DIR}/libltdl3.dll DESTINATION bin)
    7.14      INSTALL(FILES ${GLPK_BIN_DIR}/zlib1.dll DESTINATION bin)
    7.15    ENDIF(WIN32)
    7.16 -ENDIF(HAVE_GLPK)
    7.17 +ENDIF(LEMON_HAVE_GLPK)
    7.18  
    7.19 -IF(HAVE_CPLEX)
    7.20 +IF(LEMON_HAVE_CPLEX)
    7.21    SET(LEMON_SOURCES ${LEMON_SOURCES} cplex.cc)
    7.22    INCLUDE_DIRECTORIES(${CPLEX_INCLUDE_DIRS})
    7.23 -ENDIF(HAVE_CPLEX)
    7.24 +ENDIF(LEMON_HAVE_CPLEX)
    7.25  
    7.26 -IF(HAVE_CLP)
    7.27 +IF(LEMON_HAVE_CLP)
    7.28    SET(LEMON_SOURCES ${LEMON_SOURCES} clp.cc)
    7.29    INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
    7.30 -ENDIF(HAVE_CLP)
    7.31 +ENDIF(LEMON_HAVE_CLP)
    7.32  
    7.33 -IF(HAVE_CBC)
    7.34 +IF(LEMON_HAVE_CBC)
    7.35    SET(LEMON_SOURCES ${LEMON_SOURCES} cbc.cc)
    7.36    INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
    7.37 -ENDIF(HAVE_CBC)
    7.38 +ENDIF(LEMON_HAVE_CBC)
    7.39  
    7.40  ADD_LIBRARY(lemon ${LEMON_SOURCES})
    7.41  
    7.42 @@ -55,3 +55,8 @@
    7.43    DESTINATION include/lemon
    7.44    COMPONENT headers
    7.45    FILES_MATCHING PATTERN "*.h")
    7.46 +
    7.47 +INSTALL(
    7.48 +  FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h
    7.49 +  DESTINATION include/lemon
    7.50 +  COMPONENT headers)
     8.1 --- a/lemon/Makefile.am	Wed Apr 29 17:48:18 2009 +0100
     8.2 +++ b/lemon/Makefile.am	Wed Apr 29 17:48:41 2009 +0100
     8.3 @@ -15,7 +15,8 @@
     8.4  	lemon/random.cc \
     8.5  	lemon/bits/windows.cc
     8.6  
     8.7 -
     8.8 +nodist_lemon_HEADERS = lemon/config.h	
     8.9 +	
    8.10  lemon_libemon_la_CXXFLAGS = \
    8.11  	$(AM_CXXFLAGS) \
    8.12  	$(GLPK_CFLAGS) \
    8.13 @@ -57,6 +58,7 @@
    8.14  	lemon/assert.h \
    8.15  	lemon/bfs.h \
    8.16  	lemon/bin_heap.h \
    8.17 +	lemon/cbc.h \
    8.18  	lemon/circulation.h \
    8.19  	lemon/clp.h \
    8.20  	lemon/color.h \
     9.1 --- a/lemon/bits/default_map.h	Wed Apr 29 17:48:18 2009 +0100
     9.2 +++ b/lemon/bits/default_map.h	Wed Apr 29 17:48:41 2009 +0100
     9.3 @@ -97,7 +97,7 @@
     9.4    };
     9.5  
     9.6  
     9.7 -#if defined HAVE_LONG_LONG
     9.8 +#if defined LEMON_HAVE_LONG_LONG
     9.9  
    9.10    // long long
    9.11    template <typename _Graph, typename _Item>
    10.1 --- a/lemon/config.h.cmake	Wed Apr 29 17:48:18 2009 +0100
    10.2 +++ b/lemon/config.h.cmake	Wed Apr 29 17:48:41 2009 +0100
    10.3 @@ -1,7 +1,7 @@
    10.4 -#cmakedefine HAVE_LONG_LONG 1
    10.5 -#cmakedefine HAVE_LP 1
    10.6 -#cmakedefine HAVE_MIP 1
    10.7 -#cmakedefine HAVE_GLPK 1
    10.8 -#cmakedefine HAVE_CPLEX 1
    10.9 -#cmakedefine HAVE_CLP 1
   10.10 -#cmakedefine HAVE_CBC 1
   10.11 +#cmakedefine LEMON_HAVE_LONG_LONG 1
   10.12 +#cmakedefine LEMON_HAVE_LP 1
   10.13 +#cmakedefine LEMON_HAVE_MIP 1
   10.14 +#cmakedefine LEMON_HAVE_GLPK 1
   10.15 +#cmakedefine LEMON_HAVE_CPLEX 1
   10.16 +#cmakedefine LEMON_HAVE_CLP 1
   10.17 +#cmakedefine LEMON_HAVE_CBC 1
    11.1 --- a/lemon/config.h.in	Wed Apr 29 17:48:18 2009 +0100
    11.2 +++ b/lemon/config.h.in	Wed Apr 29 17:48:41 2009 +0100
    11.3 @@ -1,23 +1,23 @@
    11.4  /* Define to 1 if you have long long */
    11.5 -#undef HAVE_LONG_LONG
    11.6 +#undef LEMON_HAVE_LONG_LONG
    11.7  
    11.8  /* Define to 1 if you have any LP solver. */
    11.9 -#undef HAVE_LP
   11.10 +#undef LEMON_HAVE_LP
   11.11  
   11.12  /* Define to 1 if you have any MIP solver. */
   11.13 -#undef HAVE_MIP
   11.14 +#undef LEMON_HAVE_MIP
   11.15  
   11.16  /* Define to 1 if you have CPLEX. */
   11.17 -#undef HAVE_CPLEX
   11.18 +#undef LEMON_HAVE_CPLEX
   11.19  
   11.20  /* Define to 1 if you have GLPK. */
   11.21 -#undef HAVE_GLPK
   11.22 +#undef LEMON_HAVE_GLPK
   11.23  
   11.24  /* Define to 1 if you have SOPLEX */
   11.25 -#undef HAVE_SOPLEX
   11.26 +#undef LEMON_HAVE_SOPLEX
   11.27  
   11.28  /* Define to 1 if you have CLP */
   11.29 -#undef HAVE_CLP
   11.30 +#undef LEMON_HAVE_CLP
   11.31  
   11.32  /* Define to 1 if you have CBC */
   11.33 -#undef HAVE_CBC
   11.34 +#undef LEMON_HAVE_CBC
    12.1 --- a/lemon/core.h	Wed Apr 29 17:48:18 2009 +0100
    12.2 +++ b/lemon/core.h	Wed Apr 29 17:48:41 2009 +0100
    12.3 @@ -22,7 +22,7 @@
    12.4  #include <vector>
    12.5  #include <algorithm>
    12.6  
    12.7 -#include <lemon/core.h>
    12.8 +#include <lemon/config.h>
    12.9  #include <lemon/bits/enable_if.h>
   12.10  #include <lemon/bits/traits.h>
   12.11  #include <lemon/assert.h>
    13.1 --- a/lemon/lp.h	Wed Apr 29 17:48:18 2009 +0100
    13.2 +++ b/lemon/lp.h	Wed Apr 29 17:48:41 2009 +0100
    13.3 @@ -22,13 +22,13 @@
    13.4  #include<lemon/config.h>
    13.5  
    13.6  
    13.7 -#ifdef HAVE_GLPK
    13.8 +#ifdef LEMON_HAVE_GLPK
    13.9  #include <lemon/glpk.h>
   13.10 -#elif HAVE_CPLEX
   13.11 +#elif LEMON_HAVE_CPLEX
   13.12  #include <lemon/cplex.h>
   13.13 -#elif HAVE_SOPLEX
   13.14 +#elif LEMON_HAVE_SOPLEX
   13.15  #include <lemon/soplex.h>
   13.16 -#elif HAVE_CLP
   13.17 +#elif LEMON_HAVE_CLP
   13.18  #include <lemon/clp.h>
   13.19  #endif
   13.20  
   13.21 @@ -69,20 +69,20 @@
   13.22    ///Currently, it is either \c GlpkMip or \c CplexMip
   13.23    typedef GlpkMip Mip;
   13.24  #else
   13.25 -#ifdef HAVE_GLPK
   13.26 +#ifdef LEMON_HAVE_GLPK
   13.27  # define LEMON_DEFAULT_LP GLPK
   13.28    typedef GlpkLp Lp;
   13.29  # define LEMON_DEFAULT_MIP GLPK
   13.30    typedef GlpkMip Mip;
   13.31 -#elif HAVE_CPLEX
   13.32 +#elif LEMON_HAVE_CPLEX
   13.33  # define LEMON_DEFAULT_LP CPLEX
   13.34    typedef CplexLp Lp;
   13.35  # define LEMON_DEFAULT_MIP CPLEX
   13.36    typedef CplexMip Mip;
   13.37 -#elif HAVE_SOPLEX
   13.38 +#elif LEMON_HAVE_SOPLEX
   13.39  # define DEFAULT_LP SOPLEX
   13.40    typedef SoplexLp Lp;
   13.41 -#elif HAVE_CLP
   13.42 +#elif LEMON_HAVE_CLP
   13.43  # define DEFAULT_LP CLP
   13.44    typedef ClpLp Lp;  
   13.45  #endif
    14.1 --- a/m4/lx_check_coin.m4	Wed Apr 29 17:48:18 2009 +0100
    14.2 +++ b/m4/lx_check_coin.m4	Wed Apr 29 17:48:41 2009 +0100
    14.3 @@ -55,9 +55,9 @@
    14.4      LIBS="$lx_save_libs"
    14.5  
    14.6      if test x"$lx_clp_found" = x"yes"; then
    14.7 -      AC_DEFINE([HAVE_CLP], [1], [Define to 1 if you have CLP.])
    14.8 +      AC_DEFINE([LEMON_HAVE_CLP], [1], [Define to 1 if you have CLP.])
    14.9        lx_lp_found=yes
   14.10 -      AC_DEFINE([HAVE_LP], [1], [Define to 1 if you have any LP solver.])
   14.11 +      AC_DEFINE([LEMON_HAVE_LP], [1], [Define to 1 if you have any LP solver.])
   14.12        AC_MSG_RESULT([yes])
   14.13      else
   14.14        CLP_CXXFLAGS=""
   14.15 @@ -115,11 +115,11 @@
   14.16        LIBS="$lx_save_libs"
   14.17  
   14.18        if test x"$lx_cbc_found" = x"yes"; then
   14.19 -        AC_DEFINE([HAVE_CBC], [1], [Define to 1 if you have CBC.])
   14.20 +        AC_DEFINE([LEMON_HAVE_CBC], [1], [Define to 1 if you have CBC.])
   14.21          lx_lp_found=yes
   14.22 -        AC_DEFINE([HAVE_LP], [1], [Define to 1 if you have any LP solver.])
   14.23 +        AC_DEFINE([LEMON_HAVE_LP], [1], [Define to 1 if you have any LP solver.])
   14.24          lx_mip_found=yes
   14.25 -        AC_DEFINE([HAVE_MIP], [1], [Define to 1 if you have any MIP solver.])
   14.26 +        AC_DEFINE([LEMON_HAVE_MIP], [1], [Define to 1 if you have any MIP solver.])
   14.27          AC_MSG_RESULT([yes])
   14.28        else
   14.29          CBC_CXXFLAGS=""
    15.1 --- a/m4/lx_check_cplex.m4	Wed Apr 29 17:48:18 2009 +0100
    15.2 +++ b/m4/lx_check_cplex.m4	Wed Apr 29 17:48:41 2009 +0100
    15.3 @@ -61,11 +61,11 @@
    15.4      LIBS="$lx_save_libs"
    15.5  
    15.6      if test x"$lx_cplex_found" = x"yes"; then
    15.7 -      AC_DEFINE([HAVE_CPLEX], [1], [Define to 1 if you have CPLEX.])
    15.8 +      AC_DEFINE([LEMON_HAVE_CPLEX], [1], [Define to 1 if you have CPLEX.])
    15.9        lx_lp_found=yes
   15.10 -      AC_DEFINE([HAVE_LP], [1], [Define to 1 if you have any LP solver.])
   15.11 +      AC_DEFINE([LEMON_HAVE_LP], [1], [Define to 1 if you have any LP solver.])
   15.12        lx_mip_found=yes
   15.13 -      AC_DEFINE([HAVE_MIP], [1], [Define to 1 if you have any MIP solver.])
   15.14 +      AC_DEFINE([LEMON_HAVE_MIP], [1], [Define to 1 if you have any MIP solver.])
   15.15        AC_MSG_RESULT([yes])
   15.16      else
   15.17        CPLEX_CFLAGS=""
    16.1 --- a/m4/lx_check_glpk.m4	Wed Apr 29 17:48:18 2009 +0100
    16.2 +++ b/m4/lx_check_glpk.m4	Wed Apr 29 17:48:41 2009 +0100
    16.3 @@ -64,11 +64,11 @@
    16.4      LIBS="$lx_save_libs"
    16.5  
    16.6      if test x"$lx_glpk_found" = x"yes"; then
    16.7 -      AC_DEFINE([HAVE_GLPK], [1], [Define to 1 if you have GLPK.])
    16.8 +      AC_DEFINE([LEMON_HAVE_GLPK], [1], [Define to 1 if you have GLPK.])
    16.9        lx_lp_found=yes
   16.10 -      AC_DEFINE([HAVE_LP], [1], [Define to 1 if you have any LP solver.])
   16.11 +      AC_DEFINE([LEMON_HAVE_LP], [1], [Define to 1 if you have any LP solver.])
   16.12        lx_mip_found=yes
   16.13 -      AC_DEFINE([HAVE_MIP], [1], [Define to 1 if you have any MIP solver.])
   16.14 +      AC_DEFINE([LEMON_HAVE_MIP], [1], [Define to 1 if you have any MIP solver.])
   16.15        AC_MSG_RESULT([yes])
   16.16      else
   16.17        GLPK_CFLAGS=""
    17.1 --- a/m4/lx_check_soplex.m4	Wed Apr 29 17:48:18 2009 +0100
    17.2 +++ b/m4/lx_check_soplex.m4	Wed Apr 29 17:48:41 2009 +0100
    17.3 @@ -55,9 +55,9 @@
    17.4      LIBS="$lx_save_libs"
    17.5  
    17.6      if test x"$lx_soplex_found" = x"yes"; then
    17.7 -      AC_DEFINE([HAVE_SOPLEX], [1], [Define to 1 if you have SOPLEX.])
    17.8 +      AC_DEFINE([LEMON_HAVE_SOPLEX], [1], [Define to 1 if you have SOPLEX.])
    17.9        lx_lp_found=yes
   17.10 -      AC_DEFINE([HAVE_LP], [1], [Define to 1 if you have any LP solver.])
   17.11 +      AC_DEFINE([LEMON_HAVE_LP], [1], [Define to 1 if you have any LP solver.])
   17.12        AC_MSG_RESULT([yes])
   17.13      else
   17.14        SOPLEX_CXXFLAGS=""
    18.1 --- a/scripts/unify-sources.sh	Wed Apr 29 17:48:18 2009 +0100
    18.2 +++ b/scripts/unify-sources.sh	Wed Apr 29 17:48:41 2009 +0100
    18.3 @@ -1,8 +1,13 @@
    18.4  #!/bin/bash
    18.5  
    18.6 -YEAR=`date +2003-%Y`
    18.7 +YEAR=`date +%Y`
    18.8  HGROOT=`hg root`
    18.9  
   18.10 +function hg_year() {
   18.11 +    if [ -n "$(hg st $1)" ]; then
   18.12 +        echo $YEAR
   18.13 +}
   18.14 +
   18.15  # file enumaration modes
   18.16  
   18.17  function all_files() {
   18.18 @@ -191,7 +196,7 @@
   18.19   *
   18.20   * This file is a part of LEMON, a generic C++ optimization library.
   18.21   *
   18.22 - * Copyright (C) "$YEAR"
   18.23 + * Copyright (C) 2003-"$(hg_year $1)"
   18.24   * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
   18.25   * (Egervary Research Group on Combinatorial Optimization, EGRES).
   18.26   *
    19.1 --- a/test/CMakeLists.txt	Wed Apr 29 17:48:18 2009 +0100
    19.2 +++ b/test/CMakeLists.txt	Wed Apr 29 17:48:41 2009 +0100
    19.3 @@ -36,22 +36,22 @@
    19.4    time_measure_test
    19.5    unionfind_test)
    19.6  
    19.7 -IF(HAVE_LP)
    19.8 +IF(LEMON_HAVE_LP)
    19.9    ADD_EXECUTABLE(lp_test lp_test.cc)
   19.10    SET(LP_TEST_LIBS lemon)
   19.11 -  IF(HAVE_GLPK)
   19.12 +  IF(LEMON_HAVE_GLPK)
   19.13      SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
   19.14 -  ENDIF(HAVE_GLPK)
   19.15 -  IF(HAVE_CPLEX)
   19.16 +  ENDIF(LEMON_HAVE_GLPK)
   19.17 +  IF(LEMON_HAVE_CPLEX)
   19.18      SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
   19.19 -  ENDIF(HAVE_CPLEX)
   19.20 -  IF(HAVE_CLP)
   19.21 +  ENDIF(LEMON_HAVE_CPLEX)
   19.22 +  IF(LEMON_HAVE_CLP)
   19.23      SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
   19.24 -  ENDIF(HAVE_CLP)
   19.25 +  ENDIF(LEMON_HAVE_CLP)
   19.26    TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
   19.27    ADD_TEST(lp_test lp_test)
   19.28  
   19.29 -  IF(WIN32 AND HAVE_GLPK)
   19.30 +  IF(WIN32 AND LEMON_HAVE_GLPK)
   19.31      GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
   19.32      GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
   19.33      ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
   19.34 @@ -59,32 +59,32 @@
   19.35        COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
   19.36        COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
   19.37      )
   19.38 -  ENDIF(WIN32 AND HAVE_GLPK)
   19.39 -  IF(WIN32 AND HAVE_CPLEX)
   19.40 +  ENDIF(WIN32 AND LEMON_HAVE_GLPK)
   19.41 +  IF(WIN32 AND LEMON_HAVE_CPLEX)
   19.42      GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
   19.43      GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
   19.44      ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
   19.45        COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
   19.46      )
   19.47 -  ENDIF(WIN32 AND HAVE_CPLEX)
   19.48 -ENDIF(HAVE_LP)
   19.49 +  ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
   19.50 +ENDIF(LEMON_HAVE_LP)
   19.51  
   19.52 -IF(HAVE_MIP)
   19.53 +IF(LEMON_HAVE_MIP)
   19.54    ADD_EXECUTABLE(mip_test mip_test.cc)
   19.55    SET(MIP_TEST_LIBS lemon)
   19.56 -  IF(HAVE_GLPK)
   19.57 +  IF(LEMON_HAVE_GLPK)
   19.58      SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
   19.59 -  ENDIF(HAVE_GLPK)
   19.60 -  IF(HAVE_CPLEX)
   19.61 +  ENDIF(LEMON_HAVE_GLPK)
   19.62 +  IF(LEMON_HAVE_CPLEX)
   19.63      SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
   19.64 -  ENDIF(HAVE_CPLEX)
   19.65 -  IF(HAVE_CBC)
   19.66 +  ENDIF(LEMON_HAVE_CPLEX)
   19.67 +  IF(LEMON_HAVE_CBC)
   19.68      SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
   19.69 -  ENDIF(HAVE_CBC)
   19.70 +  ENDIF(LEMON_HAVE_CBC)
   19.71    TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
   19.72    ADD_TEST(mip_test mip_test)
   19.73  
   19.74 -  IF(WIN32 AND HAVE_GLPK)
   19.75 +  IF(WIN32 AND LEMON_HAVE_GLPK)
   19.76      GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
   19.77      GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
   19.78      ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
   19.79 @@ -92,15 +92,15 @@
   19.80        COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
   19.81        COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
   19.82      )
   19.83 -  ENDIF(WIN32 AND HAVE_GLPK)
   19.84 -  IF(WIN32 AND HAVE_CPLEX)
   19.85 +  ENDIF(WIN32 AND LEMON_HAVE_GLPK)
   19.86 +  IF(WIN32 AND LEMON_HAVE_CPLEX)
   19.87      GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
   19.88      GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
   19.89      ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
   19.90        COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
   19.91      )
   19.92 -  ENDIF(WIN32 AND HAVE_CPLEX)
   19.93 -ENDIF(HAVE_MIP)
   19.94 +  ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
   19.95 +ENDIF(LEMON_HAVE_MIP)
   19.96  
   19.97  FOREACH(TEST_NAME ${TESTS})
   19.98    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
    20.1 --- a/test/lp_test.cc	Wed Apr 29 17:48:18 2009 +0100
    20.2 +++ b/test/lp_test.cc	Wed Apr 29 17:48:41 2009 +0100
    20.3 @@ -21,23 +21,21 @@
    20.4  #include "test_tools.h"
    20.5  #include <lemon/tolerance.h>
    20.6  
    20.7 -#ifdef HAVE_CONFIG_H
    20.8  #include <lemon/config.h>
    20.9 -#endif
   20.10  
   20.11 -#ifdef HAVE_GLPK
   20.12 +#ifdef LEMON_HAVE_GLPK
   20.13  #include <lemon/glpk.h>
   20.14  #endif
   20.15  
   20.16 -#ifdef HAVE_CPLEX
   20.17 +#ifdef LEMON_HAVE_CPLEX
   20.18  #include <lemon/cplex.h>
   20.19  #endif
   20.20  
   20.21 -#ifdef HAVE_SOPLEX
   20.22 +#ifdef LEMON_HAVE_SOPLEX
   20.23  #include <lemon/soplex.h>
   20.24  #endif
   20.25  
   20.26 -#ifdef HAVE_CLP
   20.27 +#ifdef LEMON_HAVE_CLP
   20.28  #include <lemon/clp.h>
   20.29  #endif
   20.30  
   20.31 @@ -379,7 +377,7 @@
   20.32    LpSkeleton lp_skel;
   20.33    lpTest(lp_skel);
   20.34  
   20.35 -#ifdef HAVE_GLPK
   20.36 +#ifdef LEMON_HAVE_GLPK
   20.37    {
   20.38      GlpkLp lp_glpk1,lp_glpk2;
   20.39      lpTest(lp_glpk1);
   20.40 @@ -388,7 +386,7 @@
   20.41    }
   20.42  #endif
   20.43  
   20.44 -#ifdef HAVE_CPLEX
   20.45 +#ifdef LEMON_HAVE_CPLEX
   20.46    try {
   20.47      CplexLp lp_cplex1,lp_cplex2;
   20.48      lpTest(lp_cplex1);
   20.49 @@ -399,7 +397,7 @@
   20.50    }
   20.51  #endif
   20.52  
   20.53 -#ifdef HAVE_SOPLEX
   20.54 +#ifdef LEMON_HAVE_SOPLEX
   20.55    {
   20.56      SoplexLp lp_soplex1,lp_soplex2;
   20.57      lpTest(lp_soplex1);
   20.58 @@ -408,7 +406,7 @@
   20.59    }
   20.60  #endif
   20.61  
   20.62 -#ifdef HAVE_CLP
   20.63 +#ifdef LEMON_HAVE_CLP
   20.64    {
   20.65      ClpLp lp_clp1,lp_clp2;
   20.66      lpTest(lp_clp1);
    21.1 --- a/test/mip_test.cc	Wed Apr 29 17:48:18 2009 +0100
    21.2 +++ b/test/mip_test.cc	Wed Apr 29 17:48:41 2009 +0100
    21.3 @@ -18,19 +18,17 @@
    21.4  
    21.5  #include "test_tools.h"
    21.6  
    21.7 -#ifdef HAVE_CONFIG_H
    21.8  #include <lemon/config.h>
    21.9 -#endif
   21.10  
   21.11 -#ifdef HAVE_CPLEX
   21.12 +#ifdef LEMON_HAVE_CPLEX
   21.13  #include <lemon/cplex.h>
   21.14  #endif
   21.15  
   21.16 -#ifdef HAVE_GLPK
   21.17 +#ifdef LEMON_HAVE_GLPK
   21.18  #include <lemon/glpk.h>
   21.19  #endif
   21.20  
   21.21 -#ifdef HAVE_CBC
   21.22 +#ifdef LEMON_HAVE_CBC
   21.23  #include <lemon/cbc.h>
   21.24  #endif
   21.25  
   21.26 @@ -129,7 +127,7 @@
   21.27  int main()
   21.28  {
   21.29  
   21.30 -#ifdef HAVE_GLPK
   21.31 +#ifdef LEMON_HAVE_GLPK
   21.32    {
   21.33      GlpkMip mip1;
   21.34      aTest(mip1);
   21.35 @@ -137,7 +135,7 @@
   21.36    }
   21.37  #endif
   21.38  
   21.39 -#ifdef HAVE_CPLEX
   21.40 +#ifdef LEMON_HAVE_CPLEX
   21.41    try {
   21.42      CplexMip mip2;
   21.43      aTest(mip2);
   21.44 @@ -147,7 +145,7 @@
   21.45    }
   21.46  #endif
   21.47  
   21.48 -#ifdef HAVE_CBC
   21.49 +#ifdef LEMON_HAVE_CBC
   21.50    {
   21.51      CbcMip mip1;
   21.52      aTest(mip1);
    22.1 --- a/tools/dimacs-solver.cc	Wed Apr 29 17:48:18 2009 +0100
    22.2 +++ b/tools/dimacs-solver.cc	Wed Apr 29 17:48:41 2009 +0100
    22.3 @@ -200,7 +200,7 @@
    22.4      .boolOption("q", "Do not print any report")
    22.5      .boolOption("int","Use 'int' for capacities, costs etc. (default)")
    22.6      .optionGroup("datatype","int")
    22.7 -#ifdef HAVE_LONG_LONG
    22.8 +#ifdef LEMON_HAVE_LONG_LONG
    22.9      .boolOption("long","Use 'long long' for capacities, costs etc.")
   22.10      .optionGroup("datatype","long")
   22.11  #endif
   22.12 @@ -267,7 +267,7 @@
   22.13      solve<double>(ap,is,os,desc);
   22.14    else if(ap.given("ldouble"))
   22.15      solve<long double>(ap,is,os,desc);
   22.16 -#ifdef HAVE_LONG_LONG
   22.17 +#ifdef LEMON_HAVE_LONG_LONG
   22.18    else if(ap.given("long"))
   22.19      solve<long long>(ap,is,os,desc);
   22.20  #endif