gpt4 book ai didi

python - setuptools 如何构建扩展,在哪里添加编译器选项?

转载 作者:太空宇宙 更新时间:2023-11-04 05:21:44 30 4
gpt4 key购买 nike

我试图在 Cygwin 上构建 numpy,但是在 X11/xlocale.h 中定义的 xlocale.h 出现错误>。我天真的补丁是添加这个:

#ifdef __CYGWIN__ 
#include "X11/Xlocale.h"
#else
#include "xlocale.h"
#endif

或者,我可以将 -I/usr/include/X11 添加到 Makefile 中,但是在 setuptools 中没有 Makefile,我想了解它是如何工作的.

当我键入 python setup.py build_ext 时,Python 如何构建扩展?

最佳答案

我知道我的解决方案不好,但我最终还是这样做了:

cd /usr/include
ln -s locale.h xlocale.h

运行前:

pip3 install --user -U numpy 

它奏效了。

我在 pip 完成安装包后删除了链接。

关于python - setuptools 如何构建扩展,在哪里添加编译器选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40072263/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com