Opened 12 years ago

Closed 12 years ago

#1350 closed defect (fixed)

[raster] GDALPolygonize not being set to 1 when compiling with GDAL 1.9

Reported by: robe Owned by: Bborie Park
Priority: blocker Milestone: PostGIS 2.0.0
Component: raster Version: master
Keywords: mingw Cc:

Description

I suspect this is just mingw issue.

Getting back to what was discussed in: http://www.postgis.org/pipermail/postgis-devel/2011-December/016389.html

— my raster_config.h has settings like below after configure

/* GDAL library version */
#define POSTGIS_GDAL_VERSION 19

/* Define to 1 if GDAL has GDALFPolygonize function. */
#define GDALFPOLYGONIZE 0

Note it does register my 1.9 (GDAL trunk but is not giving me the new GDALFPOLYGONIZE behavior) so I assume something is wrong with our check logic as committed in r7316 or I'm doing something wrong in my GDAL compile.

If I manually override after configure

#define GDALFPOLYGONIZE 1

and then compile make check. All tests pass. Do our raster regress tests do any conditional checks if GDALFPOLYGONIZE is enabled similar to what our regular postgis tests (if you are running GEOS 3.3+)? Unfortunately I don't have any rasters lying around that are float to test with.

Attachments (3)

TMAX-20100830.tif (3.4 MB ) - added by Bborie Park 12 years ago.
sample 32BF raster. specifically, temperature max for 2010-08-30 in CA.
configure91.log (9.8 KB ) - added by robe 12 years ago.
config.log (226.8 KB ) - added by robe 12 years ago.
I think this one might be for 8.4 since that's probably the last I compiled should be teh same though

Change History (15)

comment:1 by Bborie Park, 12 years ago

Our raster regression tests (particularly test/core/testapi.c) have conditional checks for GDALFPOLYGONIZE. Since the regressions passed with you manually setting GDALFPOLYGONIZE, the only place for the issue is the configure step. Can you attach your config.log to this ticket?

I'll attach a 32BF raster for your testing.

by Bborie Park, 12 years ago

Attachment: TMAX-20100830.tif added

sample 32BF raster. specifically, temperature max for 2010-08-30 in CA.

comment:2 by Bborie Park, 12 years ago

Summary: GDALPolygonize not being set to 1 when compiling with GDAL 1.9[raster] GDALPolygonize not being set to 1 when compiling with GDAL 1.9

comment:3 by robe, 12 years ago

bborie,

Haven't had a chance to test the file. would testing with dump as polygons work?

I'm attaching my config log for my 9.1 install.

by robe, 12 years ago

Attachment: configure91.log added

comment:4 by Bborie Park, 12 years ago

Yes. If you create a raster with floating point values (like 3.14159) and use ST_DumpAsPolygons, that would quickly test it. I'll take a look at your config.log shortly…

comment:5 by robe, 12 years ago

Okay I see numbers like 17.4885787963867 with your sample raster

so I guess its okay

comment:6 by Bborie Park, 12 years ago

So the problem is in the configure step. Interesting…

comment:7 by Bborie Park, 12 years ago

Regina, can you upload the config.log file instead? The configure91.log doesn't show the gore that happens when configure runs.

by robe, 12 years ago

Attachment: config.log added

I think this one might be for 8.4 since that's probably the last I compiled should be teh same though

comment:8 by robe, 12 years ago

okay I've attached — that one is probably for 8.4 but it has the same issue.

comment:9 by Bborie Park, 12 years ago

Just the important bits.

configure:18421: checking for GDALFPolygonize in -lgdal
configure:18446: gcc -o conftest.exe -g -O2  -I/c/projects/geos/rel-3.3.2SVN/include -I/c/projects/proj/rel-4.6.1/include -I/c/projects/json-c/rel-0.9/include -I/c/projects/libxml/libxml2-2.7.8release/include/libxml2  conftest.c -lgdal  -lxml2 -L/c/projects/libxml/libxml2-2.7.8release/lib -lxml2 -liconv -lws2_32 >&5
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -lgdal
collect2: ld returned 1 exit status

So it looks like the linker can't find GDAL. I wonder if if specifying -L/c/projects/GDAL/rel-trunk/lib would help that (kinda like for xml2).

comment:10 by Bborie Park, 12 years ago

I'm guessing you either need to set the env variable LDFLAGS such as in…

LDFLAGS="-L/c/projects/GDAL/rel-trunk/lib" ./configure ...

or have mingw's ld search path set. In linux, the search paths can be set in /etc/ld.so.conf and run ldconfig afterwards.

comment:11 by Bborie Park, 12 years ago

Owner: changed from pracine to Bborie Park
Priority: mediumblocker
Status: newassigned

comment:12 by robe, 12 years ago

Resolution: fixed
Status: assignedclosed

Bborie,

Thanks — setting the LDFLAGS environment variable seems to do the trick.

Note: See TracTickets for help on using tickets.