通过Mac在PyPy中安装Pygame

3

我尝试在我的Mac OSX Lion上安装Pygame 1.9.1release版本的PyPy。首先使用pypy config.py,然后使用pypy setup.py install运行安装程序。由于我看到它正在尝试使用普通Python进行配置(这会安装正确,但会导致导入错误),所以我添加了配置到安装过程中。在安装过程中,会出现许多警告,例如:

src/overlay.c:44:5: warning: implicit declaration of function 'PyObject_Free' is invalid in C99 [-Wimplicit-function-declaration]
PyObject_Free ((PyObject*)self);
^

但是它还提供了2个类似的错误:
    In file included from src/scale_mmx.c:33:
src/scale_mmx64.c:424:27: error: invalid instruction mnemonic 'movsxl'
        asm __volatile__( " /* MMX code for inner loop of X bilinear filter */ "
                          ^
<inline asm>:1:191: note: instantiated into assembly here
         /* MMX code for inner loop of X bilinear filter */  movl             -36(%rbp),      %ecx;            pxor          %mm0,      %mm0;           1:                                           movsxl         (%rdi), ...
                                                                                                                                                                                                     ^~~~~~
In file included from src/scale_mmx.c:33:
src/scale_mmx64.c:499:27: error: invalid instruction mnemonic 'movsxl'
        asm __volatile__( " /* MMX code for inner loop of X bilinear filter */ "
                          ^
<inline asm>:1:191: note: instantiated into assembly here
         /* MMX code for inner loop of X bilinear filter */  movl             -36(%rbp),      %ecx;            pxor          %mm0,      %mm0;           1:                                           movsxl         (%rdi), ...
                                                                                                                                                                                                     ^~~~~~
2 errors generated.

看起来对我而言,PyPy在生成C语言中的块注释时卡住了。为什么它要将注释封装在asm和volatile中,我感到很困惑。但这是提供给我的代码,可以在常规python中运行。那么这是一个错误吗?还是我漏了什么?

1个回答

2

很有可能PyPy与CPython有一些不同的#defines(原因或好或坏),而pygame选择使用其他东西(基于糟糕思考的#else和隐含假设),试图编译无效的C代码。不过我只是猜测,你需要跟进为什么以及如何在CPython上编译/未编译相同的代码。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接