Install gevent in AIX with gcc
greenlet
Download greenlet-0.4.1.zip from https://github.com/python-greenlet/greenlet
1 | sudo gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -fno-tree-dominator-opts -I. -I/opt/freeware/include/python2.7 -c greenlet.c -o build/greenlet.o |
libev
Download libev-4.15.tar.gz from http://dist.schmorp.de/libev/
1 | ./configure --prefix=/usr/local/libev |
c-ares
Download c-ares from http://c-ares.haxx.se/
1 | ./configure --prefix=/usr/local/c-ares |
Or just run
run configure CONFIG_COMMANDS= CONFIG_FILES=
gevent
- Download gevent-1.0.tar.gz from https://pypi.python.org/pypi/gevent#downloads
1
2
3mkdir build
mkdir build/gevent
cp gevent/*py build/gevent - build core.so
1
2sudo gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -fno-tree-dominator-opts -I/opt/freeware/include/python2.7 -I/usr/local/libev/include gevent/gevent.core.c -c -o build/gevent/core.o
gcc -pthread -shared -lpython2.7 -L/usr/local/libev/lib -lev -lm build/gevent/core.o -o build/gevent/core.so ( **-lm should be added** otherwise error throw “ld: 0711-317 ERROR: Undefined symbol: .floor”) - build ares.so
1.change folder to c-ares and then runconfigure CONFIG_COMMANDS= CONFIG_FILES=
In file gevent/dnshelper.c, replaceto1
2
3#include <netdb.h>
reason: Error throw “dereferencing pointer to incomplete type” Ref to
http://richliu.pixnet.net/blog/post/25765892-gcc-%3A-error%3A-dereferencing-pointer-to-incomplete-type
http://blog.csdn.net/david_xtd/article/details/7781160
http://liuzhigong.blog.163.com/blog/static/1782723752011314113857852/
2.build share object
1 | gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -fno-tree-dominator-opts -I/opt/freeware/include/python2.7 -Ic-ares gevent/gevent.ares.c -c -o build/gevent/gevent.ares.o |
build semaphore.so
1
2sudo gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -fno-tree-dominator-opts -I/opt/freeware/include/python2.7 gevent/gevent.**semaphore.c -c -o build/gevent/gevent.**semaphore.o
gcc -pthread -shared -lpython2.7 build/gevent/gevent.**semaphore.o -o build/gevent/**semaphore.sobuild **util.so
1
2sudo gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -fno-tree-dominator-opts -I/opt/freeware/include/python2.7 gevent/gevent.**util.c -c -o build/gevent/gevent._util.o
gcc -pthread -shared -lpython2.7 build/gevent/gevent.**util.o -o build/gevent/**util.so
Reference:
Linux 的 .a / .so / .la 函式庫的差異
问个.a和.so的区别
Linux下静态链接库与动态链接库的区别
凡你醉处 你说过 皆非他乡
淺談coroutine與gevent