Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#219 closed enhancement (fixed)

Run 'make check' without needing 'make install' first

Reported by: pramsey Owned by: pramsey
Priority: medium Milestone: PostGIS 1.5.0
Component: postgis Version: master
Keywords: Cc: robe, kneufeld

Description

It seems a bit counterintuitive that running 'make check' requires you to 'make install' first. Attached for comment is a patch that allows you to run 'make check' on your local copy of libpostgis.so without installing it first.

Attachments (3)

regresslocal.patch (503 bytes ) - added by pramsey 15 years ago.
Point library path to local .so
regresslocal2.patch (705 bytes ) - added by strk 15 years ago.
patch modified to allow running make check from top-level dir
postgis-ticket-219-clean-rebuild-steps.txt (31.4 KB ) - added by mloskot 15 years ago.
make check is still failing. rebuild.sh script just calls: ./autogen.sh && ./configure && make clean && make && make comments && make check && sudo make install && sudo make comments-install

Download all attachments as: .zip

Change History (21)

by pramsey, 15 years ago

Attachment: regresslocal.patch added

Point library path to local .so

comment:1 by strk, 15 years ago

With this patch applied, running 'make check' from top-level dir uses the wrong $(PWD). We need an absolute path most likely, or making sure runtest* cd into regress before continuing.

This is a very good improvement for testing!

by strk, 15 years ago

Attachment: regresslocal2.patch added

patch modified to allow running make check from top-level dir

comment:2 by strk, 15 years ago

Resolution: fixed
Status: newclosed

I've committed the one allowing top-level run and also added dependency to build the source sql file (and as side-effect the actual library).

comment:3 by pramsey, 15 years ago

It's good to indicate the SVN revision you committed to, so that issue readers can easily click to the final changeset. In this case, r4284 on trunk.

comment:4 by mloskot, 15 years ago

Resolution: fixed
Status: closedreopened

Dear Fellows,

Unfortunately, it does not work for me under Ubuntu 9.10 (Karmic Koala, 64-bit). Here is the set of commands I usually issue to rebuild and install PostGIS from SVN trunk:

svn up && \
./autogen.sh && \
./configure && \
make clean && \
make && \
make comments && \
make check && \
sudo make install && \
sudo make comments-install

When building r4335 make check fails:

mloskot@vb-ubuntu910-x64:~/dev/postgis/_svn/trunk$ make check
/usr/bin/make -C liblwgeom 
make[1]: Entering directory `/home/mloskot/dev/postgis/_svn/trunk/liblwgeom'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/mloskot/dev/postgis/_svn/trunk/liblwgeom'
/usr/bin/make -C postgis 
make[1]: Entering directory `/home/mloskot/dev/postgis/_svn/trunk/postgis'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/mloskot/dev/postgis/_svn/trunk/postgis'
/usr/bin/make -C liblwgeom/cunit check
make[1]: Entering directory `/home/mloskot/dev/postgis/_svn/trunk/liblwgeom/cunit'


     CUnit - A Unit testing framework for C - Version 2.1-0
     http://cunit.sourceforge.net/


Suite: PostGIS Computational Geometry Suite
  Test: test_lw_segment_side() ... passed
  Test: test_lw_segment_intersects() ... passed
  Test: test_lwline_crossing_short_lines() ... passed
  Test: test_lwline_crossing_long_lines() ... passed
  Test: test_lwpoint_set_ordinate() ... passed
  Test: test_lwpoint_get_ordinate() ... passed
  Test: test_lwpoint_interpolate() ... passed
  Test: test_lwline_clip() ... passed
  Test: test_lwline_clip_big() ... passed
  Test: test_lwmline_clip() ... passed
  Test: test_geohash_point() ... passed
  Test: test_geohash_precision() ... passed
  Test: test_geohash() ... passed
Suite: PostGIS Measures Suite
  Test: test_mindistance2d_recursive_tolerance() ... passed

--Run Summary: Type      Total     Ran  Passed  Failed
               suites        2       2     n/a       0
               tests        14      14      14       0
               asserts      84      84      84       0
make[1]: Leaving directory `/home/mloskot/dev/postgis/_svn/trunk/liblwgeom/cunit'
/usr/bin/make -C regress check
/bin/sh: pushd: not found
make[1]: Entering directory `/home/mloskot/dev/postgis/_svn/trunk/regress'
sed 's,$libdir/postgis,/home/mloskot/dev/postgis/_svn/trunk/regress/../postgis/libpostgis,g' ../postgis/postgis.sql > postgis.sql
Creating spatial db postgis_reg 
ERROR:  function postgis_lib_version() does not exist
LINE 1: select postgis_lib_version()
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

 Something went wrong (no postgis installed in postgis_reg).
 For details, check /tmp/pgis_reg_17659/regress_log

make[1]: *** [check] Error 1
make[1]: Leaving directory `/home/mloskot/dev/postgis/_svn/trunk/regress'
make: *** [check] Error 2

