[El] Trying to build gdal with ECW support on SL 6.0

Micha Silver micha at arava.co.il
Sat May 14 05:54:00 EDT 2011


Perhaps someone can give me a tip here. I'd like to get gdal installed 
with ECW support on Scientific Linux 6. But I'm stuck at a fairly basic 
step, and I can't figure out why. Here's what I've done so far:


I've downloaded from the old ERMapper site the SDK source - version 3.3 
(For those who haven't followed the ECW "saga": some years back, when 
ECW was owned by ERMapper they released the source code SDK, version 
3.3. It would compile OK on most Linux distros. Since then ERDAS has 
taken over, and they are unfortunately less supportive of FOSS. They 
release a binary only windows installer for the SDK, now at version 4.2, 
but nothing yet for Linux, not source nor binary. So we're stuck with 
the older 3.3 version) . Anyway that older version compiled OK.


Next I got the source RPM for gdal from EPEL: still at gdal-1.7.2 . 
Before adding the compile option --with-ecw to the spec file, I tried to 
just rebuild the rpm, to make sure all dependencies were covered, etc. I 
set up my ~.rpmmacros and installed the src.rpm, then I ran:


[micha at MS-SL6 rpmbuild]$ rpmbuild -bb SPECS/gdal.spec

The %prep went OK, and it began compiling, but when it reached gdal_wrap 
I got these errors:


{---------%<----------------------------------------------------------------------------------------------------------------------}

make[2]: Entering directory 
`/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/swig/ruby'
swig -Wall -I../include -I../include/ruby -I../include/ruby/docs 
-autorename -prefix "gdal::"  
-I/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora -c++ -ruby -o 
gdal_wrap.cpp ../include/gdal.i
../include/Dataset.i:308: Warning(453): Can't apply (char **CSL). No 
typemaps are defined.
../include/Band.i:259: Warning(453): Can't apply (IF_ERROR_RETURN_NONE). 
No typemaps are defined.
../include/Band.i:269: Warning(453): Can't apply (IF_ERROR_RETURN_NONE). 
No typemaps are defined.
../include/Operations.i:227: Warning(453): Can't apply (int nList,double 
*pList). No typemaps are defined.
../include/Operations.i:358: Warning(453): Can't apply (int 
object_list_count,GDALRasterBandShadow **poObjects). No typemaps are 
defined.
../include/gdal.i:566: Warning(490): Fragment 'XMLTreeToPyList' not found.
swig -Wall -I../include -I../include/ruby -I../include/ruby/docs 
-autorename -prefix "gdal::"  
-I/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora -ruby -o 
gdalconst_wrap.c ../include/gdalconst.i
swig -Wall -I../include -I../include/ruby -I../include/ruby/docs 
-autorename -prefix "gdal::"  
-I/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora -c++ -ruby -o 
ogr_wrap.cpp ../include/ogr.i
../include/osr.i:152: Warning(453): Can't apply (char **CSL). No 
typemaps are defined.
../include/osr.i:162: Warning(453): Can't apply (char **CSL). No 
typemaps are defined.
swig -Wall -I../include -I../include/ruby -I../include/ruby/docs 
-autorename -prefix "gdal::"  
-I/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora -c++ -ruby -o 
osr_wrap.cpp ../include/osr.i
../include/osr.i:151: Warning(453): Can't apply (char **CSL). No 
typemaps are defined.
../include/osr.i:161: Warning(453): Can't apply (char **CSL). No 
typemaps are defined.
make -f RubyMakefile.mk build
make[3]: Entering directory 
`/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/swig/ruby'
/usr/bin/libtool --mode=compile --tag=CXX g++ -O2 -g  -Wall 
-Wdeclaration-after-statement  
-I/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/port 
-I/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/gcore 
-I/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/alg 
-I/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/ogr 
-I/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/ogr/ogrsf_frmts 
-I/usr/lib64/ruby/1.8  -c gdal_wrap.cpp
libtool: compile:  g++ -O2 -g -Wall -Wdeclaration-after-statement 
-I/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/port 
-I/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/gcore 
-I/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/alg 
-I/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/ogr 
-I/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/ogr/ogrsf_frmts 
-I/usr/lib64/ruby/1.8 -c gdal_wrap.cpp  -fPIC -DPIC -o .libs/gdal_wrap.o
cc1plus: warning: command line option "-Wdeclaration-after-statement" is 
valid for C/ObjC but not for C++
gdal_wrap.cpp: In function 'VALUE SWIG_AUX_NUM2DBL(VALUE*)':
gdal_wrap.cpp:2253: warning: unused variable 'type'
gdal_wrap.cpp: In function 'VALUE _wrap_escape_string(int, VALUE*, VALUE)':
gdal_wrap.cpp:3729: warning: deprecated conversion from string constant 
to 'char*'
gdal_wrap.cpp:3729: warning: deprecated conversion from string constant 
to 'char*'
gdal_wrap.cpp:3727: warning: unused variable 'kwnames'
gdal_wrap.cpp: In function 'VALUE _wrap_Driver_create(int, VALUE*, VALUE)':
gdal_wrap.cpp:5149: warning: deprecated conversion from string constant 
to 'char*'
gdal_wrap.cpp:5149: warning: deprecated conversion from string constant 
to 'char*'
gdal_wrap.cpp:5149: warning: deprecated conversion from string constant 
to 'char*'
gdal_wrap.cpp:5149: warning: deprecated conversion from string constant 
to 'char*'
gdal_wrap.cpp:5149: warning: deprecated conversion from string constant 
to 'char*'
gdal_wrap.cpp:5149: warning: deprecated conversion from string constant 
to 'char*'
gdal_wrap.cpp:5149: warning: deprecated conversion from string constant 
to 'char*'
gdal_wrap.cpp:5147: warning: unused variable 'kwnames'

