[Scipy-tickets] [SciPy] #1557: weave.inline() ignores runtime_library_dirs on Mac OS X

SciPy Trac scipy-tickets@scipy....
Tue Nov 8 08:53:49 CST 2011


#1557: weave.inline() ignores runtime_library_dirs on Mac OS X
-------------------------+--------------------------------------------------
 Reporter:  iwd32900     |       Owner:  somebody   
     Type:  defect       |      Status:  new        
 Priority:  normal       |   Milestone:  Unscheduled
Component:  scipy.weave  |     Version:  0.8.0      
 Keywords:               |  
-------------------------+--------------------------------------------------
 I'm trying to
 {{{
 * call functions in a dynamic library (*.dylib)
 * from Weave.Inline() C++ code
 * on Mac OS X (tested w/ 10.6.8 "Snow Leopard)
 }}}

 I find the dylib *must* be on the system search path (e.g. in
 /usr/local/lib or a directory in DYLD_LIBRARY_PATH).  On Linux, the *.so
 shared libraries can be anywhere, as long as I include that directory in
 the `runtime_library_dirs` keyword argument to weave.inline().  But on Mac
 OS X, `runtime_library_dirs` seems to have no effect!

 I've tried dynamically adding the path to DYLD_LIBRARY_PATH inside Python
 using os.environ, prior to calling weave.inline() -- no luck.  I've tried
 using install_name_tool and the -rpath flag to GCC as described
 (http://www.mikeash.com/pyblog/friday-qa-2009-11-06-linking-and-install-
 names.html), but I can't make that work either. (Could be because I'm
 trying to set an -rpath on weave's *.so file instead of an executable -- I
 think I read OS X doesn't chain this kind of lookup properly.)

 As a first step, it would be nice to document this limitation and the
 workarounds (copying dylibs to standard locations or setting
 DYLD_LIBRARY_PATH prior to launching Python).  If anyone figures out how
 to make this work as intended on OS X, that would be even better!

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1557>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list