mac pro安装rocketmq-client-python

杜河
2023-12-01

问题:

使用mac操作rocketMQ,按照官网说明和查找文章安装模块和依赖都出现安装失败的情况,查找资料安装也是会出现这样或那样的问题,纠结好长时间,终于安装成功记录一下,希望可以帮助到其他人

环境依赖

安装步骤:

  1. 下载压缩包

    .
    ├── 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
    
  2. RocketMQ-Client-CPP.tar.gz进行解压

  3. 进入rocketmq-client-cpp-2.1.0文件夹

  4. 创建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
    
  5. libevent-2.1.12-stable.tar.gzboost_1_79_0.tar.gzopenssl-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
    
  6. 执行./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.
    
  7. 确认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
    
  8. 创建rocketmq文件夹

    sudo mkdir -p /usr/local/include/rocketmq
    
  9. 复制生成的可执行文件和文件夹到指定的文件夹中

    sudo cp -R bin/* /usr/local/include/rocketmq
    sudo cp -R bin/librocketmq* /usr/local/lib
    
  10. 指定librocketmq.dylib对动态库的查找路径

    sudo install_name_tool -id "@rpath/librocketmq.dylib" /usr/local/lib/librocketmq.dylib
    
其他依赖模块正常安装就可以使用了

参考资料:

  • https://www.iteye.com/blog/cooler1217-2521597
 类似资料: