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 890a89f
Showing 1 changed file with 74 additions and 42 deletions.
116 changes: 74 additions & 42 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,34 +15,22 @@ 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", "-D_64BITLONGINT"] -g -I/home/linuxbrew/.linuxbrew/opt/gmp/include -g -DNOCDDPREFIX -std=c++2a -c src/field.cpp -o src/field.o <command-line>: warning: ISO C++11 requires whitespace after the macro name <command-line>: warning: ISO C++11 requires whitespace after the macro name <command-line>: warning: ISO C++11 requires whitespace after the macro name <command-line>: warning: ISO C++11 requires whitespace after the macro name src/lp_cdd.cpp:4:10: fatal error: setoper.h: No such file or directory 4 | #include "setoper.h" | ^~~~~~~~~~~ compilation terminated. make: *** [Makefile:636: src/lp_cdd.o] Error 1 make: *** Waiting for unfinished jobs.... In file included from src/field.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 | } | ^ In file included from src/field_rationals.h:8, from src/polynomialgcd.cpp:14: 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 | } | ^ In file included from src/polynomialring.h:8, from src/monomial.h:6, from src/parser.h:7, from src/parser.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 | } | ^ src/parser.cpp: In member function 'Field CharacterBasedParser::parseField()': src/parser.cpp:639:14: warning: control reaches end of non-void function [-Wreturn-type] 639 | parserError("field",c); | ~~~~~~~~~~~^~~~~~~~~~~ g++-14: warning: [-I/home/linuxbrew/.linuxbrew/opt/cddlib/include/cddlib,: linker input file unused because linking not done g++-14: error: [-I/home/linuxbrew/.linuxbrew/opt/cddlib/include/cddlib,: linker input file not found: No such file or directory make: *** [Makefile:636: src/field.o] Error 1 g++-14: warning: [-I/home/linuxbrew/.linuxbrew/opt/cddlib/include/cddlib,: linker input file unused because linking not done g++-14: error: [-I/home/linuxbrew/.linuxbrew/opt/cddlib/include/cddlib,: linker input file not found: No such file or directory make: *** [Makefile:636: src/parser.o] Error 1 g++-14: warning: [-I/home/linuxbrew/.linuxbrew/opt/cddlib/include/cddlib,: linker input file unused because linking not done g++-14: error: [-I/home/linuxbrew/.linuxbrew/

Check failure on line 25 in Formula/gfan.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-12)

`brew install --verbose --formula --build-bottle macaulay2/tap/gfan` failed on macOS Monterey (12)!

::error::The following formula cannot be installed from bottle and must be%0Abuilt from source.%0A xz%0A

Check failure on line 25 in Formula/gfan.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-13)

`brew install --verbose --formula --build-bottle macaulay2/tap/gfan` failed on macOS Ventura (13)!

==> make PREFIX=/usr/local/opt/gcc/bin/ cddnoprefix=yes GMP_LINKOPTIONS=-L/usr/local/opt/gmp/lib -lgmp GMP_INCLUDEOPTIONS=-I/usr/local/opt/gmp/include OPTFLAGS=-O2 -DGMPRATIONAL -DNDEBUG CCLINKER=/usr/local/opt/gcc/bin/g++-14 -L/usr/local/opt/cddlib/lib -static-libgcc -static-libstdc++ /usr/local/opt/gcc/bin/g++-14 -O2 -DGMPRATIONAL -DNDEBUG -g -I/usr/local/opt/gmp/include -g -DNOCDDPREFIX -std=c++2a -c src/polynomialgcd.cpp -o src/polynomialgcd.o /usr/local/opt/gcc/bin/g++-14 -O2 -DGMPRATIONAL -DNDEBUG -g -I/usr/local/opt/gmp/include -g -DNOCDDPREFIX -std=c++2a -c src/lp_cdd.cpp -o src/lp_cdd.o /usr/local/opt/gcc/bin/g++-14 -O2 -DGMPRATIONAL -DNDEBUG -g -I/usr/local/opt/gmp/include -g -DNOCDDPREFIX -std=c++2a -c src/parser.cpp -o src/parser.o /usr/local/opt/gcc/bin/g++-14 -O2 -DGMPRATIONAL -DNDEBUG -g -I/usr/local/opt/gmp/include -g -DNOCDDPREFIX -std=c++2a -c src/field.cpp -o src/field.o src/lp_cdd.cpp:4:10: fatal error: setoper.h: No such file or directory 4 | #include "setoper.h" | ^~~~~~~~~~~ compilation terminated. make: *** [src/lp_cdd.o] Error 1 make: *** Waiting for unfinished jobs.... In file included from src/field.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 | } | ^ In file included from src/field_rationals.h:8, from src/polynomialgcd.cpp:14: 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 | } | ^ In file included from src/polynomialring.h:8, from src/monomial.h:6, from src/parser.h:7, from src/parser.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 | } | ^ src/parser.cpp: In member function 'Field CharacterBasedParser::parseField()': src/parser.cpp:639:14: warning: control reaches end of non-void function [-Wreturn-type] 639 | parserError("field",c); | ~~~~~~~~~~~^~~~~~~~~~~ ==> Formula Tap: macaulay2/tap Path: /usr/local/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: 4 hours ago Core tap HEAD: 677c31e0d35d336bec94d43ef2a1c427e441cfbc Core tap last commit: 12 days

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!

