Nick,

Partial success.  After a false start with getting output from strace (my 
fault), it showed me that the vm was looking a lot in the vm's directory.  A 
symlink by the same name, allowed it to see the library.  Clearly, this is not 
a fix, because one should not be forced to make links to any/every library on 
the system.  However, it *was* nice to see the version string in an inspector :)

Looking at the strace output (relevant parts below), it tries with prepending 
lib, appending .so, .so.dylib.  It looks in the vm's directory, and in the root 
directory, not /usr/lib.

It has been almost a year (based on a dated comment) since I last really 
strained my synapses on the workings of ldconfig.  On my systems, it would tell 
one to look for the library as follows:

    ldconfig -p | grep Acces
    libAccesIO-USB.so (libc6) => /usr/lib/libAccesIO-USB.so

#moduleName answers 'libAccesIO-USB.so', and Ian's vm finds it.  My (and I use 
the term LOOSELY) understanding is that Ubuntu no longer uses LD_LIBRARY_PATH.  
dlopen() seems to prefer that one use the names as reported by ldconfig.  The 
best explanation I have found is that the change was a security measure.

How does one get ldconfig to "know" where something lives?  Putting a .so file 
in /usr/lib (and perhaps other places too) and then running ldconfig as sudo 
appears to build a cache.  Then ldconfig -p (anyone can run this) will show the 
map, and one can grep the result to find something specifc, as above.

Putting files in /usr/lib is a pain for things under active development.  A 
file can live anywhere if one puts a .conf file in /etc/ld.so.confd; the .conf 
files should contain paths to directories to be searched for .so files - or at 
least that's how it *appears* to work.  Run ldconfig as sudo to refresh the 
mapping, and verify with ldconfig - p.

The fix might be as simply as having the cog vm try passing the #moduleName to 
dlopen().

Nick, thanks for the nudge in a working direction.  I will probably symlink 
another file and see if a mix of hardware and software will get closer to 
cooperating with me.

Bill



stat64("/home/bills/Work2010/Pharo-1.1.1/libAccesIO-USB.so", 0xbfd66c5c) = -1 
ENOENT (No such file or directory)
stat64("/home/bills/Work2010/Pharo-1.1.1/libAccesIO-USB.so.so", 0xbfd66c5c) = 
-1 ENOENT (No such file or directory)
stat64("/home/bills/Work2010/Pharo-1.1.1/libAccesIO-USB.so.dylib", 0xbfd66c5c) 
= -1 ENOENT (No such file or directory)
stat64("/home/bills/Work2010/Pharo-1.1.1/liblibAccesIO-USB.so", 0xbfd66c5c) = 
-1 ENOENT (No such file or directory)
stat64("/home/bills/Work2010/Pharo-1.1.1/liblibAccesIO-USB.so.so", 0xbfd66c5c) 
= -1 ENOENT (No such file or directory)
stat64("/home/bills/Work2010/Pharo-1.1.1/liblibAccesIO-USB.so.dylib", 
0xbfd66c5c) = -1 ENOENT (No such file or directory)
stat64("./libAccesIO-USB.so", 0xbfd66c5c) = -1 ENOENT (No such file or 
directory)
stat64("./libAccesIO-USB.so.so", 0xbfd66c5c) = -1 ENOENT (No such file or 
directory)
stat64("./libAccesIO-USB.so.dylib", 0xbfd66c5c) = -1 ENOENT (No such file or 
directory)
stat64("./liblibAccesIO-USB.so", 0xbfd66c5c) = -1 ENOENT (No such file or 
directory)
stat64("./liblibAccesIO-USB.so.so", 0xbfd66c5c) = -1 ENOENT (No such file or 
directory)
stat64("./liblibAccesIO-USB.so.dylib", 0xbfd66c5c) = -1 ENOENT (No such file or 
directory)
stat64("libAccesIO-USB.so", 0xbfd66c5c) = -1 ENOENT (No such file or directory)
stat64("libAccesIO-USB.so.so", 0xbfd66c5c) = -1 ENOENT (No such file or 
directory)
stat64("libAccesIO-USB.so.dylib", 0xbfd66c5c) = -1 ENOENT (No such file or 
directory)
stat64("liblibAccesIO-USB.so", 0xbfd66c5c) = -1 ENOENT (No such file or 
directory)
stat64("liblibAccesIO-USB.so.so", 0xbfd66c5c) = -1 ENOENT (No such file or 
directory)
stat64("liblibAccesIO-USB.so.dylib", 0xbfd66c5c) = -1 ENOENT (No such file or 
directory)
stat64("/libAccesIO-USB.so", 0xbfd66c5c) = -1 ENOENT (No such file or directory)
stat64("/libAccesIO-USB.so.so", 0xbfd66c5c) = -1 ENOENT (No such file or 
directory)
stat64("/libAccesIO-USB.so.dylib", 0xbfd66c5c) = -1 ENOENT (No such file or 
directory)
stat64("/liblibAccesIO-USB.so", 0xbfd66c5c) = -1 ENOENT (No such file or 
directory)
stat64("/liblibAccesIO-USB.so.so", 0xbfd66c5c) = -1 ENOENT (No such file or 
directory)
stat64("/liblibAccesIO-USB.so.dylib", 0xbfd66c5c) = -1 ENOENT (No such file or 
directory)
stat64("/home/bills/Work2010/Pharo-1.1.1/libAccesIO-USB.so/.libs/libAccesIO-USB.so",
 0xbfd66c5c) = -1 ENOENT (No such file or directory)
