classification
Title: Compiling Python 3 with sqlite impossible when sqlite installation is in a non standard directory
Type: compile error Stage: resolved
Components: Build, Extension Modules Versions: Python 3.9, Python 3.8, Python 3.7, Python 3.6, Python 3.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: manuco
Priority: normal Keywords:

Created on 2019-08-07 10:46 by manuco, last changed 2019-11-08 14:20 by manuco. This issue is now closed.

Messages (2)
msg349162 - (view) Author: Emmanuel C (manuco) Date: 2019-08-07 10:46
When compiling sqlite with a specific prefix, Python compilation process is unable to find sqlite despite CFLAGS and LDFLAGS environment variable correctly set.

The problem is in the setup.py, in the detect_modules function or the detect_sqlite function.

The sqlite_inc_paths list variable (line 1351) only contains well known places for sqlite, but there is no way to include others pathes (except by modifying the source code). The inc_dirs variable is also checked. But since it is not initialized with CFLAGS env_var, the CFLAGS -I pathes are not included, then not checked for a sqlite header file.

This behavior forbids compiling and installing sqlite in a specific directory. Adding the sqlite3.h path in the detect_sqlite function allows sqlite to be included in the final python compilation and install and is a possible workaround.

There should be a way to add this path to the detect_sqlite without having to edit the file on the fly in order to have a working sqlite module with a non standard sqlite install directory.

On a side note, why installing sqlite in some random directory ? People don't always have right to write in /usr/lib and /usr/local/lib.
msg356241 - (view) Author: Emmanuel C (manuco) Date: 2019-11-08 14:20
Sorry guy,

I've found my error : I have to use the CPPFLAGS instead of the CFLAGS in order to include sqlite3 into my own Python compiled installation.
History
Date User Action Args
2019-11-08 14:20:48manucosetstatus: open -> closed
resolution: not a bug
messages: + msg356241

stage: resolved
2019-08-07 10:46:55manucocreate