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

From epsciwiki
Jump to navigation Jump to search
Line 1: Line 1:
 
<font size="+2">
 
<font size="+2">
== Steps to take in creating a gRPC application from an example in the C++ gRPC package. ==
+
 
<br>
+
 
'''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 example and compiling it (instructions [https://grpc.io/docs/languages/cpp/quickstart/#install-grpc here]). The compilation steps differ slightly between examples.'''
<br>
 
: '''Start by copying the hello world (simplest) example and compiling it. Note: the steps to compile different examples may also be slightly different.'''
 
 
<blockquote>
 
<blockquote>
 
<pre>
 
<pre>
cd /daqfs/gRPC
+
cd <my_gRPC_dir>
 
mkdir ejfat
 
mkdir ejfat
 
cd ejfat
 
cd ejfat
Line 20: Line 18:
 
cd cmake/build
 
cd cmake/build
 
cmake -DCMAKE_PREFIX_PATH=$GRPC_INSTALL_DIR -DBUILD_SHARED_LIBS=ON ../..
 
cmake -DCMAKE_PREFIX_PATH=$GRPC_INSTALL_DIR -DBUILD_SHARED_LIBS=ON ../..
make  
+
make -j 4
 
 
 
</pre>
 
</pre>
 
</blockquote>
 
</blockquote>
  
 +
: '''Now modify the code to suit.'''
 +
 +
 +
=== The application in this case is the reporting to the control plane of the fill level of an ERSAP backend reassembler's fifo. ===
  
 
</font>
 
</font>

Revision as of 21:02, 16 December 2022


Start by copying the hello world example and compiling it (instructions here). The compilation steps differ slightly between examples.
cd <my_gRPC_dir>
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 -j 4
Now modify the code to suit.


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