From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Johan Hidding Newsgroups: gmane.lisp.guile.user Subject: using GSL with cblas via FFI Date: Thu, 24 Mar 2011 15:54:01 +0100 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001636ed68e5e6bc70049f3ba588 X-Trace: dough.gmane.org 1300978467 11010 80.91.229.12 (24 Mar 2011 14:54:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 24 Mar 2011 14:54:27 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Mar 24 15:54:24 2011 Return-path: Envelope-to: guile-user@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 1Q2lvZ-0000kp-MN for guile-user@m.gmane.org; Thu, 24 Mar 2011 15:54:22 +0100 Original-Received: from localhost ([127.0.0.1]:34953 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2lvZ-00006B-11 for guile-user@m.gmane.org; Thu, 24 Mar 2011 10:54:21 -0400 Original-Received: from [140.186.70.92] (port=60890 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2lvJ-000066-8O for guile-user@gnu.org; Thu, 24 Mar 2011 10:54:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q2lvI-0000gz-1i for guile-user@gnu.org; Thu, 24 Mar 2011 10:54:05 -0400 Original-Received: from mail-pz0-f41.google.com ([209.85.210.41]:63572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q2lvH-0000go-Nv for guile-user@gnu.org; Thu, 24 Mar 2011 10:54:03 -0400 Original-Received: by pzk32 with SMTP id 32so4691pzk.0 for ; Thu, 24 Mar 2011 07:54:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=lDKTPG3p+lxMQY35IX60afixI9MTJ1FWZo60FntQE7g=; b=JX9v7sBUPKR7eveIPpE9r6/1fAKrDBv6JzOb8rDkisaWySpsoJZ/ll9SyaVjOSJDa8 /wnzLbp+y262Z7lPNEif7zUY508HF5VjwNN9nCQrKq/M6JfwG+2BAh7ephLASMchT3rQ pdLpKmF7vX5CnoXQRB6Ptv3ZbD8fjgKQV2fPc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=e7Dl1vNBfPe4xkfZTI2I8M7HrZF/FfPJ9TaqqTtIAW54dIiA8zV975Rf3cvxMXVmb5 jeOjkvkfyc7jRFIT3kXzsQ5JTkosln3+uXBv6BBj8O7nxz6BYjO1GwdhG/ESyRLWQqob tY/Cgi4gs8iQVZTZwH9Q8Ae27k9FUJwCb0FsY= Original-Received: by 10.142.249.42 with SMTP id w42mr5340424wfh.233.1300978442091; Thu, 24 Mar 2011 07:54:02 -0700 (PDT) Original-Received: by 10.142.217.10 with HTTP; Thu, 24 Mar 2011 07:54:01 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.41 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8551 Archived-At: --001636ed68e5e6bc70049f3ba588 Content-Type: text/plain; charset=UTF-8 Hi, I'm trying to use GSL through the FFI, but the program is not linked to libgslcblas, so it cannot find some functions. Attached a minimal example. Cheers, Johan --001636ed68e5e6bc70049f3ba588 Content-Type: text/x-scheme; charset=US-ASCII; name="minex.scm" Content-Disposition: attachment; filename="minex.scm" Content-Transfer-Encoding: base64 X-Attachment-Id: f_glnsy9vp0 Cih1c2UtbW9kdWxlcyAoc3lzdGVtIGZvcmVpZ24pIAoJICAgICAocm5ycyBieXRldmVjdG9ycykp CgooZGVmaW5lIGxpYmdzbCAoZHluYW1pYy1saW5rICJsaWJnc2wiKSkKKGRlZmluZSBsaWJnc2xj YmxhcyAoZHluYW1pYy1saW5rICJsaWJnc2xjYmxhcyIpKQoKOz09PSBNaXNjLiB1dGlsaXR5IGZ1 bmN0aW9ucyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CjsgKG1ha2Ut Z3VhcmQpIGNyZWF0ZXMgYSBndWFyZCBjbG9zdXJlIHRoYXQgY29sbGVjdHMgb2JqZWN0cwo7IHRo YXQgaGF2ZSBtZW1vcnkgc3RvcmVkIG91dHNpZGUgdGhlIGdhcmJhZ2UgY29sbGVjdG9yIHdpdGgg dGhlaXIKOyBkZXN0cnVjdG9ycy4gaWYgdGhlIGd1YXJkIGlzIGNhbGxlZCB3aXRob3V0IGFyZ3Vt ZW50cywgYWxsCjsgb2JqZWN0cyBpbiB0aGlzIGd1YXJkIGFyZSBkZXN0cm95ZWQuCgooZGVmaW5l IChhcHBseS1saXN0IGwpCiAgKGlmIChudWxsPyBsKQogICAgJygpCiAgICAoYmVnaW4gKGFwcGx5 IChjYWFyIGwpIChjZGFyIGwpKQoJICAgKGFwcGx5LWxpc3QgKGNkciBsKSkpKSkKCihkZWZpbmUg KG1ha2UtZ3VhcmQpCiAgKGxldCAoKGNvbGxlY3Rpb24gJygpKSkKICAgIChjYXNlLWxhbWJkYSAK ICAgICAgKCgpIChhcHBseS1saXN0IGNvbGxlY3Rpb24pKQogICAgICAoKGRlc3RydWN0b3Igb2Jq KSAoc2V0ISBjb2xsZWN0aW9uIAoJCQkgIChjb25zIChsaXN0IGRlc3RydWN0b3Igb2JqKSBjb2xs ZWN0aW9uKSkpKSkpCjs9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PQoKOz09PSBtYXRyaWNlcyA9PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CihkZWZpbmUgZ3NsLW1hdHJp eC1hbGxvYwogIChwb2ludGVyLT5wcm9jZWR1cmUgJyoKCQkgICAgICAoZHluYW1pYy1mdW5jICJn c2xfbWF0cml4X2FsbG9jIiBsaWJnc2wpCgkJICAgICAgKGxpc3Qgc2l6ZV90IHNpemVfdCkpKQoK KGRlZmluZSBnc2wtbWF0cml4LWZyZWUKICAocG9pbnRlci0+cHJvY2VkdXJlIHZvaWQKCQkgICAg ICAoZHluYW1pYy1mdW5jICJnc2xfbWF0cml4X2ZyZWUiIGxpYmdzbCkKCQkgICAgICAobGlzdCAn KikpKQoKKGRlZmluZSAobWFrZS1nc2wtbWF0cml4IG4gbSBndWFyZCkKICAobGV0ICgobSAoZ3Ns LW1hdHJpeC1hbGxvYyBuIG0pKSkKICAgIChndWFyZCBnc2wtbWF0cml4LWZyZWUgbSkKICAgIG0p KQoKKGRlZmluZSAoZ3NsLW1hdHJpeC0+YXJyYXkgTSkKICAobGV0KiAoKHJhdyAocGFyc2UtYy1z dHJ1Y3QgTSAobGlzdCBzaXplX3Qgc2l6ZV90IHNpemVfdCAnKiAnKiBpbnQpKSkKCSAobiAgIChj YXIgcmF3KSkKCSAobSAgIChjYWRyIHJhdykpCgkgKHRkYSAoY2FkZHIgcmF3KSkKCSAocHRyIChj YWRkZHIgcmF3KSkpCiAgICAobWFrZS1zaGFyZWQtYXJyYXkKICAgICAgKHBvaW50ZXItPmJ5dGV2 ZWN0b3IgcHRyICgqIHRkYSBuKSAwICdmNjQpCiAgICAgIChsYW1iZGEgeCAobGlzdCAoKyAoKiB0 ZGEgKGNhciB4KSkgKGNhZHIgeCkpKSkKICAgICAgbiBtKSkpCjs9PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQoKOz09PSB2 ZWN0b3JzID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09CihkZWZpbmUgZ3NsLXZlY3Rvci1hbGxvYwogIChwb2ludGVyLT5wcm9jZWR1cmUgJyoK CQkgICAgICAoZHluYW1pYy1mdW5jICJnc2xfdmVjdG9yX2FsbG9jIiBsaWJnc2wpCgkJICAgICAg KGxpc3Qgc2l6ZV90KSkpCgooZGVmaW5lIGdzbC12ZWN0b3ItZnJlZQogIChwb2ludGVyLT5wcm9j ZWR1cmUgdm9pZAoJCSAgICAgIChkeW5hbWljLWZ1bmMgImdzbF92ZWN0b3JfZnJlZSIgbGliZ3Ns KQoJCSAgICAgIChsaXN0ICcqKSkpCgooZGVmaW5lIChnc2wtdmVjdG9yLT5hcnJheSB2KQogIChs ZXQqICgocmF3ICAgIChwYXJzZS1jLXN0cnVjdCB2IChsaXN0IHNpemVfdCBzaXplX3QgJyogJyog aW50KSkpCgkgKHNpemUgICAoY2FyIHJhdykpCgkgKHN0cmlkZSAoY2FkciByYXcpKQoJIChwdHIg ICAgKGNhZGRyIHJhdykpKQogICAgKHBvaW50ZXItPmJ5dGV2ZWN0b3IgcHRyIHNpemUgMCAnZjY0 KSkpCgooZGVmaW5lIChtYWtlLWdzbC12ZWN0b3IgbiBndWFyZCkKICAobGV0ICgodiAoZ3NsLXZl Y3Rvci1hbGxvYyBuKSkpCiAgICAoZ3VhcmQgZ3NsLXZlY3Rvci1mcmVlIHYpCiAgICB2KSkKOz09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09Cgo7PT09IHBlcm11dGF0aW9ucyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT0KKGRlZmluZSBwZXJtdXRhdGlvbi1hbGxvYwogIChwb2lu dGVyLT5wcm9jZWR1cmUgJyoKCQkgICAgICAoZHluYW1pYy1mdW5jICJnc2xfcGVybXV0YXRpb25f YWxsb2MiIGxpYmdzbCkKCQkgICAgICAobGlzdCBzaXplX3QpKSkKCihkZWZpbmUgcGVybXV0YXRp b24tZnJlZQogIChwb2ludGVyLT5wcm9jZWR1cmUgdm9pZAoJCSAgICAgIChkeW5hbWljLWZ1bmMg ImdzbF9wZXJtdXRhdGlvbl9mcmVlIiBsaWJnc2wpCgkJICAgICAgKGxpc3QgJyopKSkKCihkZWZp bmUgKG1ha2UtcGVybXV0YXRpb24gbiBndWFyZCkKICAobGV0ICgocCAocGVybXV0YXRpb24tYWxs b2MgbikpKQogICAgKGd1YXJkIHBlcm11dGF0aW9uLWZyZWUgcCkKICAgIHApKQo7PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT0KCjs9PT0gbGluZWFyIGFsZ2VicmEgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PQoKOz09PSB0aGlzIGNvdWxkIGJlIGVhc2llciwgbmVlZCBhIGMtcG9p bnRlciB0byBhIHNpbmdsZSBpbnQgPT09CihkZWZpbmUgKGR5bmFtaWMtaW50KSAKICAobWFrZS1i eXRldmVjdG9yIChzaXplb2YgaW50KSkpCihkZWZpbmUgKGR5bmFtaWMtaW50LT5wb2ludGVyIGRp KSAKICAoYnl0ZXZlY3Rvci0+cG9pbnRlciBkaSkpCihkZWZpbmUgKGR5bmFtaWMtaW50LT5pbnQg ZGkpIAogIChieXRldmVjdG9yLXNpbnQtcmVmIGRpIDAgKG5hdGl2ZS1lbmRpYW5uZXNzKSAoc2l6 ZW9mIGludCkpKQo7PT09PT09CgooZGVmaW5lIGxpbmFsZy1MVS1kZWNvbXAKICAocG9pbnRlci0+ cHJvY2VkdXJlIGludAoJCSAgICAgIChkeW5hbWljLWZ1bmMgImdzbF9saW5hbGdfTFVfZGVjb21w IiBsaWJnc2wpCgkJICAgICAgKGxpc3QgJyogJyogJyopKSkKCihkZWZpbmUgbGluYWxnLUxVLXNv bHZlCiAgKHBvaW50ZXItPnByb2NlZHVyZSBpbnQKCQkgICAgICAoZHluYW1pYy1mdW5jICJnc2xf bGluYWxnX0xVX3NvbHZlIiBsaWJnc2wpCgkJICAgICAgKGxpc3QgJyogJyogJyogJyopKSkKCihk ZWZpbmUgbGluYWxnLUxVLWRldAogIChwb2ludGVyLT5wcm9jZWR1cmUgZG91YmxlCgkJICAgICAg KGR5bmFtaWMtZnVuYyAiZ3NsX2xpbmFsZ19MVV9kZXQiIGxpYmdzbCkKCQkgICAgICAobGlzdCAn KiBpbnQpKSkKCihkZWZpbmUgKG1ha2UtbGluYWxnLWRldCBuIGd1YXJkKQogIChsZXQgKChwZXJt IChtYWtlLXBlcm11dGF0aW9uIG4gZ3VhcmQpKQoJKHNnbiAoZHluYW1pYy1pbnQpKSkKICAgIChs YW1iZGEgKG0pCiAgICAgIChsaW5hbGctTFUtZGVjb21wIG0gcGVybSAoZHluYW1pYy1pbnQtPnBv aW50ZXIgc2duKSkKICAgICAgKGxpbmFsZy1MVS1kZXQgbSAoZHluYW1pYy1pbnQtPmludCBzZ24p KSkpKQoKKGRlZmluZSAobWFrZS1saW5hbGctc29sdmUgbiBndWFyZCkKICAobGV0ICgocGVybSAo bWFrZS1wZXJtdXRhdGlvbiBuIGd1YXJkKSkKCShzZ24gKGR5bmFtaWMtaW50KSkpCiAgICAobGFt YmRhIChBIGIgeCkKICAgICAgKGxpbmFsZy1MVS1kZWNvbXAgQSBwZXJtIChkeW5hbWljLWludC0+ cG9pbnRlciBzZ24pKQogICAgICAobGluYWxnLUxVLXNvbHZlIEEgcGVybSBiIHgpKSkpCgo7PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT0KKGRlZmluZSAocmFuZG9taXplLXRpbWVyKQogIChsZXQgKCh0aW1lIChnZXR0aW1l b2ZkYXkpKSkKICAgIChzZXQhICpyYW5kb20tc3RhdGUqCiAgICAgIChzZWVkLT5yYW5kb20tc3Rh dGUgKCsgKGNhciB0aW1lKQkKCQkJICAgICAoY2RyIHRpbWUpKSkpKSkKKGxldCogKChndWFyZCAo bWFrZS1ndWFyZCkpCiAgICAgICAoYiAobWFrZS1nc2wtdmVjdG9yIDUgZ3VhcmQpKQogICAgICAg KGItdmVjIChnc2wtdmVjdG9yLT5hcnJheSBiKSkKICAgICAgICh4IChtYWtlLWdzbC12ZWN0b3Ig NSBndWFyZCkpCiAgICAgICAoeC12ZWMgKGdzbC12ZWN0b3ItPmFycmF5IGIpKQogICAgICAgKEEg KG1ha2UtZ3NsLW1hdHJpeCA1IDUgZ3VhcmQpKQogICAgICAgKEEtdmVjIChnc2wtbWF0cml4LT5h cnJheSBBKSkKICAgICAgIChkZXQgKG1ha2UtbGluYWxnLWRldCA1IGd1YXJkKSkKICAgICAgIChz b2x2ZSAobWFrZS1saW5hbGctc29sdmUgNSBndWFyZCkpKQoKICAocmFuZG9taXplLXRpbWVyKQog IChhcnJheS1pbmRleC1tYXAhIChhcnJheS1jb250ZW50cyBBLXZlYykgKGxhbWJkYSBYIChyYW5k b206bm9ybWFsKSkpCiAgKGFycmF5LWluZGV4LW1hcCEgKGFycmF5LWNvbnRlbnRzIGItdmVjKSAo bGFtYmRhIFggKHJhbmRvbTpub3JtYWwpKSkKCiAgKGRpc3BsYXkgQS12ZWMpIChuZXdsaW5lKQog IChkaXNwbGF5IGItdmVjKSAobmV3bGluZSkKICAoZGlzcGxheSAiPT09PT09PT09PT09PT09PT0i KSAobmV3bGluZSkKICAoZGlzcGxheSAoZGV0IEEpKSAobmV3bGluZSkKCiAgKHNvbHZlIEEgYiB4 KQogIChkaXNwbGF5IHgtdmVjKSAobmV3bGluZSkKCiAgKGd1YXJkKSkKCg== --001636ed68e5e6bc70049f3ba588--