Compile Python 3.4 with sqlite3

I compiled SQLite3 3.8.6 and installed it in $ {HOME} / opt with

LDFLAGS="-L${HOME}/opt/lib" CFLAGS="-L${HOME}/opt/include" ./configure --prefix=$HOME/opt make && make install 

Now I'm trying to compile Python 3.4.2 to use this version instead of the version installed for the entire system. I do not have root access to this system. To compile Python, I use:

 LDFLAGS="-L${HOME}/opt/lib" CFLAGS="-L${HOME}/opt/include" ./configure --prefix=$HOME/opt make && make install 

I was able to compile Python 3.3.5 with my new version if SQLite3, but these same steps do not seem to work for me for 3.4.2.

How can I compile Python 3.4.2 to include my version of SQLite 3.8.6, which is located in $ {HOME} / opt?

Thanks.

EDIT: It compiles and installs OK, except that it uses an older system version of sqlite3 instead of the version that I compiled and installed myself.

+5
source share
3 answers

It is also possible to pre-build your custom Python assembly using native SQL-3. (I had the same problem: custom python used system sqlite3, completely ignoring the built sqlite3).

Prefix for configure and make commands:

 LD_RUN_PATH=$HOME/opt/lib configure LDFLAGS="-L$HOME/opt/lib" CPPFLAGS="-I$HOME/opt/include" … LD_RUN_PATH=$HOME/opt/lib make 

so the built python3 by default associated with your sqlite3. It worked for me.

+8
source
 import platform,sqlite3 print("Oper Sys : %s %s" % (platform.system(), platform.release())) print("Platform : %s %s" % (platform.python_implementation(),platform.python_version())) print("SQLite : %s" % (sqlite3.sqlite_version)) 

When I run this code, the output contains the system version of sqlite3:

 Oper Sys : Linux 3.2.0-4-amd64 Platform : CPython 3.4.2 SQLite : 3.7.13 

After installing sqlite v3.8.6 in the $ {HOME} / opt {include, lib} section and installing this in my .bashrc:

 export LD_LIBRARY_PATH="${HOME}/opt/lib" 

I get the desired result:

 Oper Sys : Linux 3.2.0-4-amd64 Platform : CPython 3.4.2 SQLite : 3.8.6 

Note that the version of SQLite changes from 3.7.13 to 3.8.6

+1
source

Hi, this helped me:

 cd /tmp wget https://www.sqlite.org/2019/sqlite-autoconf-3280000.tar.gz tar xvf sqlite-autoconf-3280000.tar.gz mv /usr/bin/sqlite3 /usr/bin/sqlite3.7 cp /tmp/sqlite-autoconf-3280000/sqlite3 /usr/bin/sqlite3 cp /tmp/sqlite-autoconf-3280000/.libs/libsqlite3.so.0.8.6 /usr/lib64/libsqlite3.so.0.8.6 cp /tmp/sqlite-autoconf-3280000/.libs/libsqlite3.so.0 /usr/lib64/libsqlite3.so.0 
0
source

Source: https://habr.com/ru/post/1388298/


All Articles