How do I specify the linker when building python extensions?

半城伤御伤魂 提交于 2020-06-27 09:30:55

问题


I have python2.7 installed using macports gcc-4.6. When I build an extension module (python setup.py build_ext) the correct gcc (/opt/local/bin/gcc) gets called but the wrong linker (it call /Developer/usr/bin/clang). Is there a way to override the call that python is linking with?


回答1:


You can customize the linker used with LDSHARED environment variable:

LDSHARED=/usr/bin/ld python setup.py build_ext


来源:https://stackoverflow.com/questions/9369827/how-do-i-specify-the-linker-when-building-python-extensions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!