How to create a C++ gRPC application

From epsciwiki
Revision as of 19:20, 16 December 2022 by Timmer (talk | contribs) (Created page with "<font size="+2"> === The following were the steps taken to create a gRPC application from an example in the C++ gRPC package. In this case the application is the reporting to...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The following were the steps taken to create a gRPC application from an example in the C++ gRPC package. In this case the application is the reporting to the control plane of the fill level of an ERSAP backend reassembler's fifo

Setup some environmental variables (assuming bash)
export GRPC_INSTALL_DIR=/daqfs/gRPC/installation
export PATH="$GRPC_INSTALL_DIR/bin:$PATH"
export LD_LIBRARY_PATH="$GRPC_INSTALL_DIR/lib:$LD_LIBRARY_PATH"
The alternative is to run a provided bash setup script which does the same thing
/daqfs/gRPC/setupgrpc
Clone the repository
git clone --recurse-submodules -b v1.50 --depth 1 --shallow-submodules https://github.com/grpc/grpc
Build the package
cd grpc
mkdir -p cmake/build
pushd cmake/build
cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=$GRPC_INSTALL_DIR -DBUILD_SHARED_LIBS=ON ../..
make -j 4
make install
popd

Currently grpc is installed in /daqfs/gRPC/