2012-04-09 2 views
1

저는 다양한 환경에서 일관되게 파이썬을 사용하고 싶습니다. 이러한 환경 중 하나가 cygwin입니다. 내가 사용하고자하는 구성 요소 중 하나는 gevent (http://www.gevent.org/intro.html)입니다. Cygwin에서 파이썬 2.7이 실행 중입니다 (여기에 설명 된 한 줄의 변경으로 로컬로 빌드되었습니다. 빌드하려면이 디렉토리가 필요합니다 : http://www.gossamer-threads.com/lists/python/python/976956).cygwin에서 python으로 gevent를 빌드하려면 어떻게해야합니까?

gevent에는 libevent (http://libevent.org/)가 필요합니다.

libevent는 (./configure를 & &이 & & 설치 할 수 있도록) Cygwin에서 아래 잘 구축 할 것으로 보인다.

그러나 gevent (pip install gevent)를 빌드 할 때 libevent가 정적 라이브러리 (예 : /usr/local/lib/libevent.a)를 빌드하고 gevent 빌드가 공유 라이브러리를 필요로하기 때문에 실패합니다. 따라서 :

gcc -shared -Wl,--enable-auto-image-base build/temp.cygwin-1.7.13-i686-2.7/gevent/core.o -L/usr/local/lib/python2.7/config -levent -lpython2.7 -o build/lib.cygwin-1.7.13-i686-2.7/gevent/core.dll 

/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -levent 

한편, 나는 정적으로 링크 gevent을 얻기 위해 시도하는 경우 (CFLAGS = '- 정적'gevent를 설치 PIP), -levent 여전히 역 참조 형 punned 포인터가 휴식하는 방법에 대한 많은 경고와 함께 실패 엄격한 앨리어싱 규칙과 몇 가지 추가 LD 실패 :

gevent/core.c : 21835 : 경고 : 타입 punned 포인터를 역 참조하면 중단됩니다 엄격한 앨리어싱 규칙

.... 
gevent/core.c:21836: warning: dereferencing type-punned pointer will break strict-aliasing rules 

gcc -shared -Wl,--enable-auto-image-base -static build/temp.cygwin-1.7.13-i686-2.7/gevent/core.o -L/usr/local/lib/python2.7/config -levent -lpython2.7 -o build/lib.cygwin-1.7.13-i686-2.7/gevent/core.dll 

/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -levent 

/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -lpython2.7 

... 그래서 ...

libevent에 .a 대신 .dll을 빌드해야한다고 생각하지만 libevent의 Makefile에는 실제로 .a 대상이 없으며이를 사용하기 위해 추상화가 어떻게 변경되어야하는지 명확하지 않습니다.

그래서 한 걸음 뒤로 물러서 : cygwin에서 파이썬 2.7 아래에 gevent를 설치하려면 어떻게해야합니까?

답변

1

http://code.google.com/p/gevent/downloads/list에서 베타 버전을 사용해 볼 수 있습니까?

외부 종속성이 필요하지 않습니다.

+0

제대로 구축 및 설치 된 것처럼 보입니다. 고맙습니다! (이 베타는 얼마나 안정적입니까?) – rdm

+0

그다지 안정적이지 않습니다. –

관련 문제