Skip to content

Commit

Permalink
gfan: 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
mahrud committed Oct 20, 2024
1 parent 6bf95eb commit 00142aa
Showing 1 changed file with 69 additions and 35 deletions.
104 changes: 69 additions & 35 deletions Formula/gfan.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
class Gfan < Formula
desc "Grobner fans and tropical varieties"
homepage "https://users-math.au.dk/~jensen/software/gfan/gfan.html"
url "https://users-math.au.dk/~jensen/software/gfan/gfan0.6.2.tar.gz"
sha256 "a674d5e5dc43634397de0d55dd5da3c32bd358d05f72b73a50e62c1a1686f10a"
url "https://users-math.au.dk/~jensen/software/gfan/gfan0.7.tar.gz"
sha256 "ab833757e1e4d4a98662f4aa691394013ea9a226f6416b8f8565356d6fcc989e"
license "GPL-2.0-or-later"
revision 11

bottle do
root_url "https://ghcr.io/v2/macaulay2/tap"
Expand All @@ -16,30 +15,19 @@ class Gfan < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "2ac80a1fd89713e142750d8adf6f976e4249d38f58c5c2eafcfc0f6aec35793a"
end

if OS.mac?
depends_on "gcc" => :build
fails_with :clang
else
fails_with gcc: "4"
fails_with gcc: "5"
end
depends_on "gcc@14" => :build

depends_on "cddlib"
depends_on "gmp"

patch do
url "https://raw.githubusercontent.com/Macaulay2/M2/d51564127d757a3132684e9730f4085cb89297bb/M2/libraries/gfan/patch-0.6.2"
sha256 "9ebbf25e6de16baec877050bef69c85504e7bfa81e79407c2ab00ea4433e838c"
end

patch :DATA

def install

Check failure on line 25 in Formula/gfan.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-latest)

`brew install --verbose --formula --build-bottle macaulay2/tap/gfan` failed on Linux!

/home/linuxbrew/.linuxbrew/opt/gcc/bin/g++-14 -O2 -DGMPRATIONAL -DNDEBUG -I/home/linuxbrew/.linuxbrew/opt/cddlib/include/cddlib -g -I/home/linuxbrew/.linuxbrew/opt/gmp/include -g -DNOCDDPREFIX -std=c++2a -c src/wallideal.cpp -o src/wallideal.o In file included from src/gfanlib_tableau.h:14, from src/divisionobject.h:22, from src/buchberger.cpp:17: src/gfanlib_circuittableint.h: At global scope: src/gfanlib_circuittableint.h:96:20: error: redefinition of 'std::string gfan::toStr(long int)' 96 | static std::string toStr(long int b) | ^~~~~ src/gfanlib_circuittableint.h:68:20: note: 'std::string gfan::toStr(__int64_t)' previously defined here 68 | static std::string toStr(__int64_t b) | ^~~~~ In file included from src/polynomialring.h:8, from src/polynomial.h:9, from src/wallideal.h:4, from src/wallideal.cpp:1: src/field.h: In member function 'virtual int FieldElementImplementation::getIntegerRepresentation() const': src/field.h:211:3: warning: no return statement in function returning non-void [-Wreturn-type] 211 | } | ^ src/field.h: In member function 'Field& FieldElementImplementation::operator=(const Field&)': src/field.h:226:5: warning: no return statement in function returning non-void [-Wreturn-type] 226 | }//assignment | ^ src/field.h: In member function 'virtual FieldElement FieldImplementation::random()': src/field.h:274:3: warning: no return statement in function returning non-void [-Wreturn-type] 274 | } | ^ /home/linuxbrew/.linuxbrew/opt/gcc/bin/g++-14 -O2 -DGMPRATIONAL -DNDEBUG -I/home/linuxbrew/.linuxbrew/opt/cddlib/include/cddlib -g -I/home/linuxbrew/.linuxbrew/opt/gmp/include -g -DNOCDDPREFIX -std=c++2a -c src/lp.cpp -o src/lp.o make: *** [Makefile:636: src/buchberger.o] Error 1 make: *** Waiting for unfinished jobs.... In file included from src/linalg.h:5, from src/lp.cpp:7: src/field.h: In member function 'virtual int FieldElementImplementation::getIntegerRepresentation() const': src/field.h:211:3: warning: no return statement in function returning non-void [-Wreturn-type] 211 | } | ^ src/field.h: In member function 'Field& FieldElementImplementation::operator=(const Field&)': src/field.h:226:5: warning: no return statement in function returning non-void [-Wreturn-type] 226 | }//assignment | ^ src/field.h: In member function 'virtual FieldElement FieldImplementation::random()': src/field.h:274:3: warning: no return statement in function returning non-void [-Wreturn-type] 274 | } | ^ src/lp.cpp: In member function 'virtual bool LpSolver::hasInteriorPoint(const IntegerVectorList&, bool, const IntegerVector*)': src/lp.cpp:62:1: warning: no return statement in function returning non-void [-Wreturn-type] 62 | } | ^ src/lp.cpp: In member function 'virtual bool LpSolver::hasHomogeneousSolution(int, const IntegerVectorList&, const IntegerVectorList&)': src/lp.cpp:122:1: warning: no return statement in function returning non-void [-Wreturn-type] 122 | } | ^ ==> Formula Tap: macaulay2/tap Path: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/macaulay2/homebrew-tap/Formula/gfan.rb ==> Configuration HOMEBREW_VERSION: 4.4.1-64-gd0ab3d3 ORIGIN: https://github.com/Homebrew/brew HEAD: d0ab3d3bc881291b00d2fc9a598d851b2726885d Last commit: 3 hours ago Core tap JSON: 20 Oct 21:37 UTC HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew HOMEBREW_BOOTSNAP: set HOMEBREW_CACHE: /home/runner/.cache/Homebrew HOMEBREW_CASK_OPTS: [] HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS: 3650 HOMEBREW_COLOR: set HOMEBREW_CURL_PATH: /usr/bin/curl HOMEBREW_FAIL_LOG_LINES: 150 HOMEBREW_GITHUB_API_TOKEN: set HOMEBREW_GIT_EMAIL: 1589480+BrewTestBot@users.noreply.github.com HOMEBREW_GIT_NAME: BrewTestBot HOMEBREW_GIT_PATH: /usr/bin/git HOMEBREW_LOGS: /home/runner/work/homebrew-tap/homebrew-tap/logs HOMEBREW_MAKE_JOBS: 4 HOMEBREW_NO_AUTO_UPDATE: set HOMEBREW_NO_EMOJI: set HOMEBREW_NO_ENV_HINTS: set HOM

