<div dir="ltr"><div><div>I can build the ECW/JP2ECW driver as a plugin (using 5.0 or 5.1 SDK) on Ubuntu 12.04 (GDAL 1.10) using the gdal-ecw-build script from from the ubuntugis-unstable libgdal-ecw package (<a href="https://launchpad.net/~ubuntugis/+archive/ubuntugis-unstable">https://launchpad.net/~ubuntugis/+archive/ubuntugis-unstable</a>).<br>
<br>I have also built the ECW/JP2ECW driver as a plugin (using 5.1 SDK) on Ubuntu 14.04 by copying the makefile/configure scripts from the 12.04 ubuntugis-unstable libgdal-ecw package to a vanilla GDAL 1.11 source tree (frmts/ecw), compiling and installing to /usr/lib/gdalplugins/1.11.<br>
<br>On Ubuntu 14.04 the install looks ok when running gdal utilities:<br>$ gdalinfo --version<br>GDAL 1.11.0, released 2014/04/16<br>$ gdalinfo --formats|grep -i ecw<br> ECW (rw+): ERDAS Compressed Wavelets (SDK 5.1)<br>
JP2ECW (rw+v): ERDAS JPEG2000 (SDK 5.1)<br><br>However, the ECW and JP2ECW drivers do not work in python:<br>$ python -c "from osgeo import gdal; print repr((gdal.GetDriverByName('ECW'),gdal.GetDriverByName('JP2ECW')))"<br>
ERROR 1: /usr/lib/gdalplugins/1.11/gdal_ECW_JP2ECW.so: undefined symbol: GDALRegisterMe<br>ERROR 1: /usr/lib/gdalplugins/1.11/gdal_ECW_JP2ECW.so: undefined symbol: _ZTI22GDALJP2AbstractDataset<br>(None, None)<br><br>On Ubuntu 12.04 (with the plugin built using the gdal-ecw-build script and provided source package), different undefined symbol errors are reported when importing gdal in python.<br>
<br>$ python -c "from osgeo import gdal; print repr((gdal.GetDriverByName('ECW'),gdal.GetDriverByName('JP2ECW')))"<br>ERROR 1: /usr/lib/gdalplugins/1.10/gdal_ECW_JP2ECW.so: undefined symbol: _ZTI14GDALPamDataset<br>
ERROR 1: /usr/lib/gdalplugins/1.10/gdal_ECW_JP2ECW.so: undefined symbol: _ZTI14GDALPamDataset<br>(None, None)<br><br>I reported the issue with 12.04 to UbuntuGIS (<a href="http://trac.osgeo.org/ubuntugis/ticket/34">http://trac.osgeo.org/ubuntugis/ticket/34</a>) last year, but there has been no resolution.<br>
<br>I can always build gdal itself from source with python and ECW support, but I'd like to easily build ECW support as a plugin so I can just rely on my package manager to keep everything else up to date.<br><br>Can anybody provide some guidance on how to compile the ECW/JP2ECW drivers as a plugin on Linux?<br>
<br><br></div>Regards<br></div>Luke<br></div>