Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I specify the linker when building python extensions?

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?

like image 779
aterrel Avatar asked Feb 20 '12 23:02

aterrel


1 Answers

You can customize the linker used with LDSHARED environment variable:

LDSHARED=/usr/bin/ld python setup.py build_ext
like image 141
tito Avatar answered Sep 23 '22 10:09

tito