Check failure on line 25 in Formula/gfan.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-14)

`brew install --verbose --formula --build-bottle macaulay2/tap/gfan` failed on macOS Sonoma (14) on Apple Silicon!

src/field.h: In member function 'virtual FieldElement FieldImplementation::random()': src/field.h:274:3: warning: no return statement in function returning non-void [-Wreturn-type] 274 | } | ^ clang++ -L/opt/homebrew/opt/cddlib/lib -static-libgcc -static-libstdc++ -ld_classic src/polynomialgcd.o src/lp_cdd.o src/parser.o src/field.o src/monomial.o src/printer.o src/polynomial.o src/termorder.o src/term.o src/vektor.o src/division.o src/buchberger.o src/wallideal.o src/lp.o src/enumeration.o src/ep_standard.o src/ep_xfig.o src/reversesearch.o src/application.o src/timer.o src/renderer.o src/field_rationals.o src/symmetry.o src/breadthfirstsearch.o src/genericwalk.o src/minkowskisum.o src/newtonpolytope.o src/tropical.o src/dimension.o src/bergman.o src/subspace.o src/polyhedralcone.o src/gfanapplication.o src/polyhedralfan.o src/tropical2.o src/field_zmodpz.o src/binomial.o src/matrix.o src/latticeideal.o src/scarf.o src/xfig.o src/halfopencone.o src/lll.o src/multiplicity.o src/substitute.o src/polymakefile.o src/saturation.o src/determinant.o src/polynomialring.o src/log.o src/tropicalbasis.o src/symmetriccomplex.o src/linalg.o src/minors.o src/continuedfractions.o src/triangulation.o src/minkowskidual.o src/regularsubdivision.o src/fieldlp.o src/field_rationalfunctions.o src/tropical_weildivisor.o src/intsinpolytope.o src/lattice.o src/graph.o src/restrictedautoreduction.o src/tropicaltraverse.o src/groebnerengine.o src/ge_gfan.o src/nbody.o src/codimoneconnectedness.o src/tropicalmap.o src/traverser_tropical.o src/traverser_groebnerfan.o src/field_rationalfunctions2.o src/mixedvolume.o src/traverser_stableintersection.o src/traverser_secondaryfan.o src/linalgfloat.o src/primarydecomposition.o src/tropicaldeterminant.o src/determinantpoly.o src/traverser_sphere.o src/gfanlib_zcone.o src/gfanlib_symmetry.o src/gfanlib_symmetriccomplex.o src/gfanlib_polyhedralfan.o src/gfanlib_zfan.o src/gfanlib_polymakefile.o src/gfanlib_mixedvolume.o src/gfanlib_circuittableint.o src/gfanlib_paralleltraverser.o src/padic.o src/integergb.o src/traverser_resultantfan.o src/bsptree.o src/traverser_resultantfanspecialization.o src/myassert.o src/traverser_bsptree.o src/gfanlib_traversal.o src/tropicalcurve.o src/packedmonomial.o src/gmpallocator.o src/gfanlib_memoryresource.o src/gfanlib_hypersurfaceintersection.o src/divisionobject.o src/gfanlibglue.o src/app_main.o src/app_buchberger.o src/app_doesidealcontain.o src/app_facets.o src/app_groebnercone.o src/app_homogeneityspace.o src/app_homogenize.o src/app_initialforms.o src/app_interactive.o src/app_isgroebnerbasis.o src/app_ismarkedgroebnerbasis.o src/app_krulldimension.o src/app_leadingterms.o src/app_multiplymatrix.o src/app_polynomialsetunion.o src/app_render.o src/app_renderstaircase.o src/app_stats.o src/app_substitute.o src/app_supportindices.o src/app_tolatex.o src/app_transposematrix.o src/app_tropicalbasis.o src/app_tropicalintersection.o src/app_tropicalstartingcone.o src/app_tropicaltraverse.o src/app_walk.o src/app_weightvector.o src/app_scarfisgeneric.o src/app_scarfvisualize.o src/app_scarfcomplex.o src/app_sturmsequence.o src/app_latticeideal.o src/app_lll.o src/app_tropicalmultiplicity.o src/app_idealintersection.o src/app_test.o src/app_saturation.o src/app_idealproduct.o src/app_representatives.o src/app_tropicallifting.o src/app_topolyhedralfan.o src/app_tropicalbruteforce.o src/app_secondaryfan.o src/app_composepermutations.o src/app_minors.o src/app_tropicalrank.o src/app_minkowski.o src/app_triangulate.o src/app_tropicallinearspace.o src/app_combinerays.o src/app_regularsubdivision.o src/app_lpsolve.o src/app_tropicalweildivisor.o src/app_lattice.o src/app_intsinpolytope.o src/app_tropicalevaluation.o src/app_smalessixth.o src/app_smalessixth2.o src/app_nbody.o src/app_spolynomial.o src/app_link.o src/app_normalfancleanup.o src/app_tropicalfunction.o src/app_volume.o src/app_isconnected.o src/app_tropicalhypersurface.o src/app_product.o src/app_commonrefinement.o src/app_tropicalimage.o src/app_groebnerfan.o src/app_fanhomology.o src/app_generic

