5

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.

Harel
  • 1,989
  • 3
  • 26
  • 44
  • Try parsing info from pyconfig.h? This file is generated during the compile time and is platform specific. Not sure if it has all the flags, though :( Also running python -v might reveal some information. – Mikko Ohtamaa Feb 08 '12 at 13:02
  • if you guys using newest version of python check this https://stackoverflow.com/questions/23201498/how-to-check-if-python3-was-built-with-enable-shared and this https://stackoverflow.com/questions/10192758/how-to-get-the-list-of-options-that-python-was-compiled-with – buncis Jul 28 '21 at 20:01

1 Answers1

11

--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.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Thomas Wouters
  • 130,178
  • 23
  • 148
  • 122