Debian Stretch に protobuf 3.6 をインストール
本記事では Debian 9 Stretch に protobuf 3.6 をインストールする方法を紹介しています。
C++ で gRPC/protobuf を利用するためには、ソースからコンパイルする必要があります。 deb パッケージ提供してほしい。。。
環境
- Debian 9 Stretch
- protobuf v3.6.0
インストール手順
protobuf/README.md at master · google/protobuf · GitHub を参考にインストールします。
依存パッケージのインストール
$ sudo apt-get install autoconf automake libtool curl make g++ unzip
protobuf のリポジトリをクローン
$ git clone https://github.com/google/protobuf.git
$ cd protobuf
$ git checkout v3.6.0
サブモジュールの更新
$ git submodule update --init --recursive $ ./autogen.sh
コンパイル&インストール
$ ./configure $ make # 10分〜20分くらいかかります $ make check # 5分〜10分くらいかかります $ sudo make install $ sudo ldconfig
これで protoc コマンド等が利用できるようになります!