GRPC latest release v1.56.0 - compile c++/rhel8 (gcc8.5.0) w/ cmake ; to create libprotobuf.so.** together with libgrpc.so.**

110 views
Skip to first unread message

Bu Lu

unread,
Jun 28, 2023, 7:54:36 PM6/28/23
to grpc.io
Hello,
I downloaded the latest grpc v1.56.0 source code, following the instruction to build grpc.so** . My intention is also to build libprotobuf.so.** therefore I can create distribution package (RPMs).
Is this the right approach as I have impression that when git cloned the grpc repo including submodules, the dependences (such as protobuf) are included in grpc code structure, am I right?

I use cmake/make option for my build.

I also tried to run tools/buildgen/generate_projects.sh (with all tools installed) without error, while still not able to generate protobuf so files.

Any insights what might be wrong? 

Appreciate so much for your helps!
-Wei

Bu Lu

unread,
Jun 28, 2023, 8:12:37 PM6/28/23
to grpc.io
Hi,
Forgot to mention previously, this is my cmake commands,  running under grpc/cmake/build, set protobuf provider w/ value 'module' even though I think it is default value, but still doesn't get what I expect.
cmake -DBUILD_SHARED_LIBS=ON -DgRPC_INSTALL=ON -DgRPC_PROTOBUF_PROVIDER=module -DgRPC_BUILD_TESTS=OFF ../..

Thanks,
-Wei

veb...@google.com

unread,
Jul 4, 2023, 7:09:03 PM7/4/23
to grpc.io
Hey Bu,

You should be able to see generated protobuf so file with DgRPC_PROTOBUF_PROVIDER=module. I did it myself with the HEAD version of gRPC.
BTW, this is only to make gRPC development easy and not for package management. In general, using protobuf repo to generate protobuf so files is recommended. 

$ cmake -DBUILD_SHARED_LIBS=ON -DgRPC_INSTALL=ON -DgRPC_PROTOBUF_PROVIDER=module -DgRPC_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/tmp/a  ..
$ make -j 16 install
/tmp/a/lib$ ls *proto*
libabsl_log_internal_proto.so           libprotobuf-lite.so.23.1.0  libprotoc.so
libabsl_log_internal_proto.so.2301.0.0  libprotobuf.so              libprotoc.so.23.1.0
libprotobuf-lite.so                     libprotobuf.so.23.1.0

Regards,
Esun.

Reply all
Reply to author
Forward
0 new messages