有没有办法告诉python是否配置和编译与“ - 与线程 - 共享共享”? [英] Is there a way to tell if python was configured and compiled with "--with-threads --enable-shared"?
问题描述
- 线程 - -enable-shared
好像他们不是我需要从源码自己编译和安装。 / p>
- 线程
(这是默认值) Python支持线程,这将意味着 import thread
将会工作。一个简单的测试方法是使用 python $ version -m线程
启用共享
将意味着Python附带一个 libpython $ version.so
文件,安装在$ code> $ prefix / lib (和
python $ version
目录,不在里面)。最简单的做法是查看文件是否存在 - 假设你想知道因为你需要使用这个libpython共享库。如果您确实需要知道 python $ version
二进制是否使用此共享库, ldd
会告诉你的。我做出这样的区别,因为Debian,即使 / usr / bin / python $ version /usr/lib/python$version.so
/ code>是静态链接的。
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.
--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.
这篇关于有没有办法告诉python是否配置和编译与“ - 与线程 - 共享共享”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!