[gdal-dev] building gdal: conflict with sqlite3 version

Max Bohnet bohnet.max at googlemail.com
Mon Jan 26 06:35:30 PST 2015


Dear Even,

thanks for your answer,

>> Under Ubuntu 14, 64bit, i have the python distribution anaconda installed
>> in /opt/anaconda
>> and want to use the environment
>> /opt/anaconda/envs/py27
>> source activate py27
>>
>> I need gdal with Esri FileGeodatabase support, 
> 
> With write support ? If you just need read-only support, the OpenFileGDB 
> driver should be good enough.

Yes, i need Write support, therefore the OpenFileGDB does not help

>> so i could not use
>> conda install gdal, because this version is built without FGDB-support.
>> I had to build it from source using gdal 1.11.1
>> with the following options for the ./configure command
>>
>> (py27)root at j109817:/opt/drivers/gdal/gdal-1.11.1# ./configure
>> --with-fgdb=/opt/drivers/FileGDB_API/ --with-pg
>> --with-python=/opt/anaconda/envs/py27/bin/python --with-sqlite3
>> --with-spatialite
>>
>> this causes a warning of a conflict between the FGDB-driver and the
>> libxml2 driver, because the FGDB-driver of Esri comes with another
>> libxml2 library as the one in anaconda python.
>> If i ignore the warning, there is an error when i type make.
> 
> Max, when you report something, "there is an error" is not a description. You 
> have to include the full text of the error.
> 
> I doubt your error was related to the libxml2 warning. This one is more about 
> to warn about potential strange things at runtime.



>>
>> So i renamed /opt/anaconda to /opt/anaconda2 and started the building of
>> gdal:
>>
>> (py27)root at j109817:/opt/drivers/gdal/gdal-1.11.1# ./configure
>> --with-fgdb=/opt/drivers/FileGDB_API/ --with-pg
>> --with-python=/opt/anaconda2/envs/py27/bin/python --with-sqlite3
>> --with-spatialite
>> make
>> make install
>>
>> This installs a package GDAL-1.11.1-py2.7-linux-x86_64.egg into
>> /opt/anaconda2/envs/py27/lib/python2.7/site-packages
>>
>> and then renamed /opt/anaconda2 back to /opt/anaconda
>>
>> when i start python and try to
>>
>> from osgeo import gdal
>> the following error message appears:
>>
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>>   File
>> "/opt/anaconda/envs/py27/lib/python2.7/site-packages/GDAL-1.11.1-py2.7-linu
>> x-x86_64.egg/osgeo/__init__.py", line 21, in <module>
>>     _gdal = swig_import_helper()
>>   File
>> "/opt/anaconda/envs/py27/lib/python2.7/site-packages/GDAL-1.11.1-py2.7-linu
>> x-x86_64.egg/osgeo/__init__.py", line 17, in swig_import_helper
>>     _mod = imp.load_module('_gdal', fp, pathname, description)
>> ImportError: /usr/local/lib/libgdal.so.1: undefined symbol:
>> sqlite3_column_table_name
> 

> The error seemts to indicate that the sqlite3 lib that GDAL found at configure 
> time (likely the system one) had the sqlite3_column_table_name symbol (which 
> GDAL can optionally use when available), whereas the one available at runtime 
> in your environment has not.
> If you want to link against a specific sqlite3 version, you should mention it 
> in the --with-sqlite3 option, so as GDAL properly configures against the 
> appropriate sqlite3 version. But you would also need the relevant sqlite3 
> headers.

i tried it using the
--with-sqlite3=/opt/drivers/sqlite/sqlite-amalgamation-3080401
/sqlite3481
option in order to link it against the sqlite-Version 3.8.4.1, but i
don't know if thats the right way...

the folder /opt/drivers/sqlite/sqlite-amalgamation-3080401 includs the
sqlite3.c and shell.c as well as the header files sqlite3.h and sqlite3ext.h
sqlite3481 is the executable i compiled from these 4 files.


>>
>> In another Forum i found, that the sqlite3 python package is compiled
>> aganist another sqlite version than gdal.
>> In Anaconda python 2.7, it seems to be sqlite version 3.8.4.1
>>
>>>>> import sqlite3
>>>>> sqlite3.sqlite_version
>>
>> '3.8.4.1'
>>
>>
>> I could find 4 sourcefiles for sqlite 3.8.4.1
>> wget
>> https://olex-secure.openlogic.com/content/private/5e6a6f0815e830bba705e79e4
>> a0470fbee8a5880/sqlite/3.8.4.1/sqlite-amalgamation-3080401.zip unzip
>> sqlite-amalgamation-3080401.zip
>> gcc shell.c sqlite3.c -lpthread -ldl
>> mv "a.out" sqlite3841
>>
>> and tried to build gdal against this sqlite3 version with
>> ./configure --with-fgdb=/opt/drivers/FileGDB_API/ --with-pg
>> --with-python=/opt/anaconda2/envs/py27/bin/python
>> --with-sqlite3=/opt/drivers/sqlite/sqlite-amalgamation-3080401/sqlite3481
>> --with-spatialite
>>
>> but i have no idea, if that makes any sense.
>>
>> the error that appears when from osgeo import gdal remains the same.
>>
>> any idea what i could do?
> 
> It looks like you are going to have big troubles trying to mix things...

Because of the troubles i work now with 2 different gdal-Versions.
- The one i compiled from Source with FileGDB-Support and without python
support
and
- the one precompiled by anaconda python.
The first one i use with ogr2ogr to write the FileGeodatabases, the
second one to use in my python scripts.
This workaround works for me at the moment.

Thanks, Max




More information about the gdal-dev mailing list