Difference between revisions of "How to create a C++ gRPC application"

From epsciwiki
Jump to navigation Jump to search
Line 5: Line 5:
 
<br>
 
<br>
  
: '''Start by copying the hello world example as it's the simplest and does what we want'''
+
: '''Start by copying the hello world (simplest) example and compile it''
 
<blockquote>
 
<blockquote>
 
<pre>
 
<pre>
Line 13: Line 13:
 
mkdir cpp protos
 
mkdir cpp protos
  
cp /daqfs/gRPC/grpc/examples/protos/helloworld.proto protos/loadBalancerControl.proto
+
cp /daqfs/gRPC/grpc/examples/protos/helloworld.proto protos/.
 
cp -r /daqfs/gRPC/grpc/examples/cpp/cmake cpp/.
 
cp -r /daqfs/gRPC/grpc/examples/cpp/cmake cpp/.
cp -r /daqfs/gRPC/grpc/examples/cpp/helloworld cpp/loadBalancerControl
+
cp -r /daqfs/gRPC/grpc/examples/cpp/helloworld cpp/.
  
cd cpp/loadBalancerControl
+
cd cpp/helloworld
 
mkdir -p cmake/build
 
mkdir -p cmake/build
 
cd cmake/build
 
cd cmake/build

Revision as of 20:10, 16 December 2022

Steps to take in creating a gRPC application from an example in the C++ gRPC package.


The application in this case is the reporting to the control plane of the fill level of an ERSAP backend reassembler's fifo

'Start by copying the hello world (simplest) example and compile it
cd /daqfs/gRPC
mkdir ejfat
cd ejfat
mkdir cpp protos

cp /daqfs/gRPC/grpc/examples/protos/helloworld.proto protos/.
cp -r /daqfs/gRPC/grpc/examples/cpp/cmake cpp/.
cp -r /daqfs/gRPC/grpc/examples/cpp/helloworld cpp/.

cd cpp/helloworld
mkdir -p cmake/build
cd cmake/build
cmake -DCMAKE_PREFIX_PATH=$GRPC_INSTALL_DIR -DBUILD_SHARED_LIBS=ON ../..
make