<div>The module is found ! How:</div>- Using VM Squeak 5.8b12 2 (instead of Cog or the VM provided in Seaside One-Click image) <div>- go in Squeak\ 5.8b12\ 2.app/Contents/Resources/, then ln -s /usr/local/lib/libyaz.3.dylib .</div>
<div><br></div><div>Now I have the "Unable to find function address" you have talked earlier :) I will look at the mangled function names.</div><div><br></div><div><br></div><div>Laurent --- on the road to the FFI mountain.</div>
<meta charset="utf-8"><div><br><br><div class="gmail_quote">On Tue, Dec 21, 2010 at 6:59 AM, Hernán Morales Durand <span dir="ltr"><<a href="mailto:hernan.morales@gmail.com">hernan.morales@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Laurent,<br>
I forward this e-mail to the squeak mailing list, may be someone there<br>
have a better idea how the OSX VM works. BTW there are more<br>
commentaries here<br>
<a href="http://forum.world.st/squeak-dev-Alien-amp-Squeak-FFI-issues-on-Snow-Leopard-td85608.html" target="_blank">http://forum.world.st/squeak-dev-Alien-amp-Squeak-FFI-issues-on-Snow-Leopard-td85608.html</a><br>
<div><div></div><div class="h5">Cheers,<br>
<br>
Hernán<br>
<br>
2010/12/20 laurent laffont <<a href="mailto:laurent.laffont@gmail.com">laurent.laffont@gmail.com</a>>:<br>
> Hi Hernan,<br>
> the strace equivalent on OSX seems to be dtruss (yes I'm learning OSX too :)<br>
> sudo dtruss -p [pid of process]<br>
> in the trace I have this:<br>
> stat("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3.bundle/Contents/MacOS/yaz3\0",<br>
> 0xBFF59440, 0xBFF5AB28) = -1 Err#2<br>
> stat64("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3.bundle/Contents/MacOS/yaz3\0",<br>
> 0xBFF5892C, 0xBFF5AB28) = -1 Err#2<br>
> stat("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0",<br>
> 0xBFF59440, 0xBFF5AB28) = 0 0<br>
> stat64("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0",<br>
> 0xBFF5892C, 0xBFF5AB28) = 0 0<br>
> open("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0",<br>
> 0x0, 0x0) = 12 0<br>
> pread(0xC, "\317\372\355\376\a\0", 0x1000, 0x0) = 4096 0<br>
> close(0xC) = 0 0<br>
> stat("/Users/laurentlaffont/Downloads/Plugins/yaz3.bundle/Contents/MacOS/yaz3\0",<br>
> 0xBFF59440, 0x1000) = -1 Err#2<br>
> stat64("/Users/laurentlaffont/Downloads/Plugins/yaz3.bundle/Contents/MacOS/yaz3\0",<br>
> 0xBFF5892C, 0x1000) = -1 Err#2<br>
> stat("/Users/laurentlaffont/Downloads/Plugins/yaz3\0", 0xBFF59440, 0x1000) =<br>
> -1 Err#2<br>
> stat64("/Users/laurentlaffont/Downloads/Plugins/yaz3\0", 0xBFF5892C, 0x1000)<br>
> = -1 Err#2<br>
><br>
> so it looks like the VM is trying to find yaz3 at non standard Unix places<br>
> (I don't know if it's SqueakVM or OSX related).<br>
> I've created Contents/Resources/yaz3.bundle/Contents/MacOS/, put yaz lib<br>
> there, ln -s libyaz.3.dylib yaz3 but no success.<br>
><br>
> I've read good post <a href="http://forum.world.st/FFI-Documentation-td2225150.html" target="_blank">http://forum.world.st/FFI-Documentation-td2225150.html</a> :<br>
><br>
> Module Location - where the external library file lives<br>
> - depends on the platform<br>
> - Mac<br>
> - pre Snow Leopard<br>
> - checks VM path and common library paths<br>
> - Snow Leopard<br>
> - only looks in VM bundle's Resources file, you must either [5]:<br>
> - store all external libraries there<br>
> - ln -s path/to/library path/to/VM/Resources/library_name<br>
> - Change the VM's Info.plist "SqueakPluginsBuiltInOrLocalOnly" key from<br>
> "true" to "false."<br>
><br>
> For this SqueakPluginsBuiltInOrLocalOnly I suppose I need to compile a VM ?<br>
> Cheers,<br>
> Laurent Laffont<br>
><br>
><br>
> On Mon, Dec 20, 2010 at 4:12 PM, Hernán Morales Durand<br>
> <<a href="mailto:hernan.morales@gmail.com">hernan.morales@gmail.com</a>> wrote:<br>
>><br>
>> Hi Laurent<br>
>><br>
>> I've read there is a couple of system calll monitors in MacOS, ktrace<br>
>> and dtrace (<a href="http://en.wikipedia.org/wiki/Ktrace" target="_blank">http://en.wikipedia.org/wiki/Ktrace</a> ,<br>
>> <a href="http://en.wikipedia.org/wiki/DTrace" target="_blank">http://en.wikipedia.org/wiki/DTrace</a>) so you may attach to the VM and<br>
>> see what's missing?<br>
>> Cheers,<br>
>><br>
>> Hernán<br>
>><br>
>> 2010/12/20 laurent laffont <<a href="mailto:laurent.laffont@gmail.com">laurent.laffont@gmail.com</a>>:<br>
>> > Thanks Hernan.<br>
>> > It still doesn't work. I've also tried to play with LD_LOAD_PATH /<br>
>> > LD_LIBRARY_PATH no success.... I want to make it work so I need to learn<br>
>> > :)<br>
>> ><br>
>> > For the mangled function names, on Linux and OSX there's nm.<br>
>> > Here's what I get:<br>
>> > $ nm -g libyaz.3.dylib | grep ZOOM_connection_create<br>
>> > 0000000000046a30 T _ZOOM_connection_create<br>
>> > Cheers,<br>
>> > Laurent<br>
>> ><br>
>> > On Sun, Dec 19, 2010 at 6:23 PM, Hernán Morales Durand<br>
>> > <<a href="mailto:hernan.morales@gmail.com">hernan.morales@gmail.com</a>> wrote:<br>
>> >><br>
>> >> Hi Laurent,<br>
>> >><br>
>> >> Thanks for reporting. The correct #moduleName for MacOS was missing,<br>
>> >> I've uploaded a new version answering 'libyaz.3.dylib' which I guess<br>
>> >> is the corresponding for 'yaz3.dll' (according to<br>
>> >> <a href="http://en.wikipedia.org/wiki/Dynamic_library#Naming" target="_blank">http://en.wikipedia.org/wiki/Dynamic_library#Naming</a> ).<br>
>> >><br>
>> >> I haven't access to a MacOS, but in Windows I've had to find the<br>
>> >> mangled function names (i.e. _ZOOM_connection_create@4) so FFI can<br>
>> >> find the function addresses and you don't get the classic "Error:<br>
>> >> Unable to find function address". I don't know if it's related since<br>
>> >> talks about C++, but you may want to check<br>
>> >> <a href="http://wiki.squeak.org/squeak/3735" target="_blank">http://wiki.squeak.org/squeak/3735</a><br>
>> >><br>
>> >> The tool I've used to find the mangled function names in Windows is<br>
>> >> the Steve Miller's Dependency Walker <a href="http://www.dependencywalker.com/" target="_blank">http://www.dependencywalker.com/</a><br>
>> >><br>
>> >> 2010/12/19 laurent laffont <<a href="mailto:laurent.laffont@gmail.com">laurent.laffont@gmail.com</a>>:<br>
>> >> > Hi,<br>
>> >> ><br>
>> >> > I want to use <a href="http://www.squeaksource.com/Z3950" target="_blank">http://www.squeaksource.com/Z3950</a><br>
>> >> > Following install instructions, I've dowloaded yaz sources (I've<br>
>> >> > tried<br>
>> >> > 4.1.2<br>
>> >> > and 3.0.52) as it seems there's no binary for OSX, ./configure<br>
>> >> > && make<br>
>> >> > &&<br>
>> >> > make install.<br>
>> >> > Then using latest Seaside One Click image I've copied<br>
>> >> > /usr/local/lib/*yaz*<br>
>> >> > in Seaside.app/Contents/MacOS<br>
>> >> > $ ls ~/Downloads/Seaside.app/Contents/MacOS/<br>
>> >> > Squeak VM Opt libyaz.a <a href="http://libyaz.la" target="_blank">libyaz.la</a><br>
>> >> > libyaz_icu.a <a href="http://libyaz_icu.la" target="_blank">libyaz_icu.la</a> libyaz_server.a<br>
>> >> > <a href="http://libyaz_server.la" target="_blank">libyaz_server.la</a> libyaz.3.dylib libyaz.dylib<br>
>> >> > libyaz_icu.3.dylib libyaz_icu.dylib libyaz_server.3.dylib<br>
>> >> > libyaz_server.dylib<br>
>> >> ><br>
>> >> ><br>
>> >> > But then I have a External Module Not Found on<br>
>> >> > YAZPQFFFILibrary>>createParser<br>
>> >> > " YAZPQDFFILibrary default createParser "<br>
>> >> > <cdecl: YAZPQFParser 'yaz_pqf_create' (void) module: 'yaz3'><br>
>> >> > ^ self externalCallFailed<br>
>> >> ><br>
>> >> > Any hint ?<br>
>> >> > Cheers,<br>
>> >> > Laurent Laffont -- FFI newbie<br>
>> >> ><br>
>> >> > Pharo Smalltalk Screencasts: <a href="http://www.pharocasts.com/" target="_blank">http://www.pharocasts.com/</a><br>
>> >> > Blog: <a href="http://magaloma.blogspot.com/" target="_blank">http://magaloma.blogspot.com/</a><br>
>> >> ><br>
>> >><br>
>> >> --<br>
>> >> Hernán Morales<br>
>> >> Information Technology Manager,<br>
>> >> Institute of Veterinary Genetics.<br>
>> >> National Scientific and Technical Research Council (CONICET).<br>
>> >> La Plata (1900), Buenos Aires, Argentina.<br>
>> >> Telephone: +54 (0221) 421-1799.<br>
>> >> Internal: 422<br>
>> >> Fax: 425-7980 or 421-1799.<br>
>> ><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br></div>