提交 9441e46b authored 作者: Dumitru Erhan's avatar Dumitru Erhan

a cleaner way to get the path to -lpython2.x

上级 37924e4a
......@@ -640,9 +640,10 @@ def gcc_module_compile_str(module_name, src_code, location=None, include_dirs=[]
# sometimes, the linker cannot find -lpython so we need to tell it
# explicitly where it is located
# this returns somepath/lib/python2.5/site-packages
python_lib = distutils.sysconfig.get_python_lib()
python_lib = os.path.dirname(os.path.dirname(python_lib))
# this returns somepath/lib/python2.x
python_lib = distutils.sysconfig.get_python_lib(plat_specific=1, \
standard_lib=1)
python_lib = os.path.dirname(python_lib)
if python_lib not in lib_dirs:
lib_dirs.append(python_lib)
......
......@@ -71,9 +71,10 @@ def nvcc_module_compile_str(module_name, src_code, location=None, include_dirs=[
# sometimes, the linker cannot find -lpython so we need to tell it
# explicitly where it is located
# this returns somepath/lib/python2.5/site-packages
python_lib = distutils.sysconfig.get_python_lib()
python_lib = os.path.dirname(os.path.dirname(python_lib))
# this returns somepath/lib/python2.x
python_lib = distutils.sysconfig.get_python_lib(plat_specific=1, \
standard_lib=1)
python_lib = os.path.dirname(python_lib)
if python_lib not in lib_dirs:
lib_dirs.append(python_lib)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论