Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 383569 - sci-libs/gdal-1.8.1 compile failure with zlib-1.2.5.1-r1: cpl_minizip_ioapi.h:48:44: error: expected initializer before ‘OF’
Summary: sci-libs/gdal-1.8.1 compile failure with zlib-1.2.5.1-r1: cpl_minizip_ioapi.h...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Steve Arnold
URL:
Whiteboard:
Keywords:
Depends on: 383179
Blocks:
  Show dependency tree
 
Reported: 2011-09-19 02:14 UTC by Ed Catmur
Modified: 2012-05-05 22:20 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patched gdal-1.8.1.ebuild to work with openmpi and recent zlib (gdal-1.8.1.ebuild,6.60 KB, text/plain)
2011-09-22 13:40 UTC, Juergen Rose
Details
gdal-lib-OF.patch (gdal-zlib-OF.patch,275 bytes, patch)
2011-09-24 16:13 UTC, Ed Catmur
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Catmur 2011-09-19 02:14:44 UTC
i686-pc-linux-gnu-g++ -ggdb -O1 -O2 -O3 -pipe -march=native -fdiagnostics-show-option -fPIC  -Wall  -DOGR_ENABLED -I/var/tmp/portage/sci-libs/gdal-1.8.1/work/gdal-1.8.1/port -Iexternal/include -I/usr/ -I/usr//include 	  -DHAVE_CURL -DHAVE_LIBZ -c -o cpl_vsil_gzip.o cpl_vsil_gzip.cpp
In file included from cpl_minizip_unzip.h:71:0,
                 from cpl_vsil_gzip.cpp:84:
cpl_minizip_ioapi.h:48:44: error: expected initializer before ‘OF’
cpl_minizip_ioapi.h:49:44: error: expected initializer before ‘OF’
cpl_minizip_ioapi.h:50:45: error: expected initializer before ‘OF’
cpl_minizip_ioapi.h:51:47: error: expected initializer before ‘OF’
cpl_minizip_ioapi.h:52:44: error: expected initializer before ‘OF’
cpl_minizip_ioapi.h:53:45: error: expected initializer before ‘OF’
cpl_minizip_ioapi.h:54:49: error: expected initializer before ‘OF’

The OF macro appears to have changed to _Z_OF in recent zlib.
Comment 1 SpanKY gentoo-dev 2011-09-19 03:29:44 UTC
do not just change the code to use _Z_OF.  add a local OF define to the pkg:
  #define OF(x) x
Comment 2 Juergen Rose 2011-09-20 10:27:28 UTC
I have the same issue. Is there a patch?
Comment 3 SpanKY gentoo-dev 2011-09-21 15:21:04 UTC
sed -i '1i#define OF(x) x' `find -name cpl_minizip_ioapi.h`
Comment 4 Juergen Rose 2011-09-22 13:37:16 UTC
Thanks SpanKY,

the patch worked for me in the attached ebuild.
Comment 5 Juergen Rose 2011-09-22 13:40:09 UTC
Created attachment 287407 [details]
patched gdal-1.8.1.ebuild to work with openmpi and recent zlib
Comment 6 Steffen Schaumburg 2011-09-24 15:43:17 UTC
New ebuild works for me, too. It does give these warnings, no idea if they matter, but I'll repost if I have any problems :)
 * python_mod_optimize(): /gdal.py does not exist
 * python_mod_optimize(): /ogr.py does not exist
Comment 7 Ed Catmur 2011-09-24 16:13:15 UTC
Created attachment 287607 [details, diff]
gdal-lib-OF.patch

Similar, as a source patch.
Comment 8 Ed Catmur 2011-09-24 16:14:57 UTC
To clarify, the change from OF to _Z_OF is a Gentoo patch since sys-libs/zlib-1.2.5-r1:

sed_macros() {
	# clean up namespace a little #383179
	# we do it here so we only have to tweak 2 files
	sed -i -r 's:\<(O[FN])\>:_Z_\1:g' "$@" || die
}
Comment 9 Steve Arnold archtester gentoo-dev 2011-09-24 17:45:52 UTC
I'm not sure I understand either one of these; wasn't there something besides zlib (ie, with fewer dependencies) to "fix" wrt possible name collisions?  Doesn't the zlib header change pretty much break everything built against the previous ("normal") zlib packages?

As for the mpi change, gdal doesn't care about whether hdf5 is built with parallel support or not, nor should it.  Hacking the gdal build to use the mpi wrappers wasn't the answer for missing mpi* symbols in libhdf5, nor is it the answer here.  If there's an issue with the openmpi package, then please file a bug against openmpi.
Comment 10 Steve Arnold archtester gentoo-dev 2011-09-26 03:35:43 UTC
This is fixed in the latest rev bump, along with the python stuff in pkg_pre/post.  As far as coupling gdal and mpi, that would be a bad idea...
Comment 11 Jaak Ristioja 2012-05-05 22:20:16 UTC
Bug is still present in sci-libs/gdal-1.6.3-r1 :(