2012-10-23 1 views
0

속도 향상을 위해 Python/Numpy 코드를 Cython으로 컴파일하려고합니다.Cython 코드를 컴파일 할 수 없습니다 - 인식 할 수없는 명령 행 옵션 '-mno-cygwin'

C:\Python27\MATH7450>python setup.py build_ext --inplace 
running build_ext 
cythoning heat.pyx to heat.c 
building 'heat' extension 
C:\strawberry\c\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python27\lib\site-pa 
ckages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c heat.c -o bu 
ild\temp.win32-2.7\Release\heat.o 
cc1.exe: error: unrecognized command line option '-mno-cygwin' 
error: command 'gcc' failed with exit status 1 

나는 윈도우 7 64 비트를 실행 해요 - 내 바탕 화면에 잘 컴파일 할 수 있습니다 그것을 실행하는 내 노트북에 컴파일 시도 후 내 .pyx 사이 썬 파일을 복사, 나는 다음과 같은 오류가 발생합니다. 나는 그것이 딸기 펄을 사용하고있는 것을 본다. 나는 32 비트 버전의 딸기 펄을 설치했다. 다시 말하지만, 그것은 내 바탕 화면에서 잘 작동하지만 노트북에 이식 할 때이 이상한 오류가 발생합니다.

답변

2

Windows installation instructions of Cython 당 권장 컴파일러는 오프라인 설치 Visual Studio 2008 Express iso에서 설치할 수있는 무료 Visual C++ 2008 Express입니다.

Cython can use the MinGW and its gcc 이어도 reportedly more difficult route이지만.

질문에 포함 된 출력에서 ​​Cython은 Strawberry Perl 배포에 포함 된 MinGW 설치를 사용하려고합니다.

내 생각에 Visual C++ 2008 Express을 설치하는 것이 좋습니다. 제 경험상 Cython 또는 다른 Python C 확장 모듈을 컴파일하는 데 가장 적합합니다.

1

-mno-cygwinPython\Lib\distutils\cygwinccompiler.py에서이 문제가 발생합니다. Compiling with cython and mingw produces gcc: error: unrecognized command line option '-mno-cygwin' 또는 http://korbinin.blogspot.com/2013/03/cython-mno-cygwin-problems.html을 참조하십시오. 내 파이썬 배포본 (Anaconda)의 cygwinccompiler.py에는 그런 내용이 없습니다. 어쨌든 Mingw32CCompiler 클래스의 정의에있는 -mno-cygwin을 모두 제거한 후에는 컴파일 할 수 있어야합니다.

관련 문제