public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sci-mathematics/gfan/, sci-mathematics/gfan/files/
@ 2016-06-09 20:16 Thomas Kahle
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Kahle @ 2016-06-09 20:16 UTC (permalink / raw
  To: gentoo-commits

commit:     68b401536df91ee42b4e58cd38b74f96ca0a0560
Author:     Thomas Kahle <tomka <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  9 20:16:05 2016 +0000
Commit:     Thomas Kahle <tomka <AT> gentoo <DOT> org>
CommitDate: Thu Jun  9 20:16:25 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=68b40153

sci-mathematics/gfan: gcc-6.1 compat and EAPI=6

Package-Manager: portage-2.3.0_rc1

 .../gfan/files/gfan-0.5-gcc6.1-compat.patch        | 70 ++++++++++++++++++++++
 sci-mathematics/gfan/gfan-0.5-r1.ebuild            | 39 ++++++++++++
 2 files changed, 109 insertions(+)

diff --git a/sci-mathematics/gfan/files/gfan-0.5-gcc6.1-compat.patch b/sci-mathematics/gfan/files/gfan-0.5-gcc6.1-compat.patch
new file mode 100644
index 0000000..8479557
--- /dev/null
+++ b/sci-mathematics/gfan/files/gfan-0.5-gcc6.1-compat.patch
@@ -0,0 +1,70 @@
+--- a/app_fiberpolytope.cpp
++++ b/app_fiberpolytope.cpp
+@@ -63,7 +63,7 @@
+ 
+ 	    /* If the vector configuration B does not have full rank then
+ 	       change coordinates. */
+-	    if(rank(B)!=B.getHeight())
++	    if(rank_(B)!=B.getHeight())
+ 	      {
+ 	        FieldMatrix M=integerMatrixToFieldMatrix(B,Q);
+ 	        M.reduce(false,true);//force integer operations - preserving volume
+@@ -83,7 +83,7 @@
+ 	    log1 debug<<"Done computing restricting cone\n";
+ 
+ 	    debug<<B.getRows();
+-	    debug<<int(rank(B));
++	    debug<<int(rank_(B));
+ 
+ 	    Triangulation2 t(B);
+ log1 debug<<"Computing initial triangulation\n";
+@@ -143,7 +143,7 @@
+ */
+     /* If the vector configuration A does not have full rank then
+        change coordinates. */
+-/*    if(rank(A)!=A.getHeight())
++/*    if(rank_(A)!=A.getHeight())
+       {
+ 	FieldMatrix M=integerMatrixToFieldMatrix(A,Q);
+ 	M.reduce(false,true);//force integer operations - preserving volume
+--- a/app_secondaryfan.cpp
++++ b/app_secondaryfan.cpp
+@@ -307,7 +307,7 @@
+ 
+     if(scaleOption.getValue())
+       {
+-	if(rank(A)!=A.getHeight())
++	if(rank_(A)!=A.getHeight())
+ 	  {
+ 	    cerr << "The vector configuration must have full rank in order to use the scale option.\n";
+ 	    assert(0);
+@@ -342,7 +342,7 @@
+ 
+     /* If the vector configuration A does not have full rank then
+        change coordinates. */
+-    if(rank(A)!=A.getHeight())
++    if(rank_(A)!=A.getHeight())
+       {
+ 	FieldMatrix M=integerMatrixToFieldMatrix(A,Q);
+ 	M.reduce(false,true);//force integer operations - preserving volume
+--- a/matrix.cpp
++++ b/matrix.cpp
+@@ -61,7 +61,7 @@
+ 
+ #include "linalg.h"
+ 
+-int rank(IntegerMatrix const &m)
++int rank_(IntegerMatrix const &m)
+ {
+   return integerMatrixToFieldMatrix(m,Q).rank();
+ }
+--- a/matrix.h
++++ b/matrix.h
+@@ -147,6 +147,6 @@
+ 
+ FloatMatrix integerToFloatMatrix(IntegerMatrix const &m);
+ IntegerVector flattenMatrix(IntegerMatrix const &m);
+-int rank(IntegerMatrix const &m);
++int rank_(IntegerMatrix const &m);
+ 
+ #endif

diff --git a/sci-mathematics/gfan/gfan-0.5-r1.ebuild b/sci-mathematics/gfan/gfan-0.5-r1.ebuild
new file mode 100644
index 0000000..aaf03c9
--- /dev/null
+++ b/sci-mathematics/gfan/gfan-0.5-r1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="computes Groebner fans and tropical varities"
+HOMEPAGE="http://www.math.tu-berlin.de/~jensen/software/gfan/gfan.html"
+SRC_URI="http://www.math.tu-berlin.de/~jensen/software/gfan/${PN}${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+DEPEND="dev-libs/gmp[cxx]
+	sci-libs/cddlib"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PN}${PV}/"
+
+PATCHES=(
+	"${FILESDIR}/${P}-double-declare-fix.patch"
+	"${FILESDIR}/${P}-gcc6.1-compat.patch"
+	)
+
+src_prepare () {
+	default
+	sed -i -e "s/-O2/${CXXFLAGS}/" \
+		-e "/GPROFFLAG =/d" \
+		-e "s/g++/$(tc-getCXX)/" \
+		-e "s/\$(CCLINKER)/& \$(LDFLAGS)/" Makefile || die
+}
+
+src_install() {
+	emake PREFIX="${ED}/usr" install
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sci-mathematics/gfan/, sci-mathematics/gfan/files/
@ 2020-03-06 16:58 Michael Orlitzky
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Orlitzky @ 2020-03-06 16:58 UTC (permalink / raw
  To: gentoo-commits

commit:     72f1a1873ac70ee1a9ecd27afa8c3c5fb10b58f7
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Fri Mar  6 16:52:59 2020 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Fri Mar  6 16:53:28 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=72f1a187

sci-mathematics/gfan: new version 0.6.2.

Update our version of gfan to the latest upstream v0.6.2, from
September 28th 2017. The new ebuild is based off of the version that
François Bissey maintains in the sage-on-gentoo overlay, with a few
additional changes:

  * Merged the EAPI=7 and slot dependency updates from ::gentoo.

  * Change the LICENSE to "GPL-2+", to match the upstream LICENSE file.

  * Stripped some more CFLAGS mangling out of the upstream Makefile.
    Corresponding to this we now replace "-O3" by "-O2" in the ebuild.

  * Added USE="doc", to build and install the LaTeX manual.

Closes: https://bugs.gentoo.org/711492
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 sci-mathematics/gfan/Manifest                      |   1 +
 .../gfan/files/gfan-0.6.2-Makefile.patch           | 155 ++++++++++++++
 .../gfan/files/gfan-0.6.2-testsuite.patch          | 222 +++++++++++++++++++++
 .../gfan/files/gfan-0.6.2-xcode9.3_compat.patch    |  13 ++
 sci-mathematics/gfan/gfan-0.6.2.ebuild             |  56 ++++++
 5 files changed, 447 insertions(+)

diff --git a/sci-mathematics/gfan/Manifest b/sci-mathematics/gfan/Manifest
index 09b70904371..b0e6c30ed01 100644
--- a/sci-mathematics/gfan/Manifest
+++ b/sci-mathematics/gfan/Manifest
@@ -1 +1,2 @@
 DIST gfan0.5.tar.gz 1134987 BLAKE2B 73ea793f5dbceb76a9f143a258ee3e38e1466e4e15ed96dbabb58f33d3a091a885479dd00f8179d3bf2c85cf275605823f63aa33272f1f9984e0fc5841ab35e9 SHA512 11a9657adcd5b39f73244450c09b132d8cd19474d0f9151c0127682bc16847537e4096d39e8a0a63b5c6aef6720e54a72bfd361a5271808d5a5595fd2df494fa
+DIST gfan0.6.2.tar.gz 1321059 BLAKE2B 1ed61e1e084a1ceb65dd21848440bc3a90486c0ce4012b3b64c8029e89636696d2b0e5446ea156d2cf050b5db179c7c2f25c97e683cecf6e9616e8553d8513bf SHA512 5961820750af2522fdc1a86c0254742c3b003607a8707df5d6cd5f0bc6461e4d3db3b1d3cb537979d57eb9dff387974a58aeb91d0b5246d7c701cadc5a2cf4cf

diff --git a/sci-mathematics/gfan/files/gfan-0.6.2-Makefile.patch b/sci-mathematics/gfan/files/gfan-0.6.2-Makefile.patch
new file mode 100644
index 00000000000..8e8db53bc91
--- /dev/null
+++ b/sci-mathematics/gfan/files/gfan-0.6.2-Makefile.patch
@@ -0,0 +1,155 @@
+diff --git a/Makefile b/Makefile
+index 2c9f949..a49a590 100644
+--- a/Makefile
++++ b/Makefile
+@@ -2,8 +2,8 @@ ALL: default
+ 
+ # When -g is used, it seems that stackdump does not work.
+ # GPROFFLAG = -pg
+-GPROFFLAG = -g
+-#GPROFFLAG = 
++#GPROFFLAG = -g
++GPROFFLAG =
+ 
+ PREFIX?=/usr/local
+ 
+@@ -22,20 +22,8 @@ STACTDUMP_OPTIONS = -DSTACKDUMP_ENABLED -D__assert_fail=__assert_fail2
+ endif
+ 
+ 
+-ifeq ($(sagepath),)
+-SAGE_LINKOPTIONS = 
+-SAGE_INCLUDEOPTIONS =
+-else
+-SAGE_LINKOPTIONS = -L$(sagepath)/ -lpython2.6 -lcsage -lsingular
+-SAGE_INCLUDEOPTIONS = -I $(sagepath)/
+-SAGE_OBJECTS = sage.o sage_link.so
+-
+-sage_link.so: sage_link.pyx setup.py
+-	python setup.py build_ext --inplace --pyrex-include-dirs=$(SAGE_ROOT)/devel/sage/
+-endif
+-
+ ifeq ($(gmppath),)
+-GMP_LINKOPTIONS = -lgmp
++GMP_LINKOPTIONS = -lgmp -lm
+ GMP_INCLUDEOPTIONS =
+ else
+ GMP_LINKOPTIONS = $(gmppath)/lib/libgmp.a
+@@ -49,7 +37,7 @@ CDDDEFINE_PREFIX = -DNOCDDPREFIX
+ endif
+ 
+ ifeq ($(cddpath),)
+-CDD_LINKOPTIONS = -L/usr/local -lcddgmp
++CDD_LINKOPTIONS = -lcddgmp
+ CDD_INCLUDEOPTIONS =
+ else
+ CDD_LINKOPTIONS = $(cddpath)/lib/libcddgmp.a
+@@ -71,37 +59,8 @@ SOPLEX_OBJECTS = lp_soplexcdd.o
+ endif
+ 
+ 
+-# rememember to adjust USEFACTORY in field_rationalfunctions2
+-ifeq ($(singular),)
+-ifeq ($(factory),)
+-SINGULAR_PATH =
+-SINGULAR_LINKOPTIONS =
+-SINGULAR_INCLUDEOPTIONS =
+-SINGULAR_OBJECTS = src/polynomialgcd.o 
+-else
+-SINGULAR_PATH =
+-SINGULAR_LINKOPTIONS = -lcf -lcfmem
+-SINGULAR_INCLUDEOPTIONS = -I /usr/local/include/factory/
+-SINGULAR_OBJECTS = src/polynomialgcd.o src/ftmpl_inst.o
+-endif
+-else
+-#SINGULAR_PATH = $(HOME)/math/software/Singular-3-1-0
+-#SINGULAR_LINKOPTIONS =  -L$(SINGULAR_PATH)/Singular -lsingular -lncurses -lreadline
+-#SINGULAR_INCLUDEOPTIONS = -I $(SINGULAR_PATH)/kernel -I $(SINGULAR_PATH)/omalloc
+-#SINGULAR_OBJECTS = src/singular.o src/singularconversion.o
+-SINGULAR_PATH = $(HOME)/math/software/Singular-svn/trunk/x86_64-Linux
+-SINGULAR_LINKOPTIONS =  -L$(SINGULAR_PATH)/lib -lsingular -lncurses -lreadline  -lcf -lcfmem
+-SINGULAR_INCLUDEOPTIONS = -I $(SINGULAR_PATH)/include -I $(SINGULAR_PATH)/include/omalloc
+-SINGULAR_OBJECTS = src/ftmpl_inst.o src/singular.o src/singularconversion.o
+-#Run the following line before running gfan
+-#export LD_LIBRARY_PATH="/home/anders/math/software/Singular-svn/trunk/x86_64-Linux/lib/:${LD_LIBRARY_PATH}"
+-endif
+-
+-# To produce factory templates:
+-#g++ -c /home/anders/math/software/factory-3-1-7/ftmpl_inst.cc  -fno-implicit-templates -I /usr/local/include/factory/ -I/home/anders/math/software/factory-3-1-7/ -O2 -fomit-frame-pointer -o ftmpl_inst.o
+-
+-ADDITIONALLINKOPTIONS = $(CDD_LINKOPTIONS) $(GMP_LINKOPTIONS) $(SOPLEX_LINKOPTIONS) $(SINGULAR_LINKOPTIONS) $(SAGE_LINKOPTIONS) 
+-ADDITIONALINCLUDEOPTIONS = $(CDD_INCLUDEOPTIONS) $(GMP_INCLUDEOPTIONS) $(SOPLEX_INCLUDEOPTIONS) $(SINGULAR_INCLUDEOPTIONS) $(SAGE_INCLUDEOPTIONS)
++ADDITIONALLINKOPTIONS = $(CDD_LINKOPTIONS) $(GMP_LINKOPTIONS) $(SOPLEX_LINKOPTIONS) 
++ADDITIONALINCLUDEOPTIONS = $(CDD_INCLUDEOPTIONS) $(GMP_INCLUDEOPTIONS) $(SOPLEX_INCLUDEOPTIONS)
+ 
+ 
+ MKDIR=mkdir -p
+@@ -110,13 +69,11 @@ MKDIR=mkdir -p
+ PREFIX =
+ SHELL       = /bin/sh
+ #ARCH        = LINUX
+-CC          = $(PREFIX)gcc
+-CLINKER     = $(CC)
+-CXX         = $(PREFIX)g++
+-CCLINKER    = $(CXX)
++CC          ?= $(PREFIX)gcc
++CXX         ?= $(PREFIX)g++
+ #OPTFLAGS    = -O2 -DGMPRATIONAL -DNDEBUG
+ # Note that gcc produces wrong code with -O3
+-OPTFLAGS    =  -DGMPRATIONAL -Wuninitialized -fno-omit-frame-pointer -O2	 #-O3 -fno-guess-branch-probability #-DNDEBUG
++OPTFLAGS    =  -DGMPRATIONAL -Wuninitialized
+ #OPTFLAGS    =  -DGMPRATIONAL -Wuninitialized -fno-omit-frame-pointer -O3 -mavx -msse2  -finline-limit=1000 -ffast-math -Wuninitialized # -fno-guess-branch-probability #-DNDEBUG -ftree-vectorizer-verbose=2
+ #OPTFLAGS    =  -DGMPRATIONAL -Wuninitialized -fno-omit-frame-pointer -O1             -fno-guess-branch-probability
+  #-DNDEBUG
+@@ -125,10 +82,10 @@ OPTFLAGS    =  -DGMPRATIONAL -Wuninitialized -fno-omit-frame-pointer -O2	 #-O3 -
+ #OPTFLAGS    =  -DGMPRATIONAL -Wuninitialized -fno-omit-frame-pointer -O3 -msse2 -ftree-vectorizer-verbose=2 -ffast-math #-DNDEBUG
+ #OPTFLAGS    =  -DGMPRATIONAL -Wuninitialized -fno-omit-frame-pointer -O3 -mavx -msse2 -ftree-vectorizer-verbose=2 -ffast-math #-DNDEBUG
+ 
+-CFLAGS	  = $(OPTFLAGS) $(GPROFFLAG) $(STACTDUMP_OPTIONS) $(ADDITIONALINCLUDEOPTIONS) -std=c++0x -g $(CDDDEFINE_PREFIX) #-pedantic
+-#CFLAGS	  = $(OPTFLAGS) $(GPROFFLAG) $(STACTDUMP_OPTIONS) $(ADDITIONALINCLUDEOPTIONS) -D_GLIBCXX_DEBUG -std=c++0x -g $(CDDDEFINE_PREFIX) #-pedantic
+-CCFLAGS	  = $(CFLAGS)
+-FFLAGS	  = $(OPTFLAGS)
++CFLAGS	  := $(CFLAGS) $(OPTFLAGS) $(GPROFFLAG) $(ADDITIONALINCLUDEOPTIONS) #-pedantic
++CXXFLAGS  := $(CXXFLAGS) $(OPTFLAGS) $(GPROFFLAG) $(ADDITIONALINCLUDEOPTIONS) #-pedantic
++
++SINGULAR_OBJECTS = src/polynomialgcd.o
+ 
+ CATSOBJECTS =	lp_cdd.o \
+ 		parser.o \
+@@ -394,16 +351,15 @@ EXECS	  = $(MAIN)
+ # (compiling with gcc version 4.7.2 and running gfan _tropicaltraverse on a starting cone for Grassmann3_7)
+ # Either this is a bug in the code or in the compiler. The bug disappears by compiling with -fno-guess-branch-probability
+ src/symmetrictraversal.o: src/symmetrictraversal.cpp
+-	$(CXX) $(CFLAGS) -fno-guess-branch-probability  -c src/symmetrictraversal.cpp -o src/symmetrictraversal.o
++	$(CXX) $(CXXFLAGS) -c src/symmetrictraversal.cpp -o src/symmetrictraversal.o
+ # If compiling with clang, use the line below instead:
+-#	$(CXX) $(CFLAGS) -c src/symmetrictraversal.cpp -o src/symmetrictraversal.o
++#	$(CXX) $(CXXFLAGS) -c src/symmetrictraversal.cpp -o src/symmetrictraversal.o
+ 
+ # Define suffixes to make the program compile on legolas.imf.au.dk :
+ .SUFFIXES: .o .cpp .c
+ 
+ OBJECTS = 	$(addprefix src/,$(SOPLEX_OBJECTS)) \
+ 		$(SINGULAR_OBJECTS) \
+-		$(SAGE_OBJECTS) \
+ 		$(addprefix src/,$(CATSOBJECTS)) \
+ 		$(addprefix src/,$(APPOBJECTS)) \
+ 		src/symmetrictraversal.o
+@@ -420,7 +376,7 @@ default: $(OBJECTS) $(ADDITIONALOBJECTS) $(EXECS)
+ 
+ $(MAIN): $(OBJECTS)
+ #	$(CCLINKER) $(OBJECTS) $(ADDITIONALLINKOPTIONS) $(GPROFFLAG) -lpthread  -o $(MAIN)
+-	$(CCLINKER) $(OBJECTS) $(ADDITIONALLINKOPTIONS) $(GPROFFLAG) -lpthread -rdynamic -o $(MAIN)
++	$(CXX) $(CXXFLAGS) -pthread -o $(MAIN) $(LDFLAGS) $(OBJECTS) -lpthread $(ADDITIONALLINKOPTIONS) $(GPROFFLAG)
+ 
+ release:
+ 	rm -f -r $(RELEASEDIR)/*
+@@ -546,7 +502,7 @@ check:
+ .c.o:
+ 	$(CC) $(CFLAGS) -c $< -o $(patsubst %.c,%.o,$<)
+ .cpp.o:
+-	$(CXX) $(CFLAGS) -c $< -o $(patsubst %.cpp,%.o,$<)
++	$(CXX) $(CXXFLAGS) -c $< -o $(patsubst %.cpp,%.o,$<)
+ 
+ # wget http://ftp.sunet.se/pub/gnu/gmp/gmp-4.2.2.tar.gz
+ # tar -xzvf gmp-4.2.2.tar.gz

diff --git a/sci-mathematics/gfan/files/gfan-0.6.2-testsuite.patch b/sci-mathematics/gfan/files/gfan-0.6.2-testsuite.patch
new file mode 100644
index 00000000000..920646e486e
--- /dev/null
+++ b/sci-mathematics/gfan/files/gfan-0.6.2-testsuite.patch
@@ -0,0 +1,222 @@
+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;
+   }
+ };
+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]

diff --git a/sci-mathematics/gfan/files/gfan-0.6.2-xcode9.3_compat.patch b/sci-mathematics/gfan/files/gfan-0.6.2-xcode9.3_compat.patch
new file mode 100644
index 00000000000..83f4b66f823
--- /dev/null
+++ b/sci-mathematics/gfan/files/gfan-0.6.2-xcode9.3_compat.patch
@@ -0,0 +1,13 @@
+diff --git a/src/app_main.cpp b/src/app_main.cpp
+index a33c042..e7ade81 100644
+--- a/src/app_main.cpp
++++ b/src/app_main.cpp
+@@ -205,7 +205,7 @@ public:
+     }
+ 
+     ep->close();
+-    delete ep;//<--- In next release, make the class virtual
++//    delete ep;//<--- In next release, make the class virtual # this is miscompiled clang@xcode-6.3
+ 
+     printf("\n");
+ 

diff --git a/sci-mathematics/gfan/gfan-0.6.2.ebuild b/sci-mathematics/gfan/gfan-0.6.2.ebuild
new file mode 100644
index 00000000000..07d32ab4907
--- /dev/null
+++ b/sci-mathematics/gfan/gfan-0.6.2.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Compute Groebner fans and tropical varieties"
+HOMEPAGE="https://users-math.au.dk/~jensen/software/gfan/gfan.html"
+SRC_URI="https://users-math.au.dk/~jensen/software/${PN}/${PN}${PV}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc"
+
+BDEPEND="doc? ( virtual/latex-base )"
+DEPEND="dev-libs/gmp:0=[cxx]
+	sci-libs/cddlib:0="
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PN}${PV}"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-0.6.2-xcode9.3_compat.patch"
+	"${FILESDIR}/${PN}-0.6.2-testsuite.patch"
+	"${FILESDIR}/${PN}-0.6.2-Makefile.patch"
+	)
+
+pkg_setup() {
+	tc-export CC CXX
+	append-cxxflags -DNOCDDPREFIX
+}
+
+src_configure() {
+	# The upstream Makefile says that GCC produces bad code with -O3.
+	replace-flags "-O3" "-O2"
+	default
+}
+
+src_compile() {
+	default
+	if use doc; then
+		pushd doc > /dev/null || die
+		# The LaTeX build commands need to be repeated until the
+		# document "stops changing," which is not as easy as it
+		# sounds to detect. Running it twice seems to work here.
+		pdflatex manual.tex && bibtex manual && pdflatex manual.tex || die
+		popd > /dev/null || die
+	fi
+}
+
+src_install() {
+	emake PREFIX="${ED}/usr" install
+	use doc && dodoc doc/manual.pdf
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sci-mathematics/gfan/, sci-mathematics/gfan/files/
@ 2024-08-29 17:33 Michael Orlitzky
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Orlitzky @ 2024-08-29 17:33 UTC (permalink / raw
  To: gentoo-commits

commit:     1c2a6e7fb4fb1d9205bca1556dd1a63b398d2244
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 29 16:36:57 2024 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Thu Aug 29 17:30:59 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1c2a6e7f

sci-mathematics/gfan: fix startup crash, other improvements

AKA steal a few Debian patches.

Bug: https://bugs.gentoo.org/717112
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 .../gfan/files/gfan-0.6.2-find-name.patch          | 18 +++++
 ...gfan-0.6.2-fix-0602ResultantFanProjection.patch | 27 ++++++++
 .../files/gfan-0.6.2-fix-spelling-errors.patch     | 50 ++++++++++++++
 sci-mathematics/gfan/gfan-0.6.2-r5.ebuild          | 78 ++++++++++++++++++++++
 4 files changed, 173 insertions(+)

diff --git a/sci-mathematics/gfan/files/gfan-0.6.2-find-name.patch b/sci-mathematics/gfan/files/gfan-0.6.2-find-name.patch
new file mode 100644
index 000000000000..5e6718e70ed2
--- /dev/null
+++ b/sci-mathematics/gfan/files/gfan-0.6.2-find-name.patch
@@ -0,0 +1,18 @@
+Description: Properly terminate while loop when finding application name.
+Author: Anders Nedergaard Jensen <jensen@math.au.dk>
+Origin: https://bugs.debian.org/950008#17
+Bug-Debian: https://bugs.debian.org/950008
+Forwarded: yes
+Last-Update: 2021-11-21
+
+--- a/src/application.cpp
++++ b/src/application.cpp
+@@ -26,7 +26,7 @@
+     {
+       l--;
+     }
+-  while(p[l]!=0 && p[l]!='/');
++  while(l >= 0 && p[l]!='/');
+ 
+   return p+l+1;
+ }

diff --git a/sci-mathematics/gfan/files/gfan-0.6.2-fix-0602ResultantFanProjection.patch b/sci-mathematics/gfan/files/gfan-0.6.2-fix-0602ResultantFanProjection.patch
new file mode 100644
index 000000000000..99fe8167398e
--- /dev/null
+++ b/sci-mathematics/gfan/files/gfan-0.6.2-fix-0602ResultantFanProjection.patch
@@ -0,0 +1,27 @@
+Description: Use int64_t instead of signed long int for 64-bit integer typedef
+ On 32-bit architectures, longs are only 32 bits.  The resulting overflow
+ was causing an infinite loop in the 0602ResultantFanProjection test.
+Bug-Debian: https://bugs.debian.org/905300
+Bug-Debian: https://bugs.debian.org/974558
+Author: Doug Torrance <dtorrance@piedmont.edu>
+Last-Update: 2020-11-12
+
+(mjo: added missing include)
+
+--- a/src/vektor.h
++++ b/src/vektor.h
+@@ -6,11 +6,12 @@
+ #include <assert.h>
+ #include <algorithm>
+ #include <complex>
++#include <cstdint>
+ #include <stdio.h>
+ 
+ using namespace std;
+ 
+-typedef signed long int int64;
++typedef int64_t int64;
+ 
+ void outOfRange(int i, int n);
+ 
+

diff --git a/sci-mathematics/gfan/files/gfan-0.6.2-fix-spelling-errors.patch b/sci-mathematics/gfan/files/gfan-0.6.2-fix-spelling-errors.patch
new file mode 100644
index 000000000000..08b78c6efcaa
--- /dev/null
+++ b/sci-mathematics/gfan/files/gfan-0.6.2-fix-spelling-errors.patch
@@ -0,0 +1,50 @@
+Descriptions: Fix some spelling errors in output text of the programs
+Author: Cédric Boutillier <boutil@debian.org>
+Author: Doug Torrance <dtorrance@piedmont.edu>
+Forwarded: yes
+Last-Update: 2020-11-13
+
+--- a/src/app_scarfisgeneric.cpp
++++ b/src/app_scarfisgeneric.cpp
+@@ -24,7 +24,7 @@
+   }
+   const char *helpText()
+   {
+-    return "This program takes a matrix as input and checks if it satisfies Scarf's generality conditions. The rows of the matrix are listed on the input. The A1 condition is that there exists a strictly poistive vector in the co-kernel of the matrix. The A2 condition is that te maximal minors of the matrix are non-zero. A3\n";
++    return "This program takes a matrix as input and checks if it satisfies Scarf's generality conditions. The rows of the matrix are listed on the input. The A1 condition is that there exists a strictly poistive vector in the co-kernel of the matrix. The A2 condition is that the maximal minors of the matrix are non-zero. A3\n";
+   }
+   ScarfIsGenericApplication()
+   {
+--- a/src/app_symmetries.cpp
++++ b/src/app_symmetries.cpp
+@@ -35,7 +35,7 @@
+   }
+   SymmetriesApplication():
+     optionSymmetry("--symmetry","Specify subgroup to be searched for permutations keeping the ideal fixed."),
+-    optionTorusSymmetry("--symsigns","Specify for each generator of the group specified wiht --symmetry an element of ${-1,+1}^n$ which by its multiplication on the variables together with the permutation is expected to keep the ideal fixed.")
++    optionTorusSymmetry("--symsigns","Specify for each generator of the group specified with --symmetry an element of ${-1,+1}^n$ which by its multiplication on the variables together with the permutation is expected to keep the ideal fixed.")
+   {
+     registerOptions();
+   }
+--- a/src/app_representatives.cpp
++++ b/src/app_representatives.cpp
+@@ -24,7 +24,7 @@
+   }
+   const char *helpText()
+   {
+-    return "This program computes takes generaters for a subgroup of S_n and a list of n-dimensional integer vectors. The output is a list of vectors, one from each orbit of elements of the list. \n";
++    return "This program computes takes generators for a subgroup of S_n and a list of n-dimensional integer vectors. The output is a list of vectors, one from each orbit of elements of the list. \n";
+   }
+   RepresentativesApplication()
+   {
+--- a/src/tropical2.cpp
++++ b/src/tropical2.cpp
+@@ -271,7 +271,7 @@
+   PolynomialSet r(theRing);
+   if(theRing.getNumberOfVariables()!=weight.size())
+     {
+-      cerr << "Error: Number of varaibles in polynomial ring "<<theRing.getNumberOfVariables()<< " length of weight vector " << weight.size() <<endl;
++      cerr << "Error: Number of variables in polynomial ring "<<theRing.getNumberOfVariables()<< " length of weight vector " << weight.size() <<endl;
+       assert(0);
+     }
+ 

diff --git a/sci-mathematics/gfan/gfan-0.6.2-r5.ebuild b/sci-mathematics/gfan/gfan-0.6.2-r5.ebuild
new file mode 100644
index 000000000000..47fbcc3b8e1d
--- /dev/null
+++ b/sci-mathematics/gfan/gfan-0.6.2-r5.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Compute Groebner fans and tropical varieties"
+HOMEPAGE="https://users-math.au.dk/~jensen/software/gfan/gfan.html"
+SRC_URI="https://users-math.au.dk/~jensen/software/${PN}/${PN}${PV}.tar.gz"
+
+S="${WORKDIR}/${PN}${PV}"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~riscv ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc"
+
+BDEPEND="doc? ( virtual/latex-base )"
+DEPEND="dev-libs/gmp:0=[cxx(+)]
+	sci-libs/cddlib:0="
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-0.6.2-testsuite.patch"
+	"${FILESDIR}/${PN}-0.6.2-Makefile.patch"
+	"${FILESDIR}/${PN}-0.6.2-fix-0602ResultantFanProjection.patch"
+	"${FILESDIR}/${PN}-0.6.2-fix-spelling-errors.patch"
+	"${FILESDIR}/${PN}-0.6.2-find-name.patch"
+)
+
+pkg_setup() {
+	tc-export CC CXX
+
+	# This should really go in cppflags, but that doesn't work with
+	# gfan's hand-written Makefile.
+	append-cxxflags -DNOCDDPREFIX -I"${EPREFIX}"/usr/include/cddlib
+}
+
+src_prepare() {
+	default
+
+	# And this one fails (harmlessly) on x86, bug 818397.
+	rm -r testsuite/0009RenderStairCase || \
+		die "unable to disable test 0009RenderStairCase"
+}
+
+src_configure() {
+	# -Werror=odr
+	# https://bugs.gentoo.org/863044
+	# Only contact method is email. I have sent one detailing the issue.
+	filter-lto
+
+	# The upstream Makefile says that GCC produces bad code with -O3.
+	replace-flags "-O3" "-O2"
+	default
+}
+
+src_compile() {
+	default
+	if use doc; then
+		pushd doc > /dev/null || die
+		# The LaTeX build commands need to be repeated until the
+		# document "stops changing," which is not as easy as it
+		# sounds to detect. Running it twice seems to work here.
+		for iteration in 1 2; do
+			latex manual.tex && \
+				bibtex manual && \
+				dvipdf manual.dvi manual.pdf || die
+		done
+		popd > /dev/null || die
+	fi
+}
+
+src_install() {
+	emake PREFIX="${ED}/usr" install
+	use doc && dodoc doc/manual.pdf
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sci-mathematics/gfan/, sci-mathematics/gfan/files/
@ 2024-10-05 13:11 Michael Orlitzky
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Orlitzky @ 2024-10-05 13:11 UTC (permalink / raw
  To: gentoo-commits

commit:     f27391fc418baa5ce0f4b08e32235adb547d4e9f
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  5 12:53:03 2024 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Sat Oct  5 13:09:19 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f27391fc

sci-mathematics/gfan: new patch to fix out-of-bounds indexing

Fix the SageMath test suite by making sure gfan_mixedvolume doesn't
crash.

Closes: https://bugs.gentoo.org/897782
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 .../gfan/files/gfan-0.6.2-glibcxx-assertions.patch | 39 ++++++++++++++++++++++
 .../{gfan-0.6.2-r5.ebuild => gfan-0.6.2-r6.ebuild} |  1 +
 2 files changed, 40 insertions(+)

diff --git a/sci-mathematics/gfan/files/gfan-0.6.2-glibcxx-assertions.patch b/sci-mathematics/gfan/files/gfan-0.6.2-glibcxx-assertions.patch
new file mode 100644
index 000000000000..00c616d036fe
--- /dev/null
+++ b/sci-mathematics/gfan/files/gfan-0.6.2-glibcxx-assertions.patch
@@ -0,0 +1,39 @@
+From f0e9e24f1f20801bd49c78b30b951433f834a2c7 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Sat, 5 Oct 2024 08:48:57 -0400
+Subject: [PATCH] src/gfanlib_tropicalhomotopy.h: avoid out-of-bounds vector
+ indexes
+
+Add a check to ensure that we don't try to access the -1st element of
+a vector. The code would be trying to subtract zero from the entry, so
+it was "harmless," but it does crash glibcxx when assertions are
+enabled (as they are on hardened Gentoo). This should allow the
+SageMath "mixed volume" tests to pass.
+---
+ src/gfanlib_tropicalhomotopy.h | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/src/gfanlib_tropicalhomotopy.h b/src/gfanlib_tropicalhomotopy.h
+index f3127ba..f6db26e 100644
+--- a/src/gfanlib_tropicalhomotopy.h
++++ b/src/gfanlib_tropicalhomotopy.h
+@@ -454,10 +454,12 @@ template<class mvtyp, class mvtypDouble, class mvtypDivisor>
+ 			//chioices are "relative" so no update is needed.
+ 
+ 			choices=parent.choices;
+-			int numberToDrop=(subconfigurationIndex!=0) ? numberToDrop=k+1 : 0;
+-
+-			choices[subconfigurationIndex-1].first-=numberToDrop;
+-			choices[subconfigurationIndex-1].second-=numberToDrop;
++			int numberToDrop = 0;
++			if (subconfigurationIndex != 0) {
++				numberToDrop=k+1;
++				choices[subconfigurationIndex-1].first-=numberToDrop;
++				choices[subconfigurationIndex-1].second-=numberToDrop;
++			}
+ 
+ 			denominator=parent.denominator;
+ 			int offsetOld=0;
+-- 
+2.45.2
+

diff --git a/sci-mathematics/gfan/gfan-0.6.2-r5.ebuild b/sci-mathematics/gfan/gfan-0.6.2-r6.ebuild
similarity index 97%
rename from sci-mathematics/gfan/gfan-0.6.2-r5.ebuild
rename to sci-mathematics/gfan/gfan-0.6.2-r6.ebuild
index 47fbcc3b8e1d..c755b754b378 100644
--- a/sci-mathematics/gfan/gfan-0.6.2-r5.ebuild
+++ b/sci-mathematics/gfan/gfan-0.6.2-r6.ebuild
@@ -27,6 +27,7 @@ PATCHES=(
 	"${FILESDIR}/${PN}-0.6.2-fix-0602ResultantFanProjection.patch"
 	"${FILESDIR}/${PN}-0.6.2-fix-spelling-errors.patch"
 	"${FILESDIR}/${PN}-0.6.2-find-name.patch"
+	"${FILESDIR}/${PN}-0.6.2-glibcxx-assertions.patch"
 )
 
 pkg_setup() {


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-10-05 13:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-06 16:58 [gentoo-commits] repo/gentoo:master commit in: sci-mathematics/gfan/, sci-mathematics/gfan/files/ Michael Orlitzky
  -- strict thread matches above, loose matches on Subject: below --
2024-10-05 13:11 Michael Orlitzky
2024-08-29 17:33 Michael Orlitzky
2016-06-09 20:16 Thomas Kahle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox