Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure fails to detect too-old ruby and fails on syntax error #256

Open
jeffhammond opened this issue Dec 29, 2015 · 3 comments
Open

Comments

@jeffhammond
Copy link

I got this very strange error:

[jrhammon@esgmonster github]$ ./configure 
./configure:72: syntax error, unexpected kNOT
  if not(opt.cc) && not(opt.cxx)
                       ^
./configure:74: syntax error, unexpected kEND, expecting $end

I had a crazy idea to look at configure, and noticed that it requires Ruby 1.9.3, while I have only 1.8.7:

[jrhammon@esgmonster github]$ ruby --version
ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]

I am confused as to why the script cannot figure this out via:

# verify we're running a supported ruby version
required_version = '1.9.3'
rv_arr = required_version.split('.').map{ |s| s.to_i }
av_arr = RUBY_VERSION.split('.').map{ |s| s.to_i }
if (av_arr <=> rv_arr) < 0
  abort("Ruby version #{required_version} required, but found #{RUBY_VERSION}. Aborting.")
end

Unfortunately, I am too stupid and know too little Ruby to even debug this problem, because none of my attempts to write out debug info to the terminal have any effect.

@jeffhammond
Copy link
Author

The configure script works fine if I remove the following lines:

[jrhammon@esgmonster github]$ git diff
diff --git a/configure b/configure
index 96a46c7..a214965 100755
--- a/configure
+++ b/configure
@@ -68,21 +68,10 @@ end
 # Xcode generator must have CC set to a version of Clang, and must have a corresponding plugin
 # see github.com/bholt/Clang-Head.xcplugin for an example

-### unless opt.generator =~ /Xcode/ # (Xcode generator currently chokes on other compilers...)
-  if not(opt.cc) && not(opt.cxx)
-    abort("Must specify C compiler (either use '--cc=' or '--cxx=' flags, or set the environment variables CC & CXX\nhint: if the compiler you want is on your PATH, you can do: --cc=$(which gcc)...")
-  end
-### end
-
 if opt.tracing && opt.profiling
   abort "Please choose one of profiling or tracing."
 end

-      
-if opt.tracing && not(opt.vampir) && opt.third_party
-  opt.vampir = opt.third_party
-end
-
 # verify we're on a 64-bit machine
 case `uname -m`
 when /x86_64/

@nelsonje
Copy link
Member

The real solution here is to rewrite the configure script in bash; we don't need to use Ruby here (or anywhere else in the project). This is on my list, but it'll be a while until I get to it.

@jeffhammond
Copy link
Author

I stopped using configure and am now invoking CMake directly to avoid Ruby issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants