Opened 14 years ago

Closed 13 years ago

#610 closed defect (fixed)

[raster] Can't build with raster

Reported by: robe Owned by: jorgearevalo
Priority: high Milestone: PostGIS 2.0.0
Component: raster Version: master
Keywords: Cc: jorge.arevalo@…

Description

This may just be a MingW issue, but I can't build PostGIS 2.0 with —with-raster. It seems like the later rt-make is ignoring my custom GDAL configuration though configure correctly picks it up.

Anyrate if someone else can check on their platform, that would be great. Also I'm sure Paul and Jorge were discussing this, though I didn't udnerstand anything they were saying: IS there is a reason why we need a separate rt-install. Why can't it be like —with-gui where when you say that it builds the make and all that for the gui and if you don't it doesn't?

— Getting back to my problem — — my configure looks like this

./configure --with-gdal=/c/projects/gdal/rel-trunk/bin/gdal-config --prefix=/c/projects/pg/pg91 --with-xml2config=/c/projects/libxml/libxml2-2.7.6release/bin/xml2-config --with-pgconfig=/c/projects/pg/pg91/bin/pg_config --with-geosconfig=/c/projects/geos/rel-trunk/bin/geos-config --with-projdir=/c/projects/proj/rel-4.6.1 --with-gui --with-raster

— and generates an output which looks like this (as you can see GDAL is being picked up —

 PostGIS is now configured for i686-pc-mingw32

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

 -------------- Dependencies -------------- 
  GEOS config:          /c/projects/geos/rel-3.3.0/bin/geos-config
  GEOS version:         3.3.0
  GDAL config:          /c/projects/gdal/rel-trunk/bin/gdal-config
  GDAL version:         1.8.0
  PostgreSQL config:    /c/projects/pg/pg91/bin/pg_config
  PostgreSQL version:   PostgreSQL 9.1alpha1
  PROJ4 version:        46
  Libxml2 config:       /c/projects/libxml/libxml2-2.7.6release/bin/xml2-config
  Libxml2 version:      2.7.6
  PostGIS debug level:  0
 -------------- Extensions -------------- 
  PostGIS Raster:       0.1.6d

But in the raster compile — it gives all sorts ofo errors which I recall getting before when the gdal config path is not set.

  ------------------------------------------------------
Generating PostGIS Raster stuff
------------------------------------------------------
make -C raster all
make[1]: Entering directory `/c/projects/PostGIS/trunk/raster'
make -C rt_core
make[2]: Entering directory `/c/projects/PostGIS/trunk/raster/rt_core'
gcc -g -O2  -DDLL_EXPORT -DPIC  -Wall -Wmissing-prototypes  -Ic:/projects/PostGIS/trunk/liblwgeom     -c -o rt_api.o rt_api.c
In file included from rt_api.c:33:
rt_api.h:89:22: gdal_alg.h: No such file or directory
rt_api.h:90:24: gdal_frmts.h: No such file or directory
rt_api.h:91:18: gdal.h: No such file or directory
rt_api.h:92:21: ogr_api.h: No such file or directory
rt_api.c: In function `rt_raster_dump_as_polygons':
rt_api.c:1406: error: `GDALDataType' undeclared (first use in this function)
rt_api.c:1406: error: (Each undeclared identifier is reported only once
rt_api.c:1406: error: for each function it appears in.)
rt_api.c:1406: error: syntax error before "nPixelType"
rt_api.c:1408: error: `OGRSFDriverH' undeclared (first use in this function)
rt_api.c:1408: error: syntax error before "ogr_drv"
rt_api.c:1409: error: `GDALDriverH' undeclared (first use in this function)
rt_api.c:1410: error: `GDALDatasetH' undeclared (first use in this function)

don't have an issue compiling the old wktraster standalone.

Attachments (1)

rt_core_Makefile.patch (483 bytes ) - added by robe 13 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 by mcayland, 14 years ago

+1. This is completely broken on my Linux system too:

pg83@zeno:~/src/postgis-svn/trunk$ make rt-all


Generating PostGIS Raster stuff


make -C raster all make[1]: Entering directory `/home/pg83/src/postgis-svn/trunk/raster' make -C rt_core make[2]: Entering directory `/home/pg83/src/postgis-svn/trunk/raster/rt_core' cc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -I/home/pg83/src/postgis-svn/trunk/liblwgeom -c -o rt_api.o rt_api.c

It looks like the -I argument is wrong which is why the headers can't be found.

comment:2 by pracine, 13 years ago

Summary: raster: Can't build with raster[raster] Can't build with raster

by robe, 13 years ago

Attachment: rt_core_Makefile.patch added

comment:3 by robe, 13 years ago

Not sure the patch I have was the right thing to do, but the attached patch fix my issues. Also I noticed the rtpostgis.sql is being installed in wrong folder. I'll put that in as a separate ticket item.

comment:4 by jorgearevalo, 13 years ago

Regina: The patch is working for me. And yes, I missed these 2 lines. I think it worked before because I've defined LD_LIBRARY_PATH pointing to gdal directory in my enviroment. Many thanks and sorry. I'll commit the changes.

Pierre: I just wanted to keep raster stuff totally separated from the rest until official 2.0 release. But ok, maybe it's a bit… too much. I'll modify the scripts to avoid the make rt-install part, and simply install the raster part with "make install" if "—with-raster" option is provided.

comment:5 by jorgearevalo, 13 years ago

Changes commited in r6075:

  • Added Regina's patch to solve the build problem (please test it)
  • Changed placement of rtpostgis.sql file. Now is placed in <contrib_dir>/<rtpostgis-version>/. Can be changed to put it in <contrib_dir>/<postgis-version> directory, like the rest of postgis-related sql files. I think we can keep this location until official 2.0 release (raster stuff separated from rest of postgis stuff).
  • Library file name constructed with versioning, like postgis library file

comment:6 by mcayland, 13 years ago

Is there a reason there is a separate version for the raster library file? Surely now WKTRaster is part of trunk they should be one and the same?

comment:7 by pracine, 13 years ago

Right. The raster lib should now use the postgis Version.config file instead of its own one.

comment:8 by jorgearevalo, 13 years ago

Agree. I wanted to keep raster stuff separated from the rest of PostGIS by now. But once you compile PostGIS with raster option activated, it should be part of PostGIS library, not a separated file. Working on it.

comment:9 by pracine, 13 years ago

Jorge, we are speaking just about the version number. rtpostgis.dll should use PostGIS Version.config file instead of its own one. We don't speak about merging both library into one file yet.

comment:10 by jorgearevalo, 13 years ago

Owner: changed from pracine to jorgearevalo
Status: newassigned

Ok, understand. We keep library files separated.

comment:11 by jorgearevalo, 13 years ago

Cc: jorge.arevalo@… added

With the new release (r6095) to construct the raster stuff you only need to do "./configure —with-raster & make & make install". And the library object now uses the PostGIS version numbers (2.0)

comment:12 by mcayland, 13 years ago

Excellent. Can you take a look at #616 too please?

comment:13 by jorgearevalo, 13 years ago

Done. Check #616.

comment:14 by jorgearevalo, 13 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.