Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm just having a problem compiling postgis on a second machine, I wonder if anyone has any pointers:

./autogen.sh
./configure

gives

  PostGIS is now configured for i686-pc-linux-gnu

 -------------- Compiler Info ------------- 
  C compiler:           gcc -g -O2
  C++ compiler:         g++ -g -O2

 -------------- Dependencies -------------- 
  GEOS config:          /usr/local/bin/geos-config
  GEOS version:         3.3.0
  PostgreSQL config:    /usr/bin/pg_config
  PostgreSQL version:   PostgreSQL 8.4beta2
  PROJ4 version:        47
  Libxml2 config:       /usr/bin/xml2-config
  Libxml2 version:      2.6.26
  PostGIS debug level:  0

and make gives:

make -C liblwgeom 
make[1]: Entering directory `/root/postgis-1.5.3/liblwgeom'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/postgis-1.5.3/liblwgeom'
make -C postgis 
make[1]: Entering directory `/root/postgis-1.5.3/postgis'
Makefile.pgxs:17: warning: overriding commands for target `install'
/usr/lib/pgsql/pgxs/src/makefiles/pgxs.mk:92: warning: ignoring old commands for target `install'
Makefile.pgxs:63: warning: overriding commands for target `installdirs'
/usr/lib/pgsql/pgxs/src/makefiles/pgxs.mk:140: warning: ignoring old commands for target `installdirs'
Makefile.pgxs:82: warning: overriding commands for target `uninstall'
/usr/lib/pgsql/pgxs/src/makefiles/pgxs.mk:164: warning: ignoring old commands for target `uninstall'
gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/et -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv -g -fpic -I/usr/local/include  -I/usr/include/libxml2 -I../liblwgeom -I. -I/usr/include/pgsql/server -I/usr/include/pgsql/internal -I/usr/include/et -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include  -c -o lwgeom_accum.o lwgeom_accum.c
lwgeom_accum.c: In function ‘pgis_geometry_accum_transfn’:
lwgeom_accum.c:114: error: ‘WindowAggState’ has no member named ‘aggcontext’
lwgeom_accum.c:308:66: error: macro "InitFunctionCallInfoData" passed 6 arguments, but takes just 5
lwgeom_accum.c: In function ‘PGISDirectFunctionCall1’:
lwgeom_accum.c:308: error: ‘InitFunctionCallInfoData’ undeclared (first use in this function)
lwgeom_accum.c:308: error: (Each undeclared identifier is reported only once
lwgeom_accum.c:308: error: for each function it appears in.)
make[1]: *** [lwgeom_accum.o] Error 1
make[1]: Leaving directory `/root/postgis-1.5.3/postgis'
make: *** [postgis] Error 2
share|improve this question

1 Answer 1

up vote 6 down vote accepted

Postgis has decided you run a Postgresql version higher then 8.4 and is attempting to use the new API.

It's configure that sets the value of POSTGIS_PGSQL_VERSION so I think your beta Postgresql version identifies itself as something bigger then 84 (maybe 842) so the wrong Postgresql version is selected.

To set the variable, configure uses the following code:

PGSQL_MAJOR_VERSION=`$PGCONFIG --version | sed 's/[[A-Za-z ]]*//' | cut -d. -f1 | sed 's/[[^0-9]]//g'`
PGSQL_MINOR_VERSION=`$PGCONFIG --version | sed 's/[[A-Za-z ]]*//' | cut -d. -f2 | sed 's/[[^0-9]]//g'`
PGSQL_FULL_VERSION=`$PGCONFIG --version`
POSTGIS_PGSQL_VERSION="$PGSQL_MAJOR_VERSION$PGSQL_MINOR_VERSION"

The easiest fix is probably to hardcode POSTGIS_PGSQL_VERSION to "84". I.e. in configure, add

POSTGIS_PGSQL_VERSION="84"

after the lines above.

The cause of the problem is in lwgeo_accum.c (it does not permit any version like 842, etc):

#if POSTGIS_PGSQL_VERSION == 84
        else if (fcinfo->context && IsA(fcinfo->context, WindowAggState))
                aggcontext = ((WindowAggState *) fcinfo->context)->wincontext;
#endif
#if POSTGIS_PGSQL_VERSION > 84
        else if (fcinfo->context && IsA(fcinfo->context, WindowAggState))
                aggcontext = ((WindowAggState *) fcinfo->context)->aggcontext;
#endif
share|improve this answer
    
This worked like a charm! I figured it had something to do with the 8.4beta but don't want to upgrade/update it as it's on a production server. –  EoghanM Sep 17 '11 at 14:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.