Set C/C++ compiler for Python extensions
I would like to setup a default C and C++ compiler when building Python e开发者_高级运维xtensions 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
精彩评论