help-guix
[Top][All Lists]
Advanced

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

Re: (dynamic-link "libm") doesn't work on guile


From: Alex Vong
Subject: Re: (dynamic-link "libm") doesn't work on guile
Date: Fri, 08 Jan 2016 20:43:18 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

address@hidden (宋文武) writes:

> The `dynamic-link` will search and dlopen the shared library.  The guile
> from guix doesn’t search common places like ‘/usr/lib’, so you need to
> set the environment variable `LD_LIBRARY_PATH` or `LTDL_LIBRARY_PATH`
> explicitly to the directory contains `libm.so`.
>
> by the way, since guile is linked with libm.so, we can just use
> `(dynamic-link)` here.
>
> well, I also find `(dynamic-link "libm-2.22")` work too, but it doesn’t
> seem to be what we want to use.

I think it is weird. It seems only dynamic linking with "libc" or "libm"
fails, dynamic linking with external library like "libpcre2-8" or
anyhome-made shared library would work. And yes, "libc-2.22" and
"libm-2.22" also works for me. As you have mentioned, since guile is
already linked with "libc" and "libm", so it is pratically not a
problem. I am just wondering if it is a bug or the intended behavior.

Below are the selected output from running
`LD_DEBUG=all LD_LIBRARY_PATH="$HOME/.guix-profile/lib" guile`:

scheme@(guile-user)> (dynamic-link "libm")
     29677:     
     29677:     file=/home/alexvong1995/.guix-profile/lib/libm.so [0];  
dynamically loaded by /home/alexvong1995/.guix-profile/lib/libltdl.so.7 [0]
     29677:     
     29677:     
file=/gnu/store/5i87jzm90nw8j692y7z1j2qfx16h6ni3-guile-2.0.11/lib/libm.so [0];  
dynamically loaded by /home/alexvong1995/.guix-profile/lib/libltdl.so.7 [0]
     29677:     
     29677:     
file=/gnu/store/5i87jzm90nw8j692y7z1j2qfx16h6ni3-guile-2.0.11/lib/guile/2.0/extensions/libm.so
 [0];  dynamically loaded by /home/alexvong1995/.guix-profile/lib/libltdl.so.7 
[0]
ERROR: In procedure dynamic-link:
ERROR: In procedure dynamic-link: file: "libm", message: "file not found"

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.

scheme@(guile-user)> (dynamic-link "libc")
     29677:     
     29677:     file=/home/alexvong1995/.guix-profile/lib/libc.so [0];  
dynamically loaded by /home/alexvong1995/.guix-profile/lib/libltdl.so.7 [0]
     29677:     
     29677:     
file=/gnu/store/5i87jzm90nw8j692y7z1j2qfx16h6ni3-guile-2.0.11/lib/libc.so [0];  
dynamically loaded by /home/alexvong1995/.guix-profile/lib/libltdl.so.7 [0]
     29677:     
     29677:     
file=/gnu/store/5i87jzm90nw8j692y7z1j2qfx16h6ni3-guile-2.0.11/lib/guile/2.0/extensions/libc.so
 [0];  dynamically loaded by /home/alexvong1995/.guix-profile/lib/libltdl.so.7 
[0]
ERROR: In procedure dynamic-link:
ERROR: In procedure dynamic-link: file: "libc", message: "file not found"

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.



reply via email to

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