使用mac操作rocketMQ,按照官网说明和查找文章安装模块和依赖都出现安装失败的情况,查找资料安装也是会出现这样或那样的问题,纠结好长时间,终于安装成功记录一下,希望可以帮助到其他人
下载压缩包
.
├── boost_1_72_0.tar.gz
├── libevent-2.1.12-stable.tar.gz
├── openssl-openssl-3.0.2.tar.gz
└── rocketmq-client-cpp-2.1.0.tar.gz
0 directories, 4 files
将RocketMQ-Client-CPP.tar.gz
进行解压
进入rocketmq-client-cpp-2.1.0
文件夹
创建tmp_down_dir
文件夹
.
├── CMakeLists.txt
├── CONTRIBUTING.md
├── LICENSE
├── NOTICE
├── PULL_REQUEST_TEMPLATE.md
├── README.md
├── Win32
├── build.sh
├── cmake
├── dep
├── distribution
├── example
├── format.sh
├── include
├── libs
├── package_rocketmq.mri
├── project
├── rpm
├── src
├── test
├── tmp-down-dir # 新创建的文件夹
└── win32_build.bat
12 directories, 10 files
将libevent-2.1.12-stable.tar.gz
、boost_1_79_0.tar.gz
、openssl-openssl-3.0.2.tar.gz
移动到刚创建的tmp_down_dir
的文件夹中
tmp_down_dir
├── boost_1_72_0.tar.gz
├── libevent-release-2.1.11-stable.zip
└── openssl-openssl-3.0.2.tar.gz
0 directories, 3 files
执行./build.sh
看到现在的情况就表示编译成功了
At last, ar libboost_filesystem
Md5 Hash RocketMQ After:
./build.sh: line 440: md5sum: command not found
Try to copy /Users/txk/Downloads/rocketmq-client-cpp-2.1.0/tmp_static_package_dir/librocketmq.a to /Users/txk/Downloads/rocketmq-client-cpp-2.1.0/bin/
############# Package static rocketmq library success.#############
Build success without executing unit tests.
确认bin
是否生成内容,如果没有内容表示失败了,重新按照步骤编译
bin
├── AsyncProducer
├── AsyncPushConsumer
├── BatchProducer
├── CAsyncProducer
├── CBatchProducer
├── COrderlyAsyncProducer
├── OrderProducer
├── OrderlyPushConsumer
├── Producer
├── PullConsumeMessage
├── PullConsumer
├── PushConsumeMessage
├── PushConsumer
├── PushConsumerOrderly
├── SendDelayMsg
├── SyncProducer
├── TransactionProducer
├── bin
├── include
├── lib
├── librocketmq.a
└── librocketmq.dylib
创建rocketmq
文件夹
sudo mkdir -p /usr/local/include/rocketmq
复制生成的可执行文件和文件夹到指定的文件夹中
sudo cp -R bin/* /usr/local/include/rocketmq
sudo cp -R bin/librocketmq* /usr/local/lib
指定librocketmq.dylib
对动态库的查找路径
sudo install_name_tool -id "@rpath/librocketmq.dylib" /usr/local/lib/librocketmq.dylib