Check failure on line 25 in Formula/gfan.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-15)

`brew install --verbose --formula --build-bottle macaulay2/tap/gfan` failed on macOS Sequoia (15) on Apple Silicon!

src/field.h: In member function 'virtual FieldElement FieldImplementation::random()': src/field.h:274:3: warning: no return statement in function returning non-void [-Wreturn-type] 274 | } | ^ clang++ -L/opt/homebrew/opt/cddlib/lib -static-libgcc -static-libstdc++ -ld_classic src/polynomialgcd.o src/lp_cdd.o src/parser.o src/field.o src/monomial.o src/printer.o src/polynomial.o src/termorder.o src/term.o src/vektor.o src/division.o src/buchberger.o src/wallideal.o src/lp.o src/enumeration.o src/ep_standard.o src/ep_xfig.o src/reversesearch.o src/application.o src/timer.o src/renderer.o src/field_rationals.o src/symmetry.o src/breadthfirstsearch.o src/genericwalk.o src/minkowskisum.o src/newtonpolytope.o src/tropical.o src/dimension.o src/bergman.o src/subspace.o src/polyhedralcone.o src/gfanapplication.o src/polyhedralfan.o src/tropical2.o src/field_zmodpz.o src/binomial.o src/matrix.o src/latticeideal.o src/scarf.o src/xfig.o src/halfopencone.o src/lll.o src/multiplicity.o src/substitute.o src/polymakefile.o src/saturation.o src/determinant.o src/polynomialring.o src/log.o src/tropicalbasis.o src/symmetriccomplex.o src/linalg.o src/minors.o src/continuedfractions.o src/triangulation.o src/minkowskidual.o src/regularsubdivision.o src/fieldlp.o src/field_rationalfunctions.o src/tropical_weildivisor.o src/intsinpolytope.o src/lattice.o src/graph.o src/restrictedautoreduction.o src/tropicaltraverse.o src/groebnerengine.o src/ge_gfan.o src/nbody.o src/codimoneconnectedness.o src/tropicalmap.o src/traverser_tropical.o src/traverser_groebnerfan.o src/field_rationalfunctions2.o src/mixedvolume.o src/traverser_stableintersection.o src/traverser_secondaryfan.o src/linalgfloat.o src/primarydecomposition.o src/tropicaldeterminant.o src/determinantpoly.o src/traverser_sphere.o src/gfanlib_zcone.o src/gfanlib_symmetry.o src/gfanlib_symmetriccomplex.o src/gfanlib_polyhedralfan.o src/gfanlib_zfan.o src/gfanlib_polymakefile.o src/gfanlib_mixedvolume.o src/gfanlib_circuittableint.o src/gfanlib_paralleltraverser.o src/padic.o src/integergb.o src/traverser_resultantfan.o src/bsptree.o src/traverser_resultantfanspecialization.o src/myassert.o src/traverser_bsptree.o src/gfanlib_traversal.o src/tropicalcurve.o src/packedmonomial.o src/gmpallocator.o src/gfanlib_memoryresource.o src/gfanlib_hypersurfaceintersection.o src/divisionobject.o src/gfanlibglue.o src/app_main.o src/app_buchberger.o src/app_doesidealcontain.o src/app_facets.o src/app_groebnercone.o src/app_homogeneityspace.o src/app_homogenize.o src/app_initialforms.o src/app_interactive.o src/app_isgroebnerbasis.o src/app_ismarkedgroebnerbasis.o src/app_krulldimension.o src/app_leadingterms.o src/app_multiplymatrix.o src/app_polynomialsetunion.o src/app_render.o src/app_renderstaircase.o src/app_stats.o src/app_substitute.o src/app_supportindices.o src/app_tolatex.o src/app_transposematrix.o src/app_tropicalbasis.o src/app_tropicalintersection.o src/app_tropicalstartingcone.o src/app_tropicaltraverse.o src/app_walk.o src/app_weightvector.o src/app_scarfisgeneric.o src/app_scarfvisualize.o src/app_scarfcomplex.o src/app_sturmsequence.o src/app_latticeideal.o src/app_lll.o src/app_tropicalmultiplicity.o src/app_idealintersection.o src/app_test.o src/app_saturation.o src/app_idealproduct.o src/app_representatives.o src/app_tropicallifting.o src/app_topolyhedralfan.o src/app_tropicalbruteforce.o src/app_secondaryfan.o src/app_composepermutations.o src/app_minors.o src/app_tropicalrank.o src/app_minkowski.o src/app_triangulate.o src/app_tropicallinearspace.o src/app_combinerays.o src/app_regularsubdivision.o src/app_lpsolve.o src/app_tropicalweildivisor.o src/app_lattice.o src/app_intsinpolytope.o src/app_tropicalevaluation.o src/app_smalessixth.o src/app_smalessixth2.o src/app_nbody.o src/app_spolynomial.o src/app_link.o src/app_normalfancleanup.o src/app_tropicalfunction.o src/app_volume.o src/app_isconnected.o src/app_tropicalhypersurface.o src/app_product.o src/app_commonrefinement.o src/app_tropicalimage.o src/app_groebnerfan.o src/app_fanhomology.o src/app_generic
linker_args = "#{ENV.cxx} -L#{Formula["cddlib"].lib} "
linker_args << "-static-libgcc -static-libstdc++ "
linker_args << "-ld_classic" if OS.mac? && DevelopmentTools.clang_build_version >= 1500

