Thread: cube and earthdistance diffs

cube and earthdistance diffs

From
Bruno Wolff III
Date:
I added some earth distance stuff based on cube instead of point to the
earthdistance contrib. I corrected a problem with the original earthdistance
and also used a better way to calcuate distance that is more accurate for
short distances. I added regression tests. Earthdistance now depends on
contrib/cube and make in earthdistance will do a make install in cube.

I also made a couple of minor changes to cube. I changed it to use
create or replace function in the install script. I added some commented
out grant commands in the install script that shows what needs to be
done to make the functions publicly available.

Attachment

Re: cube and earthdistance diffs

From
Peter Eisentraut
Date:
Bruno Wolff III writes:

> Earthdistance now depends on contrib/cube and make in earthdistance will
> do a make install in cube.

You can't do that.  An "all" target must not install anything.  I think
it's enough to describe run-time dependencies in the documentation.  Also
note that, for example, make install for pg_dump doesn't install libpq
either.

--
Peter Eisentraut   peter_e@gmx.net


Re: cube and earthdistance diffs

From
Bruno Wolff III
Date:
On Mon, Sep 09, 2002 at 20:40:43 +0200,
  Peter Eisentraut <peter_e@gmx.net> wrote:
> Bruno Wolff III writes:
>
> > Earthdistance now depends on contrib/cube and make in earthdistance will
> > do a make install in cube.
>
> You can't do that.  An "all" target must not install anything.  I think
> it's enough to describe run-time dependencies in the documentation.  Also
> note that, for example, make install for pg_dump doesn't install libpq
> either.

I asked about that earlier and got a different response so I submitted
the patch that way.

Do you want me to rework things and resubmit the patch or do you want to
change things yourself?

Re: cube and earthdistance diffs

From
Bruno Wolff III
Date:
On Mon, Sep 09, 2002 at 14:32:06 -0500,
  Bruno Wolff III <bruno@wolff.to> wrote:
> On Mon, Sep 09, 2002 at 20:40:43 +0200,
>   Peter Eisentraut <peter_e@gmx.net> wrote:
> > Bruno Wolff III writes:
> >
> > > Earthdistance now depends on contrib/cube and make in earthdistance will
> > > do a make install in cube.
> >
> > You can't do that.  An "all" target must not install anything.  I think
> > it's enough to describe run-time dependencies in the documentation.  Also
> > note that, for example, make install for pg_dump doesn't install libpq
> > either.
>
> I asked about that earlier and got a different response so I submitted
> the patch that way.
>
> Do you want me to rework things and resubmit the patch or do you want to
> change things yourself?

Reading a message in another thread makes it seem likely that I am going
to want to change things to add the grants into the creation scripts,
so I will probably need to change thinsg anyway and might as well fix
the cube install issues myself.

Re: cube and earthdistance diffs

From
Bruce Momjian
Date:
Bruno Wolff III wrote:
> > I asked about that earlier and got a different response so I submitted
> > the patch that way.
> >
> > Do you want me to rework things and resubmit the patch or do you want to
> > change things yourself?
>
> Reading a message in another thread makes it seem likely that I am going
> to want to change things to add the grants into the creation scripts,
> so I will probably need to change thinsg anyway and might as well fix
> the cube install issues myself.

Oh, I didn't realize you would have to _install_ the cube stuff to get
earthdistance compiled.   Obviously that isn't a good idea.  I think
documention the requirement for cube is enough.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: cube and earthdistance diffs

From
Bruce Momjian
Date:
Bruno Wolff III wrote:
> Reading a message in another thread makes it seem likely that I am going
> to want to change things to add the grants into the creation scripts,
> so I will probably need to change thinsg anyway and might as well fix
> the cube install issues myself.

Actually, I though that to make earthdistance, you were going to specify
cube/* as a dependency, and have that compile before earthdistance
compiled.  Maybe that would work, but earthdistance can't install cube.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: cube and earthdistance diffs

From
Bruno Wolff III
Date:
On Mon, Sep 09, 2002 at 22:16:06 -0400,
  Bruce Momjian <pgman@candle.pha.pa.us> wrote:
> Bruno Wolff III wrote:
> > Reading a message in another thread makes it seem likely that I am going
> > to want to change things to add the grants into the creation scripts,
> > so I will probably need to change thinsg anyway and might as well fix
> > the cube install issues myself.
>
> Actually, I though that to make earthdistance, you were going to specify
> cube/* as a dependency, and have that compile before earthdistance
> compiled.  Maybe that would work, but earthdistance can't install cube.

No big deal. I sent in a new patch that doesn't install cube, but instead
says to install it first in the documentation.

It isn't like the psql using libpq case, because it needs the functions to
be loadable into the database to run the regression test. The real dependency
was that to usefully install earthdistance you needed to have cube installed.
I didn't need to have it to the install on all, to it would have to be
installed to run the regression test.

I also got a regression test failure reported to me this evening on an alpha
and it turns out the was a bug in cube_enlarge that didn't cause a
regression failure on my system by luck. I submitted a patch for it tonight.
It doesn't touch anything changed by my other patch and can be applied
either before or after the other one. I also changed a couple of ints to
int4s to match the sql declarations used for the functions.

Re: cube and earthdistance diffs

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Actually, I though that to make earthdistance, you were going to specify
> cube/* as a dependency, and have that compile before earthdistance
> compiled.  Maybe that would work, but earthdistance can't install cube.

Agreed, but I'm missing why you'd even need to build cube first.  Surely
all that's really needed to compile earthdistance is access to cube's .h
files?  Just put -I$(srcdir)/../cube into earthdistance's CPPFLAGS.

            regards, tom lane

Re: cube and earthdistance diffs

From
Bruno Wolff III
Date:
On Tue, Sep 10, 2002 at 09:18:17 -0400,
  Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Actually, I though that to make earthdistance, you were going to specify
> > cube/* as a dependency, and have that compile before earthdistance
> > compiled.  Maybe that would work, but earthdistance can't install cube.
>
> Agreed, but I'm missing why you'd even need to build cube first.  Surely
> all that's really needed to compile earthdistance is access to cube's .h
> files?  Just put -I$(srcdir)/../cube into earthdistance's CPPFLAGS.

To do the installcheck for earth distance cube needs to be installed.

I think part of my problem was being used to checks being done after make all,
but before make install. I think for contrib, you would have to build
a different install script from the .in file that would specify to load
the files from the current directory instead of the installed library location.

It just seems easier in this case to tell people to make and install cube
before trying to install and check earthdistance.