stat64("/home/bills/Work2010/Pharo-1.1.1/libAccesIO-USB.so/.libs/libAccesIO-USB.so.so",
 0xbfd66c5c) = -1 ENOENT (No such file or directory)
stat64("/home/bills/Work2010/Pharo-1.1.1/libAccesIO-USB.so/.libs/libAccesIO-USB.so.dylib",
 0xbfd66c5c) = -1 ENOENT (No such file or directory)
stat64("/home/bills/Work2010/Pharo-1.1.1/libAccesIO-USB.so/.libs/liblibAccesIO-USB.so",
 0xbfd66c5c) = -1 ENOENT (No such file or directory)
stat64("/home/bills/Work2010/Pharo-1.1.1/libAccesIO-USB.so/.libs/liblibAccesIO-USB.so.so",
 0xbfd66c5c) = -1 ENOENT (No such file or directory)
stat64("/home/bills/Work2010/Pharo-1.1.1/libAccesIO-USB.so/.libs/liblibAccesIO-USB.so.dylib",
 0xbfd66c5c) = -1 ENOENT (No such file or directory)
read(10, ">externalCallFailed\nAccesIOUSBLi"..., 3424) = 3424
read(10, ">externalCallFailed\nAccesIOUSBLi"..., 4096) = 3424
write(10, "FileAccess: ", 12)           = 12
write(10, "SocketAccess: ", 14)         = 14
write(10, "an AccesIOUSBLibrary", 20)   = 20
write(10, "'libAccesIO-USB.so'", 19)    = 19
write(10, "an AccesIOUSBLibrary", 20)   = 20
write(10, "'libAccesIO-USB.so'", 19)    = 19
write(10, "an AccesIOUSBLibrary", 20)   = 20
write(10, "'libAccesIO-USB.so'", 19)    = 19
write(10, "an AccesIOUSBLibrary", 20)   = 20
write(10, "'libAccesIO-USB.so'", 19)    = 19
write(10, "#'Hardware-AccesIO'", 19)    = 19
write(10, "\t\ttextOrStream: \t'\t^AccesIOUSBLi"..., 65) = 65
write(10, "\t^ AccesIOUSBLibrary default AIO"..., 46) = 46
write(10, "a ReadStream '\t^AccesIOUSBLibrar"..., 61) = 61
write(10, "\t^AccesIOUSBLibrar...etc...", 27) = 27
write(10, "\t^AccesIOUSBLibrar...etc...", 27) = 27
write(10, "\t^AccesIOUSBLibrary defau...etc."..., 34) = 34


________________________________
From: pharo-project-boun...@lists.gforge.inria.fr 
[pharo-project-boun...@lists.gforge.inria.fr] on behalf of Schwab,Wilhelm K 
[bsch...@anest.ufl.edu]
Sent: Saturday, January 07, 2012 8:55 AM
To: Pharo-project@lists.gforge.inria.fr
Subject: Re: [Pharo-project] Cog+linux: external module not found

It would also be nice to see (either via syslog()/OutputDebugString()) or (if 
possible) in the error itself, what library (full path) was being loaded.  The 
output will generally be of interest only when something fails.

