[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Profile's LD_LIBRARY_PATH by default

From: Sébastien Lerique
Subject: Re: Profile's LD_LIBRARY_PATH by default
Date: Thu, 29 Oct 2020 11:07:10 +0100


On 29 Oct 2020 at 10:10, david larsson <> wrote:
On 2020-10-28 13:49, Sébastien Lerique wrote:
While running a racket program which uses OpenCV, I realised that my
LD_LIBRARY_PATH does not contain my user's profile libs. I have
`libopencv*.so` in `~/.guix-profile/lib/`, but running a racket
program which needs that fails:
$ racket capture.rkt
ffi-lib: couldn't open "" ( cannot
open shared object file: No such file or directory)
While running
env LD_LIBRARY_PATH=/home/sl/.guix-profile/lib/ racket capture.rkt
(Also, this <> is the output of `env
LD_DEBUG=libs racket capture.rkt`.)
Is this normal behaviour, i.e. that the path to dynamic libs installed in my user profile should be manually configured in my shell startup scripts? Should this not be included in `~/.guix-profile/etc/profile`?

I wondered the same, and got answer in the IRC #guix that setting LD_LIBRARY_PATH is highly discouraged (unless you have a specific and good reason to do so in a specific case - never globally). I a good explanation
about it here:

A good example of how it can go wrong:

"In its startup script[a program called WidgetMan], it sets LD_LIBRARY_PATH to point to its copy of Motif so it uses that one when it runs. As it happens, WidgetMan is designed to launch other programs too. Unfortunately, when WidgetMan launches other apps, they inherit the LD_LIBRARY_PATH setting and some Motif based apps now break when run from WidgetMan because WidgetMan's Motif is incompatible with (but the same library version as) the system Motif library.

Yes I see that makes sense. Does this mean that one shouldn't install libraries in user profiles?

Or maybe that, if I were to package this racket program, then it would depend on `opencv` and set its required lib paths properly in its package definition (so work no matter if it's system-wide or in a user profile)?

Then, for development, is setting LD_LIBRARY_PATH still the only way without installing the lib system-wide?

(that's a lot of questions, apologies!)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]