Ruby on AIX 4.3.3

I just built Ruby 1.8.1 on an AIX 4.3.3 box using gcc. When I try to run
something that uses “require ‘net/http’”, I get the following:

/usr/local/lib/ruby/1.8/net/protocol.rb:21:in require': No such file to load -- socket (LoadError) from /usr/local/lib/ruby/1.8/net/protocol.rb:21 from /usr/local/lib/ruby/1.8/net/http.rb:26:inrequire’
from /usr/local/lib/ruby/1.8/net/http.rb:26
from ./testit:3:in `require’
from ./testit:3

And, I can’t fins any file named ‘socket*’ under /usr/local/lib

HELP???

– Matt
The American Non-Sequiteur Society: We may not make sense, but we do like
pizza.

Socket is a C extension; I would strongly suspect that it failed to
compile when you built ruby. Compiles of extensions will fail silently.

Try cd’ing into the source/ext/socket/ directory and “ruby extconf.rb;
make”; This will display any errors.

···

On May 11, 2004, at 6:17 PM, Matt Lawrence wrote:

I just built Ruby 1.8.1 on an AIX 4.3.3 box using gcc. When I try to
run
something that uses “require ‘net/http’”, I get the following:

/usr/local/lib/ruby/1.8/net/protocol.rb:21:in require': No such file to load -- socket (LoadError) from /usr/local/lib/ruby/1.8/net/protocol.rb:21 from /usr/local/lib/ruby/1.8/net/http.rb:26:in require’
from /usr/local/lib/ruby/1.8/net/http.rb:26
from ./testit:3:in `require’
from ./testit:3

And, I can’t fins any file named ‘socket*’ under /usr/local/lib

I just tried that. Here’s what it said:

]/usr/src/ruby-1.8.1/ext/socket > ruby extconf.rb
checking for t_open() in -lnsl… no
checking for socket() in -lsocket… no
checking for netinet/tcp.h… yes
checking for netinet/udp.h… yes
checking for sendmsg()… no
checking for recvmsg()… no
checking for inet_ntop()… no
checking for inet_ntoa()… no
checking for inet_pton()… no
checking for inet_aton()… no
checking for getservbyport()… no
checking for arpa/inet.h… yes
checking for arpa/nameser.h… yes
checking for resolv.h… yes
checking for sys/un.h… yes
checking for sys/uio.h… yes
checking for socket()… no

Ideas? Something missing from the gcc libraries? Help?

– Matt
The American Non-Sequiteur Society: We may not make sense, but we do like
pizza.

···

On Wed, 12 May 2004, Mark Hubbart wrote:

Socket is a C extension; I would strongly suspect that it failed to
compile when you built ruby. Compiles of extensions will fail silently.

Try cd’ing into the source/ext/socket/ directory and “ruby extconf.rb;
make”; This will display any errors.

Hi Matt,

···

On Wed, May 12, 2004 at 11:23:11AM +0900, Matt Lawrence wrote:

I just tried that. Here’s what it said:

checking for socket()… no

Ideas? Something missing from the gcc libraries? Help?

I think it will be necessary to link with libbsd.a to use the BSD
socket functions on AIX. It looks as though the configure script
did not check that library.

Refer to the AIX version 4.3 Communications Programming Concepts manual.
http://publib.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/progcomc/skt_examps.htm#A299X9b27

Best regards,


Zane Dodson

I’ve been poking through the configure scripts and I really have no clue
what to modify to make this work. Hints?

– Matt
The American Non-Sequiteur Society: We may not make sense, but we do like
pizza.

···

On Wed, 12 May 2004, Zane Dodson wrote:

I think it will be necessary to link with libbsd.a to use the BSD
socket functions on AIX. It looks as though the configure script
did not check that library.

Hi Matt,

···

On Wed, May 12, 2004 at 01:52:44PM +0900, Matt Lawrence wrote:

On Wed, 12 May 2004, Zane Dodson wrote:

I think it will be necessary to link with libbsd.a to use the BSD
socket functions on AIX. It looks as though the configure script
did not check that library.

I’ve been poking through the configure scripts and I really have no clue
what to modify to make this work. Hints?

Try invoking configure this way (untested — I do not have access
to an AIX box):

./configure LIBS=-lbsd

(It would also be a good idea to use nm' to verify that socket’ is
indeed in `libbsd.a’.)

Best regards,


Zane Dodson

It used to be sufficient (back in the AIX 3 days) to invoke configure like
this:

CC=bsdcc ./configure ...

but that may no longer work in AIX 4. Does your system have
/usr/lpp/bos/bsdport?

···

On Wed, May 12, 2004 at 01:52:44PM +0900, Matt Lawrence wrote:

I’ve been poking through the configure scripts and I really have no clue
what to modify to make this work. Hints?


Jos Backus / /// Sunnyvale, CA
_/ _/ _/
/ ///
_/ _/ _/ /
jos at catnook.com // //
/ require ‘std/disclaimer’

Try invoking configure this way (untested — I do not have access
to an AIX box):

./configure LIBS=-lbsd

Well, I tried. It didn’t work.

(It would also be a good idea to use nm' to verify that socket’ is
indeed in `libbsd.a’.)

I’ve never used nm before, but if I’m reading the output correctly, socket
doesn’t seem to be defined in any of the .a files in /lib or /usr/lib.

Ok, so I’m not a developer, just a sys admin.

– Matt
The American Non-Sequiteur Society: We may not make sense, but we do like
pizza.

···

On Wed, 12 May 2004, Zane Dodson wrote:

It doesn’t seem to. The problem looks to be somewhere in the configure
script. I really wish I understood enough of how it works to stand a
chance of fixing it. This is the sort of side issue that Matz shouldn’t
need to worry about.

– Matt
The American Non-Sequiteur Society: We may not make sense, but we do like
pizza.

···

On Fri, 14 May 2004, Jos Backus wrote:

On Wed, May 12, 2004 at 01:52:44PM +0900, Matt Lawrence wrote:

I’ve been poking through the configure scripts and I really have no clue
what to modify to make this work. Hints?

It used to be sufficient (back in the AIX 3 days) to invoke configure like
this:

CC=bsdcc ./configure ...

but that may no longer work in AIX 4. Does your system have
/usr/lpp/bos/bsdport?

Unfortunately I don’t have access to an AIX box or I would investigate. That
plus I’m in the middle of moving…

···

On Fri, May 14, 2004 at 08:47:06AM +0900, Matt Lawrence wrote:

It doesn’t seem to. The problem looks to be somewhere in the configure
script. I really wish I understood enough of how it works to stand a
chance of fixing it. This is the sort of side issue that Matz shouldn’t
need to worry about.


Jos Backus / /// Sunnyvale, CA
_/ _/ _/
/ ///
_/ _/ _/ /
jos at catnook.com // //
/ require ‘std/disclaimer’