unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* How do I set LTDL_LIBRARY_PATH?
@ 2020-09-17 20:58 divoplade
  2020-09-29 14:02 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: divoplade @ 2020-09-17 20:58 UTC (permalink / raw)
  To: help-guix

Hello guix,

I have written a small C guile module to access (some parts of) the GNU
nettle library. I can install it with guix, but then if I try to load
it from within an environment:

guix environment --ad-hoc guile guile-nettle -- guile <<EOF
(load-extension "libguile-nettle" "init_nettle")
EOF

guile does not find "libguile-nettle" (In procedure dynamic-link: file:
"libguile-nettle", message: "file not found")

This is because guile expects it to be in LTDL_LIBRARY_PATH, and guix
does not set that up.

How do I do that? Can I just update my package definition? I did not
find any modules that even mentions LTDL_LIBRARY_PATH; however I found
this in r-with-tests:

    (native-search-paths
     (list (search-path-specification
            (variable "R_LIBS_SITE")
            (files (list "site-library/")))))

Am I correct in assuming that if I put "LTDL_LIBRARY_PATH" as the
variable and "lib/" as the files, an environment containing my library
will set LTDL_LIBRARY_PATH=lib/ or is there a catch?

Best regards,

divoplade



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How do I set LTDL_LIBRARY_PATH?
  2020-09-17 20:58 How do I set LTDL_LIBRARY_PATH? divoplade
@ 2020-09-29 14:02 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2020-09-29 14:02 UTC (permalink / raw)
  To: divoplade; +Cc: help-guix

Hi,

divoplade <d@divoplade.fr> skribis:

> I have written a small C guile module to access (some parts of) the GNU
> nettle library. I can install it with guix, but then if I try to load
> it from within an environment:
>
> guix environment --ad-hoc guile guile-nettle -- guile <<EOF
> (load-extension "libguile-nettle" "init_nettle")
> EOF
>
> guile does not find "libguile-nettle" (In procedure dynamic-link: file:
> "libguile-nettle", message: "file not found")
>
> This is because guile expects it to be in LTDL_LIBRARY_PATH, and guix
> does not set that up.

Common practice is to arrange so that bindings refer to C libraries by
absolute file name.  For example:

--8<---------------cut here---------------start------------->8---
$ grep /libgcrypt $(find $(guix build guile-gcrypt) -name \*config.scm)
  "/gnu/store/qc3k3kd458pgrqsc7ih641160q81npwq-libgcrypt-1.8.5/lib/libgcrypt")
$ grep /libz $(find $(guix build guile-zlib) -name \*config.scm)
  "/gnu/store/rykm237xkmq7rl1p0nwass01p090p88x-zlib-1.2.11/lib/libz")
--8<---------------cut here---------------end--------------->8---

HTH!

Ludo’.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-29 14:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17 20:58 How do I set LTDL_LIBRARY_PATH? divoplade
2020-09-29 14:02 ` Ludovic Courtès

unofficial mirror of help-guix@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guix-user/0 guix-user/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-user guix-user/ https://yhetil.org/guix-user \
		help-guix@gnu.org
	public-inbox-index guix-user

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.gnu.guix.user
	nntp://news.gmane.io/gmane.comp.gnu.guix.user


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git