【问题标题】:Set C/C++ compiler for Python extensions为 Python 扩展设置 C/C++ 编译器
【发布时间】:2011-07-04 16:54:41
【问题描述】:

我想在 Linux 下构建 Python 扩展时设置一个默认的 C 和 C++ 编译器。我注意到python setup.py 构建的--compiler 选项,但我想知道是否有办法将其设置为环境变量,以便我可以只指定一次。

【问题讨论】:

    标签: c++ python linux


    【解决方案1】:

    无法使用环境变量,但您可以创建 setup.cfg 文件。见Writing the Setup Configuration File。以下 setup.cfg 文件将尝试使用英特尔 C 编译器:

    [build_ext] 
    compiler=icc
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-21
      相关资源
      最近更新 更多