kubo / ruby-oci8

Ruby-oci8 - Oracle interface for ruby
Other
169 stars 75 forks source link

Ubuntu Oneiric Ocelot installation issue, gcc: error: unrecognized option ‘-j5’ issue #23

Closed bbozo closed 11 years ago

bbozo commented 11 years ago

Messages printed out to the console

bbozo@maroko:/etc$ gem install ruby-oci8
Building native extensions.  This could take a while...
ERROR:  Error installing ruby-oci8:
        ERROR: Failed to build gem native extension.

        /home/bbozo/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for load library path... 
  LD_LIBRARY_PATH... 
    checking /opt/oracle/product/11.2.0/client_1/lib/... yes
  /opt/oracle/product/11.2.0/client_1/lib/libclntsh.so.11.1 looks like a full client.
checking for cc... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/home/bbozo/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
        --with-instant-client
        --without-instant-client
/home/bbozo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': RuntimeError (RuntimeError)
        from /home/bbozo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:435:in `try_link0'
        from /home/bbozo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:615:in `try_run'
        from /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:563:in `check_cc'
        from /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:553:in `init'
        from /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:701:in `initialize'
        from /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:319:in `new'
        from /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:319:in `get'
        from extconf.rb:18:in `<main>'
---------------------------------------------------
Error Message:
  The complier failed to generate an executable file.
  You have to install development tools first.

Backtrace:
  /home/bbozo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:368:in `try_do'
  /home/bbozo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:435:in `try_link0'
  /home/bbozo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:615:in `try_run'
  /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:563:in `check_cc'
  /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:553:in `init'
  /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:701:in `initialize'
  /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:319:in `new'
  /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:319:in `get'
  extconf.rb:18:in `<main>'
---------------------------------------------------
See:
 * http://ruby-oci8.rubyforge.org/en/HowToInstall.html
 * http://ruby-oci8.rubyforge.org/en/ReportInstallProblem.html

Gem files will remain installed in /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2 for inspection.
Results logged to /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/gem_make.out

gem_make.out

bbozo@maroko:~/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2$ cat /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/gem_make.out
/home/bbozo/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for load library path... 
  LD_LIBRARY_PATH... 
    checking /opt/oracle/product/11.2.0/client_1/lib/... yes
  /opt/oracle/product/11.2.0/client_1/lib/libclntsh.so.11.1 looks like a full client.
checking for cc... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/home/bbozo/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
        --with-instant-client
        --without-instant-client
/home/bbozo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': RuntimeError (RuntimeError)
        from /home/bbozo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:435:in `try_link0'
        from /home/bbozo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:615:in `try_run'
        from /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:563:in `check_cc'
        from /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:553:in `init'
        from /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:701:in `initialize'
        from /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:319:in `new'
        from /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:319:in `get'
        from extconf.rb:18:in `<main>'
---------------------------------------------------
Error Message:
  The complier failed to generate an executable file.
  You have to install development tools first.

Backtrace:
  /home/bbozo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:368:in `try_do'
  /home/bbozo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:435:in `try_link0'
  /home/bbozo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:615:in `try_run'
  /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:563:in `check_cc'
  /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:553:in `init'
  /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:701:in `initialize'
  /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:319:in `new'
  /home/bbozo/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2/ext/oci8/oraconf.rb:319:in `get'
  extconf.rb:18:in `<main>'
---------------------------------------------------
See:
 * http://ruby-oci8.rubyforge.org/en/HowToInstall.html
 * http://ruby-oci8.rubyforge.org/en/ReportInstallProblem.html

Last 100 lines of 'ext/oci8/mkmf.log'

bbozo@maroko:~/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2$ tail -100 ext/oci8/mkmf.log
"gcc -o conftest -I/home/bbozo/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/x86_64-linux -I/home/bbozo/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/ruby/backward -I/home/bbozo/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1 -I.     -j5 -fPIC conftest.c  -L. -L/home/bbozo/.rvm/rubies/ruby-1.9.2-p180/lib -Wl,-R/home/bbozo/.rvm/rubies/ruby-1.9.2-p180/lib -L.  -rdynamic -Wl,-export-dynamic     -Wl,-R -Wl,/home/bbozo/.rvm/rubies/ruby-1.9.2-p180/lib -L/home/bbozo/.rvm/rubies/ruby-1.9.2-p180/lib -lruby-static  -lpthread -lrt -ldl -lcrypt -lm   -lc"
gcc: error: unrecognized option ‘-j5’
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main() {return 0;}
/* end */

