Opened 15 years ago

Closed 9 years ago

Last modified 9 years ago

#3084 closed defect (fixed)

make: swig/perl does not build

Reported by: fgenolini Owned by: Ari Jolma
Priority: normal Milestone: 2.0.0
Component: ConfigBuild Version: svn-trunk
Severity: normal Keywords: swig perl
Cc: warmerdam

Description (last modified by warmerdam)

gdal does not build with perl

Linux hostname 2.6.28-13-generic #45-Ubuntu SMP Tue Jun 30 19:49:51 UTC 2009 i686 GNU/Linux Ubuntu 9.04

gdal obtained from SVN trunk on Tuesday 28th July 2009 VERSION 1.7.0

Running configure with the following parameters:

./configure --verbose --prefix=/usr/local --with-swig --with-python --with-geos=yes --with-threads --with-perl

issue (make output):

make[2]: Entering directory `/home/me/gdal/src/swig/perl'
perl Makefile.PL
Building in GDAL distro tree
GDAL version (1.7.0) and module version () do not match at Makefile.PL line 50.
make[2]: *** [Makefile_Geo__GDAL] Error 255
make[2]: Leaving directory `/home/me/gdal/src/swig/perl'
make[1]: *** [build] Error 2
make[1]: Leaving directory `/home/me/gdal/src/swig'
make: *** [swig-modules] Error 2

Attachments (1)

ogr_perl_2.0.0.diff (818 bytes ) - added by saultdon 9 years ago.
patch to fix comments in ogr_perl.i

Download all attachments as: .zip

Change History (7)

comment:1 by warmerdam, 15 years ago

Cc: warmerdam added
Description: modified (diff)
Keywords: swig perl added
Owner: changed from warmerdam to Ari Jolma

Ari, thoughts?

comment:2 by Even Rouault, 15 years ago

The issue is that some swig generated files are not up-to-date into svn, namely swig/perl/lib/Geo/GDAL.pm. Provided that you have SWIG installed, do the following in swig/perl :

make veryclean
make generate
make build

comment:3 by Even Rouault, 14 years ago

Resolution: invalid
Status: newclosed

by saultdon, 9 years ago

Attachment: ogr_perl_2.0.0.diff added

patch to fix comments in ogr_perl.i

comment:4 by saultdon, 9 years ago

Milestone: 1.7.02.0
Resolution: invalid
Status: closedreopened

I gave the make suggestions a try in the swig/perl folder for GDAL 2.0.0RC1 and build is failing with the error:

..kg/gdal-filegdb/src/gdal-2.0/swig/perl (svn)-[gdal:29351] % make generate
swig -Wall -I../include -I../include/perl -I../include/perl/docs -DPERL_CPAN_NAMESPACE -I/tmp/makepkg/gdal-filegdb/src/gdal-2.0 -c++ -perl -o gdal_wrap.cpp ../include/gdal.i
../include/perl/ogr_perl.i:112: Error: Unknown SWIG preprocessor directive: wrapped (if this is a block of target language code, delimit it with %{ and %})
../include/perl/ogr_perl.i:116: Error: Unknown SWIG preprocessor directive: wrapped (if this is a block of target language code, delimit it with %{ and %})
../include/perl/ogr_perl.i:124: Error: Unknown SWIG preprocessor directive: wrapped (if this is a block of target language code, delimit it with %{ and %})
../include/perl/ogr_perl.i:128: Error: Unknown SWIG preprocessor directive: wrapped (if this is a block of target language code, delimit it with %{ and %})
../SWIGmake.base:9: recipe for target 'gdal_wrap.cpp' failed
make: *** [gdal_wrap.cpp] Error 1
..kg/gdal-filegdb/src/gdal-2.0/swig/perl (svn)-[gdal:29351] % make build
swig -Wall -I../include -I../include/perl -I../include/perl/docs -DPERL_CPAN_NAMESPACE -I/tmp/makepkg/gdal-filegdb/src/gdal-2.0 -c++ -perl -o gdal_wrap.cpp ../include/gdal.i
../include/perl/ogr_perl.i:112: Error: Unknown SWIG preprocessor directive: wrapped (if this is a block of target language code, delimit it with %{ and %})
../include/perl/ogr_perl.i:116: Error: Unknown SWIG preprocessor directive: wrapped (if this is a block of target language code, delimit it with %{ and %})
../include/perl/ogr_perl.i:124: Error: Unknown SWIG preprocessor directive: wrapped (if this is a block of target language code, delimit it with %{ and %})
../include/perl/ogr_perl.i:128: Error: Unknown SWIG preprocessor directive: wrapped (if this is a block of target language code, delimit it with %{ and %})
../SWIGmake.base:9: recipe for target 'gdal_wrap.cpp' failed
make: *** [gdal_wrap.cpp] Error 1

So I had a quick look at that file and lines and there is just some issue with commented out code. I googled the swig stuff and looked at examples to see that instead of using '#' they were using ''.

Got a successful build after making those changes. Attached my attempt at a patch. ogr_perl_2.0.0.diff

comment:5 by Ari Jolma, 9 years ago

Resolution: fixed
Status: reopenedclosed

Fixed in trunk by r29538 and branch 2.0 by r39539.

comment:6 by Even Rouault, 9 years ago

Milestone: 2.02.0.0

Milestone renamed

Note: See TracTickets for help on using tickets.