[BioRuby] Installing Ruby 1.9 on CentOS 5.4

Naohisa Goto ngoto at gen-info.osaka-u.ac.jp
Sat Nov 5 12:10:57 UTC 2011


Hi Peter,

> Note I tried passing -prefix and --prefix to configure, but it didn't
> accept it - use prefix with no minus at all,

This seems to be very strange. I'm afraid if the machine might have
serious trouble.

> $ cd ~/Downloads
> $ wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
> $ tar -xzvf yaml-0.1.4.tar.gz
> $ cd yaml-0.1.4
> $ ./configure --prefix=$HOME
> $ make
> $ make check
> $ make install

The above process seems completely right.

In addition, install libffi is recommended.
 $ cd ~/Downloads
 $ wget ftp://sourceware.org/pub/libffi/libffi-3.0.10.tar.gz
 $ tar zxvf libffi-3.0.10.tar.gz
 $ cd libffi-3.0.10
 $ ./configure --prefix=$HOME
 $ make
 $ make check
 $ make install

"yum install openssl-devel" is also strongly recommended.

And then, configureing Ruby. For using libraries installed other than
system-wide directory, additional options to specify paths of C header
files and libraries shoud be given to CPPFLAGS, LDFLAGS, etc.

 $ tar zxvf ruby-1.9.3-p0.tar.gz
 $ cd ruby-1.9.3-p0
 $ ./configure --prefix=$HOME \
   CPPFLAGS="-I$HOME/lib/libffi-3.0.10/include -I$HOME/include" \
   LDFLAGS="-L$HOME/lib -Wl,-rpath,$HOME/lib"
 $ make
 $ make check
 $ make install

If you think the gcc in CentOS 5.4 is buggy, adding optflags="-O2"
to supress optimize level is suggested.

During make check, few error would be happened, due to incomplete IPv6
network settings, kernel and glibc bug, older libraries bug, etc.

FYI, I have very very old RedHat 4.6 (x86_64), and I've successfully
installed ruby-1.9.3-p0 in my home directory without root privilege.

RedHat 4.6 uses gcc 3.4.6 that may have bug about symbol visibility
options, and the following error happened during make process.

 Generating RDoc documentation
 ./ruby: symbol lookup error: /XXXXX/src/ruby-1.9.3-p0/.ext/
 x86_64-linux/enc/encdb.so: undefined symbol: rb_encdb_declare

For the workaround of  the (very old gcc's) bug, editing Makefile is
needed. after configure before make.

 $ cp Makefile Makefile.bak
 $ sed -e "s/-fvisibility=hidden/-fvisibility=default/" Makefile.bak > Makefile
 $ make clean
 $ make

Note that the workaround is needed only when you see the symbol 
lookup error. On, CentOS 5.4, it seems the workaround is not needed
(and it may have bad effect for systems without the problem).

-- 
Naohisa Goto
ngoto at gen-info.osaka-u.ac.jp




More information about the BioRuby mailing list