system "make", "cddnoprefix=yes",
system "make", "PREFIX=#{Formula["gcc@14"].bin}/", "cddnoprefix=yes",
"GMP_LINKOPTIONS=-L#{Formula["gmp"].lib} -lgmp",
"GMP_INCLUDEOPTIONS=-I#{Formula["gmp"].include}",
"OPTFLAGS=-O2 -DGMPRATIONAL -DNDEBUG -I#{Formula["cddlib"].include}/cddlib",
Expand All @@ -57,31 +45,77 @@ def install

__END__

diff --git a/Makefile-orig b/Makefile
index 737208abfb..52e010e0b3 100644
diff --git a/Makefile b/Makefile
index 67c8164..16b6d61 100644
--- a/Makefile
+++ b/Makefile
@@ -110,15 +110,15 @@ MKDIR=mkdir -p
PREFIX =
@@ -113,14 +113,13 @@ MKDIR=mkdir -p

# PREFIX = /usr/local/gcc/6.2.0/bin/
# PREFIX = /usr/local/gcc-8.1/bin/
-PREFIX =
SHELL = /bin/sh
#ARCH = LINUX

-CC = $(PREFIX)gcc
-CLINKER = $(CC)
-CXX = $(PREFIX)g++
-CCLINKER = $(CXX)
+#CC = $(PREFIX)gcc
+#CLINKER = $(CC)
+#CXX = $(PREFIX)g++
+#CCLINKER = $(CXX)
#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 -fno-omit-frame-pointer -O2 #-O3 -fno-guess-branch-probability #-DNDEBUG
#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
+OPTFLAGS = -DGMPRATIONAL -Wuninitialized -fno-omit-frame-pointer -O1 -fno-guess-branch-probability
#-DNDEBUG
#OPTFLAGS = -DGMPRATIONAL -Wuninitialized -fno-omit-frame-pointer -O3 -mavx -msse2 -ftree-vectorizer-verbose=2 -finline-limit=1000 -ffast-math #-DNDEBUG
#OPTFLAGS = -DGMPRATIONAL -Wuninitialized -fno-omit-frame-pointer -O3 -mavx -msse2 -ftree-vectorizer-verbose=2 -march=native -unroll-loops --param max-unroll-times=4 -ffast-math #-DNDEBUG
+CC = $(PREFIX)gcc-14
+CLINKER = $(PREFIX)gcc-14
+CXX = $(PREFIX)g++-14
+CCLINKER = $(PREFIX)g++-14

