unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Michael Ellis <michael.f.ellis@gmail.com>
To: Andreas Rottmann <a.rottmann@gmx.at>
Cc: bug-guile@gnu.org
Subject: Re: FFI on OS X?
Date: Thu, 3 Mar 2011 11:53:31 -0500	[thread overview]
Message-ID: <AANLkTin9UrztOHYw3AYu9187mWEoJY-=bVyY7gdTp1+5@mail.gmail.com> (raw)
In-Reply-To: <877hcgqnhz.fsf@gmx.at>

On Thu, Mar 3, 2011 at 9:36 AM, Andreas Rottmann <a.rottmann@gmx.at> wrote:
> Hans Aberg <haberg-1@telia.com> writes:

>>> Why does this fail? �Can you strace it?
>>
>> If you tell me how. :-)
>>
> Apparently, on OS X, "dtruss" does fulfill the role of "strace":
> <http://humberto.digi.com.br/blog/2008/02/25/strace-on-mac-os-x-leopard/>.

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)		 = -1 Err#2
89795/0x1bfacf:  open_nocancel("/usr/local/lib/libf77lapack.la\0",
0x0, 0x1B6)		 = -1 Err#2
89795/0x1bfacf:  open_nocancel("/lib/libf77lapack.la\0", 0x0, 0x1B6)		
= -1 Err#2
89795/0x1bfacf:  open_nocancel("/usr/lib/libf77lapack.la\0", 0x0,
0x1B6)		 = -1 Err#2
89795/0x1bfacf:  open_nocancel("libf77lapack.la\0", 0x0, 0x1B6)		 = -1 Err#2
89795/0x1bfacf:  access("/usr/local/lib/libf77lapack.so\0", 0x4,
0x10060A800)		 = -1 Err#2
89795/0x1bfacf:  access("/usr/local/lib/libf77lapack.so\0", 0x4,
0x10060A800)		 = -1 Err#2
89795/0x1bfacf:  access("/lib/libf77lapack.so\0", 0x4, 0x10060A800)		 = -1 Err#2
89795/0x1bfacf:  access("/usr/lib/libf77lapack.so\0", 0x4,
0x10060A800)		 = -1 Err#2
89795/0x1bfacf:  stat64("libf77lapack.so\0", 0x7FFF5FBFE630,
0x7FFF5FBFEC70)		 = -1 Err#2
89795/0x1bfacf:  stat64("/Users/mellis/lib/libf77lapack.so\0",
0x7FFF5FBFEA10, 0x7FFF5FBFEC70)		 = -1 Err#2
89795/0x1bfacf:  stat64("/usr/local/lib/libf77lapack.so\0",
0x7FFF5FBFEA10, 0x7FFF5FBFEC70)		 = -1 Err#2
89795/0x1bfacf:  stat64("/usr/lib/libf77lapack.so\0", 0x7FFF5FBFEA20,
0x7FFF5FBFEC70)		 = -1 Err#2
89795/0x1bfacf:  sigprocmask(0x1, 0x0, 0x7FFF5FBFEEC0)		 = 0x0 0
89795/0x1bfacf:  sigaltstack(0x0, 0x7FFF5FBFEEB0, 0x0)		 = 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)		 = 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



  reply	other threads:[~2011-03-03 16:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-02 20:07 FFI on OS X? Michael Ellis
2011-03-02 20:23 ` Hans Aberg
2011-03-02 21:22 ` Andy Wingo
2011-03-02 22:15   ` Hans Aberg
2011-03-03  9:25     ` Andy Wingo
2011-03-03  9:48       ` Hans Aberg
2011-03-03 14:36         ` Andreas Rottmann
2011-03-03 16:53           ` Michael Ellis [this message]
2011-03-03 19:49             ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTin9UrztOHYw3AYu9187mWEoJY-=bVyY7gdTp1+5@mail.gmail.com' \
    --to=michael.f.ellis@gmail.com \
    --cc=a.rottmann@gmx.at \
    --cc=bug-guile@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).