美文网首页
centos7 install mongocxx driver

centos7 install mongocxx driver

作者: 蓝云风翼 | 来源:发表于2019-07-31 14:05 被阅读0次

    1.首先安装依赖包:

    sudo yum install cyrus-sasl cyrus-sasl-devel.x86_64 cyrus-sasl.x86_64 cyrus-sasl-lib.x86_64 cyrus-sasl-plain.x86_64 cyrus-sasl-gssapi cyrus-sasl-plain krb5-libs libcurl libpcap lm_sensors-libs net-snmp net-snmp-agent-libs openldap openssl openssl-devel rpm-libs tcp_wrappers-libs

    2.安装编译snappy

    wget https://github.com/google/snappy/tarball/master

    tar -xzf master

    cd ./google-snappy-156cd89/cmake

    sudo cmake -DBUILD_SHARED_LIBS=ON ..

    sudo make -j6

    sudo make install

    cd ../../

    3.安装编译icu

    wget http://download.icu-project.org/files/icu4c/4.2.1/icu4c-4_2_1-src.tgz

    tar -xzf icu4c-4_2_1-src.tgz

    cd ./icu/source

    ./configure

    sudo make -j6

    sudo make install

    cd ../../

    4.安装编译mongo-c-driver

    wget https://github.com/mongodb/mongo-c-driver/releases/download/1.13.0/mongo-c-driver-1.13.0.tar.gz

    tar xzf mongo-c-driver-1.13.0.tar.gz

    cd ./mongo-c-driver-1.13.0

    mkdir cmake-build

    cd cmake-build

    sudo cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..

    sudo make -j6

    sudo make install

    cd ../../

    4.安装编译mongo-cxx-driver

    curl -OL https://github.com/mongodb/mongo-cxx-driver/archive/r3.4.0.tar.gz

    tar -xzf r3.4.0.tar.gz

    cd ./mongo-cxx-driver-r3.4.0/build

    sudo cmake -DCMAKE_BUILD_TYPE=Release -DBSONCXX_POLY_USE_MNMLSTC=1 -DCMAKE_INSTALL_PREFIX=/usr/local ..

    sudo make EP_mnmlstc_core

    sudo make -j6

    sudo make install

    參考:https://www.cnblogs.com/ealamyan/p/9903299.html

    相关文章

      网友评论

          本文标题:centos7 install mongocxx driver

          本文链接:https://www.haomeiwen.com/subject/xpozrctx.html