Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 305395 - sci-libs/gdal-1.6.3 - gdal_wrap.cpp:17933: error: too many initializers for 'swig_command_info'
Summary: sci-libs/gdal-1.6.3 - gdal_wrap.cpp:17933: error: too many initializers for '...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Steve Arnold
URL:
Whiteboard:
Keywords:
: 305605 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-02-16 14:21 UTC by Silvio
Modified: 2010-02-23 08:04 UTC (History)
8 users (show)

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


Attachments
Patch gdal-1.6.3.ebuild src_compile (gentoo305395.patch,817 bytes, patch)
2010-02-21 17:33 UTC, Martin von Gagern
Details | Diff
bzipped build.log (build_log.tar.bz2,21.43 KB, application/octet-stream)
2010-02-22 14:01 UTC, Geoff Madden
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Silvio 2010-02-16 14:21:47 UTC
I got this error

gdal_wrap.cpp:17933: error: too many initializers for 'swig_command_info'
gdal_wrap.cpp: In function 'void boot_Geo__GDAL(PerlInterpreter*, CV*)':
gdal_wrap.cpp:18176: error: 'struct swig_command_info' has no member named 'wrapper'
make[3]: *** [gdal_wrap.o] Error 1
make[3]: Leaving directory `/var/tmp/portage/sci-libs/gdal-1.6.3/work/gdal-1.6.3/swig/perl'
make[2]: *** [build] Error 2
make[2]: Leaving directory `/var/tmp/portage/sci-libs/gdal-1.6.3/work/gdal-1.6.3/swig/perl'
make[1]: *** [build] Error 2
make[1]: Leaving directory `/var/tmp/portage/sci-libs/gdal-1.6.3/work/gdal-1.6.3/swig'
make: *** [swig-modules] Error 2


Reproducible: Always




emerge --info

Portage 2.2_rc62 (default/linux/x86/10.0/desktop, gcc-4.4.3, glibc-2.11-r1, 2.6.32-gentoo-r5 i686)
=================================================================
System uname: Linux-2.6.32-gentoo-r5-i686-Intel-R-_Core-TM-2_Duo_CPU_T7700_@_2.40GHz-with-gentoo-2.0.1
Timestamp of tree: Tue, 16 Feb 2010 12:00:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.1_p2
dev-java/java-config: 2.1.10
dev-lang/python:     2.4.6, 2.5.4-r4, 2.6.4-r1, 3.1.1-r1
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.8.0-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.0-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.8.5-r3, 1.9.6-r2, 1.10.3, 1.11.1
sys-devel/binutils:  2.20
sys-devel/gcc:       4.2.4-r1, 4.3.4, 4.4.3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.32
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/fax /usr/share/X11/xkb /usr/share/config /var/lib/hsqldb /var/spool/fax/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests ccache distlocks fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS=" http://mirror.ovh.net/gentoo-distfiles/ http://ftp.heanet.ie/pub/gentoo/ http://mirror.ovh.net/gentoo-distfiles/ http://www.die.unipd.it/pub/Linux/distributions/gentoo-sources/ rsync://rsync3.it.gentoo.org/gentoo-sources/ ftp://ftp.unina.it/pub/linux/distributions/gentoo/"
LANG="it_IT"
LC_ALL="it_IT"
LDFLAGS="-Wl,-O1"
LINGUAS="it en"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/voyageur /usr/portage/local/layman/armagetron /usr/portage/local/layman/sunrise /usr/portage/local/layman/trauma /usr/portage/local/layman/zugaina /usr/portage/local/layman/rion /usr/portage/local/manual"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3ds X a52 aac acl acpi aiglx akode alias alsa amr ao apache apm audiofile autoreplace avi bash-completion berkdb bitmap-fonts bluetooth bmp branding browserplugin bzip bzip2 cairo cdaudio cdr cli connectionstatus consolekit contactnotes cracklib crypt cups cxx dbus dialup djvu dri dts dv dvd dvdr dvdread ebook eds emboss encode ethereal evo exif fam fat ffmpeg firefox flac fluidsynth foomaticdb fortran freetds gdbm gif glib glitz gphoto2 gpm gps gpu groupwise gstreamer gtk gtk2 hal highlight history hvm i8x0 iconv ieee1394 imagemagick innodb ipod ipv6 irc ithreads jack java javascript jingle jpeg jpeg2k kde kerberos kqemu lame laptop ldap libnotify lm_sensors lucene m4a mad mdnsresponder-compat midi mikmod mime mmx mmxext mng modules moonlight mozilla mp3 mp4 mpeg mpeg2 mplayer mssql mudflap mysql ncurses netmeeting nls nowlistening npt1 nptl nptlonly nsplugin ntfs nvidia odbc ogg openexr opengl openipmi openmp oss pam pcmcia pcre pda pdf perl pmu png portaudio postgres ppds pppd prelude python python3 qt qt3support qt4 quicktime rar raw rdesktop rdp readline reflection reiserfs samba sametime sdl semantic-desktop session smp sms speex spell spl sse sse2 ssl startup-notification subtitles svg sysfs tcpd texteffect texteffects theora thunar tidy tiff timidity translator truetype truetype-fonts twolame type1-fonts unicode usb utempter v4l v4l2 vcd virtualbox vorbis webkit webpresence wifi win32codecs winpopup wlm wmf wxwindows x264 x86 xcb xen xine xml xorg xulrunner xv xvid xvmc yahoo zeroconf zlib" ALSA_CARDS="snd_hda_intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CAMERAS="canon" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev joystick synaptics wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="it en" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia nv vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Thomas Beierlein gentoo-dev 2010-02-16 16:49:47 UTC
As it works for me here in stable amd64 chroot with USE="perl python" can you please give some more informations about your USE flags and the installed dependencies?
Comment 2 Martin von Gagern 2010-02-16 16:59:02 UTC
Same error message here, except it steats much earlier for me:

x86_64-pc-linux-gnu-gcc -c  -I../../gcore -I../../alg -I../../ogr -I../../port -I/var/tmp/portage/sci-libs/gdal-1.6.3/work/gdal-1.6.3/po
rt -I/var/tmp/portage/sci-libs/gdal-1.6.3/work/gdal-1.6.3/gcore -I/var/tmp/portage/sci-libs/gdal-1.6.3/work/gdal-1.6.3/alg -I/var/tmp/po
rtage/sci-libs/gdal-1.6.3/work/gdal-1.6.3/ogr -I/var/tmp/portage/sci-libs/gdal-1.6.3/work/gdal-1.6.3/ogr/ogrsf_frmts -D_REENTRANT -D_GNU
_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -march=amdfam10 -O2 -ggdb -p
ipe   -DVERSION=\"0.23\" -DXS_VERSION=\"0.23\" -fPIC "-I/usr/lib64/perl5/5.10.1/x86_64-linux-thread-multi/CORE"   gdal_wrap.cpp
gdal_wrap.cpp:1232: error: expected unqualified-id before string constant
gdal_wrap.cpp:1233: error: expected initializer before ‘*’ token
gdal_wrap.cpp:1238: error: ‘SwigPerlWrapperPtr’ does not name a type
gdal_wrap.cpp: In function ‘void _wrap_new_SavedEnv(PerlInterpreter*, CV*)’:
gdal_wrap.cpp:3054: warning: format not a string literal and no format arguments

The first error line seems to be the actual cause; everything else should be consequences of this error. The originagl code in gdal_wrap.cpp reads:
typedef XS(SwigPerlWrapper);

After preprocessing the line looks like this instead:
typedef extern "C" void SwigPerlWrapper( PerlInterpreter* my_perl , CV* cv);

Tracing the involved preprocessor macros:

/usr/lib64/perl5/5.10.1/x86_64-linux-thread-multi/CORE/XSUB.h:
123:#      define XS(name) extern "C" XSPROTO(name)
109:#define XSPROTO(name) void name(pTHX_ CV* cv)
/usr/lib64/perl5/5.10.1/x86_64-linux-thread-multi/CORE/perl.h:
200:#  define pTHX_		pTHX,
188:#  define pTHX  register tTHX my_perl PERL_UNUSED_DECL
4062:#  define register
187:#  define tTHX	PerlInterpreter*
332:#    define PERL_UNUSED_DECL

There is a closed swig bug report for this issue:
http://sourceforge.net/tracker/index.php?func=detail&aid=1771410&group_id=1645&atid=301645
>=dev-lang/swig-1.3.32 should be fine.

The trouble probably is that gdal does ship the broken swig code as part of the tarball. In that case the proper solution would be for the ebuild to drop that outdated code and instead call swig to regenerate it, either by a manual invocation or as part of the gdal build process.

Of course, a report upstream asking gdal devs to switch to newer swig would be nice as well. But I don't think we should wait on them.
Comment 3 Martin von Gagern 2010-02-16 17:19:23 UTC
Workaround until the ebuild is fixed:

emerge -1n '>=dev-lang/swig-1.3.32'
ebuild /usr/portage/sci-libs/gdal/gdal-1.6.3.ebuild clean unpack
rm /var/tmp/portage/sci-libs/gdal-1.6.3/work/gdal-1.6.3/swig/perl/*_wrap.cpp
make -C /var/tmp/portage/sci-libs/gdal-1.6.3/work/gdal-1.6.3/swig/perl generate
ebuild /usr/portage/sci-libs/gdal/gdal-1.6.3.ebuild merge

Fixing the ebuild should be easy as well: add dependency on swig, with the perl USE flag as a condition, delete these wrap files in either src_unpack or src_prepare, and generate the *_wrap.cpp in src_prepare or src_compile, the latter again conditioned on the perl USE flag.
Comment 4 Martin von Gagern 2010-02-16 18:05:45 UTC
(In reply to comment #2)
> Of course, a report upstream asking gdal devs to switch to newer swig would be
> nice as well. But I don't think we should wait on them.

Seems there is no need: 1.6 branch and trunk both are at swig 1.3.33:
http://trac.osgeo.org/gdal/changeset/17004

They are also discussing 1.3.39 for the 1.7 release:
http://thread.gmane.org/gmane.comp.gis.gdal.devel/21376
Comment 5 Geoff Madden 2010-02-19 12:57:45 UTC
(In reply to comment #4)
> (In reply to comment #2)
> > Of course, a report upstream asking gdal devs to switch to newer swig would be
> > nice as well. But I don't think we should wait on them.
> 
> Seems there is no need: 1.6 branch and trunk both are at swig 1.3.33:
> http://trac.osgeo.org/gdal/changeset/17004
> 
> They are also discussing 1.3.39 for the 1.7 release:
> http://thread.gmane.org/gmane.comp.gis.gdal.devel/21376
> 
I found that by installing rubygems,sqlite-ruby & sqlite3-ruby, fixed all the problems with the compile of gdal-wrap. I then was able to leave the compile to the ebuild,without any additional flags(removal).
So it would seem that although ruby is an optional dependency,it becomes a fixed dependency some how.
Comment 6 David Kredba 2010-02-20 15:25:24 UTC
Your method is not working for me:

gdal_wrap.cpp:17933: error: too many initializers for ‘swig_command_info’
gdal_wrap.cpp: In function ‘void boot_Geo__GDAL(PerlInterpreter*, CV*)’:
gdal_wrap.cpp:18176: error: ‘struct swig_command_info’ has no member named ‘wrapper’
make[3]: *** [gdal_wrap.o] Error 1
make[3]: Leaving directory `/var/tmp/portage/sci-libs/gdal-1.6.3/work/gdal-1.6.3/swig/perl'

