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.
On Ubuntu 14.04 the install looks ok when running gdal utilities: $ gdalinfo --version GDAL 1.11.0, released 2014/04/16 $ gdalinfo --formats|grep -i ecw ECW (rw+): ERDAS Compressed Wavelets (SDK 5.1)
JP2ECW (rw+v): ERDAS JPEG2000 (SDK 5.1)
However, the ECW and JP2ECW drivers do not work in python: $ python -c "from osgeo import gdal; print repr((gdal.GetDriverByName('ECW'),gdal.GetDriverByName('JP2ECW')))"
ERROR 1: /usr/lib/gdalplugins/1.11/gdal_ECW_JP2ECW.so: undefined symbol: GDALRegisterMe ERROR 1: /usr/lib/gdalplugins/1.11/gdal_ECW_JP2ECW.so: undefined symbol: _ZTI22GDALJP2AbstractDataset (None, None)
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.
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.
Can anybody provide some guidance on how to compile the ECW/JP2ECW drivers as a plugin on Linux?
Andre, doing this, you are building the plugin for gdal 1.11 with old gdal 1.10 code, which is not optimal as there were quite a few changes to the ECW/JP2ECW drivers between 1.10 and 1.11. And it still does not solve the problem of not being able to use the drivers in python (in fact python segfaults immediately for me when trying to import gdal).
What I do is very similar, but use the makefile from libgdal-ecw and manually build (using the same commands as per `gdal-ecw-build`) against the gdal 1.11 tree.