Unable to build grpc after installing brpc & braft library

32 views
Skip to first unread message

Flame Hashira

unread,
Dec 18, 2023, 12:12:18 PM12/18/23
to raft-dev
Hi all,
       We are using grpc as communication protocol path and also braft (brpc) as consensus protocol in our project. Both grpc and brpc are using protobuf and protoc library with different version of protoc (3.0.0 for grpc and 3.15.8 for brpc). I read on some SO thread that we need to use the latest protoc lib for compatibility between both brpc and grpc and removed the order version of protoc using "apt-get remove libprotobuf-dev". Has anyone tried using grpc and brpc in the same environment and faced any issues building both together?

/usr/local/bin/protoc --version (libprotoc 3.15.8)
/usr/bin/protoc --version (libprotoc 3.0.0)

ERROR during application build:

make -C raft_proto
g++  -DFLUIDOS_CONFIG='"/home/vagrant/ibofscaleout/cluster_manager_ldu/config/fluidos.cfg"' -g -Wall -Wno-register -O2 -std=c++17 -DIBOFOS_CONFIG='"/home/vagrant/ibofscaleout/cluster_manager_ldu/config/ibofos.conf"' -DNDEBUG  -c -o generated/cpp/raft.pb.o generated/cpp/raft.pb.cc
make -C src cmgr
Compiling [hresource.cpp]...
Compiling [sresource.cpp]...
In file included from /usr/include/braft/raft.h:30:0,
                 from /home/vagrant/ibofscaleout/cluster_manager_ldu/src/common/lib/config_manager.h:9,
                 from hresource.cpp:11:
/usr/include/braft/enum.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
 #error This file was generated by an older version of protoc which is
  ^~~~~
/usr/include/braft/enum.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers.  Please
  ^~~~~
/usr/include/braft/enum.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
 #error regenerate this file with a newer version of protoc.

Flame Hashira

unread,
Dec 19, 2023, 1:05:13 AM12/19/23
to raft-dev
Hi all,
     This is to inform that the issue has been resolved. We need to keep only one version of protobuf and protoc but in my case both grpc and brpc were installing, so multiple versions exists and different versions were used at build time and run-time. So I have cleaned the environment with no trace of protoc and ensured in build steps of brpc that it should not install libprotoc-dev again (since protoc installed by grpc is of higher version and more compatible). One more thing what I did was to include all paths required for headers and libs in config_brpc.sh for brpc build (resolved the cannot find lgflags package issue).

Thanks all !
Rahul Jain
rahul...@samsung.com
Reply all
Reply to author
Forward
0 new messages