#!/bin/bash yum install make cmake gcc-c++ python-devel zlib-devel cd /home/amy git clone https://github.com/apache/rocketmq-client-python.git #instll bootstrap wget -O boost_1_58_0.tar.gz http://127.0.0.1:8090/rocketmq_pyclient/boost_1_58_0.tar.gz tar -xzf boost_1_58_0.tar.gz cd boost_1_58_0 ./bootstrap.sh --prefix=/usr/local --with-libraries=python if [ $? -ne 0 ];then exit 1 fi echo "Install boost static library...." sudo ./b2 cflags="-fPIC" cxxflags="-fPIC -Wno-unused-local-typedefs -Wno-strict-aliasing" link=static runtime-link=static --with-python -a install if [ $? -ne 0 ];then exit 1 fi echo "Install boost dynamic library....." sudo ./b2 cflags="-fPIC" cxxflags="-fPIC -Wno-unused-local-typedefs -Wno-strict-aliasing" link=shared runtime-link=shared --with-python -a install if [ $? -ne 0 ];then exit 1 fi echo "Finish build boost library." #install pythonlib cd /home/amy mkdir rocketmqlib && cd rocketmqlib wget https://opensource-rocketmq-client.oss-cn-hangzhou.aliyuncs.com/cpp-client/linux/1.2.0/RHEL7.x/librocketmq.tar.gz tar -xzf librocketmq.tar.gz cp librocketmq.so librocketmq.a /usr/local/lib/ cp -r rocketmq /usr/local/include/ #install module cd cd /home/amy/rocketmq-client-python mkdir build && cd build cmake ../ -DBoost_USE_STATIC_LIBS=OFF -DROCKETMQ_USE_STATIC_LIBS=OFF make make install #verify version strings /usr/local/lib/librocketmqclientpython.so | grep PYTHON_CLIENT_VERSION #export LD_LIBRARY_PATH export LD_LIBRARY_PATH=/usr/local/lib
参考地址:https://github.com/apache/rocketmq-client-python/blob/master/doc/Introduction.md