Unable to build the C++ hellowold grpc server

76 views
Skip to first unread message

Brad Taylor

unread,
Mar 17, 2025, 10:38:58 AMMar 17
to grpc.io
I have attempted to follow the instructions on building the example and it fails.  I have a system wide cmake installed which is a bit older, so I installed the latest according to instructions.  After installing I do a version

/var/lzlabs.d/Downloads/cmake/bin/cmake --version
cmake version 3.30.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).

I  export MY_INSTALL_DIR=/var/lzlabs.d/Downloads/grpc/grpc
cd examples/cpp/helloworld/
mkdir -p cmake/build
pushd cmake/build
/var/lzlabs.d//Downloads/cmake/bin/cmake -DCMAKE_PREFIX_PATH=$MY_INSTALL_DIR ../..
....get ... 

CMake Warning:
  Ignoring extra path from command line:

   "../.."

make -j 4
make: *** No targets specified and no makefile found.  Stop.

What am I doing wrong?

Peter Schow

unread,
Mar 17, 2025, 1:13:45 PMMar 17
to Brad Taylor, grpc.io
Hi Brad,

First, you'll likely get more help if you supply some basic details, like OS, OS version, which shell you're using, etc.

Before trying to build the examples, did you successfully build gRPC itself? 

https://grpc.io/docs/languages/cpp/quickstart/


 

Brad Taylor

unread,
Mar 18, 2025, 11:41:59 AMMar 18
to grpc.io
Oracle Linux Server release 9.5
GNU bash, version 5.1.8(1)-release (x86_64-redhat-linux-gnu)  
I did not build grpc, but instead installed from an Rpm in the el9 repositories
dnf into grpce*
Name         : grpc             Verrsion   : 1.46.7  Release      : 10.el9
Name         : grpc-cli        Version    : 1.46.7  Release      : 10.el9
Name         : grpc-cpp      Version   : 1.46.7   Release      : 10.el9
Name         : grpc-data     Version    : 1.46.7  Release      : 10.el9
Name         : grpc-devel    Version    : 1.46.7  Release      : 10.el9
Name         : grpc-doc        Version    : 1.46.7  Release      : 10.el9
Name         : grpc-plugins  Version    : 1.46.7 Release      : 10.el9

Peter Schow

unread,
Mar 18, 2025, 12:37:55 PMMar 18
to Brad Taylor, grpc.io
On Tue, Mar 18, 2025 at 9:41 AM Brad Taylor <cbrad...@gmail.com> wrote:
>
> Oracle Linux Server release 9.5
> GNU bash, version 5.1.8(1)-release (x86_64-redhat-linux-gnu)  
> I did not build grpc, but instead installed from an Rpm in the el9 repositories
> dnf into grpce*
> Name         : grpc             Version   : 1.46.7  Release      : 10.el9

> Name         : grpc-cli        Version    : 1.46.7  Release      : 10.el9
> Name         : grpc-cpp      Version   : 1.46.7   Release      : 10.el9
> Name         : grpc-data     Version    : 1.46.7  Release      : 10.el9
> Name         : grpc-devel    Version    : 1.46.7  Release      : 10.el9
> Name         : grpc-doc        Version    : 1.46.7  Release      : 10.el9
> Name         : grpc-plugins  Version    : 1.46.7 Release      : 10.el9

A couple of things:

gRPC 1.46.7 is 2+ years old

And the c++ example you are trying to build assumes that grpc and protobuf have been built/installed with cmake.  

See:  grpc/examples/cpp/cmake/common.cmake

# cmake build file for C++ route_guide example.
# Assumes protobuf and gRPC have been installed using cmake.


The easiest and most straightforward path to take is simply build grpc (and friends) yourself instead of
relying on ancient OS packages.

It's all here:




Brad Taylor

unread,
Mar 19, 2025, 9:48:48 AMMar 19
to grpc.io
Unfortunately I can not do that without permission as we use RPMs for distribution to our customers.  I have gotten a bit further, but the cmake from the line command can not find the package protobuf.  In our product make system it can.  I will dig further into that and see if I can find the secret to getting cmake to find the package.
ty for your input

Reply all
Reply to author
Forward
0 new messages