Re: setting dyld_library_path causes x11 to fail
Re: setting dyld_library_path causes x11 to fail
- Subject: Re: setting dyld_library_path causes x11 to fail
- From: Will Mortensen <email@hidden>
- Date: Thu, 26 Apr 2012 00:50:00 -0700
Andrew might also try unsetting DYLD_LIBRARY_PATH from within Matlab by running setenv('DYLD_LIBRARY_PATH, ''). Although, might that prevent Matlab from finding shared libraries afterward? Maybe only if it uses dlopen()? I'm not an expert on dynamic linking.
On Apr 25, 2012, at 11:07 AM, Jeremy Huddleston wrote:
> On Apr 25, 2012, at 3:04 AM, Martin Costabel <email@hidden> wrote:
>
>> On 25/04/12 10:28, Jeremy Huddleston wrote:
>> []
>>> The only reason I can think of for that happening is if *MATLAB* is doing something wrong with DYLD_ environment variables or if ncdump is not linked correctly. The output from otool -L above should help me figure that out if it's an issue in ncdump (which can then be fixed in MacPorts).
>>
>> MATLAB is indeed setting the DYLD_LIBRARY_PATH environment variable in the wrapper script that launches matlab. They need it because of sloppy linking of their dynamic libraries. Many of them have decent install_names, but many others don't (this is based on observation of Matlab-2008; perhaps newer versions are better behaved in this respect, but I doubt it.)
>
> Yeah, netcdf from MacPorts looks fine. File a bug against Matlab to fix their linking.
>
> You can fix it on your own machine. Just remove the DYLD_LIBRARY_PATH from their launch script and try launching. That should reveal what is broken in their linking. I don't know how many things need to be cleaned up, so it may be quite tedious.
>
> As a local solution, you can try using a shell script to unset DYLD_LIBRARY_PATH and then call the real ncdump. I'd suggest placing them in ~/bin and make sure that this appears before /opt/local/bin in $PATH:
>
> mkdir ${HOME}/bin
> for f in nccopy ncdump ncgen ncgen3 ; do
> cat > ${HOME}/bin/${f} <<EOF
> #!/bin/sh
> unset DYLD_LIBRARY_PATH
> exec /opt/local/bin/${f} "\${@}"
> EOF
> chmod 755 ${HOME}/bin/${f}
> done
>
> Then try launching matlab:
> PATH=${HOME}/bin:${PATH} matlab
>
>> A better advice of how to fix this in your ~/.tcshrc would be to write
>>
>> unsetenv DYLD_LIBRARY_PATH
>
> That won't solve the problem if netcdf is exec'd from MatLab directly as opposed to a tcsh script.
>
> --Jeremy
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> X11-users mailing list (email@hidden)
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden