oggy / looksee

Supercharged method introspection in IRB
MIT License
364 stars 14 forks source link

(2.0.0) gem installation fails on Ruby 2.1.0 #23

Closed bryanwoods closed 10 years ago

bryanwoods commented 10 years ago
$ ruby -v
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0]

$ gem install looksee -v 2.0.0
Building native extensions.  This could take a while...
ERROR:  Error installing looksee:
    ERROR: Failed to build gem native extension.

    /Users/howaboutwe/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling mri/mri.c
In file included from mri/mri.c:4:
In file included from mri/2.1.0/method.h:14:
mri/2.1.0/internal.h:209:22: error: expected ')'
nlz_int128(uint128_t x)
                     ^
mri/2.1.0/internal.h:209:11: note: to match this '('
nlz_int128(uint128_t x)
          ^
mri/2.1.0/internal.h:211:5: error: redefinition of '__int128'
    uint128_t y;
    ^
/Users/howaboutwe/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/x86_64-darwin12.0/ruby/config.h:164:28: note: instantiated from:
#define uint128_t unsigned __int128
                           ^
mri/2.1.0/internal.h:209:12: note: previous definition is here
nlz_int128(uint128_t x)
           ^
/Users/howaboutwe/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/x86_64-darwin12.0/ruby/config.h:164:28: note: instantiated from:
#define uint128_t unsigned __int128
                           ^
In file included from mri/mri.c:4:
In file included from mri/2.1.0/method.h:14:
mri/2.1.0/internal.h:211:14: error: expected ';' at end of declaration
    uint128_t y;
             ^
             ;
mri/2.1.0/internal.h:213:5: error: use of undeclared identifier 'y'
    y = x >> 64; if (y) {n -= 64; x = y;}
    ^
mri/2.1.0/internal.h:213:9: error: use of undeclared identifier 'x'
    y = x >> 64; if (y) {n -= 64; x = y;}
        ^
mri/2.1.0/internal.h:213:22: error: use of undeclared identifier 'y'
    y = x >> 64; if (y) {n -= 64; x = y;}
                     ^
mri/2.1.0/internal.h:213:35: error: use of undeclared identifier 'x'
    y = x >> 64; if (y) {n -= 64; x = y;}
                                  ^
mri/2.1.0/internal.h:213:39: error: use of undeclared identifier 'y'
    y = x >> 64; if (y) {n -= 64; x = y;}
                                      ^
mri/2.1.0/internal.h:214:5: error: use of undeclared identifier 'y'
    y = x >> 32; if (y) {n -= 32; x = y;}
    ^
mri/2.1.0/internal.h:214:9: error: use of undeclared identifier 'x'
    y = x >> 32; if (y) {n -= 32; x = y;}
        ^
mri/2.1.0/internal.h:214:22: error: use of undeclared identifier 'y'
    y = x >> 32; if (y) {n -= 32; x = y;}
                     ^
mri/2.1.0/internal.h:214:35: error: use of undeclared identifier 'x'
    y = x >> 32; if (y) {n -= 32; x = y;}
                                  ^
mri/2.1.0/internal.h:214:39: error: use of undeclared identifier 'y'
    y = x >> 32; if (y) {n -= 32; x = y;}
                                      ^
mri/2.1.0/internal.h:215:5: error: use of undeclared identifier 'y'
    y = x >> 16; if (y) {n -= 16; x = y;}
    ^
mri/2.1.0/internal.h:215:9: error: use of undeclared identifier 'x'
    y = x >> 16; if (y) {n -= 16; x = y;}
        ^
mri/2.1.0/internal.h:215:22: error: use of undeclared identifier 'y'
    y = x >> 16; if (y) {n -= 16; x = y;}
                     ^
mri/2.1.0/internal.h:215:35: error: use of undeclared identifier 'x'
    y = x >> 16; if (y) {n -= 16; x = y;}
                                  ^
mri/2.1.0/internal.h:215:39: error: use of undeclared identifier 'y'
    y = x >> 16; if (y) {n -= 16; x = y;}
                                      ^
mri/2.1.0/internal.h:216:5: error: use of undeclared identifier 'y'
    y = x >>  8; if (y) {n -=  8; x = y;}
    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [mri.o] Error 1

make failed, exit code 2
oggy commented 10 years ago

What version of osx / gcc are you using?

bryanwoods commented 10 years ago

OSX: 10.7.5

$ gcc --version i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)

oggy commented 10 years ago

Hmm, something seems iffy about your ruby or compiler environment. It's setting HAVE_UINT128_T to true yet uint128_t doesn't exist.

Does brew update && brew install apple-gcc42 help? Might also need to reinstall ruby 2.1 using that compiler so ruby's extconf sets the right compiler settings.

FWIW, this works for me on Mavericks using the default XCode llvm-gcc.

bryanwoods commented 10 years ago

Upgrading to Mavericks resolved this issue for me; thanks.