From 333264b1b4a3a019d8a86223259f6986abd4980a Mon Sep 17 00:00:00 2001 From: Jerry James Date: Sep 29 2017 04:01:32 +0000 Subject: New upstream release. Also: - License change to GPLv2+. - Manual is now free. - Drop upstreamed -format patch. - Drop unnecessary -respect-destdir patch. --- diff --git a/.gitignore b/.gitignore index d74b407..ef942c6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ gfan0.5.tar.gz +/gfan0.6.2.tar.gz diff --git a/gfan-format.patch b/gfan-format.patch deleted file mode 100644 index 57c0100..0000000 --- a/gfan-format.patch +++ /dev/null @@ -1,275 +0,0 @@ ---- ./genericwalk.cpp.orig 2011-01-25 08:33:16.000000000 -0700 -+++ ./genericwalk.cpp 2011-04-27 13:42:52.227946066 -0600 -@@ -202,7 +202,7 @@ - g=newG; - - nflips++; -- fprintf(Stderr,"Flip %i, new size %i\n",nflips,g.size()); -+ fprintf(Stderr,"Flip %i, new size %zu\n",nflips,g.size()); - } - fprintf(Stderr,"Number of flips:%i\n",nflips); - ---- ./app_isgroebnerbasis.cpp.orig 2011-01-25 08:33:15.000000000 -0700 -+++ ./app_isgroebnerbasis.cpp 2011-04-27 13:48:16.474949962 -0600 -@@ -47,7 +47,7 @@ - IntegerVectorListList sums; - IntegerVectorList polytope=minkowski(polytopes,&sums); - -- fprintf(Stderr,"Number of extreme vertices in Minkowski sum: %i\n",polytope.size()); -+ fprintf(Stderr,"Number of extreme vertices in Minkowski sum: %zu\n",polytope.size()); - - bool isGroebnerBasis=false; - int counter=0; ---- ./polyhedralfan.cpp.orig 2011-01-25 08:33:17.000000000 -0700 -+++ ./polyhedralfan.cpp 2011-04-27 13:46:56.746866265 -0600 -@@ -604,7 +604,7 @@ - { - // log0 fprintf(Stderr,"rayComplexSymmetry - begin\n"); - PolyhedralFan ret(n); -- log1 fprintf(Stderr,"Computing rays of %i cones\n",cones.size()); -+ log1 fprintf(Stderr,"Computing rays of %zu cones\n",cones.size()); - for(PolyhedralConeList::const_iterator i=cones.begin();i!=cones.end();i++) - { - { -@@ -812,7 +812,7 @@ - SymmetryGroup localsym(n); - if(!sym)sym=&localsym; - set rays; -- log1 fprintf(Stderr,"Computing rays of %i cones\n",cones.size()); -+ log1 fprintf(Stderr,"Computing rays of %zu cones\n",cones.size()); - for(PolyhedralConeList::const_iterator i=cones.begin();i!=cones.end();i++) - { - { -@@ -1212,7 +1212,7 @@ - static int t; - if((t&1023)==0) - { -- fprintf(Stderr,"clist size:%i\n",clist.size()); -+ fprintf(Stderr,"clist size:%zu\n",clist.size()); - } - t++; - } ---- ./bergman.cpp.orig 2011-01-25 08:33:16.000000000 -0700 -+++ ./bergman.cpp 2011-04-27 13:45:37.266767581 -0600 -@@ -149,7 +149,7 @@ - if(0) - { - s=fullColoredIdeals(*g,false); -- fprintf(Stderr,"Full colored ideals computed, #=%i\n",s.size()); -+ fprintf(Stderr,"Full colored ideals computed, #=%zu\n",s.size()); - } - else - { -@@ -539,7 +539,7 @@ - while(!active.empty()) - { - log1 fprintf(Stderr,"\n-------------------------------------\n"); -- log1 fprintf(Stderr,"Size of active set: %i, Completed: %i\n",active.size(),ret.cones.size()); -+ log1 fprintf(Stderr,"Size of active set: %i, Completed: %zu\n",active.size(),ret.cones.size()); - log1 fprintf(Stderr,"-------------------------------------\n"); - AsciiPrinter p(Stderr); - ---- ./symmetry.cpp.orig 2011-01-25 08:33:17.000000000 -0700 -+++ ./symmetry.cpp 2011-04-27 13:43:45.571656038 -0600 -@@ -300,7 +300,7 @@ - l.push_back(*i); - } - P.printVectorList(l); -- fprintf(f,"Group order=%i\n",elements.size()); -+ fprintf(f,"Group order=%zu\n",elements.size()); - P.printString("Done printing SymmetryGroup.\n"); - } - ---- ./xfig.cpp.orig 2011-01-25 08:33:17.000000000 -0700 -+++ ./xfig.cpp 2011-04-27 13:46:06.770948094 -0600 -@@ -103,7 +103,7 @@ - { - if(vertices.size()) - { -- fprintf(f,"2 3 0 1 0 %i 50 0 25 0.000 0 0 -1 0 0 %i\n ",7,vertices.size()+1); -+ fprintf(f,"2 3 0 1 0 %i 50 0 25 0.000 0 0 -1 0 0 %zu\n ",7,vertices.size()+1); - - for(Polygon::const_iterator i=vertices.begin();i!=vertices.end();i++) - kickPoint(*i,mode); ---- ./lp_cdd.cpp.orig 2011-01-25 08:33:16.000000000 -0700 -+++ ./lp_cdd.cpp 2011-04-27 13:39:42.788631110 -0600 -@@ -1287,8 +1287,8 @@ - if(A->rowsize!=newLin.size()+newIn.size()) - { - fprintf(stderr,"A->rowsize: %i\n",(int)A->rowsize); -- fprintf(stderr,"newLin.size(): %i\n",newLin.size()); -- fprintf(stderr,"newIn.size(): %i\n",newIn.size()); -+ fprintf(stderr,"newLin.size(): %zu\n",newLin.size()); -+ fprintf(stderr,"newIn.size(): %zu\n",newIn.size()); - - dd_WriteMatrix(Stderr,A); - ---- ./minkowskisum.cpp.orig 2011-01-25 08:33:16.000000000 -0700 -+++ ./minkowskisum.cpp 2011-04-27 13:43:17.412392770 -0600 -@@ -27,7 +27,7 @@ - - assert(f); - { -- fprintf(f,"%i",polytopes.size()); -+ fprintf(f,"%zu",polytopes.size()); - TopcomPrinter p(f); - //AsciiPrinter p(f); - ---- ./xfig.h.orig 2011-01-25 08:33:19.000000000 -0700 -+++ ./xfig.h 2011-04-27 13:40:09.491983874 -0600 -@@ -52,7 +52,7 @@ - void endDrawLine() - { - assert(p.size()>0); -- fprintf(f," %i\n",p.size()); -+ fprintf(f," %zu\n",p.size()); - if(arrowOrigin) - fprintf(f,"\t 2 1 1.00 60.00 120.00\n"); - if(arrowTarget) ---- ./gmpallocator.cpp.orig 2011-01-25 08:33:16.000000000 -0700 -+++ ./gmpallocator.cpp 2011-04-27 13:44:36.363523526 -0600 -@@ -145,19 +145,19 @@ - //Debug - void *myAllocateFunctionD(size_t alloc_size) - { -- fprintf(stderr,"Allocating: %i bytes.\n",alloc_size); -+ fprintf(stderr,"Allocating: %zu bytes.\n",alloc_size); - return malloc(alloc_size); - } - - void *myReallocateFunctionD(void *ptr, size_t old_size, size_t new_size) - { -- fprintf(stderr,"Reallocating: %i --> %i bytes.\n",old_size,new_size); -+ fprintf(stderr,"Reallocating: %zu --> %zu bytes.\n",old_size,new_size); - return realloc(ptr,new_size); - } - - void myDeallocateFunctionD(void *ptr, size_t size) - { -- fprintf(stderr,"Freeing: %i bytes.\n",size); -+ fprintf(stderr,"Freeing: %zu bytes.\n",size); - return free(ptr); - } - ---- ./app_test.cpp.orig 2011-01-25 08:33:15.000000000 -0700 -+++ ./app_test.cpp 2011-04-27 13:49:04.826968542 -0600 -@@ -128,7 +128,7 @@ - - M[I]=minusOne*M[I]; - } -- fprintf(Stdout,"Extreme permutations (%i):\n",extreme.size()); -+ fprintf(Stdout,"Extreme permutations (%zu):\n",extreme.size()); - P.printVectorList(extreme); - } - ---- ./buchberger.cpp.orig 2011-01-25 08:33:16.000000000 -0700 -+++ ./buchberger.cpp 2011-04-27 13:41:04.116614389 -0600 -@@ -540,7 +540,7 @@ - { - static int t; - t++; -- if((t&31)==0)fprintf(Stderr," spolys:%i\n",sPolynomials.size()); -+ if((t&31)==0)fprintf(Stderr," spolys:%zu\n",sPolynomials.size()); - } - - { -@@ -565,7 +565,7 @@ - { - static int t; - if(((++t)&=31)==0) -- fprintf(Stderr,"gsize:%i spolys:%i\n",g->size()+1,sPolynomials.size()); -+ fprintf(Stderr,"gsize:%zu spolys:%zu\n",g->size()+1,sPolynomials.size()); - } - PolynomialSet::iterator j=g->end();j--; - updatePairs(sPolynomials,g,&redundantOnes,j,indexj,truncationDegree,&grading); ---- ./halfopencone.cpp.orig 2011-01-25 08:33:16.000000000 -0700 -+++ ./halfopencone.cpp 2011-04-27 13:47:51.531488017 -0600 -@@ -555,14 +555,14 @@ - { - HalfOpenConeList surface=tropicalHyperSurface(*i); - -- fprintf(Stderr,"Number of cones in current intersection:%i\n",intersection.size()); -- fprintf(Stderr,"Number of cones in next surface:%i\n",surface.size()); -+ fprintf(Stderr,"Number of cones in current intersection:%zu\n",intersection.size()); -+ fprintf(Stderr,"Number of cones in next surface:%zu\n",surface.size()); - - fprintf(Stderr,"A\n"); - intersection=refinement(intersection,surface); - fprintf(Stderr,"B\n"); - } -- fprintf(Stderr,"%i",intersection.size()); -+ fprintf(Stderr,"%zu",intersection.size()); - - return intersection; - } ---- ./app_normalfancleanup.cpp.orig 2011-01-25 08:33:15.000000000 -0700 -+++ ./app_normalfancleanup.cpp 2011-04-27 13:51:05.227545050 -0600 -@@ -71,7 +71,7 @@ - FILE *f=fopen("iteraTIon","w"); - if(f) - { -- fprintf(f,"%i:%i\n",a,l2.size()); -+ fprintf(f,"%i:%zu\n",a,l2.size()); - fclose(f); - } - } ---- ./app_secondaryfan.cpp.orig 2011-01-25 08:33:15.000000000 -0700 -+++ ./app_secondaryfan.cpp 2011-04-27 13:50:21.635232740 -0600 -@@ -142,7 +142,7 @@ - - while(1) - { -- fprintf(stdout,"Triangles in current triangulation:%i\n",a.bases.size()); -+ fprintf(stdout,"Triangles in current triangulation:%zu\n",a.bases.size()); - PolyhedralCone C=a.secondaryCone(); - - C.canonicalize(); -@@ -198,7 +198,7 @@ - - while(1) - { -- fprintf(stdout,"Triangles in current triangulation:%i\n",a.bases.size()); -+ fprintf(stdout,"Triangles in current triangulation:%zu\n",a.bases.size()); - // PolyhedralCone C=a.secondaryCone(); - - // C.canonicalize(); -@@ -214,7 +214,7 @@ - { - Triangulation2 b=a; - b.flipNew(-*i); -- fprintf(stdout,"Triangles in new triangulation:%i\n",b.bases.size()); -+ fprintf(stdout,"Triangles in new triangulation:%zu\n",b.bases.size()); - - if(b.bases.size()==abortAtSize) - { ---- ./app_intsinpolytope.cpp.orig 2011-01-25 08:33:15.000000000 -0700 -+++ ./app_intsinpolytope.cpp 2011-04-27 13:49:42.202664015 -0600 -@@ -104,7 +104,7 @@ - } - } - -- fprintf(stderr,"Sets to test: %i\n",setsToCheck.size()); -+ fprintf(stderr,"Sets to test: %zu\n",setsToCheck.size()); - - set > ret; - for(set >::const_iterator i=setsToCheck.begin();i!=setsToCheck.end();i++) -@@ -118,7 +118,7 @@ - if(isPartOfAZBasis(l))ret.insert(*i); - } - -- fprintf(stderr,"Produced sets: %i\n",ret.size()); -+ fprintf(stderr,"Produced sets: %zu\n",ret.size()); - - return ret; - } ---- ./app_tropicaltraverse.cpp.orig 2011-01-25 08:33:15.000000000 -0700 -+++ ./app_tropicaltraverse.cpp 2011-04-27 13:48:41.939379788 -0600 -@@ -156,7 +156,7 @@ - BergmanFan f=bergman(coneGroebnerBasis,idealGroebnerBasis,&s); - f.computeMultiplicities(); - /* log1 fprintf(Stderr,"Is simplicial: %s\n",f.isSimplicial()?"true":"false");*/ -- log1 fprintf(Stderr,"Order of input symmetry group: %i\n",s.elements.size()); -+ log1 fprintf(Stderr,"Order of input symmetry group: %zu\n",s.elements.size()); - log1 fprintf(Stderr,"Number of maximal cones: %i\n",f.numberOfMaximalCones()); - log1 fprintf(Stderr,"Modulo the homogeneity space:\n"); - log1 AsciiPrinter(Stderr).printVectorList(hv); diff --git a/gfan-permissive.patch b/gfan-permissive.patch index ea5bc61..54f0638 100644 --- a/gfan-permissive.patch +++ b/gfan-permissive.patch @@ -1,16 +1,38 @@ -diff -up app_main.cpp.orig app_main.cpp ---- app_main.cpp.orig 2012-07-05 12:10:18.377378026 -0400 -+++ app_main.cpp 2012-07-05 12:10:24.414378093 -0400 -@@ -76,14 +76,6 @@ public: +--- src/app_main.cpp.orig 2017-06-20 08:47:37.000000000 -0600 ++++ src/app_main.cpp 2017-08-08 21:02:48.608389876 -0600 +@@ -77,37 +77,6 @@ public: int main() { - if(name1[0]==0) - { -- debug<<"This is the Gfan program for computing Groebner fans and tropical varieties.\n" -- "Use the command \"gfan list\" to view all subcommands.\n" -- "The command \"gfan\" is deprecate for computing all Groebner bases of an ideal.\n" -- "Please use subcommand \"gfan _bases\" instead. Awaiting input. -D to end.\n"; +- debug<<"----------------------------------------------------------------------------\n" +- "This is the Gfan program for computing Groebner fans and tropical varieties.\n" +- " Webpage: http://home.math.au.dk/jensen/software/gfan/gfan.html\n" +- "----------------------------------------------------------------------------\n" +- "\n" +- "To run a Gfan subcommand do for example:\n" +- " gfan _groebnerfan\n" +- "in your shell and type in your input, for example:\n" +- " Q[x,y]{x^2-y-1,y^2-xy-2/3}\n" +- "\n" +- "Options for controlling the main program:\n" +- " _list List all subcommands.\n" +- " _version Display version of gfan and compiled libraries.\n" +- " _test Run selftest. Use --suite to specify test suite.\n" +- " Creates/overwrites files in current folder.\n" +- " _documentation Generate .tex file for manual.\n" +- "\n" +- "General useful options for subcommands:\n" +- " --help Print the help text associated to the subcommand.\n" +- " --log1 Set the log level for comments written to stderr while computing (--log2,--log3).\n" +- " --stdin FILENAME Use the specified file as input for the program rather than reading from stdin.\n" +- " --stdout FILENAME Use the specified file as output for the program rather than writing to stdout.\n" +- "\n" +- "The command \"gfan\" is deprecate for computing all Groebner bases of an ideal.\n" +- "Please use subcommand \"gfan _bases\" instead.\n" +- "To keep compatibility with older versions, gfan _bases is awaiting input.\n" +- "-D to end.\n"; - } - LexicographicTermOrder myOrder; diff --git a/gfan-respect-destdir.patch b/gfan-respect-destdir.patch deleted file mode 100644 index 7230bf2..0000000 --- a/gfan-respect-destdir.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- Makefile.orig 2011-01-25 08:33:19.000000000 -0700 -+++ Makefile 2011-04-25 16:07:52.441724570 -0600 -@@ -308,11 +308,11 @@ - - all: $(MAIN) - --$(BINDIR): $(PREFIX) -- $(MKDIR) $(BINDIR) -+$(DESTDIR)$(BINDIR): $(DESTDIR)$(PREFIX) -+ $(MKDIR) $(DESTDIR)$(BINDIR) - --$(PREFIX): -- $(MKDIR) $(PREFIX) -+$(DESTDIR)$(PREFIX): -+ $(MKDIR) -p $(DESTDIR)$(PREFIX) - - default: $(OBJECTS) $(ADDITIONALOBJECTS) $(EXECS) - -@@ -419,11 +419,11 @@ - - clean: - /bin/rm -f *.o $(EXECS) $(MAIN) --install: $(BINDIR) -- cp $(EXECS) $(BINDIR) -+install: $(DESTDIR)$(BINDIR) -+ cp $(EXECS) $(DESTDIR)$(BINDIR) - # cp $(EXECS) /usr/local/bin - # ./gfan installlinks --path $(BINDIR)/ -- cd $(BINDIR) && ./gfan installlinks -+ cd $(DESTDIR)$(BINDIR) && ./gfan installlinks - library: - /bin/rm -f gfanlib/*.a - /bin/rm -f gfanlib/*.o diff --git a/gfan-warning.patch b/gfan-warning.patch index 7b5970b..40611c9 100644 --- a/gfan-warning.patch +++ b/gfan-warning.patch @@ -1,5 +1,5 @@ ---- ./app_fancoarsening.cpp.orig 2011-01-25 08:33:15.000000000 -0700 -+++ ./app_fancoarsening.cpp 2012-01-09 11:27:29.299438352 -0700 +--- src/app_fancoarsening.cpp.orig 2017-06-20 08:47:37.000000000 -0600 ++++ src/app_fancoarsening.cpp 2017-08-08 20:44:07.874478774 -0600 @@ -33,12 +33,14 @@ public: return false; } @@ -15,8 +15,21 @@ const char *helpText() { ---- ./application.cpp.orig 2011-01-25 08:33:16.000000000 -0700 -+++ ./application.cpp 2012-01-09 11:27:29.312437096 -0700 +--- src/app_librarytest.cpp.orig 2017-06-20 08:47:37.000000000 -0600 ++++ src/app_librarytest.cpp 2017-08-19 19:35:36.540662585 -0600 +@@ -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 + #include +--- src/application.cpp.orig 2017-06-20 08:47:37.000000000 -0600 ++++ src/application.cpp 2017-08-08 20:46:08.339136885 -0600 @@ -3,6 +3,8 @@ #include #include @@ -25,15 +38,16 @@ +#include #include #include - -@@ -546,10 +548,11 @@ void Application::makeSymbolicLinks(cons + #include +@@ -556,11 +558,11 @@ void Application::makeSymbolicLinks(cons if(all || p->includeInDefaultInstallation()) if(strlen(p->name())>0) { - char c[1024]; - sprintf(c,"ln -s %s%s %s%s%s\n",path,name,path,name,p->name()); - fprintf(stderr,"%s",c); -- system(c); +- int err=system(c); +- assert(err==0); + char c[PATH_MAX], d[PATH_MAX]; + snprintf(c,PATH_MAX,"%s%s",path,name); + snprintf(d,PATH_MAX,"%s%s%s",path,name,p->name()); @@ -42,19 +56,8 @@ } p=p->next; } ---- ./app_minkowski.cpp.orig 2011-01-25 08:33:15.000000000 -0700 -+++ ./app_minkowski.cpp 2012-01-09 11:28:20.926240318 -0700 -@@ -160,7 +160,7 @@ public: - //log0 fprintf(Stderr,"4"); - f.insert(c); - //log0 fprintf(Stderr,"5\n"); -- static int i; -+ //static int i; - //log0 fprintf(Stderr,"inserted:%i\n",++i); - } - log1 fprintf(Stderr,"Resolving symmetries.\n"); ---- ./app_test.cpp.orig 2011-04-27 13:49:04.826968542 -0600 -+++ ./app_test.cpp 2015-03-10 16:40:15.157574168 -0600 +--- src/app_test.cpp.orig 2017-06-20 08:47:37.000000000 -0600 ++++ src/app_test.cpp 2017-08-08 20:51:47.178175233 -0600 @@ -1,5 +1,7 @@ #include #include @@ -63,27 +66,29 @@ #include "parser.h" #include "printer.h" #include "polynomial.h" -@@ -193,10 +195,7 @@ public: - { +@@ -491,10 +493,7 @@ int testIntegers() outputName=outputName+"New"; } + int err=0; - { - string t="rm "+outputName; -- system(t.c_str()); +- /*err|=*/system(t.c_str()); - } + unlink(outputName.c_str()); string command3="cat <"+input+"|"+string(command2)+">"+outputName; cerr<<"Running command:\""< subFolderNames() { -#define tempName "GfAnTeMpTeStS" - char command[256]; -- system("rm "tempName); +- int err=system("rm " tempName); +- err=0;//Having err!=0 above is probably not at mistake. Rather the file did not exist. - sprintf(command,"ls %s>" tempName ,testSuiteFolderOption.getValue()); -- system(command); +- err|=system(command); +- assert(err==0); - list ret; - FILE *f=fopen(tempName,"r"); @@ -106,18 +111,42 @@ return ret; } ---- ./app_tropicalintersection.cpp.orig 2011-01-25 08:33:15.000000000 -0700 -+++ ./app_tropicalintersection.cpp 2012-01-09 11:27:29.304437850 -0700 -@@ -42,6 +42,7 @@ public: - AsciiPrinter(Stdout)<<"The following vector is in intersection, but initial ideal contains a monomial:\n"<0) ? groupSize/numFixed : 0; + } + + void markFacet(IntegerVector const &relIntRidgeVector) +--- src/breadthfirstsearch.cpp.orig 2017-06-20 08:47:37.000000000 -0600 ++++ src/breadthfirstsearch.cpp 2017-08-19 19:04:35.078732494 -0600 +@@ -260,7 +260,7 @@ public: + } + + log2 fprintf(Stderr,"numFixed = %i\n",numFixed); +- return groupSize/numFixed; ++ return (numFixed>0) ? groupSize/numFixed : 0; + } }; ---- ./enumeration.h.orig 2011-01-25 08:33:17.000000000 -0700 -+++ ./enumeration.h 2015-03-10 16:48:12.249941222 -0600 +--- src/bsptree.cpp.orig 2017-06-20 08:47:37.000000000 -0600 ++++ src/bsptree.cpp 2017-08-19 19:11:55.757531793 -0600 +@@ -131,7 +131,8 @@ public: + p=&(i->first); + } + } +- normal=*p; ++ if (p) ++ normal=*p; + } + return normal; + } +--- src/enumeration.h.orig 2017-06-20 08:47:37.000000000 -0600 ++++ src/enumeration.h 2017-08-08 20:53:14.696930681 -0600 @@ -36,7 +36,7 @@ class EnumerationFilePrinter: public Enu FILE *file; public: @@ -135,52 +164,70 @@ void setEnumerationTarget(EnumerationTarget *target){this->target=target;} virtual void enumerate(const PolynomialSet &groebnerBasis){} }; ---- ./field_rationals.cpp.orig 2011-01-25 08:33:16.000000000 -0700 -+++ ./field_rationals.cpp 2012-01-09 11:27:29.300438251 -0700 -@@ -326,17 +326,17 @@ const char *FieldRationalsImplementation - return "GmpRationals"; - } - --/*FieldRationals::FieldRationals(): -+#if 0 -+FieldRationals::FieldRationals(): - Field(new FieldRationalsImplementation()) - { - /* fprintf(Stderr,"Adding field rationals\n"); - next=list; - list=this; - */ --/* - log2 fprintf(Stderr,"Initializing field Rationals\n"); +--- src/gfanlib_symmetry.cpp.orig 2017-06-20 08:47:37.000000000 -0600 ++++ src/gfanlib_symmetry.cpp 2017-08-19 19:02:38.303050669 -0600 +@@ -423,7 +423,7 @@ int SymmetryGroup::orbitSize(ZVector con + if(doesFix)numFixed++; + } + } +- return groupSize/numFixed; ++ return (numFixed>0) ? groupSize/numFixed : 0; } --*/ -+#endif - //FieldRationals Q; - Field Q(new FieldRationalsImplementation()); - ---- ./gfanapplication.cpp.orig 2011-01-25 08:33:16.000000000 -0700 -+++ ./gfanapplication.cpp 2015-03-10 16:41:48.563450249 -0600 -@@ -51,7 +51,7 @@ GFanApplication::StdinFileOption::StdinF - void GFanApplication::StdinFileOption::onOptionsParsed() - { -- if(strlen(getValue())>0)freopen(getValue(),"r",stdin); -+ if(strlen(getValue())>0)stdin=freopen(getValue(),"r",stdin); - } - GFanApplication::StdoutFileOption::StdoutFileOption(): -@@ -62,7 +62,7 @@ GFanApplication::StdoutFileOption::Stdou +--- src/gfanlib_tropicalhomotopy.h.orig 2017-06-20 08:47:37.000000000 -0600 ++++ src/gfanlib_tropicalhomotopy.h 2017-08-19 20:27:59.920417245 -0600 +@@ -454,7 +454,7 @@ template0)freopen(getValue(),"w",stdout); -+ if(strlen(getValue())>0)stdout=freopen(getValue(),"w",stdout); - } + choices=parent.choices; +- int numberToDrop=(subconfigurationIndex!=0) ? numberToDrop=k+1 : 0; ++ int numberToDrop=(subconfigurationIndex!=0) ? k+1 : 0; + choices[subconfigurationIndex-1].first-=numberToDrop; + choices[subconfigurationIndex-1].second-=numberToDrop; +--- src/gfanlib_zcone.cpp.orig 2017-06-20 08:47:37.000000000 -0600 ++++ src/gfanlib_zcone.cpp 2017-08-19 19:35:36.550662558 -0600 +@@ -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 + //} ---- ./gfanlib_polymakefile.cpp.orig 2011-01-25 08:33:16.000000000 -0700 -+++ ./gfanlib_polymakefile.cpp 2012-01-09 11:27:29.306437673 -0700 -@@ -51,7 +51,7 @@ static list readIntList(istream &s) +@@ -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" +--- src/lp_cdd.cpp.orig 2017-06-20 08:47:37.000000000 -0600 ++++ src/lp_cdd.cpp 2017-08-19 19:35:36.545662572 -0600 +@@ -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" +--- src/polymakefile.cpp.orig 2017-06-20 08:47:37.000000000 -0600 ++++ src/polymakefile.cpp 2017-08-08 20:59:35.271908934 -0600 +@@ -371,7 +371,7 @@ static list readIntList(istream &s) { list ret; int c=s.peek(); @@ -189,65 +236,19 @@ { // fprintf(Stderr,"?\n"); int r; ---- ./gfanlib_symmetriccomplex.cpp.orig 2011-01-25 08:33:16.000000000 -0700 -+++ ./gfanlib_symmetriccomplex.cpp 2012-01-09 11:27:29.311437193 -0700 -@@ -215,13 +215,12 @@ bool SymmetricComplex::isMaximal(Cone co - return true; - } - --/* -+#if 0 - IntVector SymmetricComplex::dimensionsAtInfinity()const - { - /* Using a double description like method this routine computes the - dimension of the intersection of each cone in the complex with - the plane x_0=0 */ --/* - IntVector ret(cones.size()); - - int I=0; -@@ -240,7 +239,7 @@ IntVector SymmetricComplex::dimensionsAt - } - return ret; - } --*/ -+#endif - - void SymmetricComplex::buildConeLists(bool onlyMaximal, bool compressed, std::vector >*conelist/*, ZMatrix *multiplicities*/)const - { ---- ./gfanlib_vector.h.orig 2011-01-25 08:33:18.000000000 -0700 -+++ ./gfanlib_vector.h 2012-01-09 11:27:29.307437580 -0700 -@@ -288,6 +288,7 @@ public: - f<<*i; +--- src/symmetry.cpp.orig 2017-06-20 08:47:37.000000000 -0600 ++++ src/symmetry.cpp 2017-08-19 19:05:05.790648815 -0600 +@@ -580,7 +580,7 @@ int SymmetryGroup::orbitSize(IntegerVect + if(doesFix)numFixed++; } - f<<")"; -+ return f; - } - typ gcd()const - { ---- ./gfanlib_zcone.cpp.orig 2011-01-25 08:33:16.000000000 -0700 -+++ ./gfanlib_zcone.cpp 2012-01-09 11:27:29.309437387 -0700 -@@ -726,6 +726,7 @@ std::ostream &operator<<(std::ostream &f - f<0) ? groupSize/numFixed : 0; } ---- ./polymakefile.cpp.orig 2011-01-25 08:33:17.000000000 -0700 -+++ ./polymakefile.cpp 2012-01-09 11:27:29.310437290 -0700 -@@ -371,7 +371,7 @@ static list readIntList(istream &s) - { - list ret; - int c=s.peek(); -- while((c>='0') && (c<='9')|| (c==' ')) -+ while((c>='0' && c<='9')|| c==' ') - { - // fprintf(Stderr,"?\n"); - int r; ---- ./vektor.cpp.orig 2011-01-25 08:33:17.000000000 -0700 -+++ ./vektor.cpp 2012-01-09 11:27:29.303437946 -0700 +--- src/vektor.cpp.orig 2017-06-20 08:47:37.000000000 -0600 ++++ src/vektor.cpp 2017-08-08 21:00:13.911805196 -0600 @@ -96,7 +96,7 @@ int gcdGFAN(int r, int s) int gcdOfVector(IntegerVector const &v) { @@ -257,32 +258,300 @@ if(ret<0)ret=-ret; assert(ret!=0); for(int i=0;isize(); -@@ -963,7 +963,7 @@ bool fastIsFacet(IntegerVectorList const - } +--- src/vektor.h.orig 2017-06-20 08:47:37.000000000 -0600 ++++ src/vektor.h 2017-08-19 20:37:20.222665653 -0600 +@@ -72,7 +72,7 @@ public: + template explicit Vektor(const Vektor& c) + :v(c.size()) + { +- for(int i=0;i=0 && n=0 && (size_t)n=0 && n=0 && (size_t)nb.size())return false; +- for(int i=0;iv[i])ret=v[i]; ++ for(size_t i=0;iv[i])ret=v[i]; + return ret; + } + typ infinityNorm()const + { + typ a=0; + typ b=0; +- for(int i=0;iv[i])b=v[i]; +@@ -234,7 +234,7 @@ public: + bool aOK=true; + bool bOK=true; + +- for(int i=0;i-k); +@@ -249,9 +249,9 @@ public: + typ pq=dot(p,q); + return pq*pq==pp*qq; + */ +- int n=p.size(); ++ size_t n=p.size(); + assert(n==q.size()); +- int i; ++ size_t i; + for(i=0;iq[i])p1[i]=q[i];return p1;} +- friend Vektor coordinatewiseProduct(const Vektor& p, const Vektor& q){assert(p.size()==q.size());Vektor p1(q.size());for(int i=0;iq[i])p1[i]=q[i];return p1;} ++ friend Vektor coordinatewiseProduct(const Vektor& p, const Vektor& q){assert(p.size()==q.size());Vektor p1(q.size());for(size_t i=0;i0)if(q.v[i]0)&&(q[t]>0)) return false; ++ size_t n=p.size(); ++ for(size_t t=0;t0)&&(q[t]>0)) return false; + return true; + } + Vektor supportVector()const + { + Vektor r(v.size()); +- for(int i=0;i=0); +- assert(end<=size()); ++ assert((size_t)end<=size()); + assert(end>=begin); + Vektor ret(end-begin); + for(int i=0;i const &subset)const // Inverse of the above, except that unknown entries are set to zero. + { + Vektor ret(subset.size()); +- int i=0; +- for(int j=0;j const &positions) + { + Vektor ret(newSize); + assert(positions.size()==size()); +- for(int i=0;i0)==true)&1); ++ for(size_t i=0;i0)==true)&1); + } + }; + diff --git a/gfan.spec b/gfan.spec index 26b80bc..acb88b7 100644 --- a/gfan.spec +++ b/gfan.spec @@ -1,25 +1,24 @@ Name: gfan -Version: 0.5 -Release: 18%{?dist} +Version: 0.6.2 +Release: 1%{?dist} Summary: Software for Computing Gröbner Fans and Tropical Varieties -License: GPL+ +License: GPLv2+ URL: http://home.math.au.dk/jensen/software/gfan/gfan.html Source0: http://home.math.au.dk/jensen/software/%{name}/%{name}%{version}.tar.gz -# Sent upstream 2011 Apr 27. Respect DESTDIR -Patch0: %{name}-respect-destdir.patch -# Sent upstream 2011 Apr 27. Fix 64-bit issues in printf statements by -# using %%zu instead of %%i for printing size_t values. -Patch1: %{name}-format.patch # Sent upstream 2011 Apr 27. Fix warnings that could indicate runtime # problems. -Patch2: %{name}-warning.patch +Patch0: %{name}-warning.patch # Treat plain "gfan" call as "gfan_bases" call (as done in previous versions) # instead of warning that "gfan_bases" should be called and exiting -Patch3: %{name}-permissive.patch +Patch1: %{name}-permissive.patch BuildRequires: cddlib-devel BuildRequires: gcc-c++ +BuildRequires: ghostscript-core BuildRequires: gmp-devel +BuildRequires: tex(latex) +BuildRequires: tex(ulem.sty) +BuildRequires: TOPCOM Suggests: TOPCOM @@ -44,49 +43,49 @@ Gfan examples and documentation files. %setup -q -n %{name}%{version} %patch0 %patch1 -%patch2 -%patch3 -# manual is non-free -rm -rf doc +fixtimestamp() { + touch -r $1.orig $1 + rm -f $1.orig +} + +# Fix the cddlib include paths +sed -i.orig 's,cdd/,cddlib/,' src/{app_librarytest,lp_cdd,gfanlib_zcone}.cpp +fixtimestamp src/app_librarytest.cpp +fixtimestamp src/lp_cdd.cpp +fixtimestamp src/gfanlib_zcone.cpp # Point to where the TOPCOM binaries will be installed -sed -i \ +sed -i.orig \ "s|^#define MINKOWSKIPROG.*|#define MINKOWSKIPROGRAM \"%{_bindir}/essai\"|" \ - minkowskisum.cpp - -# Fix the tests -sed -i 's/^%s/%s _bases/' \ - testsuite/0000InstallationSection/command \ - testsuite/0001GroebnerFan/command \ - testsuite/0003GroebnerFanMod3/command \ - testsuite/0004GroebnerFanSymmetry/command \ - testsuite/0007LeadingTerms/command \ - testsuite/0008PolynomialSetUnion/command \ - testsuite/0100SymmetricGfan/command \ - testsuite/0100TwoVariables/command -sed -i 's/^gfan/%s/' \ - testsuite/0507InitialIdeal/command \ - testsuite/0508IntegerGroebnerCone/command \ - testsuite/0509IntegerGroebnerFan/command -sed -i 's|func.poly|testsuite/0056WeildDivisor/func.poly|g' \ - testsuite/0056WeildDivisor/command + src/minkowskisum.cpp +fixtimestamp src/minkowskisum.cpp + +# Update the C++ standard slightly +sed -i 's/-std=c++0x/-std=c++11/' Makefile gfanlib/Makefile.in # No need to install a simple upstream Makefile to rsync homepage # directory to upstream page. rm -f homepage/Makefile %build -# Linking with RPM_LD_FLAGS fails because -z now breaks cddlib's aliasing -make %{?_smp_mflags} \ - OPTFLAGS="%{optflags} -DGMPRATIONAL -I/usr/include/cddlib -std=gnu++98" \ +make %{?_smp_mflags} CC=gcc CXX=g++ \ + OPTFLAGS="%{optflags} -DGMPRATIONAL -I%{_includedir}/cddlib" \ PREFIX=%{_prefix} \ - SOPLEX_LINKOPTIONS="-Wl,-z,relro" - + SOPLEX_LINKOPTIONS="$RPM_LD_FLAGS" + +# Build the manual +pushd doc +latex manual.tex +bibtex manual +latex manual.tex +latex manual.tex +dvipdf manual.dvi manual.pdf +popd %install -make install DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix} -pushd $RPM_BUILD_ROOT%{_bindir} +make install PREFIX=%{buildroot}%{_prefix} +pushd %{buildroot}%{_bindir} ./%{name} installlinks popd @@ -98,6 +97,7 @@ rm -fr testsuite/0009RenderStairCase %files +%doc README doc/manual.pdf %license COPYING LICENSE %{_bindir}/* @@ -106,6 +106,13 @@ rm -fr testsuite/0009RenderStairCase %doc homepage %changelog +* Thu Sep 28 2017 Jerry James - 0.6.2-1 +- New upstream release +- License change to GPLv2+ +- Manual is now free +- Drop upstreamed -format patch +- Drop unnecessary -respect-destdir patch + * Wed Aug 02 2017 Fedora Release Engineering - 0.5-18 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild diff --git a/sources b/sources index cd00f22..37a1ae4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2d76d1625e0766c57c2b3ece809c23c8 gfan0.5.tar.gz +SHA512 (gfan0.6.2.tar.gz) = 5961820750af2522fdc1a86c0254742c3b003607a8707df5d6cd5f0bc6461e4d3db3b1d3cb537979d57eb9dff387974a58aeb91d0b5246d7c701cadc5a2cf4cf