New package: gfan-0.6.2

Uses three patches taken from sagemath, cf
https://git.sagemath.org/sage.git/plain/build/pkgs/gfan/patches?h=9.5.beta7

 - fix location of cddlib include files
 - normalize the output of one failing test
 - make tests return an error so build aborts

Also fixes for 32 bit bugs catched by testsuite:
 - add `-ffloat-store` to CFLAGS to fix `0009RenderStairCase`
 - patch typedef for `int64` which causes hang in `0602ResultantFanProjection`
This commit is contained in:
Gonzalo Tornaría 2021-11-21 09:29:09 -03:00 committed by Leah Neukirchen
parent 95215facf5
commit 290d0ac224
6 changed files with 350 additions and 0 deletions

View file

@ -0,0 +1,18 @@
patch typedef for `int64` which causes hang in `0602ResultantFanProjection`
cf:
https://github.com/void-linux/void-packages/pull/34182
https://trac.sagemath.org/ticket/32088
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=905300
--- a/src/vektor.h 2017-06-20 11:47:37.000000000 -0300
+++ b/src/vektor.h 2021-11-21 18:28:43.384750825 -0300
@@ -10,7 +10,7 @@
using namespace std;
-typedef signed long int int64;
+typedef int64_t int64;
void outOfRange(int i, int n);

View file

@ -0,0 +1,27 @@
diff --git a/src/app_test.cpp b/src/app_test.cpp
index 755bfe6..183c735 100644
--- a/src/app_test.cpp
+++ b/src/app_test.cpp
@@ -562,6 +562,9 @@ int testIntegers()
failed.push_back(i->folder);
}
cout<<"\n";
+ cout<<"Number of succesful tests "<<good<<endl;
+ cout<<"Number of failed tests "<<bad<<endl;
+
if(!failed.empty())
{
cout<<"Failed tests:\n-------------\n";
@@ -569,11 +572,9 @@ int testIntegers()
{
cout<<*i<<" FAILED!\n";
}
+ return 1;
}
- cout<<"Number of succesful tests "<<good<<endl;
- cout<<"Number of failed tests "<<bad<<endl;
-
return 0;
}
};

View file

