[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (dynamic-link "libm") doesn't work on guile
From: |
宋文武 |
Subject: |
Re: (dynamic-link "libm") doesn't work on guile |
Date: |
Fri, 08 Jan 2016 11:27:49 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Alex Vong <address@hidden> writes:
> Hi people,
>
>
> I got the following error message when trying to dlopen a shared library
> in ~/guix-profile/bin/guile installed by guix:
>
> scheme@(guile-user)> (dynamic-link "libm")
> 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.
>
>
> I think it is a guix-specific problem since /usr/bin/guile installed by
> debian works fine:
>
> scheme@(guile-user)> (dynamic-link "libm")
> $1 = #<dynamic-object "libm">
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.