Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
852 views
in Technique[技术] by (71.8m points)

sqlite - Compile Python 3.4 with sqlite3

I have compiled SQLite3 3.8.6 and installed it to ${HOME}/opt with:

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

I am now 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 on this system. To compile Python, I am using:

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 newer version if SQLite3, but these same steps don't 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 & installs OK except for the fact that is using the older, system version of sqlite3 instead of the version that I compiled & installed myself.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

There is also the option of pre-linking your custom Python build with your own-built sqlite3. (I had the same issue: the custom python was using the system-provided sqlite3, completely ignoring the sqlite3 I built).

Prefix your configure and make commands with:

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 that the built python3 by default is linked to your sqlite3. This worked for me.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...