Difference between revisions of "How to install and build C++ gRPC"

From epsciwiki
Jump to navigation Jump to search
Line 1: Line 1:
 
<font size="+2">
 
<font size="+2">
  
Here are the official instructions for [https://grpc.io/docs/languages/cpp/quickstart/#install-grpc downloading and building grpc].<br>
+
===Here are the official instructions for [https://grpc.io/docs/languages/cpp/quickstart/#install-grpc downloading and building grpc]===
However, the following is a more relevant version of how grpc was installed on the ejfat nodes:
 
  
#Setup some environmental variables (assuming bash)
+
===However, the following is a more relevant version of how grpc was installed on the ejfat nodes===
 +
: '''Setup some environmental variables (assuming bash)'''
 
<blockquote>
 
<blockquote>
<pre<includeonly></includeonly>>
+
<pre>
 
export GRPC_INSTALL_DIR=/daqfs/gRPC/installation
 
export GRPC_INSTALL_DIR=/daqfs/gRPC/installation
 
export PATH="$GRPC_INSTALL_DIR/bin:$PATH"
 
export PATH="$GRPC_INSTALL_DIR/bin:$PATH"
Line 12: Line 12:
 
</pre>
 
</pre>
 
</blockquote>
 
</blockquote>
::The alternative is to run a provided bash setup script which does the same thing
+
:: The alternative is to run a provided bash setup script which does the same thing
:<pre>/daqfs/gRPC/setupgrpc</pre>
+
:: <pre>/daqfs/gRPC/setupgrpc</pre>
#Clone the repository<pre>git clone --recurse-submodules -b v1.50 --depth 1 --shallow-submodules https://github.com/grpc/grpc</pre>
+
: '''Clone the repository'''<pre>git clone --recurse-submodules -b v1.50 --depth 1 --shallow-submodules https://github.com/grpc/grpc</pre>
#Build the package<pre>cd grpc</pre><pre>mkdir -p cmake/build</pre>
+
: '''Build the package'''
 +
<blockquote>
 +
<pre>
 +
cd grpc
 +
mkdir -p cmake/build
 +
</pre>
 +
</blockquote>
  
##python client libraries:<pre>pip install prometheus-client</pre><pre>pip install prometheus-api-client</pre>
 
##exporter start up:<pre>sudo systemctl start prometheus-node-exporter</pre><pre>sudo systemctl enable prometheus-node-exporter</pre>
 
# For increased UDP buffer sizes:
 
##For the long term write the following lines into the sysctl.conf file:<pre>net.core.rmem_max=25000000</pre><pre>net.core.wmem_max=25000000</pre>
 
##To make it immediately effective, execute:<pre>sudo sysctl -w net.core.rmem_max=25000000</pre><pre>sudo sysctl -w net.core.wmem_max=25000000</pre>
 
# To mount /daqfs:
 
## sudo mkdir /daqfs
 
##  edit /etc/fstab to include the line: <pre>dubhe:/raid/daqfs          nfs    rw,bg          0      0</pre>
 
##  sudo apt-get install nfs-common
 
##  sudo mount /daqfs
 
# To change one's home directory to /daqfs/home/myUserName:
 
##Edit the /etc/passwd file to include a line something like:<pre>myUserName:x:2101:1208:John Doe,,,:/daqfs/home/myUserName:/bin/bash</pre>where 2101 is user id and 1208 is epsci group. Hint: set your user id and group ids on the ejfat nodes to be the same as it is on the computer center machines or there will be an issue when you access files served by computer center like /daqfs/home or /group/...
 
 
</font>
 
</font>

Revision as of 18:45, 16 December 2022

Here are the official instructions for downloading and building grpc

However, the following is a more relevant version of how grpc was installed on the ejfat nodes

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