@ -0,0 +1,71 @@
diff --git a/doc/installation.tex b/doc/installation.tex
index 763f147..61c87be 100644
--- a/doc/installation.tex
+++ b/doc/installation.tex
@@ -20,7 +20,7 @@ Should this command fail, then you are using an old version of gfan.
As an alternative to using package managers as above you can try to locate an executable file named ``gfan'' in the installation of other math software. SageMath, for example, contains a gfan executable. You also have the possibility of installing a precompiled executables: go to the Gfan webpage, go to the binaries.html subpage, and follow the instructions there. There is however only very few executables available.
%% Rewrite this section.
-%% The apt-get linux trouble disappears if all includes of cdd files are of form ``cdd/set\_oper.h''. Now of course if we cannot run apt-get because we are not root we need to install cddlib manually. Here we should use configure to specify how that is done correctly. We should use --prefix=, --includedir=, and possibly --libdir=.
+%% The apt-get linux trouble disappears if all includes of cdd files are of form ``cddlib/set\_oper.h''. Now of course if we cannot run apt-get because we are not root we need to install cddlib manually. Here we should use configure to specify how that is done correctly. We should use --prefix=, --includedir=, and possibly --libdir=.
%% The same thing goes for gmp???? EXCEPT THAT FOR SOME REASON gmp is allowed to be in /usr/include .
diff --git a/src/app_librarytest.cpp b/src/app_librarytest.cpp
index 3b1395b..d91a264 100644
--- a/src/app_librarytest.cpp
+++ b/src/app_librarytest.cpp
@@ -12,8 +12,8 @@
#include "setoper.h"
#include "cdd.h"
#else
-#include "cdd/setoper.h"
-#include "cdd/cdd.h"
+#include "cddlib/setoper.h"
+#include "cddlib/cdd.h"
#endif
#include <iostream>
#include <fstream>
diff --git a/src/gfanlib_zcone.cpp b/src/gfanlib_zcone.cpp
index f24f09c..481f116 100644
--- a/src/gfanlib_zcone.cpp
+++ b/src/gfanlib_zcone.cpp
@@ -16,8 +16,8 @@
#include "setoper.h"
#include "cdd.h"
#else
-#include "cdd/setoper.h"
-#include "cdd/cdd.h"
+#include "cddlib/setoper.h"
+#include "cddlib/cdd.h"
#endif
//}
@@ -52,8 +52,8 @@ namespace gfan{
"dd_free_global_constants()\n"
"in your deinitialisation code (only available for cddlib version>=094d).\n"
"This requires the header includes:\n"
- "#include \"cdd/setoper.h\"\n"
- "#include \"cdd/cdd.h\"\n"
+ "#include \"cddlib/setoper.h\"\n"
+ "#include \"cddlib/cdd.h\"\n"
"\n"
"Alternatively, you may call gfan:initializeCddlibIfRequired() and deinitializeCddlibIfRequired()\n"
"if gfanlib is the only code using cddlib. If at some point cddlib is no longer required by gfanlib\n"
diff --git a/src/lp_cdd.cpp b/src/lp_cdd.cpp
index ec36517..5232d50 100644
--- a/src/lp_cdd.cpp
+++ b/src/lp_cdd.cpp
@@ -5,9 +5,9 @@
#include "cdd.h"
#include "cdd_f.h"
#else
-#include "cdd/setoper.h"
-#include "cdd/cdd.h"
-#include "cdd/cdd_f.h"
+#include "cddlib/setoper.h"
+#include "cddlib/cdd.h"
+#include "cddlib/cdd_f.h"
#endif
//}
#include "termorder.h"

View file

@ -0,0 +1,195 @@
diff --git a/testsuite/0008PolynomialSetUnion/command b/testsuite/0008PolynomialSetUnion/command
index cbb23d6..d61cb71 100644
--- a/testsuite/0008PolynomialSetUnion/command
+++ b/testsuite/0008PolynomialSetUnion/command
@@ -1 +1 @@
-%s _bases | %s _polynomialsetunion |sort
+%s _bases | %s _polynomialsetunion |LC_ALL=C sort|tail -n +2 | sed -e '$ d'
diff --git a/testsuite/0008PolynomialSetUnion/output b/testsuite/0008PolynomialSetUnion/output
index 38dfb6f..12a65c7 100644
--- a/testsuite/0008PolynomialSetUnion/output
+++ b/testsuite/0008PolynomialSetUnion/output
@@ -1,62 +1,60 @@
-{
+a*b-c^6,
+a*b^2-c^3,
+a*b^4-b,
+a*c-b^6,
+a*c^2-b,
+a*c^6-c,
+a-b^11,
+a-b^2*c,
+a-c^9,
a^11-c,
a^15-a,
+a^2*b-c,
a^2*b^3-a,
+a^2*c-b^3,
a^2-b^8,
-a^2*b-c,
a^2-c^4,
-a^2*c-b^3,
-a^3-b^5,
-a^3-b*c^2,
a^3*c^2-c}
-a^4-b^2,
+a^3-b*c^2,
+a^3-b^5,
a^4*c-a,
+a^4-b^2,
a^5-c^3,
a^6*b-a,
a^6-b*c,
a^8-c^2,
a^9-b,
-a-b^11,
-a-b^2*c,
-a*b^2-c^3,
-a*b^4-b,
-a*b-c^6,
-a*c^2-b,
-a*c^6-c,
-a-c^9,
-a*c-b^6,
+b*c-a^6,
+b*c^2-a^3,
+b*c^4-c,
+b-a*c^2,
+b-a^9,
+b-c^11,
b^11-a,
b^15-b,
-b^2-a^4,
+b^2*c-a,
b^2*c^3-b,
+b^2-a^4,
b^2-c^8,
-b^2*c-a,
b^3-a^2*c,
b^3-c^5,
b^4-c^2,
b^5-a^3,
-b^6-a*c,
b^6*c-b,
+b^6-a*c,
b^8-a^2,
b^9-c,
-b-a^9,
-b-a*c^2,
-b-c^11,
-b*c^2-a^3,
-b*c^4-c,
-b*c-a^6,
+c-a^11,
+c-a^2*b,
+c-b^9,
c^11-b,
c^15-c,
c^2-a^8,
c^2-b^4,
-c^3-a^5,
c^3-a*b^2,
+c^3-a^5,
c^4-a^2,
c^5-b^3,
c^6-a*b,
c^8-b^2,
c^9-a,
-c-a^11,
-c-a^2*b,
-c-b^9,
-Q[a,b,c]
diff --git a/testsuite/0008PolynomialSetUnion/outputNew b/testsuite/0008PolynomialSetUnion/outputNew
index 38dfb6f..12a65c7 100644
--- a/testsuite/0008PolynomialSetUnion/outputNew
+++ b/testsuite/0008PolynomialSetUnion/outputNew
@@ -1,62 +1,60 @@
-{
+a*b-c^6,
+a*b^2-c^3,
+a*b^4-b,
+a*c-b^6,
+a*c^2-b,
+a*c^6-c,
+a-b^11,
+a-b^2*c,
+a-c^9,
a^11-c,
a^15-a,
+a^2*b-c,
a^2*b^3-a,
+a^2*c-b^3,
a^2-b^8,
-a^2*b-c,
a^2-c^4,
-a^2*c-b^3,
-a^3-b^5,
-a^3-b*c^2,
a^3*c^2-c}
-a^4-b^2,
+a^3-b*c^2,
+a^3-b^5,
a^4*c-a,
+a^4-b^2,
a^5-c^3,
a^6*b-a,
a^6-b*c,
a^8-c^2,
a^9-b,
-a-b^11,
-a-b^2*c,
-a*b^2-c^3,
-a*b^4-b,
-a*b-c^6,
-a*c^2-b,
-a*c^6-c,
-a-c^9,
-a*c-b^6,
+b*c-a^6,
+b*c^2-a^3,
+b*c^4-c,
+b-a*c^2,
+b-a^9,
+b-c^11,
b^11-a,
b^15-b,
-b^2-a^4,
+b^2*c-a,
b^2*c^3-b,
+b^2-a^4,
b^2-c^8,
-b^2*c-a,
b^3-a^2*c,
b^3-c^5,
b^4-c^2,
b^5-a^3,
-b^6-a*c,
b^6*c-b,
+b^6-a*c,
b^8-a^2,
b^9-c,
-b-a^9,
-b-a*c^2,
-b-c^11,
-b*c^2-a^3,
-b*c^4-c,
-b*c-a^6,
+c-a^11,
+c-a^2*b,
+c-b^9,
c^11-b,
c^15-c,
c^2-a^8,
c^2-b^4,
-c^3-a^5,
c^3-a*b^2,
+c^3-a^5,
c^4-a^2,
c^5-b^3,
c^6-a*b,
c^8-b^2,
c^9-a,
-c-a^11,
-c-a^2*b,
-c-b^9,
-Q[a,b,c]

38
srcpkgs/gfan/template Normal file
View file

@ -0,0 +1,38 @@
# Template file for 'gfan'
pkgname=gfan
version=0.6.2
revision=1
wrksrc=gfan$version
build_style=gnu-makefile
makedepends="gmp-devel cddlib-devel"
short_desc="Package for computing Groebner fans and tropical varieties"
maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
license="GPL-2.0-or-later"
homepage="https://math.au.dk/~jensen/software/gfan/gfan.html"
distfiles="https://math.au.dk/~jensen/software/gfan/gfan${version}.tar.gz"
checksum=a674d5e5dc43634397de0d55dd5da3c32bd358d05f72b73a50e62c1a1686f10a
# Makefile has this but our CFLAGS override it; build fails otherwise
CFLAGS="-DGMPRATIONAL"
case $XBPS_TARGET_MACHINE in
# avoid numerical noise caused by extended-precision of registers
# fixes testsuite/0009RenderStairCase
i686*) CFLAGS+=" -ffloat-store" ;;
esac
if [ -n "$CROSS_BUILD" ]; then
# depend on host gfan for installlinks
hostmakedepends+=" gfan"
fi
do_install() {
if [ -z "$CROSS_BUILD" ]; then
# Makefile doesn't support DESTDIR so we add it to PREFIX
make PREFIX=${DESTDIR}/usr install
else
vbin gfan
# use host gfan to install links
cd ${DESTDIR}/usr/bin && gfan installlinks
fi
}

1
srcpkgs/gfan/update Normal file
View file

@ -0,0 +1 @@
ignore=lib*