Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to tell if python was configured and compiled with "--with-threads --enable-shared"?

Tags:

python

debian

This is for Python 2.6.6 on Debian Squeeez. I'm trying to find out if the binaries shipped with debian were configured with the flags of:

--with-threads --enable-shared

as if they were not I will need to compile and install from source myself.

like image 225
Harel Avatar asked Feb 08 '12 12:02

Harel


1 Answers

--with-threads (which is the default) will mean Python supports threading, which will mean import thread will work. An easy way to test this is with python$version -m threading

--enable-shared will mean Python comes with a libpython$version.so file, installed in $prefix/lib (alongside the python$version directory, not inside it.) The easiest thing to do is to look if that file is there -- assuming you want to know because you need to use this libpython shared library. If you actually need to know if the python$version binary uses this shared library, ldd will tell you that. I make that distinction because on Debian, /usr/lib/python$version.so will exist even though /usr/bin/python$version is statically linked.

like image 96
Thomas Wouters Avatar answered Nov 15 '22 04:11

Thomas Wouters