2012-05-21 62 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上編譯相同的代碼。