==> Patching ==> make PREFIX=/opt/homebrew/opt/gcc/bin/ cddnoprefix=yes GMP_LINKOPTIONS=-L/opt/homebrew/opt/gmp/lib -lgmp GMP_INCLUDEOPTIONS=-I/opt/homebrew/opt/gmp/include OPTFLAGS=-O2 -DGMPRATIONAL -DNDEBUG CCLINKER=/opt/homebrew/opt/gcc/bin/g++-14 -L/opt/homebrew/opt/cddlib/lib -static-libgcc -static-libstdc++ /opt/homebrew/opt/gcc/bin/g++-14 -O2 -DGMPRATIONAL -DNDEBUG -g -I/opt/homebrew/opt/gmp/include -g -DNOCDDPREFIX -std=c++2a -c src/polynomialgcd.cpp -o src/polynomialgcd.o /opt/homebrew/opt/gcc/bin/g++-14 -O2 -DGMPRATIONAL -DNDEBUG -g -I/opt/homebrew/opt/gmp/include -g -DNOCDDPREFIX -std=c++2a -c src/lp_cdd.cpp -o src/lp_cdd.o /opt/homebrew/opt/gcc/bin/g++-14 -O2 -DGMPRATIONAL -DNDEBUG -g -I/opt/homebrew/opt/gmp/include -g -DNOCDDPREFIX -std=c++2a -c src/parser.cpp -o src/parser.o src/lp_cdd.cpp:4:10: fatal error: setoper.h: No such file or directory 4 | #include "setoper.h" | ^~~~~~~~~~~ compilation terminated. make: *** [src/lp_cdd.o] Error 1 make: *** Waiting for unfinished jobs.... In file included from src/field_rationals.h:8, from src/polynomialgcd.cpp:14: 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 | } | ^ In file included from src/polynomialring.h:8, from src/monomial.h:6, from src/parser.h:7, from src/parser.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 | } | ^ src/parser.cpp: In member function 'Field CharacterBasedParser::parseField()': src/parser.cpp:639:14: warning: control reaches end of non-void function [-Wreturn-type] 639 | parserError("field",c); | ~~~~~~~~~~~^~~~~~~~~~~ ==> Formula Tap: macaulay2/tap Path: /opt/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: 4 hours ago Core tap HEAD: 794c222c7fe5d3fed014b6599c3c50bf9fba33f8 Core tap last commit: 2 weeks ago Core tap JSON: 20 Oct 22:32 UTC Core cask tap HEAD: 55446b22b754e331842a4d72e85c70d6eb2c9839 Core cask tap last commit: 2 weeks ago Core cask tap JSON: 20 Oct 22:32 UTC HOMEBREW_PREFIX: /opt/homebrew HOMEBREW_BOOTSNAP: set HOMEBREW_CACHE: /Users/runner/Library/Caches/Homebrew HOMEBREW_CASK_OPTS: ["--no-quarantine"] 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: /Users/runner/work/homebrew-tap/homebrew-tap/logs HOMEBREW_MAKE_JOBS: 3 HOMEBREW_NO_AUTO_UPDATE: set HOMEBREW_NO_EMOJI: set HOMEBREW_NO_ENV_HINTS: set HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: set HOMEBREW_NO_INSTALL_CLEANUP: set HOMEBREW_SORBET_RUNTIM

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!