and here is the regress log:

mloskot@vb-ubuntu910-x64:~/dev/postgis/_svn/trunk$ more /tmp/pgis_reg_17659/regress_log
BEGIN
psql:postgis.sql:53: NOTICE:  type "spheroid" is not yet defined
DETAIL:  Creating a shell type definition.
psql:postgis.sql:53: ERROR:  could not access file "/home/mloskot/dev/postgis/_svn/trunk/regress/../postgis/libpostgis-1.5": 
No such file or directory
...

There is no libpostgis-1.5.so but only postgis-1.5.so:

mloskot@vb-ubuntu910-x64:~/dev/postgis/_svn/trunk$ find . -name 'postgis*.so'
./postgis/postgis-1.5.so
mloskot@vb-ubuntu910-x64:~/dev/postgis/_svn/trunk$ find . -name 'libpostgis.so*'
mloskot@vb-ubuntu910-x64:~/dev/postgis/_svn/trunk$

So, I've reopened this ticket.

comment:5 by pramsey, 15 years ago

Try on a fresh checkout.

comment:6 by mloskot, 15 years ago

Paul,

But I was trying the most recent one - r4335. I can't see any newer revision in the repo or am I missing something?

comment:7 by pramsey, 15 years ago

I had some problems with version numbers 1.4→1.5 until I did a clean checkout. So, don't 'svn up', do a fresh 'svn co'.

comment:8 by mloskot, 15 years ago

Fresh checkout is what I did yesterday and what I tried today morning (also r4335) and still getting the same error. I attached postgis-ticket-219-clean-rebuild-steps.txt file with all the steps I follow and that lead to make check failure.

by mloskot, 15 years ago

make check is still failing. rebuild.sh script just calls: ./autogen.sh && ./configure && make clean && make && make comments && make check && sudo make install && sudo make comments-install

comment:9 by mcayland, 15 years ago

Looking at this with a fresh pair of eyes, I think the simple approach implemented in SVN trunk is wrong. This is because the name of the source library .so/.dll before the copy to the PostgreSQL installation directory can very between platforms, and so only PGXS can know the correct voodoo to install it.

I think that a better approach would be to alter the regression Makefile so that it does "make DESTDIR=regress/tmp -f ../Makefile" to install the binaries in a subdirectory under regression, and then use the files in this location which should resolve the issue.

ATB,

Mark.

comment:10 by mloskot, 15 years ago

Just keeping it up, make check is still failing (r4643):

loskot@vb-ubuntu910-x64:~/dev/postgis/_svn/trunk$ head -n4  /tmp/pgis_reg_6641/regress_log 
BEGIN
psql:postgis.sql:53: NOTICE:  type "spheroid" is not yet defined
DETAIL:  Creating a shell type definition.
psql:postgis.sql:53: ERROR:  could not access file 
 "/home/mloskot/dev/postgis/_svn/trunk/regress/../postgis/libpostgis-1.5": 
  No such file or directory

comment:11 by robe, 15 years ago

For the record — this doesn't work for me either under MingW. I always have to edit the make file and get rid of all that sed gobbly gook in the regress Makefile to get it to properly copy the .dll and sql scripts.

in reply to:  10 comment:12 by jorgearevalo, 14 years ago

Replying to mloskot:

Just keeping it up, make check is still failing (r4643):

loskot@vb-ubuntu910-x64:~/dev/postgis/_svn/trunk$ head -n4  /tmp/pgis_reg_6641/regress_log 
BEGIN
psql:postgis.sql:53: NOTICE:  type "spheroid" is not yet defined
DETAIL:  Creating a shell type definition.
psql:postgis.sql:53: ERROR:  could not access file 
 "/home/mloskot/dev/postgis/_svn/trunk/regress/../postgis/libpostgis-1.5": 
  No such file or directory

I'm having the same problem just now.

comment:13 by pramsey, 14 years ago

Between 8.3 and 8.4 PgSQL changed the name of the library from libpostgis.so to postgis.so, hence the problem.

comment:14 by pramsey, 14 years ago

Resolution: fixed
Status: reopenedclosed

Added in hack to match the library .so substition name to the one produced by a particular PgSQL version, r4840

comment:15 by mcayland, 14 years ago

I've just done a proper fix for this which will should work across all architectures/platforms using PGXS (as explained above). Please can the reporters update from SVN and try again?

ATB,

Mark.

comment:16 by pramsey, 14 years ago

Works for me against 8.3 and 8.4 on OS/X

comment:17 by strk, 14 years ago

Works for me against 8.3.8 on x86_64-pc-linux-gnu

comment:18 by mloskot, 14 years ago

Works for me against 8.4 on x86_64-pc-linux-gnu

I no longer need to symlink libpostgis-1.5.so to postgis-1.5.so binary

Note: See TracTickets for help on using tickets.