[SciPy-dev] [mlabwrap] linker path

David Cournapeau david@ar.media.kyoto-u.ac...
Mon Oct 19 22:25:51 CDT 2009

David Warde-Farley wrote:
> On Tue, Oct 20, 2009 at 12:20:24AM +0200, Clemens Buchacher wrote:
>> However, contrary to 1.1-pre (after fixing it up with the patch below), it
>> requires matlab to be added to the linker path. I really don't want that,
>> because matlab contains old versions of standard libraries such as zlib and
>> libstdc++. Since we only need libeng.so, libmat.so, libmx.so and libut.so,
>> wouldn't it be much nicer to create a directory with symlinks to those
>> instead?
> This may not work, since the libraries you specify may depend on specific versions of zlib, libstdc++, etc. The 
> version installed in your system's link path may be ABI-incompatible with the one that the Matlab guys built against, 
> hence the reason for including them in the first place.

That's a major problem with the matlab C API BTW - since matlab uses
quite a few well known libraries internally (atlas, fftw), if your own
extension uses say fftw as well, it is very unlikely to work. That's a
consequence of the dreadful flat namespace in the conventional unix model.

On the "bright" side, I doubt that the new mlabwrap changes anything:
when mlabwrap used ctypes and loaded the matlab engine through ctypes,
the old zlib was likely loaded as well through rpath links.

I think that at least in theory, this could be solved with symbol
versioning, but this is likely to be quite hairy, if not impossible
since you don't have matlab sources. I doubt it worths it for most cases.


More information about the Scipy-dev mailing list