librelist archives

« back to archive

kgio 2.5.0 failed build/install

kgio 2.5.0 failed build/install

From:
Mohit Chawla
Date:
2011-06-24 @ 19:12
Hi,

Seeing this on CentOS 5.6:

### build error

Building native extensions.  This could take a while...
ERROR:  Error installing kgio:
       ERROR: Failed to build gem native extension.

       /usr/bin/ruby extconf.rb
checking for CLOCK_MONOTONIC in "time.h"... yes
checking for clockid_t... yes
checking for clock_gettime() in -lrt... no
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for poll()... no
checking for getaddrinfo()... no
getaddrinfo required
*** extconf.rb failed ***

### mkmf.log

have_func: checking for getaddrinfo()... -------------------- no

"gcc -o conftest -I. -I/usr/lib64/ruby/1.8 -I.    -D_GNU_SOURCE
-DPOSIX_C_SOURCE=1-D_POSIX_C_SOURCE=200112L -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing
-fPIC   conftest.c  -L/usr/lib64      -lruby-static  -lpthread -lrt
-ldl -lcrypt -lm   -lc"
conftest.c: In function ‘t’:
conftest.c:7: error: too few arguments to function ‘getaddrinfo’
checked program was:
/* begin */
1: #include <sys/types.h>
2: #include <sys/socket.h>
3: #include <netdb.h>
4:
5: /*top*/
6: int main() { return 0; }
7: int t() { getaddrinfo(); return 0; }
/* end */

No such issues on my Ubuntu/Scientific Linux 6/CentOS 5.5 boxes. Any
clues what could be the reason ?

Re: kgio 2.5.0 failed build/install

From:
Mohit Chawla
Date:
2011-06-24 @ 19:40
On Sat, Jun 25, 2011 at 12:42 AM, Mohit Chawla
<mohit.chawla.binary@gmail.com> wrote:
> Hi,
> Seeing this on CentOS 5.6:

Tried a different ruby build ( same version though - 1.8.7 ! ) - one
using rvm and one from this repo:
http://centos.karan.org/el5/ruby187/$basearch/

With the rvm ruby, kgio compiles fine on this box, as well.

Re: [kgio] kgio 2.5.0 failed build/install

From:
Eric Wong
Date:
2011-06-24 @ 20:50
Mohit Chawla <mohit.chawla.binary@gmail.com> wrote:
> Hi,
> 
> Seeing this on CentOS 5.6:
> 
> ### build error
> 
> Building native extensions.  This could take a while...
> ERROR:  Error installing kgio:
>        ERROR: Failed to build gem native extension.
> 
>        /usr/bin/ruby extconf.rb
> checking for CLOCK_MONOTONIC in "time.h"... yes
> checking for clockid_t... yes
> checking for clock_gettime() in -lrt... no
> checking for t_open() in -lnsl... no
> checking for socket() in -lsocket... no
> checking for poll()... no
> checking for getaddrinfo()... no
> getaddrinfo required

Weird, clock_gettime() and poll() aren't detected, either.  Those
should always be present in a Linux system.

> "gcc -o conftest -I. -I/usr/lib64/ruby/1.8 -I.    -D_GNU_SOURCE
> -DPOSIX_C_SOURCE=1-D_POSIX_C_SOURCE=200112L -O2 -g -pipe -Wall
> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
> --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing
> -fPIC   conftest.c  -L/usr/lib64      -lruby-static  -lpthread -lrt
> -ldl -lcrypt -lm   -lc"

It could be a mixed 32/64-bit environment problem.  Can you verify
your gcc/Ruby are 64-bit?

> No such issues on my Ubuntu/Scientific Linux 6/CentOS 5.5 boxes. Any
> clues what could be the reason ?

The mixed 64-bit/32-bit toolchain is the only thing that comes to
mind.

I've always built my own Ruby packages (since long before RVM) on
CentOS/Debian machines.  Those distros enable pthreads by default on 1.8
(for tcl/tk compatibility) and that kills performance.  If RVM works for
you, then go for it, otherwise "./configure --prefix=$HOME/foo && make
&& make install" works great, too.

-- 
Eric Wong

Re: [kgio] kgio 2.5.0 failed build/install

From:
Mohit Chawla
Date:
2011-06-25 @ 06:32
Hi,

On Sat, Jun 25, 2011 at 2:20 AM, Eric Wong <normalperson@yhbt.net> wrote:
> The mixed 64-bit/32-bit toolchain is the only thing that comes to
> mind.

I couldn't really find the exact problematic libs, but starting again
from scratch taking close care of the arch libs - seems to make it
work fine.
Thanks for the hint !