Home > Archive > PostgreSQL Hacks > April 2006 > Suggestion: Which Binary?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Suggestion: Which Binary?
David Wheeler

2006-03-31, 8:27 pm

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

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Seneca Cunningham

2006-03-31, 8:27 pm

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

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

David Wheeler

2006-03-31, 8:27 pm

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

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Josh Berkus

2006-03-31, 8:27 pm

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

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

David Wheeler

2006-03-31, 8:27 pm

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

Tom Lane

2006-03-31, 8:27 pm

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

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql
.org so that your
message can get through to the mailing list cleanly

Tom Lane

2006-03-31, 8:27 pm

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

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

David Wheeler

2006-03-31, 8:27 pm

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

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

David Wheeler

2006-03-31, 8:27 pm

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

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

David Fetter

2006-03-31, 8:27 pm

On Fri, Mar 31, 2006 at 06:52:51PM -0500, Tom Lane wrote:
> David Wheeler <david@kineticode.com> writes:
>
>
> 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!

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Tom Lane

2006-04-01, 3:26 am

David Wheeler <david@kineticode.com> writes:
> On Mar 31, 2006, at 16:01, Tom Lane wrote:
[color=darkred]
> 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 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.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Peter Eisentraut

2006-04-01, 9:29 am

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/

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Jim C. Nasby

2006-04-01, 9:29 am

On Fri, Mar 31, 2006 at 07:01:18PM -0500, Tom Lane wrote:
> David Wheeler <david@kineticode.com> writes:
>
> 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

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Peter Eisentraut

2006-04-01, 11:27 am

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/

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Andrew Dunstan

2006-04-01, 11:27 am



Jim C. Nasby wrote:

>On Fri, Mar 31, 2006 at 07:01:18PM -0500, Tom Lane 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.

cheers

andrew

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

David Wheeler

2006-04-01, 8:26 pm

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

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

David Wheeler

2006-04-01, 8:26 pm

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

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

David Wheeler

2006-04-01, 8:26 pm

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


Peter Eisentraut

2006-04-01, 8:27 pm

David Wheeler wrote:
> On Apr 1, 2006, at 15:39, David Wheeler wrote:
>
> 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/

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

David Wheeler

2006-04-01, 8:27 pm

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

Tom Lane

2006-04-01, 8:27 pm

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

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Robert Treat

2006-04-02, 8:28 pm

On Saturday 01 April 2006 10:47, Andrew Dunstan wrote:
> Jim C. Nasby wrote:
>
> 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

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Tom Lane

2006-04-02, 8:28 pm

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/pgsq...04/msg00026.php

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

David Wheeler

2006-04-02, 8:28 pm

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

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

David Wheeler

2006-04-03, 8:27 pm

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


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Peter Eisentraut

2006-04-03, 8:27 pm

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/

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

David Wheeler

2006-04-03, 8:27 pm

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

Alvaro Herrera

2006-04-03, 8:27 pm

David Wheeler wrote:
> On Apr 3, 2006, at 13:08, Peter Eisentraut wrote:
>
>
> 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

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Peter Eisentraut

2006-04-03, 8:27 pm

David Wheeler wrote:
> On Apr 3, 2006, at 13:08, Peter Eisentraut wrote:
>
> Thanks. How's this, then?


configure is autogenerated. You can't patch in there.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql
.org so that your
message can get through to the mailing list cleanly

David Wheeler

2006-04-03, 8:27 pm

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

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

David Wheeler

2006-04-03, 8:27 pm

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

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

David Wheeler

2006-04-03, 8:27 pm

On Apr 3, 2006, at 13:49, David Wheeler wrote:

>
> 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

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Tom Lane

2006-04-03, 8:27 pm

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

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Peter Eisentraut

2006-04-03, 8:27 pm

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(DOCBOOKST
YLE, [location of DocBook stylesheets])dnl

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Andrew Dunstan

2006-04-04, 7:41 am



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?
>
>


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

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com