Similar comments would apply to serial ports that won't open - what did the vm 
actually try to do when something failed?  Most problems that I have had with 
getting Pharo to open something (library or port) have been relatively obvious 
to solve as soon as I saw how my intent was translated before it was passed on 
to the hardware (e.g. /usr/lib//this/that/something.so).

Bill


________________________________
From: pharo-project-boun...@lists.gforge.inria.fr 
[pharo-project-boun...@lists.gforge.inria.fr] on behalf of Mariano Martinez 
Peck [marianop...@gmail.com]
Sent: Saturday, January 07, 2012 5:20 AM
To: Pharo-project@lists.gforge.inria.fr
Subject: Re: [Pharo-project] Cog+linux: external module not found

BTW, Eliot, is there a way so that FFI throws something different from "Module 
not found" when the module is there but not 32 bits? like "Module found but it 
is not 32 bits" ?
cheers

On Sat, Jan 7, 2012 at 10:04 AM, Nick Ager 
<nick.a...@gmail.com<mailto:nick.a...@gmail.com>> wrote:
Hi Bill,

Have you tried strace to determine what library it's failing to load?

Nick


On 7 January 2012 03:26, Schwab,Wilhelm K 
<bsch...@anest.ufl.edu<mailto:bsch...@anest.ufl.edu>> wrote:
Eliot,

There is no /lib32 or /usr/lib32.  As a double check,

    locate lib32

returns nothing.  I put the library in /usr/lib, which is what I have done on 
two other Lucid systems.  ldconfig shows it registered there.

What's next?

Bill




________________________________
From: 
pharo-project-boun...@lists.gforge.inria.fr<mailto:pharo-project-boun...@lists.gforge.inria.fr>
 
[pharo-project-boun...@lists.gforge.inria.fr<mailto:pharo-project-boun...@lists.gforge.inria.fr>]
 on behalf of Eliot Miranda 
[eliot.mira...@gmail.com<mailto:eliot.mira...@gmail.com>]
Sent: Friday, January 06, 2012 7:29 PM

To: 
Pharo-project@lists.gforge.inria.fr<mailto:Pharo-project@lists.gforge.inria.fr>
Subject: Re: [Pharo-project] Cog+linux: external module not found



On Fri, Jan 6, 2012 at 4:18 PM, Schwab,Wilhelm K 
<bsch...@anest.ufl.edu<mailto:bsch...@anest.ufl.edu>> wrote:
Paul,

The library is 32 bit - I build it from source because it ships with 64 bit 
binaries.

Then try changing your LD_LIBRARY_PATH to /lib32:/usr/lib32:$LD_LIBRARY_PATH 
and see if that helps (if you have /lib32 & /usr/lib32 that is)


Bill


________________________________________
From: 
pharo-project-boun...@lists.gforge.inria.fr<mailto:pharo-project-boun...@lists.gforge.inria.fr>
 
[pharo-project-boun...@lists.gforge.inria.fr<mailto:pharo-project-boun...@lists.gforge.inria.fr>]
 on behalf of Paul DeBruicker [pdebr...@gmail.com<mailto:pdebr...@gmail.com>]
Sent: Friday, January 06, 2012 6:59 PM
To: 
pharo-project@lists.gforge.inria.fr<mailto:pharo-project@lists.gforge.inria.fr>
Subject: Re: [Pharo-project] Cog+linux: external module not found

Schwab,Wilhelm K wrote
>
> Eliot,
>
> I'm getting the same error with your latest VM.  Any ideas?
>
> Bill
>
>
>

When I had trouble with this it was a 64bit vs 32bit library mismatch on a
64bit OS.

Is it a 32 bit or 64 bit OS?  Is the library you're trying to reach 32bit?
64bit libs won't work with the 32bit CogVM, but are installed by default by
the Ubuntu package manager on a 64bit Ubuntu.

Ubuntu also moved some mandatory (from Cog's perspectvie) 32 bit libs from
their ia32-libs package to the ia32-libs-multiarch recently but I don't know
if that change affects Lucid.

--
View this message in context: 
http://forum.world.st/Cog-linux-external-module-not-found-tp4271136p4271354.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.





--
best,
Eliot





--
Mariano
http://marianopeck.wordpress.com

Reply via email to