From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Ellis Newsgroups: gmane.lisp.guile.bugs Subject: Re: FFI on OS X? Date: Thu, 3 Mar 2011 11:53:31 -0500 Message-ID: References: <877hcgqnhz.fsf@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1299171228 20811 80.91.229.12 (3 Mar 2011 16:53:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 3 Mar 2011 16:53:48 +0000 (UTC) Cc: bug-guile@gnu.org To: Andreas Rottmann Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Mar 03 17:53:41 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PvBmW-0002Av-Me for guile-bugs@m.gmane.org; Thu, 03 Mar 2011 17:53:40 +0100 Original-Received: from localhost ([127.0.0.1]:51273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PvBmW-0001Fc-9n for guile-bugs@m.gmane.org; Thu, 03 Mar 2011 11:53:40 -0500 Original-Received: from [140.186.70.92] (port=45778 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PvBmQ-0001DS-8w for bug-guile@gnu.org; Thu, 03 Mar 2011 11:53:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PvBmO-00030U-VP for bug-guile@gnu.org; Thu, 03 Mar 2011 11:53:34 -0500 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:36889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PvBmO-00030J-QP for bug-guile@gnu.org; Thu, 03 Mar 2011 11:53:32 -0500 Original-Received: by wyi11 with SMTP id 11so1447857wyi.0 for ; Thu, 03 Mar 2011 08:53:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ldtMhtGbEFCD9tHZ1z4unzcWZVSLRLA472rDoZQt+bQ=; b=TgsfyPgoaea04mVkjyJ8e04TyvUacyed78DT3xzTXAOlzFubEP47i0MZWDx9+j2gJv sN8bCzu2nao1GwrCucO/DNtkxoDbc3kQkUhrbup2fVybsd26nABEjZIr9uuFf3IAr++5 ulrH/bl3jQTjbM4YnTd6vQ/iplIj/VFO5S0go= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=tMTHqYsCO7ScSGwo0A90drNmM+ECFIn+7Enok5HNDpR4ytrEbq4/eZpnvZK/CboBCz g/4/JIVqQHL0U8//g0/W9+mN5bJboHZxd/1f/MFzfCcwDzf36r5L/gWKsGZJ3G1NRnEC 3oU8KGctmvEapsz08AFkdby2Y5WZEXOdb9Jmo= Original-Received: by 10.227.23.200 with SMTP id s8mr1157179wbb.196.1299171211422; Thu, 03 Mar 2011 08:53:31 -0800 (PST) Original-Received: by 10.227.134.82 with HTTP; Thu, 3 Mar 2011 08:53:31 -0800 (PST) In-Reply-To: <877hcgqnhz.fsf@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.169 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5268 Archived-At: On Thu, Mar 3, 2011 at 9:36 AM, Andreas Rottmann wrote: > Hans Aberg writes: >>> Why does this fail? =EF=BF=BDCan you strace it? >> >> If you tell me how. :-) >> > Apparently, on OS X, "dtruss" does fulfill the role of "strace": > = . Thanks for the tip about dtruss. Very useful to know about. For the record, here's some dtruss output created when I try to dynamic-link a library that doesn't have a .so softlink, ie (dynamic-link "libf77lapack"). As you can see it's trying 'open_nocancel', 'access', and 'stat64' looking for .la and .so in all all the right places before giving up. 89795/0x1bfacf: open_nocancel("/usr/local/lib/libf77lapack.la\0", 0x0, 0x1B6) =3D -1 Err#2 89795/0x1bfacf: open_nocancel("/usr/local/lib/libf77lapack.la\0", 0x0, 0x1B6) =3D -1 Err#2 89795/0x1bfacf: open_nocancel("/lib/libf77lapack.la\0", 0x0, 0x1B6) =09 =3D -1 Err#2 89795/0x1bfacf: open_nocancel("/usr/lib/libf77lapack.la\0", 0x0, 0x1B6) =3D -1 Err#2 89795/0x1bfacf: open_nocancel("libf77lapack.la\0", 0x0, 0x1B6) =3D -1 Er= r#2 89795/0x1bfacf: access("/usr/local/lib/libf77lapack.so\0", 0x4, 0x10060A800) =3D -1 Err#2 89795/0x1bfacf: access("/usr/local/lib/libf77lapack.so\0", 0x4, 0x10060A800) =3D -1 Err#2 89795/0x1bfacf: access("/lib/libf77lapack.so\0", 0x4, 0x10060A800) =3D -= 1 Err#2 89795/0x1bfacf: access("/usr/lib/libf77lapack.so\0", 0x4, 0x10060A800) =3D -1 Err#2 89795/0x1bfacf: stat64("libf77lapack.so\0", 0x7FFF5FBFE630, 0x7FFF5FBFEC70) =3D -1 Err#2 89795/0x1bfacf: stat64("/Users/mellis/lib/libf77lapack.so\0", 0x7FFF5FBFEA10, 0x7FFF5FBFEC70) =3D -1 Err#2 89795/0x1bfacf: stat64("/usr/local/lib/libf77lapack.so\0", 0x7FFF5FBFEA10, 0x7FFF5FBFEC70) =3D -1 Err#2 89795/0x1bfacf: stat64("/usr/lib/libf77lapack.so\0", 0x7FFF5FBFEA20, 0x7FFF5FBFEC70) =3D -1 Err#2 89795/0x1bfacf: sigprocmask(0x1, 0x0, 0x7FFF5FBFEEC0) =3D 0x0 0 89795/0x1bfacf: sigaltstack(0x0, 0x7FFF5FBFEEB0, 0x0) =3D 0 0 89795/0x1bfacf: write(0x1, "ERROR: In procedure dynamic-link:\nERROR: In procedure dynamic-link: file: \"libf77lapack\", message: \"file not found\"\n\0", 0x74) =3D 116 0 If I try to specify the .dylib extension, dtruss shows that it fails because the standard extensions are being appended, e.g. open_nocancel("/usr/local/lib/libf77lapack.dylib.la\0", 0x0, 0x1B6) Is this something that can be fixed within Guile? Cheers, Mike