From bd0a3d68df6e0c486ebfabc91a498846416131f4 Mon Sep 17 00:00:00 2001 From: Thomas Scalise Date: Sat, 16 Oct 2021 17:53:25 +0200 Subject: [PATCH 1/2] Made installation work with gpp10+ (version > 10) --- lib/nmatrix/mkmf.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/nmatrix/mkmf.rb b/lib/nmatrix/mkmf.rb index 8c5d0526..0c912a57 100644 --- a/lib/nmatrix/mkmf.rb +++ b/lib/nmatrix/mkmf.rb @@ -49,7 +49,7 @@ def gplusplus_version raise("unable to determine g++ version (match to get version was nil)") if major.nil? || minor.nil? || patch.nil? - "#{major}.#{minor}.#{patch}" + [major, minor, patch] end @@ -69,14 +69,14 @@ def gplusplus_version $CXX_STANDARD = 'c++11' else version = gplusplus_version - if version < '4.3.0' && CONFIG['CXX'] == 'g++' # see if we can find a newer G++, unless it's been overridden by user + if (version[0] < 4 || version[0] == 4 && version[1] < 3) && CONFIG['CXX'] == 'g++' # see if we can find a newer G++, unless it's been overridden by user if !find_newer_gplusplus raise("You need a version of g++ which supports -std=c++0x or -std=c++11. If you're on a Mac and using Homebrew, we recommend using mac-brew-gcc.sh to install a more recent g++.") end version = gplusplus_version end - if version < '4.7.0' + if version[0] < 4 || version[0] == 4 && version[1] < 7 $CXX_STANDARD = 'c++0x' else $CXX_STANDARD = 'c++11' From acff3790dd71679f1818413dc7d405eeb9a671bb Mon Sep 17 00:00:00 2001 From: Thomas Scalise Date: Thu, 7 Apr 2022 10:18:05 +0200 Subject: [PATCH 2/2] FIXED comparision between String and Integer. --- lib/nmatrix/mkmf.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nmatrix/mkmf.rb b/lib/nmatrix/mkmf.rb index 0c912a57..d8449f47 100644 --- a/lib/nmatrix/mkmf.rb +++ b/lib/nmatrix/mkmf.rb @@ -49,7 +49,7 @@ def gplusplus_version raise("unable to determine g++ version (match to get version was nil)") if major.nil? || minor.nil? || patch.nil? - [major, minor, patch] + [major.to_i, minor.to_i, patch.to_i] end