In reverse order:

emerge -v sqlite3-ruby           

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N    ] dev-ruby/rake-compiler-0.7.0-r1  USE="-doc -test" RUBY_TARGETS="ruby18 -jruby (-ruby19)" 26 kB
[ebuild  N    ] dev-ruby/rake-0.8.7-r3  USE="-bash-completion -doc -test" RUBY_TARGETS="ruby18 -jruby (-ruby19)" 101 kB
[ebuild  N    ] dev-ruby/hoe-2.5.0  USE="-doc -test" RUBY_TARGETS="ruby18 -jruby (-ruby19)" 111 kB                     
[ebuild  N    ] dev-ruby/sqlite3-ruby-1.2.5  USE="-doc -test" RUBY_TARGETS="ruby18" 73 kB

emerge -v sqlite-ruby                    

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N    ] virtual/rubygems-0-r2  RUBY_TARGETS="ruby18 -jruby (-ruby19)" 0 kB
[ebuild  N    ] dev-ruby/sqlite-ruby-2.2.3-r2  USE="-test" RUBY_TARGETS="ruby18 (-ruby19)" 41 kB

 emerge -v rubygems                       

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N    ] dev-ruby/rubygems-1.3.5-r3  USE="-doc -server" RUBY_TARGETS="ruby18 -jruby" 272 kB
Comment 7 Martin von Gagern 2010-02-20 19:24:28 UTC
(In reply to comment #5)
> I found that by installing rubygems,sqlite-ruby & sqlite3-ruby,
> fixed all the problems with the compile of gdal-wrap.

I'm quite surprised by this, Geoff: the original comment reports errors make encountered in the swig/perl directory, so it should be related to perl, e.g. the upgrade to perl 5.10.1. The same holds for me as reported in comment #2 and fixed by the workaround in comment #3.

Can you please check your build log and see if it was the swig/perl directory where your errors occured, or rather the swig/ruby directory. The latter would be an indication of a different bug, and you should probably open a different bug report for it.

If it is swig/perl for you as well, I'd be interested in the full build log. Especially I'd be curious to learn if the first error messages mentioning gdal_wrap.cpp match those I quoted in comment #2, the one about "expected unqualified-id before string constant" in particular.

(In reply to comment #6)
> Your method is not working for me:

David, does the workaround from comment #3 work for you?
Comment 8 Didier Link 2010-02-21 11:22:42 UTC
Hi all,

Same error on amd64 arch and the comment#3 works for me, thanks for the solution ;)
Comment 9 Martin von Gagern 2010-02-21 17:33:09 UTC
Created attachment 220615 [details, diff]
Patch gdal-1.6.3.ebuild src_compile

This patch should address the problem.

For simplicity, I've only modified src_compile, and not moved the deletion of files to other stages.

I've also corrected the dependency on swig to what I assume was originally intended: depend on swig if ANY of perl, python or ruby USE flags are set. The previous implementation would only depend on swig if ALL these USE flags are set, which doesn't make sense to me.
Comment 10 Geoff Madden 2010-02-22 13:15:20 UTC
(In reply to comment #7)
> (In reply to comment #5)
> > I found that by installing rubygems,sqlite-ruby & sqlite3-ruby,
> > fixed all the problems with the compile of gdal-wrap.
> 
> I'm quite surprised by this, Geoff: the original comment reports errors make
> encountered in the swig/perl directory, so it should be related to perl, e.g.
> the upgrade to perl 5.10.1. The same holds for me as reported in comment #2 and
> fixed by the workaround in comment #3.
> 
> Can you please check your build log and see if it was the swig/perl directory
> where your errors occured, or rather the swig/ruby directory. The latter would
> be an indication of a different bug, and you should probably open a different
> bug report for it.
> 
> If it is swig/perl for you as well, I'd be interested in the full build log.
> Especially I'd be curious to learn if the first error messages mentioning
> gdal_wrap.cpp match those I quoted in comment #2, the one about "expected
> unqualified-id before string constant" in particular.
> 
> (In reply to comment #6)
> > Your method is not working for me:
> 
> David, does the workaround from comment #3 work for you?
> 

My original problem was with ruby ,hence the additional files,but since the upgrade of perl-5.10 it now resides in swig-perl ,am noe in the process of recompiling with the addition of geos,so will see how things pan out.
Comment 11 Geoff Madden 2010-02-22 14:01:39 UTC
Created attachment 220695 [details]
bzipped build.log
Comment 12 Martin von Gagern 2010-02-22 14:33:53 UTC
(In reply to comment #10)
> (In reply to comment #7)
> > (In reply to comment #5)

Please stop quoting all but those lines you actually reply to. Otherwise this bug report will grow pretty long and will become hard to read.

> My original problem was with ruby ,hence the additional files, but since the
> upgrade of perl-5.10 it now resides in swig-perl ,am noe in the process of
> recompiling with the addition of geos,so will see how things pan out.

I don't know how the geos USE flag should affect any of this. I somewhat doubt that it does.

(In reply to comment #11)
> bzipped build.log

The tar inside the bzip2 is somewhat superfluous, as it only contains a single file, but never mind. You will notice that lines 2233-2238 of that log resemble those I quoted in comment #2. The line "typedef XS(SwigPerlWrapper);" is causing your build to fail as well. That can be worked around using comment #3 or fixed in the ebuild using comment #9. If after that you are back to ruby issues, please open a separate bug report for those.
Comment 13 Steve Arnold archtester gentoo-dev 2010-02-23 08:03:17 UTC
Another weird one...  Seems like I have a pretty current swig, and I haven't seen this error on any of my machines.  That said, I was already in the process of updating the legacy swig dep (apparently there's no more elegant way than what we both came up with) and testing it.  I went ahead and added the work-around to src_compile from your patch, so it should be good to go (in Theory...)
Comment 14 Steve Arnold archtester gentoo-dev 2010-02-23 08:04:33 UTC
*** Bug 305605 has been marked as a duplicate of this bug. ***