From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark Harig Newsgroups: gmane.lisp.guile.bugs Subject: Re: Can not work with libguile-2.0 Date: Fri, 18 Feb 2011 14:42:21 -0500 Message-ID: <8CD9DBB17997622-1BBC-1DCB2@webmail-d063.sysops.aol.com> References: <1e640654.925f.12e338022b5.Coremail.lispor@163.com><8CD9CED2114C060-235C-1E45A@Webmail-m118.sysops.aol.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1298058196 25264 80.91.229.12 (18 Feb 2011 19:43:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 18 Feb 2011 19:43:16 +0000 (UTC) Cc: bug-guile@gnu.org, lispor@163.com To: wingo@pobox.com Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Feb 18 20:43:11 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 1PqWEO-0001xi-DD for guile-bugs@m.gmane.org; Fri, 18 Feb 2011 20:43:08 +0100 Original-Received: from localhost ([127.0.0.1]:37868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PqWEO-00012b-0z for guile-bugs@m.gmane.org; Fri, 18 Feb 2011 14:43:08 -0500 Original-Received: from [140.186.70.92] (port=36405 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PqWEJ-00012T-8X for bug-guile@gnu.org; Fri, 18 Feb 2011 14:43:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PqWEI-0003yc-2m for bug-guile@gnu.org; Fri, 18 Feb 2011 14:43:03 -0500 Original-Received: from imr-ma06.mx.aol.com ([64.12.78.142]:64733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PqWEH-0003yS-SG for bug-guile@gnu.org; Fri, 18 Feb 2011 14:43:01 -0500 Original-Received: from imo-ma04.mx.aol.com (imo-ma04.mx.aol.com [64.12.78.139]) by imr-ma06.mx.aol.com (8.14.1/8.14.1) with ESMTP id p1IJgU0p025028; Fri, 18 Feb 2011 14:42:30 -0500 Original-Received: from idirectscm@aim.com by imo-ma04.mx.aol.com (mail_out_v42.9.) id w.d19.52a89ef4 (37037); Fri, 18 Feb 2011 14:42:26 -0500 (EST) Original-Received: from smtprly-mb01.mx.aol.com (smtprly-mb01.mx.aol.com [64.12.207.148]) by cia-db02.mx.aol.com (v129.9) with ESMTP id MAILCIADB027-5c5b4d5ecb9d2a6; Fri, 18 Feb 2011 14:42:26 -0500 Original-Received: from webmail-d063 (webmail-d063.sim.aol.com [205.188.91.212]) by smtprly-mb01.mx.aol.com (v129.9) with ESMTP id MAILSMTPRLYMB011-5c5b4d5ecb9d2a6; Fri, 18 Feb 2011 14:42:21 -0500 X-MB-Message-Type: User Original-Received: from 98.185.24.91 by webmail-d063.sysops.aol.com (205.188.91.212) with HTTP (WebMailUI); Fri, 18 Feb 2011 14:42:21 -0500 X-AOL-IP: 98.185.24.91 X-MB-Message-Source: WebUI X-Mailer: AIM WebMail 33222-STANDARD In-Reply-To: X-AOL-SENDER: idirectscm@aim.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 64.12.78.142 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:5184 Archived-At: On Fri, Feb 18, 2011 at 09:53:27AM +0100, Andy Wingo wrote: > > > The command listed in section 2.4 "Writing Guile Extensions" > > should follow the pattern used in section 2.3 "Linking Guile into > > Programs," namely, add the 'pkg-config' command to provide the > > appropriate command-line options for the preprocessor, compiler, and > > linker. > > Really? It doesn't seem to be necessary to actually link to libguile > there. > OK. I was suggesting 'pkg-config' for simplicity (i.e., it is used in the example in the previous section, so let's continue with that recommended method of looking up environment variables). What I suggested was too simple a solution. Because statically linking libguile to libguile-bessel.so is inappropriate, the correct command is to provide the preprocessor option '-I [path to Guile's header files]'. Example: gcc -I /usr/local/include/guile/2.0 -shared \ -o libguile-bessel.so -fPIC bessel.c Then, the problem is to provide clear explanatory text on how the user can determine what value to provide to the '-I' switch. > > In addition, the manual should mention that the environment > > variable 'PKG_CONFIG_PATH' needs to be set before invoking the > > compiler. Something like the following needs to be added, along=20 with > > some explanatory text: > > > > $ export PKG_CONFIG_PATH=3D/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH > > Well that isn't quite right, as /usr/local/lib isn't the right place=20 for > libguile-2.0 on many systems. It's lib64 on my fedora machine. > It's interesting that Guile installed libguile-2.0 in /usr/local/lib64 on your system. I have not looked into the Guile installation process in detail to understand how it determines where to install its libraries. But on my system it is installing 64-bit libraries in the /usr/local/lib directory tree, while /usr/local/lib64 is empty: $ file /usr/local/lib/libguile-2.0.so.22.0.0 /usr/local/lib/libguile-2.0.so.22.0.0: ELF 64-bit LSB shared object,=20 x86-64, version 1 (SYSV), dynamically linked, not stripped $ cat /etc/fedora-release Fedora release 14 (Laughlin) > I guess we will have to add a section on install prefixes, and the > relation between -rpath, libtool, PKG_CONFIG_PATH, and > guile-config. > Then further compile/link examples can refer back (or > forwards) to it. I have not used Guile enough to comment on those specifically, but the manual should provide a description of whatever is required for users to (know that they must) specify in order to create all of the many types of files that Guile supports. > Perhaps it would be best to assume that Guile is system-installed, and > note that if linking fails, see some section at the end of=20 libguile.texi > that discusses these issues. > > What do you think? > The example command, above, that provides the '-I' preprocessor option is sufficient to get the source compiled into a valid library. It might not work on some systems if header files are in another directory tree, but at least the user has been notified about what kinds of information is needed to compile the file. In addition, some statement describing what might be required if the command fails due to variations in installations should be added. Suggested: "As stated at the beginning of this chapter, examples assume that Guile has been installed in the "/usr/local" directory tree. If you have installed Guile in another location, then you will need to adjust the value of the "-I" option accordingly." This should be useful both for those who have used a package installation that puts the files in the "/usr" directory tree (who would then be providing a redundant "-I /usr" option) and someone who provided a "-I /usr/local" or "-I /opt" option. The basic point is to provide the user with enough information to understand why the command failed for them. Otherwise, the user is left to wonder what is wrong with Guile. "I did what the manual told me to do, and yet it does not work. Did I do something wrong, or is my installation of Guile broken?" --