Set C/C++ compiler for Python extensions

I would like to setup a default C and C++ compiler when building Python extensions under Linux. I noticed the --compiler option to python setup.py build, but I am wondering if there is a way of setting this as an environmental variable so that I can specify them just once.


It's not possible to use an environment variable, but you can create a setup.cfg file. See Writing the Setup Configuration File. The following setup.cfg file will try to use the Intel C Compiler:

[build_ext] 
compiler=icc
链接地址: http://www.djcxy.com/p/51206.html

上一篇: System.Internal中的HACK方法(x64上的.net 4.0)

下一篇: 为Python扩展设置C / C ++编译器