Problem installing the grace port

Joshua Root jmr at macports.org
Sat Nov 16 23:49:40 UTC 2019


On 2019-11-17 04:54 , Ippoliti, Emiliano wrote:
> Dear Joshua,
> 
> thank you for your detailed answer.
> In fact, looking at the content of my DYLD_LIBRARY_PATH variable:
> 
>> echo $DYLD_LIBRARY_PATH
> /usr/local/qt/lib:/usr/local/psh/lib:/usr/local/dt/lib:/usr/local/netpbm/lib:/opt/lib
> 
> and trying to remove each path separately, I found that the offended
> path preventing xmgrace to start was:
> 
> /usr/local/dt/lib
> 
> Removing that path from DYLD_LIBRARY_PATH xmgrace opens normally. So,
> problem solved. Thank you!
> 
> Then, I looked for when that path is added to DYLD_LIBRARY_PATH in the
> interactive login session, and I figured out it happens in my ~/.profile
> configuration file, where there is the line:
> 
> *export*DYLD_LIBRARY_PATH=${QTDIR}/lib:/usr/local/psh/lib:/usr/local/dt/lib:/usr/local/netpbm/lib:/opt/lib
> 
> Really, I could not remember when or if I edit this file in order to add
> that path to the DYLD_LIBRARY_PATH. Maybe this was done in the
> installation procedure of some program.
> 
> For what I could understand, /usr/local/dt contains an openmotif client:
> 
>> ls /usr/local/dt/bin/
> mwm    uil    xmbind
> 
>> ls /usr/local/dt/lib 
> X11                libMrm.4.dylib    libMrm.dylib     
> libUil.4.0.2.dyliblibUil.a           libUil.la <http://libUil.la>       
>   libXm.4.dylib       libXm.dylib libMrm.4.0.2.dyliblibMrm.a          
> libMrm.la <http://libMrm.la>          libUil.4.dylib    libUil.dylib   
>   libXm.4.0.2.dylib  libXm.a            libXm.la <http://libXm.la>
> 
> but it is not yet clear to me if this program is still relevant or
> employed by some other software or if I can remove it.
> 
> Thank you again for your valuable help.
> 
> All the best,
> Emy

You're welcome; glad you figured out the problem. Be aware that having
DYLD_LIBRARY_PATH set all the time is asking for trouble. It has
legitimate uses, such as testing things in a build directory before
libraries have been installed to their final location, but end users are
not supposed to need to set it, and it can easily lead to incorrect
libraries being loaded, as you have just experienced. My general advice
would be not to set it unless you really know what you're doing.

Any program that requires the end user to set DYLD_LIBRARY_PATH is not
correctly linked. But unfortunately there are some programs that ship
incorrectly linked binaries for whatever reason and do need
DYLD_LIBRARY_PATH set. In these cases, I would recommend setting it only
when running these specific programs, and setting it to the exact value
required by the program being run. A wrapper script is one way of doing
this conveniently.

For example, for a program "foo" that needs to be told where to find
some library which is in /opt/foo/lib:

#!/bin/sh
env DYLD_LIBRARY_PATH=/opt/foo/lib foo "$@"

- Josh


More information about the macports-users mailing list