==> Patching ==> make PREFIX=/opt/homebrew/opt/gcc/bin/ cddnoprefix=yes GMP_LINKOPTIONS=-L/opt/homebrew/opt/gmp/lib -lgmp GMP_INCLUDEOPTIONS=-I/opt/homebrew/opt/gmp/include OPTFLAGS=-O2 -DGMPRATIONAL -DNDEBUG CCLINKER=/opt/homebrew/opt/gcc/bin/g++-14 -L/opt/homebrew/opt/cddlib/lib -static-libgcc -static-libstdc++ /opt/homebrew/opt/gcc/bin/g++-14 -O2 -DGMPRATIONAL -DNDEBUG -g -I/opt/homebrew/opt/gmp/include -g -DNOCDDPREFIX -std=c++2a -c src/polynomialgcd.cpp -o src/polynomialgcd.o /opt/homebrew/opt/gcc/bin/g++-14 -O2 -DGMPRATIONAL -DNDEBUG -g -I/opt/homebrew/opt/gmp/include -g -DNOCDDPREFIX -std=c++2a -c src/lp_cdd.cpp -o src/lp_cdd.o /opt/homebrew/opt/gcc/bin/g++-14 -O2 -DGMPRATIONAL -DNDEBUG -g -I/opt/homebrew/opt/gmp/include -g -DNOCDDPREFIX -std=c++2a -c src/parser.cpp -o src/parser.o src/lp_cdd.cpp:4:10: fatal error: setoper.h: No such file or directory 4 | #include "setoper.h" | ^~~~~~~~~~~ compilation terminated. make: *** [src/lp_cdd.o] Error 1 make: *** Waiting for unfinished jobs.... In file included from src/field_rationals.h:8, from src/polynomialgcd.cpp:14: 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 | } | ^ In file included from src/polynomialring.h:8, from src/monomial.h:6, from src/parser.h:7, from src/parser.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 | } | ^ src/parser.cpp: In function 'std::string variableIndexToString(int)': src/parser.cpp:20:26: warning: 'int sprintf(char*, const char*, ...)' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] 20 | if(i>=0 && i<26)sprintf(s,"%c",i+'a'); | ~~~~~~~^~~~~~~~~~~~~~ In file included from /opt/homebrew/Cellar/gcc/14.2.0/lib/gcc/current/gcc/aarch64-apple-darwin24/14/include-fixed/stdio.h:75, from /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/_wchar.h:90, from /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/wchar.h:67, from /opt/homebrew/Cellar/gcc/14.2.0/include/c++/14/cwchar:44, from /opt/homebrew/Cellar/gcc/14.2.0/include/c++/14/bits/postypes.h:40, from /opt/homebrew/Cellar/gcc/14.2.0/include/c++/14/bits/char_traits.h:42, from /opt/homebrew/Cellar/gcc/14.2.0/include/c++/14/string:42, from src/parser.h:4: /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/_stdio.h:276:10: note: declared here 276 | int sprintf(char * __restrict, const char * __restrict, ...) __printflike(2, 3); | ^~~~~~~ src/parser.cpp:21:32
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
linker_args = "-L#{Formula["cddlib"].lib} -static-libgcc -static-libstdc++"
cxx_flags = "-I#{Formula["cddlib"].include}/cddlib", "-D_64BITLONGINT" unless OS.mac?

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",
"CCLINKER=#{linker_args}"
"OPTFLAGS=-O2 -DGMPRATIONAL -DNDEBUG #{cxx_flags}",
"CCLINKER=#{Formula["gcc@14"].bin}/g++-14 #{linker_args}"
system "make", "PREFIX=#{prefix}", "install"
end

Expand All @@ -57,31 +44,76 @@ def install

__END__

diff --git a/Makefile-orig b/Makefile
index 737208abfb..52e010e0b3 100644
diff --git a/Makefile b/Makefile
index 67c8164..fe6e00b 100644
--- a/Makefile
+++ b/Makefile
@@ -110,15 +110,15 @@ MKDIR=mkdir -p
PREFIX =
@@ -113,13 +113,12 @@ 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)
+CC = $(PREFIX)gcc-14
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
+CXX = $(PREFIX)g++-14
CCLINKER = $(CXX)

#CC = $(PREFIX)gcc-8.1
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,15 @@ static std::string toStr(__uint32_t b)
return s.str();
}

+#ifndef _64BITLONGINT
+static std::string toStr(long int b)
+{
+ std::stringstream s;
+ s<<b;
+ return s.str();
+}
+#endif
+
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 890a89f

Please sign in to comment.