Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Mark S
RE: ruby-oci8 fails install Solaris 9 - cc er [ reply ]  
2007-05-10 20:54
Thank you. I also found more specific info on how to edit rbconfig.rb to compile with gcc at this link:

"The most common problem involves "cc" not being found. The best method is to fix all the default parameters that Ruby uses, which are found in: /opt/csw/lib/ruby/1.8/(ARCH)/rbconfig.rb"

http://forum.textdrive.com/viewtopic.php?id=12630


By: Kubo Takehiro
RE: ruby-oci8 fails install Solaris 9 - cc er [ reply ]  
2007-05-08 13:22
> cc: unrecognized option `-KPIC'

The ruby was compiled by a SUN's C compiler.
But gcc cannot accept the SUN cc specific option.

You have three options:
1. use SUN's C compiler instead of gcc.
2. recompile ruby by gcc, then compile ruby-oci8.
3. fix rbconfig.rb. ( '-KPIC' -> '-fPIC', '-xO3' -> '-O3', '-xarch=v8' -> '-m32'(maybe), etc.)

By: Mark S
ruby-oci8 fails install Solaris 9 - cc error [ reply ]  
2007-05-07 19:52
Hi, I am trying to install ruby-oci8 on solaris 9. At make, "checking for cc... ng"... "C Compiler doesn't work correctly" ... "ruby-oci8-1.0.0-rc1/ext/oci8/extconf.rb failed"

tail -100 ext/oci8/mkmf.log
"cc -o conftest -I. -I/opt/csw/lib/ruby/1.8/sparc-solaris2.8 -I/mnt/sysadm/solaris/ruby_deps/ruby-oci8-1.0.0-rc1/ext/oci8 -I/opt/csw/include -I/opt/csw/include -xO3 -xarch=v8 -xspace -xildoff -I/opt/csw/include -I/opt/csw/include -KPIC conftest.c -L'/opt/csw/lib' -R'/opt/csw/lib' -lruby-static -lrt -lpthread -ldl -lcrypt -lm -lc"
cc: unrecognized option `-KPIC'
cc: language ildoff not recognized
ld: fatal: file conftest.c: unknown file type
ld: fatal: File processing errors. No output written to conftest
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: int main() { return 0; }
/* end */

ruby --version
ruby 1.8.5 (2006-12-25 patchlevel 12) [sparc-solaris2.8]

ruby -r rbconfig -e "p Config::CONFIG['host']"
"sparc-sun-solaris2.8"

ruby -r rbconfig -e "p Config::CONFIG['CC']"
"cc"

ruby -r rbconfig -e "p Config::CONFIG['CFLAGS']"
"-xO3 -xarch=v8 -xspace -xildoff -I/opt/csw/include -I/opt/csw/include -KPIC"

ruby -r rbconfig -e "p Config::CONFIG['LDSHARED']"
"ld -G"

ruby -r rbconfig -e "p Config::CONFIG['LDFLAGS']"
" -xarch=v8 -L/opt/csw/lib -L/opt/csw/lib"

ruby -r rbconfig -e "p Config::CONFIG['DLDLAGS']"
nil

ruby -r rbconfig -e "p Config::CONFIG['LIBS']"
"-lrt -lpthread -ldl -lcrypt -lm "

ruby -r rbconfig -e "p Config::CONFIG['GNU_LD']"
"no"

gcc --print-prog-name=ld
/usr/ccs/bin/ld

gcc --print-prog-name=as
/usr/ccs/bin/as

file `which ruby`
/opt/csw/bin/ruby: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped

file $ORACLE_HOME/bin/oracle
/oracle/product/9i/bin/oracle: cannot open: Permission denied

echo $LD_LIBRARY_PATH
/oracle/product/9i/lib

echo $LD_LIBRARY_PATH_32
/oracle/product/9i/lib

And one more error: in attempting to upgrade to gcc 3.4.6:

WARNING: /usr/local/bin/c++ <no longer a linked file>
WARNING: /usr/local/bin/sparc-sun-solaris2.9-c++ <no longer a linked file>
WARNING: /usr/local/bin/sparc-sun-solaris2.9-g++ <no longer a linked file>
WARNING: /usr/local/bin/sparc-sun-solaris2.9-gcc <no longer a linked file>

Thank you.