2012-05-21 34 views
3

我尝试在我的Mac OSX Lion上安装Pygame 1.9.1版的PyPy。我先用pypy setup.py installpypy config.py。我将配置添加到安装过程,因为我看到它试图用普通的python进行配置(安装正确,但导致导入错误)。 Durring安装过程中,有很多这样的警示:通过Mac在PyPy中安装Pygame

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工作。那么这是一个错误?或者我错过了什么?

回答

2

很可能PyPy有一些与CPython不同的定义(出于好的或坏的原因),并且pygame选择使用其他的东西(基于带有隐含假设的糟糕的想法#else)试图编译无效的C。米只是猜测,但你需要遵循为什么以及如何在CPython上编译相同的代码。