From 212b3d0d1c57c887d5e1cbf7eef3ffc7208a5296 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Mon, 28 Jan 2008 13:18:09 +0100 Subject: [PATCH] configure.in: require cddlib 0.94e by testing for bug in earlier versions --- cdd94e-test | 12 ++++++++++++ configure.in | 32 +++++++++++++++++++++++++++++++- doc/implementation.tex | 3 ++- 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 cdd94e-test diff --git a/cdd94e-test b/cdd94e-test new file mode 100644 index 0000000..a0a221d --- /dev/null +++ b/cdd94e-test @@ -0,0 +1,12 @@ +H-representation +begin + 6 5 rational + 0 217789657 18658414 24701 18324 + -1 73103863 6264270 5567 6152 + 3 -73103863 -6264270 -5567 -6152 + 0 -71251881 -6105438 141283 -5996 + 0 -140577 -12218 -4077 -12 + 0 -6112 0 -18337 0 +end +maximize + 0 3400 1 0 0 diff --git a/configure.in b/configure.in index bfdffaa..4b636c9 100644 --- a/configure.in +++ b/configure.in @@ -381,7 +381,37 @@ if test "$cddlib_package" != "no"; then mytype a; dd_init(a); ], [ have_cddlib=true - AC_CHECK_LIB(cddgmp, main,[],[have_cddlib=false]) + AC_CHECK_LIB(cddgmp, main,[ + SAVE_LIBS="$LIBS" + LIBS="-lcddgmp $LIBS" + AC_DEFINE_UNQUOTED([SRCDIR], ["$srcdir"], [srcdir]) + AC_LANG_PUSH(C++) + AC_RUN_IFELSE(AC_LANG_PROGRAM([[#define GMPRATIONAL +#include +#include ]], + [[ + const char *filename = SRCDIR"/cdd94e-test"; + FILE *f; + dd_MatrixPtr M; + dd_LPType *lp; + dd_ErrorType err = dd_NoError; + + dd_set_global_constants(); + + f = fopen(filename, "r"); + M = dd_PolyFile2Matrix(f, &err); + lp = dd_Matrix2LP(M, &err); + dd_LPSolve(lp, dd_DualSimplex, &err); + return lp->LPS == dd_Inconsistent; + ]]),[ + AC_DEFINE(HAVE_LIBCDDGMP, [], [Define to 1 if you have the `cddgmp' library (-lcddgmp).]) + ],[ + AC_MSG_WARN(please upgrade cddlib to 0.94e or later) + LIBS="$SAVE_LIBS" + have_cddlib=false + ]) + AC_LANG_POP + ],[have_cddlib=false]) ]) fi AM_CONDITIONAL(HAVE_CDDLIB, test x$have_cddlib = xtrue) diff --git a/doc/implementation.tex b/doc/implementation.tex index 28f3225..511c898 100644 --- a/doc/implementation.tex +++ b/doc/implementation.tex @@ -3963,7 +3963,8 @@ describing the polytope are large. \item \ai[\tt]{cdd}~\shortcite{cdd} This solver is based on exact integer arithmetic. -However, versions up to and including \verb+cddlib 0.94d+ have +Note that you need version \verb+cddlib 0.94e+ or newer. +Earlier versions have a bug that may sometimes result in a polytope being reported as (rationally) empty even though it is not. -- 2.11.4.GIT