[... Lots more lines like these ...]


gdal_wrap.cpp: In function 'VALUE _wrap_regenerate_overview(int, VALUE*, 
VALUE)':

gdal_wrap.cpp:15200: warning: deprecated conversion from string constant 
to 'char*'
gdal_wrap.cpp:15200: warning: deprecated conversion from string constant 
to 'char*'
gdal_wrap.cpp:15200: warning: deprecated conversion from string constant 
to 'char*'
gdal_wrap.cpp:15200: warning: deprecated conversion from string constant 
to 'char*'
gdal_wrap.cpp:15200: warning: deprecated conversion from string constant 
to 'char*'
gdal_wrap.cpp:15198: warning: unused variable 'kwnames'
gdal_wrap.cpp: In function 'VALUE _wrap_push_error_handler(int, VALUE*, 
VALUE)':
gdal_wrap.cpp:3616: warning: 'argv[0]' may be used uninitialized in this 
function
libtool: compile:  g++ -O2 -g -Wall -Wdeclaration-after-statement 
-I/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/port 
-I/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/gcore 
-I/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/alg 
-I/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/ogr 
-I/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/ogr/ogrsf_frmts 
-I/usr/lib64/ruby/1.8 -c gdal_wrap.cpp -o gdal_wrap.o >/dev/null 2>&1
g++ -L../../.libs/ -O2 -g  -Xcompiler -shared -L/usr/lib64  -L/usr/lib64 
-lgeos_c -L/usr/lib -lsqlite3 -lodbc -lodbcinst -L/usr/lib -lexpat 
-L/usr/lib -lxerces-c -lpthread -lNCSEcw -lNCSCnet -lNCSUtil -ljasper 
-lhdf5 -L/usr/lib64/hdf -lmfhdf -ldf -logdi -lgif -ljpeg -lgeotiff 
-ltiff -lpng -lnetcdf -lcfitsio -lpq -L/usr/lib64 -lpq -lz -lpthread -lm 
-lrt -ldl  -ldap -ldapclient -ldapserver -lpthread -lrx  -lcurl    
-lxml2 -lz -lm   -lcurl      -rdynamic -L/usr/lib64/mysql -lmysqlclient 
-lz -lcrypt -lnsl -lm -lssl -lcrypto 
-L/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora -lgdal -lruby 
gdal_wrap.o -o gdal.so
g++: unrecognized option '-Xcompiler'
/usr/bin/ld: gdal_wrap.o: relocation R_X86_64_32 against `.bss' can not 
be used when making a shared object; recompile with -fPIC
gdal_wrap.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[3]: *** [gdal.so] Error 1
make[3]: Leaving directory 
`/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/swig/ruby'
make[2]: *** [build] Error 2
make[2]: Leaving directory 
`/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/swig/ruby'
make[1]: *** [build] Error 2
make[1]: Leaving directory 
`/home/micha/Downloads/rpmbuild/BUILD/gdal-1.7.2-fedora/swig'
make: *** [swig-modules] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.e8MsR0 (%build)


RPM build errors:
     Bad exit status from /var/tmp/rpm-tmp.e8MsR0 (%build)

{---------%<----------------------------------------------------------------------------------------------------------------------}


BTW, I also tried with the new gdal-1.8.0 which was just released for 
CentOS 5.6. With some twiddling (lib paths, etc) I got it to start 
compiling, but it also errored out at the same step as above.


Any ideas?

Thanks,


Micha




More information about the el mailing list