bbozo@maroko:~/.rvm/gems/ruby-1.9.2-p180/gems/ruby-oci8-2.1.2$ 

And the command output listing

bbozo@maroko:/etc$  ruby --version
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
bbozo@maroko:/etc$  ruby -r rbconfig -e "p Config::CONFIG['host']"
"x86_64-unknown-linux-gnu"
bbozo@maroko:/etc$  ruby -r rbconfig -e "p Config::CONFIG['CC']"
"gcc"
bbozo@maroko:/etc$  ruby -r rbconfig -e "p Config::CONFIG['CFLAGS']"
" -j5 -fPIC"
bbozo@maroko:/etc$  ruby -r rbconfig -e "p Config::CONFIG['LDSHARED']"
"gcc -shared"
bbozo@maroko:/etc$  ruby -r rbconfig -e "p Config::CONFIG['LDFLAGS']"
"-L.  -rdynamic -Wl,-export-dynamic"
bbozo@maroko:/etc$  ruby -r rbconfig -e "p Config::CONFIG['DLDLAGS']"
nil
bbozo@maroko:/etc$  ruby -r rbconfig -e "p Config::CONFIG['LIBS']"
"-lpthread -lrt -ldl -lcrypt -lm "
bbozo@maroko:/etc$  ruby -r rbconfig -e "p Config::CONFIG['GNU_LD']"
"no"
bbozo@maroko:/etc$ 
bbozo@maroko:/etc$  # if you use gcc,
bbozo@maroko:/etc$  gcc --print-prog-name=ld
ld
bbozo@maroko:/etc$  gcc --print-prog-name=as
as
bbozo@maroko:/etc$ 
bbozo@maroko:/etc$  # Oracle full client
bbozo@maroko:/etc$  file $ORACLE_HOME/bin/oracle
/opt/oracle/product/11.2.0/client_1/bin/oracle: ERROR: cannot open `/opt/oracle/product/11.2.0/client_1/bin/oracle' (No such file or directory)
bbozo@maroko:/etc$ 
bbozo@maroko:/etc$  # Oracle Instant client. You need to change INSTANT_CLIENT_DIRECTORY.
bbozo@maroko:/etc$  file /opt/oracle/product/11.2.0/client_1/lib/libclntsh.*
/opt/oracle/product/11.2.0/client_1/lib/libclntsh.so:      symbolic link to `/opt/oracle/product/11.2.0/client_1/lib/libclntsh.so.11.1'
/opt/oracle/product/11.2.0/client_1/lib/libclntsh.so.10.1: symbolic link to `/opt/oracle/product/11.2.0/client_1/lib/libclntsh.so'
/opt/oracle/product/11.2.0/client_1/lib/libclntsh.so.11.1: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
bbozo@maroko:/etc$ 
bbozo@maroko:/etc$  echo $LD_LIBRARY_PATH
:/opt/oracle/product/11.2.0/client_1/lib/:/opt/oracle/product/11.2.0/client_1/lib/
bbozo@maroko:/etc$  echo $LIBPATH              # AIX

bbozo@maroko:/etc$  echo $SHLIB_PATH           # HP-UX PA-RISC 32-bit ruby

bbozo@maroko:/etc$  echo $DYLD_LIBRARY_PATH    # Mac OS X

bbozo@maroko:/etc$  echo $LD_LIBRARY_PATH_32   # Solaris 32-bit ruby

bbozo@maroko:/etc$  echo $LD_LIBRARY_PATH_64   # Solaris 64-bit ruby

Would be glad to kick out the -j5 flag from CFLAGS if I could find a way how. Any help is greatly appreciated, can't continue work without this.

Borna

bbozo commented 11 years ago

Can't find a single spot in my user profile, system profile or the gem source introducing the '-j5' flag

bbozo commented 11 years ago

Found it. It appears ruby was built with an older version, rbconfig.rb was the one propagating the CFLAG which now generates an error, not oci related