#CC = $(PREFIX)gcc-8.1
#CLINKER = $(CC)
diff --git a/src/gfanlib_circuittableint.h b/src/gfanlib_circuittableint.h
index 2b5ced4..b5bf6ed 100644
--- a/src/gfanlib_circuittableint.h
+++ b/src/gfanlib_circuittableint.h
@@ -25,6 +25,7 @@ namespace gfan{
template<typename> struct MyMakeUnsigned;
template <> struct MyMakeUnsigned<int>{typedef unsigned int type;};
template <> struct MyMakeUnsigned<long int>{typedef unsigned long int type;};
+ template <> struct MyMakeUnsigned<long long int>{typedef unsigned long long int type;};
template <> struct MyMakeUnsigned<__int128>{typedef unsigned __int128 type;};

class MVMachineIntegerOverflow: public std::exception
@@ -92,6 +93,13 @@ static std::string toStr(__uint32_t b)
return s.str();
}

+static std::string toStr(long int b)
+{
+ std::stringstream s;
+ s<<b;
+ return s.str();
+}
+
class my256s{
public:
__int128_t lo,hi;
@@ -213,6 +221,10 @@ static __int128_t extMul(long int a, long int b)
{
return ((__int128_t)a)*((__int128_t)b);
}
+static __int128_t extMul(long long int a, long long int b)
+{
+ return ((__int128_t)a)*((__int128_t)b);
+}

static __uint128_t unsignedProd64(uint64_t x,uint64_t y)
{
diff --git a/src/gfanlib_z.h b/src/gfanlib_z.h
index f56597c..8c84ed1 100644
--- a/src/gfanlib_z.h
+++ b/src/gfanlib_z.h
@@ -9,6 +9,7 @@
#define LIB_Z_H_

#include <string.h>
+#include <cstdint>
#include <ostream>
#include <iostream>
#define OLD 1
--
2.31.1
2.46.0

0 comments on commit 00142aa

Please sign in to comment.