自学内容网 自学内容网

ubuntu下安装编译cmake,grpc与protobuf

install cmake

sudo apt-get install -y g++ make libssl-dev

cd third_party/cmake-3.17.2
 
./configure
 
sudo make && make install

cmake --version 

install grpc

$ sudo apt-get install -y build-essential autoconf libtool pkg-config

install 
  cd third_party/grpc-1.41.0
  cd cmake
  mkdir build
  cd build
  cmake -DgRPC_INSTALL=ON \
        -DgRPC_BUILD_TESTS=OFF \
        -DCMAKE_INSTALL_PREFIX=$MY_INSTALL_DIR \
        ../..
  make -j4
  sudo make install

install protobuf

  • 注意:要是没有XXtest文件时,手动创建一下
$ sudo apt-get install -y autoconf automake libtool curl make g++ unzip

install
    cd third_party/grpc-1.41.0/third_party/protobuf
    sudo ./autogen.sh
    sudo ./configure --prefix=/usr/local
    sudo make -j4
    sudo make check
    sudo make install
    sudo ldconfig # refresh shared library cache.

  • 资源下不了的,可以去各自官网下载
  • 或者使用我的版本

原文地址:https://blog.csdn.net/weixin_49065061/article/details/145174907

免责声明:本站文章内容转载自网络资源,如侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!