Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit 71123d8

Browse files
author
Release Manager
committed
Trac #30319: Upgrade cddlib to fix wrong intersection of polytopes
As reported in [[https://groups.google.com/forum/#!topic/sage- devel/514hUpM7pBY | this sage-devel thread]], the intersection of polytopes is sometimes very wrong {{{ a = Polyhedron([[0, -1, 1], [1, -1, 1], [1, 1, -1]]) b = Polyhedron([[0.0, -0.5, 1.5], [1.0, -0.5, 1.5], [1.0, 1.5, -0.5]]) c = a.intersection(b) }}} Here `c` should have been empty but is equal to `b`. We fix it by upgrading to cddlib 0.94m, installing symlinks so that consumers of cddlib that have not been updated to work with the new header file locations (#29413) continue to work. URL: https://trac.sagemath.org/30319 Reported by: vdelecroix Ticket author(s): Jonathan Kliem, Matthias Koeppe Reviewer(s): Matthias Koeppe, Dima Pasechnik
2 parents 3da0a29 + 167c832 commit 71123d8

File tree

4 files changed

+37
-5
lines changed

4 files changed

+37
-5
lines changed

build/pkgs/cddlib/checksums.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tarball=cddlib-VERSION.tar.gz
2-
sha1=4bad24b32d9c056615377ff3103e6b95e17628ac
3-
md5=73e5f7dfa72b5c3339c09564721813d6
4-
cksum=3211115816
2+
sha1=8f38597a0479a191a62346dab89794e888c478b6
3+
md5=ec7f35912e34232b5306a643f99b6311
4+
cksum=2420656558
55
upstream_url=https://github.com/cddlib/cddlib/releases/download/VERSION/cddlib-VERSION.tar.gz
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.94j
1+
0.94m

build/pkgs/cddlib/spkg-configure.m4

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,39 @@ SAGE_SPKG_CONFIGURE([cddlib], [
1616
AC_CHECK_PROGS(SCDD, [scdd_gmp scdd])
1717
AS_IF([test x$SCDD = x], [sage_spkg_install_cddlib=yes])
1818
19-
dnl Future versions (>= 0.94k) of cddlib will put these headers in
19+
dnl https://trac.sagemath.org/ticket/30319
20+
AS_IF([test -n "$CDDEXEC"], [
21+
AC_MSG_CHECKING([whether $CDDEXEC --redcheck works correctly for real input])
22+
cat > conftest.ine <<EOF
23+
H-representation
24+
linearity 2 1 2
25+
begin
26+
5 4 real
27+
0.0 0.0 1.0 1.0
28+
-1.0 0.0 1.0 1.0
29+
-1.0 2.0 -1.0 0.0
30+
-1.0 4.0 -2.0 0.0
31+
1 0 0 0
32+
end
33+
EOF
34+
rm -f conftest.out
35+
$CDDEXEC --redcheck <conftest.ine >conftest.out 2>& AS_MESSAGE_LOG_FD
36+
AS_IF([grep -q "^Redundant rows.*1" conftest.out 2>& AS_MESSAGE_LOG_FD], [
37+
AC_MSG_RESULT([no])
38+
sage_spkg_install_cddlib=yes
39+
], [
40+
AC_MSG_RESULT([yes])
41+
])
42+
])
43+
dnl Recent versions (>= 0.94k) of cddlib put these headers in
2044
dnl a "cddlib" subdirectory, and Debian currently relocates them
2145
dnl under "cdd". But for now they're at the top-level, in e.g.
2246
dnl /usr/include/cdd.h. The lattE and gfan packages within
2347
dnl SageMath both look for them there, so that's where we have to
2448
dnl check, passing up a chance to detect cddlib on Fedora and Debian
2549
dnl for now. Once all of cddlib's consumers know about the new (or
2650
dnl both) locations, we can update this check to support them.
51+
dnl See https://trac.sagemath.org/ticket/29413
2752
AC_CHECK_HEADER([cdd.h],[],[sage_spkg_install_cddlib=yes],[
2853
#include <setoper.h>
2954
#include <cddmp.h>

build/pkgs/cddlib/spkg-install.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,10 @@ cd src
55
sdh_configure
66
sdh_make
77
sdh_make_install
8+
9+
# Old versions of cddlib install headers without the official prefix "cddlib/";
10+
# and some distributions install the headers with a prefix "cdd/".
11+
# We install symlinks to shadow possible system installations of these headers.
12+
# This can be removed as soon as all packages that detect cddlib have been
13+
# updated to check the official prefix "cddlib/" first.
14+
(cd $SAGE_DESTDIR$SAGE_LOCAL/include/ && ln -sf cddlib cdd && ln -sf cddlib/*.h .)

0 commit comments

Comments
 (0)