From mboxrd@z Thu Jan 1 00:00:00 1970 From: iyzsong@member.fsf.org (=?utf-8?B?5a6L5paH5q2m?=) Subject: Re: (dynamic-link "libm") doesn't work on guile Date: Fri, 08 Jan 2016 11:27:49 +0800 Message-ID: <87a8ogbvii.fsf@member.fsf.org> References: <87bn8x65i9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHNiw-0002bV-3v for help-guix@gnu.org; Thu, 07 Jan 2016 22:28:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHNis-00073T-UZ for help-guix@gnu.org; Thu, 07 Jan 2016 22:28:22 -0500 Received: from smtp29.openmailbox.org ([62.4.1.63]:59980) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHNis-00073M-OU for help-guix@gnu.org; Thu, 07 Jan 2016 22:28:18 -0500 In-Reply-To: <87bn8x65i9.fsf@gmail.com> (Alex Vong's message of "Thu, 07 Jan 2016 18:36:14 +0800") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org To: Alex Vong Cc: help-guix@gnu.org Alex Vong 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 =3D # The `dynamic-link` will search and dlopen the shared library. The guile from guix doesn=E2=80=99t search common places like =E2=80=98/usr/lib=E2=80= =99, 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=E2=80= =99t seem to be what we want to use.