我下载了一个 python 包装的 C++ 代码,并试图从源代码构建它,它编译时没有错误,但是当我运行最终结果时,它失败的方式似乎表明它没有找到至少一个它应该链接的库。
令我惊讶的是,在 中distutils.core.Extension
,您可以提供库列表,但没有错误或消息告诉我其中一个库不存在。我可以将任何乱码字符串放入列表中,它仍然可以正常运行。里面有这个设置Extension
吗?或者有什么其他的检查方法?
作为参考,这里是setup.py
代码(Ubuntu 14.04,Python 2.7):
coolmodule = Extension('cool',
sources = [
'cool/main_python.c'
],
libraries = [
'cool',
'stdc++'
'lapack',
'blas',
'gfortran',
'fftw3',
# if I add any gibberish string to this list,
# it still runs without error!
],
library_dirs = ['./build'],
extra_link_args = [
'./build/libcool.a'
]
)
setup(name = 'cool',
ext_modules = [coolmodule]
)
先感谢您!!