Thread: Suggestion: Which Binary?
Dear PostgreSQL Hackers, I recently ran into an issue where I was having trouble compiling PostgreSQL with PL/Perl. Although Mac OS X 10.4 comes with a dynamic Perl, I long ago compiled my own Perl, which is static. So /usr/bin/ perl was my static Perl, and /usr/bin/perl5.8.6 is the stock Perl. But of course, PostgreSQL's configure script was just executing 'perl' and finding it in the path, thus getting my static Perl which, of course, wouldn't work. I got 'round this by temporarily moving things around: rm /usr/bin/perl ln /usr/bin/perl5.8.6 /usr/bin/perl ./configure --with-perl rm /usr/bin/perlo ln /usr/local/bin/perl5.8.8/usr/bin/perl But that's a PITA. I'd much rather have been able to tell configure *which* perl to use: ./configure --with-perl=/usr/bin/perl5.8.6 Would it be possible to add support for an optional argument to the PL/* options (--with-perl,--with-python, --with-tcl) so that we can get it to use the correct binary without having to resort to any shenanigans? Just an idea. Thanks! David
David Wheeler wrote: > But that's a PITA. I'd much rather have been able to tell configure > *which* perl to use: > > ./configure --with-perl=/usr/bin/perl5.8.6 > > Would it be possible to add support for an optional argument to the PL/* > options (--with-perl,--with-python, --with-tcl) so that we can get it to > use the correct binary without having to resort to any shenanigans? Like passing PERL=/usr/bin/perl5.8.6 to configure? -- Seneca Cunningham scunning@ca.afilias.info
On Mar 31, 2006, at 12:05, Seneca Cunningham wrote: > Like passing PERL=/usr/bin/perl5.8.6 to configure? Is that currently supported? Because, if so, it's documented AFAICT. Best, David
People: > ./configure --with-perl=/usr/bin/perl5.8.6 In support of David's suggestion, I'll point out that most other OSS software configuration scripts (Apache, PHP, etc.) I deal with supports the above syntax. -- --Josh Josh Berkus Aglio Database Solutions San Francisco
On Mar 31, 2006, at 12:40, Josh Berkus wrote: > In support of David's suggestion, I'll point out that most other OSS > software configuration scripts (Apache, PHP, etc.) I deal with > supports > the above syntax. Yes, but even the environment variables get me what I want. I therefore respectfully submit the attached patch to document them in the INSTALL file. Best, David
Attachment
David Wheeler <david@kineticode.com> writes: > But that's a PITA. I'd much rather have been able to tell configure > *which* perl to use: > ./configure --with-perl=/usr/bin/perl5.8.6 The more usual way to handle this sort of thing is to put each version of perl in a different directory, and then you can alter PATH while running configure to pick which one you want. I've got several versions of perl on this machine that I select that way ... it doesn't require any special smarts on the part of the perl-using program, and it scales to handle multiple versions of other things like Tcl, too. regards, tom lane
David Wheeler <david@kineticode.com> writes: > Yes, but even the environment variables get me what I want. I > therefore respectfully submit the attached patch to document them in > the INSTALL file. It seems rather pointless to document two instances of what is in fact a generic autoconf-script behavior ... regards, tom lane
On Mar 31, 2006, at 15:52, Tom Lane wrote: > The more usual way to handle this sort of thing is to put each version > of perl in a different directory, and then you can alter PATH while > running configure to pick which one you want. I've got several > versions > of perl on this machine that I select that way ... it doesn't require > any special smarts on the part of the perl-using program, and it > scales > to handle multiple versions of other things like Tcl, too. I would normally do that, as well, but in this case, I wanted my self- compiled Perl to always be what runs (as a general rule), so I had it hard link itself in /usr/bin as well as /usr/local/bin. It is only in this one case where I need the stock Perl to be found that things get wonky for me. :-) Best, David
On Mar 31, 2006, at 16:01, Tom Lane wrote: > It seems rather pointless to document two instances of what is in fact > a generic autoconf-script behavior ... I'm sorry to be such a moron about this, but what exactly is that behavior? That you can specify an environment variable for whatever * is in --with-*? Thanks, David
On Fri, Mar 31, 2006 at 06:52:51PM -0500, Tom Lane wrote: > David Wheeler <david@kineticode.com> writes: > > But that's a PITA. I'd much rather have been able to tell configure > > *which* perl to use: > > > ./configure --with-perl=/usr/bin/perl5.8.6 > > The more usual way to handle this sort of thing is to put each > version of perl in a different directory, and then you can alter > PATH while running configure to pick which one you want. I've got > several versions of perl on this machine that I select that way ... > it doesn't require any special smarts on the part of the perl-using > program, and it scales to handle multiple versions of other things > like Tcl, too. You mean something more like this? PATH=/path/to/perl:/usr/bin:/bin ./configure ... Sounds good, except when the perl people have in mind is on the same path as other perls. How would changing $PATH help with a situation like that? Cheers, D -- David Fetter <david@fetter.org> http://fetter.org/ phone: +1 415 235 3778 AIM: dfetter666 Skype: davidfetter Remember to vote!
David Wheeler <david@kineticode.com> writes: > On Mar 31, 2006, at 16:01, Tom Lane wrote: >> It seems rather pointless to document two instances of what is in fact >> a generic autoconf-script behavior ... > I'm sorry to be such a moron about this, but what exactly is that > behavior? That you can specify an environment variable for whatever * > is in --with-*? The generic autoconf documentation says You can give `configure' initial values for configuration parameters by setting variables in the command line or in theenvironment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix This isn't super helpful, of course, since it doesn't say exactly which variables any particular autoconf script responds to. But pretty much all of the programs that a configure script searches for are reflected as variables. A quick grep through our configure script for the phrase "Let the user override" finds a couple dozen hits, and that's just for programs, never mind non-program variables. regards, tom lane
David Wheeler wrote: > Yes, but even the environment variables get me what I want. I > therefore respectfully submit the attached patch to document them in > the INSTALL file. Next time you submit a patch, please consider reading it before sending it out. -- Peter Eisentraut http://developer.postgresql.org/~petere/
On Fri, Mar 31, 2006 at 07:01:18PM -0500, Tom Lane wrote: > David Wheeler <david@kineticode.com> writes: > > Yes, but even the environment variables get me what I want. I > > therefore respectfully submit the attached patch to document them in > > the INSTALL file. > > It seems rather pointless to document two instances of what is in fact > a generic autoconf-script behavior ... The problem is that PostgreSQL is moving out of the realm of "hard-core geeks only" and more into the mainstream. I'd bet a number of our users have very little idea how autoconf and it's progeny work. It's probably not unlikely that those folks would be able to figure out where their perl was, but then not know how to tell it to configure. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461
Jim C. Nasby wrote: > The problem is that PostgreSQL is moving out of the realm of > "hard-core geeks only" and more into the mainstream. Someone who has a non-default Perl installation is hardly mainstream. -- Peter Eisentraut http://developer.postgresql.org/~petere/
Jim C. Nasby wrote: >On Fri, Mar 31, 2006 at 07:01:18PM -0500, Tom Lane wrote: > > >>David Wheeler <david@kineticode.com> writes: >> >> >>>Yes, but even the environment variables get me what I want. I >>>therefore respectfully submit the attached patch to document them in >>>the INSTALL file. >>> >>> >>It seems rather pointless to document two instances of what is in fact >>a generic autoconf-script behavior ... >> >> > >The problem is that PostgreSQL is moving out of the realm of "hard-core >geeks only" and more into the mainstream. I'd bet a number of our users >have very little idea how autoconf and it's progeny work. It's probably >not unlikely that those folks would be able to figure out where their >perl was, but then not know how to tell it to configure. > > Most such users would use a binary distribution, though - either from the OS supplier or from our collection of binaries. If people are going to build postgres themselves from source then I *do* expect them to be moderately hard-core geeks. cheers andrew
On Mar 31, 2006, at 20:02, Tom Lane wrote: > You can give `configure' initial values for configuration > parameters > by setting variables in the command line or in the environment. > Here > is an example: > > ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix > > This isn't super helpful, of course, since it doesn't say exactly > which > variables any particular autoconf script responds to. But pretty much > all of the programs that a configure script searches for are reflected > as variables. A quick grep through our configure script for the > phrase > "Let the user override" finds a couple dozen hits, and that's just for > programs, never mind non-program variables. Right, but me, while I compile lots of stuff, I don't understand configure or autconf at all. So I was completely unaware of this feature. I'm very pleased to know it now, of course. But I don't see how it could be any harm to add notes to the INSTALL file explicitly letting users know how to do stuff like this. The INSTALL file is, after all, what folks like me read when looking for information beyond ./configure && make && make install. It would have helped me a lot, and I see no disadvantage to including it. Am I missing something? Thanks, David
On Apr 1, 2006, at 06:58, Peter Eisentraut wrote: > Next time you submit a patch, please consider reading it before > sending > it out. I just read the patch, and it looks fine to me. No typos that I noticed. I might have screwed up the SGML stuff, but I know even less about SGML than I do about autoconf and configure. :-) So, pray tell, what have I screwed up? I would of course be happy to submit a corrected patch. Best, David
On Apr 1, 2006, at 15:39, David Wheeler wrote: > So, pray tell, what have I screwed up? I would of course be happy > to submit a corrected patch. Sorry, I'm an idiot. New version attached. Best, David
Attachment
David Wheeler wrote: > On Apr 1, 2006, at 15:39, David Wheeler wrote: > > So, pray tell, what have I screwed up? I would of course be happy > > to submit a corrected patch. > > Sorry, I'm an idiot. New version attached. Well, you got one of them, but I still have my doubts about "/usr/bin/per5.8.6". -- Peter Eisentraut http://developer.postgresql.org/~petere/
On Apr 1, 2006, at 15:49, Peter Eisentraut wrote: > Well, you got one of them, but I still have my doubts about > "/usr/bin/per5.8.6". LOL! God, what an oaf! David
Attachment
David Wheeler <david@kineticode.com> writes: > Right, but me, while I compile lots of stuff, I don't understand > configure or autconf at all. So I was completely unaware of this > feature. I'm very pleased to know it now, of course. But I don't see > how it could be any harm to add notes to the INSTALL file explicitly > letting users know how to do stuff like this. Just to clarify my point: what'd make sense to me is to describe this generic autoconf behavior, and maybe include a small table listing some of the more-likely-to-be-useful variables. ("configure --help" already does that, on a very small scale.) It doesn't make much sense to me to document two specific variables in a way that fails to draw the reader's attention to the fact that there are many other ones. After all, the reader might have some other problem to solve than "use this perl". If he knows that there might be a way to solve it by setting a variable, he's ahead of the game. regards, tom lane
On Saturday 01 April 2006 10:47, Andrew Dunstan wrote: > Jim C. Nasby wrote: > >On Fri, Mar 31, 2006 at 07:01:18PM -0500, Tom Lane wrote: > >>David Wheeler <david@kineticode.com> writes: > >>>Yes, but even the environment variables get me what I want. I > >>>therefore respectfully submit the attached patch to document them in > >>>the INSTALL file. > >> > >>It seems rather pointless to document two instances of what is in fact > >>a generic autoconf-script behavior ... > > > >The problem is that PostgreSQL is moving out of the realm of "hard-core > >geeks only" and more into the mainstream. I'd bet a number of our users > >have very little idea how autoconf and it's progeny work. It's probably > >not unlikely that those folks would be able to figure out where their > >perl was, but then not know how to tell it to configure. > > Most such users would use a binary distribution, though - either from > the OS supplier or from our collection of binaries. If people are going > to build postgres themselves from source then I *do* expect them to be > moderately hard-core geeks. > ISTM that by any measure of the general population, David Wheeler is a hard-core geek. :-) Actually by most measures of the "programming/oss community" he is a hard core geek. But he still got tripped up by this. A lot of people never get passed ./configure;make;make install even though they do a lot of coding on oss projects. Why turn these people away? -- Robert Treat Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
Robert Treat <xzilla@users.sourceforge.net> writes: > ISTM that by any measure of the general population, David Wheeler is a > hard-core geek. :-) Actually by most measures of the "programming/oss > community" he is a hard core geek. But he still got tripped up by this. A > lot of people never get passed ./configure;make;make install even though they > do a lot of coding on oss projects. Why turn these people away? I didn't say anything about turning people away; I said that I didn't like this particular approach to documenting the behavior. See http://archives.postgresql.org/pgsql-hackers/2006-04/msg00026.php regards, tom lane
On Apr 2, 2006, at 17:47, Robert Treat wrote: > ISTM that by any measure of the general population, David Wheeler is a > hard-core geek. :-) Actually by most measures of the "programming/ > oss > community" he is a hard core geek. But he still got tripped up by > this. A > lot of people never get passed ./configure;make;make install even > though they > do a lot of coding on oss projects. Why turn these people away? /me blushes Maybe I am a hard-core OSS hacker, I'm just not a C hacker (and not familiar with the OSS C distribution stuff). But I'd be happy to work on a patch that creates a table like that described by Tom. I think that would help folks like me (and even soft core OSS hackers ;-)) a lot. Cheers, David
On Apr 1, 2006, at 16:37, Tom Lane wrote: > Just to clarify my point: what'd make sense to me is to describe this > generic autoconf behavior, and maybe include a small table listing > some > of the more-likely-to-be-useful variables. ("configure --help" > already > does that, on a very small scale.) It doesn't make much sense to > me to > document two specific variables in a way that fails to draw the > reader's > attention to the fact that there are many other ones. After all, the > reader might have some other problem to solve than "use this > perl". If > he knows that there might be a way to solve it by setting a variable, > he's ahead of the game. Agreed. I've started with this, at least, in ./configure --help *** configure 06 Mar 2006 09:41:42 -0800 1.485 --- configure 03 Apr 2006 12:41:47 -0700 *************** *** 907,912 **** --- 907,915 ---- LDFLAGS_SL DOCBOOKSTYLE location of DocBook stylesheets + PERL location of perl executable + PYTHON location of python executable + TCL location of tcl executable Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. But I'm not sure what other variables are supported. I'd *really* like to know, for example, if there's a READLINE variable, so that I can point it at GNU readline instead of Mac OS X's crappy readline. And are there also variables for tclconfig, krb5, pam, ldap, bonjour, openssl, zlib, and ld? And if so, what do they point at, since some of these are not execurables (e.g., readline)? I'll submit a more complete patch, along with a patch to INSTALL, once I get a more complete list via replies to the above questions from you kind folks. Thanks! David
David Wheeler wrote: > But I'm not sure what other variables are supported. I'm not sure if this list is complete, but it's a good approximation: AWK CC CFLAGS COLLATEINDEX CPP CPPFLAGS DOCBOOKSTYLE JADE LDFLAGS LDFLAGS_SL LORDER MSGFMT MSGMERGE NSGMLS PERL PTHREAD_CC PYTHON RANLIB SGMLSPL STRIP TAR TCLSH XGETTEXT YACC -- Peter Eisentraut http://developer.postgresql.org/~petere/
On Apr 3, 2006, at 13:08, Peter Eisentraut wrote: > I'm not sure if this list is complete, but it's a good approximation: Thanks. How's this, then? Best, David
Attachment
David Wheeler wrote: > On Apr 3, 2006, at 13:08, Peter Eisentraut wrote: > > >I'm not sure if this list is complete, but it's a good approximation: > > Thanks. How's this, then? Too verbose :-( How about putting the most important in configure, and the rest in a text file? Configure can then say "Some of them are here, the rest can be found in file such-and-such". -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support
David Wheeler wrote: > On Apr 3, 2006, at 13:08, Peter Eisentraut wrote: > > I'm not sure if this list is complete, but it's a good > > approximation: > > Thanks. How's this, then? configure is autogenerated. You can't patch in there. -- Peter Eisentraut http://developer.postgresql.org/~petere/
On Apr 3, 2006, at 13:37, Alvaro Herrera wrote: > Too verbose :-( How about putting the most important in configure, > and > the rest in a text file? Configure can then say "Some of them are > here, > the rest can be found in file such-and-such". Yeah, I'll create a table for INSTALL. Best, David
On Apr 3, 2006, at 13:44, Peter Eisentraut wrote: > configure is autogenerated. You can't patch in there. Oh. Duh. I'll grep for it. D
On Apr 3, 2006, at 13:49, David Wheeler wrote: >> configure is autogenerated. You can't patch in there. > > Oh. Duh. I'll grep for it. Hrm. Is there a file somewhere from which the environment variable section is generated? Or is it just created by autoconf? Thanks, David
David Wheeler <david@kineticode.com> writes: > Hrm. Is there a file somewhere from which the environment variable > section is generated? Or is it just created by autoconf? I believe that most of the "configure --help" text is autogenerated by autoconf, and you're probably not going to have much luck altering it (short of hacking the local autoconf installation, which isn't going to fly). I would suggest handling this strictly as an addition to our installation.sgml docs. regards, tom lane
David Wheeler wrote: > Hrm. Is there a file somewhere from which the environment variable > section is generated? Or is it just created by autoconf? Compare with AC_ARG_VAR(DOCBOOKSTYLE, [location of DocBook stylesheets])dnl -- Peter Eisentraut http://developer.postgresql.org/~petere/
Robert Treat wrote: >>>The problem is that PostgreSQL is moving out of the realm of "hard-core >>>geeks only" and more into the mainstream. I'd bet a number of our users >>>have very little idea how autoconf and it's progeny work. It's probably >>>not unlikely that those folks would be able to figure out where their >>>perl was, but then not know how to tell it to configure. >>> >>> >>Most such users would use a binary distribution, though - either from >>the OS supplier or from our collection of binaries. If people are going >>to build postgres themselves from source then I *do* expect them to be >>moderately hard-core geeks. >> >> >> > >ISTM that by any measure of the general population, David Wheeler is a >hard-core geek. :-) Actually by most measures of the "programming/oss >community" he is a hard core geek. But he still got tripped up by this. A >lot of people never get passed ./configure;make;make install even though they >do a lot of coding on oss projects. Why turn these people away? > > Robert, You missed my point completely. I am not saying we should turn away people like David. In fact, it was me who suggested to him that he should write to -hackers on this subject. All I was saying was that we should not feel a need to tailor the configure script for people who aren't hard core geeks, as Jim was suggesting. I agree that we should help people like David. cheers andrew
Jim C. Nasby wrote: > On Fri, Mar 31, 2006 at 07:01:18PM -0500, Tom Lane wrote: >> David Wheeler <david@kineticode.com> writes: >>> Yes, but even the environment variables get me what I want. I >>> therefore respectfully submit the attached patch to document them in >>> the INSTALL file. >> It seems rather pointless to document two instances of what is in fact >> a generic autoconf-script behavior ... > > The problem is that PostgreSQL is moving out of the realm of "hard-core > geeks only" and more into the mainstream. I'd bet a number of our users > have very little idea how autoconf and it's progeny work. It's probably > not unlikely that those folks would be able to figure out where their > perl was, but then not know how to tell it to configure. Not to mention that it is very popular to be able to specify a specific version of a binary/language. Just a couple of projects that allow you to do it now with a --with type configure statement: subversion mod_python (just about any python module) Joshua D. Drake -- === The PostgreSQL Company: Command Prompt, Inc. === Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 Providing the most comprehensive PostgreSQL solutions since 1997 http://www.commandprompt.com/
On Apr 3, 2006, at 14:37, Tom Lane wrote: > I would suggest handling this strictly as an addition to our > installation.sgml docs. Finally got 'round to this. Patch attached. There are quite a few environment variables in the list that Peter sent to me that I know nothing about. These I've listed, but the documentation for them is full of "??"s. You can either fill them in, leave them out, or tell me where to learn what they mean and I'll resubmit the patch. And by the way, Tom, I really appreciate the time you take to answer my questions and point me to where I can create a patch to help the project. It's people like you who create really successful open- source projects, just by being so responsive and helpful. Now that's leadership! Best, David
Attachment
Your patch has been added to the PostgreSQL unapplied patches list at: http://momjian.postgresql.org/cgi-bin/pgpatches It will be applied as soon as one of the PostgreSQL committers reviews and approves it. --------------------------------------------------------------------------- David Wheeler wrote: > On Apr 3, 2006, at 14:37, Tom Lane wrote: > > > I would suggest handling this strictly as an addition to our > > installation.sgml docs. > > Finally got 'round to this. Patch attached. There are quite a few > environment variables in the list that Peter sent to me that I know > nothing about. These I've listed, but the documentation for them is > full of "??"s. You can either fill them in, leave them out, or tell > me where to learn what they mean and I'll resubmit the patch. > > And by the way, Tom, I really appreciate the time you take to answer > my questions and point me to where I can create a patch to help the > project. It's people like you who create really successful open- > source projects, just by being so responsive and helpful. Now that's > leadership! > > Best, > > David > [ Attachment, skipping... ] > > ---------------------------(end of broadcast)--------------------------- > TIP 6: explain analyze is your friend -- Bruce Momjian http://candle.pha.pa.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. +
On Apr 21, 2006, at 13:54, Bruce Momjian wrote: > Your patch has been added to the PostgreSQL unapplied patches list at: > > http://momjian.postgresql.org/cgi-bin/pgpatches > > It will be applied as soon as one of the PostgreSQL committers reviews > and approves it. Cool, thanks Bruce. Best, David