unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: david larsson <david.larsson@selfhosted.xyz>
To: "Sébastien Lerique" <sl@eauchat.org>
Cc: help-guix@gnu.org,
	Help-Guix <help-guix-bounces+someone=selfhosted.xyz@gnu.org>
Subject: Re: Profile's LD_LIBRARY_PATH by default
Date: Thu, 29 Oct 2020 09:10:37 +0000	[thread overview]
Message-ID: <aa5a7654977cdc03c89379563a1b482a@selfhosted.xyz> (raw)
In-Reply-To: <877dra1mvr.fsf@eauchat.org>

On 2020-10-28 13:49, Sébastien Lerique wrote:
> Dear all,
> 
> This question could stem from a simpler example, but I think in this
> case it doesn't change much. So I'll go with my use case:
> 
> 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 "libopencv_core.so" (libopencv_core.so: cannot
> open shared object file: No such file or directory)
> ```
> 
> While running
> 
> ```
> env LD_LIBRARY_PATH=/home/sl/.guix-profile/lib/ racket capture.rkt
> ```
> 
> works.
> 
> (Also, this <http://0x0.st/ik3s.txt> 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`?
> 
> Thanks all, and best wishes!
> Sébastien

Hi!

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: 
https://web.archive.org/web/20060719201954/http://www.visi.com/~barr/ldpath.html

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. Bummer!"


  reply	other threads:[~2020-10-29  9:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28 13:49 Profile's LD_LIBRARY_PATH by default Sébastien Lerique
2020-10-29  9:10 ` david larsson [this message]
2020-10-29 10:07   ` Sébastien Lerique
2020-10-29 11:07     ` david larsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa5a7654977cdc03c89379563a1b482a@selfhosted.xyz \
    --to=david.larsson@selfhosted.xyz \
    --cc=help-guix-bounces+someone=selfhosted.xyz@gnu.org \
    --cc=help-guix@gnu.org \
    --cc=sl@eauchat.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).