Subject: Re: [ruby-ffi] [Q] search paths for loading libraries |
From: Wayne Meissner |
Date: 5/6/10 5:26 PM |
To: ruby-ffi@googlegroups.com |
ffi_lib searches in the standard locations that dlopen() would look for the library - usually /usr/lib. For everything else, you need to specify by absolute path. You can specify both "search the default paths" and "use this specific path" like so: module FooLib ffi_lib [ "foo", "/usr/local/libfoo.so", "/opt/local/libfoo.dylib" ] end That will try to load each of the members of the array in turn, and stop once it has loaded once successfully. On 7 May 2010 07:35, Chuck Remes <cremes.devlist@mac.com> wrote:
I'm working on providing a set of FFI bindings for the zeromq (zeromq.com) message queuing library. It is typically installed in /usr/local/lib. The ruby bindings that it currently has builds a C extension which it stashes in ruby/lib/ruby/site_ruby/1.9.1/ for the correct platform. Presumably FFI would find a library installed here, but I'm hoping it will also find a library stored at the traditional /usr/local/lib location. Will it? Any way to give it a hint (aside from providing an absolute path)? cr