[CentralOH] pysqlite2

Mark Erbaugh mark at microenh.com
Sat Apr 11 20:28:50 CEST 2009


I'm trying to build pysqlite2 against a version of sqlite3 that is not
installed as the default version.  Basically, I built a web app on my
local machine against sqlite 3.4.2 and went to install it on my web
server. They have sqlite 3.2.1 installed. I discovered that there were
some changes between 3.2.1 and 3.4.2 that are important to my app.
Rather than change my app, I thought I'd upgrade pysqlite2.  I'm just a
customer of the web server and don't have superuser access.

First, my understanding is that all the database access code is built
into pysqlite2, there is no "server" required.  It's just a matter of
getting _sqlite.so (part of pysqlite2) built with the proper code.

I downloaded and built the latest sqlite 3.6.12, using ./configure
--prefix=/home/mark/Projects/sqlite/install, make and make install
(where install is a local user writeable directory).  If I go into the
install directory and launch the command-line sqlite3, it indicates the
correct version 3.6.12.

pysqlite2 (version 2.5.5) is built using distutils and has a setup.cfg
file that is supposed to be modifiable for my situation. Here's the
original:

[build_ext]
#define=
#include_dirs=/usr/local/include
#library_dirs=/usr/local/lib
libraries=sqlite3
define=SQLITE_OMIT_LOAD_EXTENSION

I modified it to:

[build_ext]
#define=
include_dirs=/home/mark/Projects/sqlite/install/include
library_dirs=/home/mark/Projects/sqlite/install/lib
libraries=????
define=SQLITE_OMIT_LOAD_EXTENSION

I assume that # are comments, so I removed them when I edited the
include_dirs and library_dirs.  It appears that the correct -I and -L
parameters are passed to gcc.

The problem, I think is the libraries command.  If I leave it at

libraries=sqlite3 (the default)

pysqlite2 builds, but includes the versions of installed version of
sqlite3.

I haven't been able to figure what to do with the libraries line. If I
change it to anything other than sqlite3, the build process complains

for example with 

libraries=libsqlite3

there is an error message: /usr/bin/ld: cannot find -llibsqlite3

I changed it to

libraries = /home/mark/Projects/sqlite/install/lib/libsqlite3

and gcc complained

warning: no library file corresponding to
'/home/mark/Projects/sqlite/install/lib/libsqlite3' found (skipping)

There are several other files in the install/lib directory, but I get
similar errors with them all. FWIW, there is no sqlite3 file.  The only
sqlite3 file in the install tree is an executable which runs the sqlite
command line program (which indicates the proper version).

Obviously, I'm in over my head in understanding what's going on. Any
help would be appreciated.

Thanks,
Mark



More information about the CentralOH mailing list