agoragames/pyevent — Issue #4: pyevent fails to build against libevent 2.x
Author: vitaly-krugl
Created: 2012-03-08 04:27:52+00:00
State: open

On Mac OS:

1. built libevent-2.0.17 in a private (non-system) directory.

2. Downloaded agoragames-pyevent-0_4_2-0-g93d1ba3.tar

3. modified pyevent's setup.py to include this search block for libevent (to reference my private libevent build location)

# Look for my private location for libevent
elif glob.glob('/Users/vkruglikov/Packages/libevent/libevent-2.0.17-stable/.libs/libevent.*'):
basePath = '/Users/vkruglikov/Packages/libevent/libevent-2.0.17-stable'
print 'found libevent under: ', basePath, '/.libs'
event = Extension(name='event',
sources=[ 'event.c' ],
libraries=[ 'event' ],
include_dirs=[os.path.join(basePath, 'include'), basePath],
library_dirs=[os.path.join(basePath, '.libs')])

4. Ran: python setup.py build

This failed with the following errors:

Vitalys-MacBook-Pro:agoragames-pyevent-93d1ba3 vkruglikov$ python setup.py build
found libevent under: /Users/vkruglikov/Packages/libevent/libevent-2.0.17-stable /.libs
running build
running build_ext
building 'event' extension
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/Users/vkruglikov/Packages/libevent/libevent-2.0.17-stable/include -I/Users/vkruglikov/Packages/libevent/libevent-2.0.17-stable -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c event.c -o build/temp.macosx-10.7-intel-2.6/event.o
event.c: In function ‘__pyx_pf_5event_5event_add’:
event.c:2069: warning: implicit conversion shortens 64-bit value into a 32-bit value
event.c:2076: warning: implicit conversion shortens 64-bit value into a 32-bit value
event.c: In function ‘__pyx_pf_5event_11bufferevent_read’:
event.c:4137: error: dereferencing pointer to incomplete type
event.c:4149: error: dereferencing pointer to incomplete type
event.c:4177: error: dereferencing pointer to incomplete type
event.c: In function ‘__pyx_pf_5event_11bufferevent_write’:
event.c:4247: warning: passing argument 2 of ‘PyObject_AsCharBuffer’ from incompatible pointer type
event.c:4247: warning: passing argument 3 of ‘PyObject_AsCharBuffer’ from incompatible pointer type
event.c: In function ‘__pyx_pf_5event_dns_resolve_reverse’:
event.c:5307: warning: passing argument 1 of ‘evdns_resolve_reverse’ from incompatible pointer type
event.c: In function ‘__pyx_pf_5event_dns_resolve_reverse_ipv6’:
event.c:5463: warning: passing argument 1 of ‘evdns_resolve_reverse’ from incompatible pointer type
event.c: In function ‘__pyx_pf_5event_12__wsgi_input_read’:
event.c:6320: warning: pointer targets in passing argument 1 of ‘PyString_FromStringAndSize’ differ in signedness
event.c: In function ‘__pyx_f_5event___path_handler’:
event.c:6607: warning: assignment discards qualifiers from pointer target type
event.c:6630: warning: assignment discards qualifiers from pointer target type
event.c:6653: warning: assignment discards qualifiers from pointer target type
event.c: In function ‘__pyx_pf_5event_5event___simple_callback’:
event.c:1689: warning: implicit conversion shortens 64-bit value into a 32-bit value
event.c: In function ‘__pyx_pf_5event_5event_add’:
event.c:2069: warning: implicit conversion shortens 64-bit value into a 32-bit value
event.c:2076: warning: implicit conversion shortens 64-bit value into a 32-bit value
event.c: In function ‘__pyx_pf_5event_11bufferevent_read’:
event.c:4137: error: dereferencing pointer to incomplete type
event.c:4149: error: dereferencing pointer to incomplete type
event.c:4177: error: dereferencing pointer to incomplete type
event.c: In function ‘__pyx_pf_5event_11bufferevent_write’:
event.c:4247: warning: passing argument 2 of ‘PyObject_AsCharBuffer’ from incompatible pointer type
event.c:4247: warning: passing argument 3 of ‘PyObject_AsCharBuffer’ from incompatible pointer type
event.c: In function ‘__pyx_f_5event___evdns_callback’:
event.c:4536: warning: cast from pointer to integer of different size
event.c: In function ‘__pyx_pf_5event_dns_resolve_ipv4’:
event.c:4995: warning: cast to pointer from integer of different size
event.c: In function ‘__pyx_pf_5event_dns_resolve_ipv6’:
event.c:5151: warning: cast to pointer from integer of different size
event.c: In function ‘__pyx_pf_5event_dns_resolve_reverse’:
event.c:5307: warning: cast to pointer from integer of different size
event.c:5307: warning: passing argument 1 of ‘evdns_resolve_reverse’ from incompatible pointer type
event.c: In function ‘__pyx_pf_5event_dns_resolve_reverse_ipv6’:
event.c:5463: warning: cast to pointer from integer of different size
event.c:5463: warning: passing argument 1 of ‘evdns_resolve_reverse’ from incompatible pointer type
event.c: In function ‘__pyx_pf_5event_12__wsgi_input_read’:
event.c:6320: warning: pointer targets in passing argument 1 of ‘PyString_FromStringAndSize’ differ in signedness
event.c: In function ‘__pyx_f_5event___path_handler’:
event.c:6607: warning: assignment discards qualifiers from pointer target type
event.c:6630: warning: assignment discards qualifiers from pointer target type
event.c:6653: warning: assignment discards qualifiers from pointer target type
lipo: can't open input file: /var/folders/my/whcrb5rn1rqc3g8klvk_vk580000gn/T//cctX4zKQ.out (No such file or directory)
error: command 'llvm-gcc-4.2' failed with exit status 1
Vitalys-MacBook-Pro:agoragames-pyevent-93d1ba3 vkruglikov$ uname -a
Darwin Vitalys-MacBook-Pro.local 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64
Vitalys-MacBook-Pro:agoragames-pyevent-93d1ba3 vkruglikov$