setuptools 如何构建扩展,在哪里添加编译器选项?
How setuptools builds extensions, where to add a compiler option?
我试图在 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 完成安装包后删除了 link。
我试图在 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 完成安装包后删除了 link。