From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Vong Subject: Re: (dynamic-link "libm") doesn't work on guile Date: Fri, 08 Jan 2016 20:43:18 +0800 Message-ID: <87bn8w9r89.fsf@gmail.com> References: <87bn8x65i9.fsf@gmail.com> <87a8ogbvii.fsf@member.fsf.org> 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]:52023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHWO8-0004ay-2c for help-guix@gnu.org; Fri, 08 Jan 2016 07:43:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHWO4-0004EB-OB for help-guix@gnu.org; Fri, 08 Jan 2016 07:43:27 -0500 Received: from mail-pf0-x22a.google.com ([2607:f8b0:400e:c00::22a]:36380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHWO4-0004E6-IV for help-guix@gnu.org; Fri, 08 Jan 2016 07:43:24 -0500 Received: by mail-pf0-x22a.google.com with SMTP id n128so9511926pfn.3 for ; Fri, 08 Jan 2016 04:43:24 -0800 (PST) In-Reply-To: <87a8ogbvii.fsf@member.fsf.org> (=?utf-8?B?IuWui+aWh+atpiIn?= =?utf-8?B?cw==?= message of "Fri, 08 Jan 2016 11:27:49 +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: =?utf-8?B?5a6L5paH5q2m?= Cc: help-guix@gnu.org iyzsong@member.fsf.org (=E5=AE=8B=E6=96=87=E6=AD=A6) writes: > 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. 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=3Dall LD_LIBRARY_PATH=3D"$HOME/.guix-profile/lib" guile`: scheme@(guile-user)> (dynamic-link "libm") 29677:=09 29677: file=3D/home/alexvong1995/.guix-profile/lib/libm.so [0]; dynam= ically loaded by /home/alexvong1995/.guix-profile/lib/libltdl.so.7 [0] 29677:=09 29677: file=3D/gnu/store/5i87jzm90nw8j692y7z1j2qfx16h6ni3-guile-2.0.11= /lib/libm.so [0]; dynamically loaded by /home/alexvong1995/.guix-profile/l= ib/libltdl.so.7 [0] 29677:=09 29677: file=3D/gnu/store/5i87jzm90nw8j692y7z1j2qfx16h6ni3-guile-2.0.11= /lib/guile/2.0/extensions/libm.so [0]; dynamically loaded by /home/alexvon= g1995/.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:=09 29677: file=3D/home/alexvong1995/.guix-profile/lib/libc.so [0]; dynam= ically loaded by /home/alexvong1995/.guix-profile/lib/libltdl.so.7 [0] 29677:=09 29677: file=3D/gnu/store/5i87jzm90nw8j692y7z1j2qfx16h6ni3-guile-2.0.11= /lib/libc.so [0]; dynamically loaded by /home/alexvong1995/.guix-profile/l= ib/libltdl.so.7 [0] 29677:=09 29677: file=3D/gnu/store/5i87jzm90nw8j692y7z1j2qfx16h6ni3-guile-2.0.11= /lib/guile/2.0/extensions/libc.so [0]; dynamically loaded by /home/alexvon= g1995/.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.