From ad6eb56e979a54fa8d9d7e3ae50306a309ce2315 Mon Sep 17 00:00:00 2001 From: Shehab Hosny Date: Thu, 29 Apr 2021 23:20:50 +0200 Subject: [PATCH 1/6] Update Installation Steps for grpc Updated the steps for installing grpc by replacing 'make' which is no deprecated by cmake installation --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2d6b24ef..837b6c94 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,10 @@ git submodule update --init #export CFLAGS='-g -O2 -w' #export CXXFLAGS='-g -O2 -w' +mkdir -p cmake/build +cd cmake/build +cmake ../.. make -sudo make install sudo ldconfig ``` From 98e141893e10e7ca440c5b9d3e97be638a3d7568 Mon Sep 17 00:00:00 2001 From: Shehab Hosny Date: Thu, 29 Apr 2021 23:22:53 +0200 Subject: [PATCH 2/6] Update Installation Steps for grpc Updated the steps for installing grpc by replacing 'make' which is no deprecated by cmake installation --- install | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install b/install index 86d7a308..31402ac7 100644 --- a/install +++ b/install @@ -2,6 +2,8 @@ git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc grp cd grpc_base git submodule update --init +mkdir -p cmake/build +cd cmake/build +cmake ../.. make -sudo make install sudo ldconfig From 91a74869c45522187fd784bf7b47d6d386c3f7cf Mon Sep 17 00:00:00 2001 From: Shehab Hosny Date: Fri, 30 Apr 2021 17:31:05 +0200 Subject: [PATCH 3/6] Update install Update for successful build and install --- install | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/install b/install index 31402ac7..48669c3c 100644 --- a/install +++ b/install @@ -1,9 +1,28 @@ -git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc grpc_base -cd grpc_base -git submodule update --init +export GRPC_INSTALL_DIR=$HOME/.local +mkdir -p $GRPC_INSTALL_DIR +export PATH="$GRPC_INSTALL_DIR/bin:$PATH" + +sudo apt install -y cmake +sudo apt install -y build-essential autoconf libtool pkg-config + +git clone --recurse-submodules -b v1.35.0 https://github.com/grpc/grpc grpc_base +cd grpc_base mkdir -p cmake/build -cd cmake/build -cmake ../.. -make -sudo ldconfig +pushd cmake/build +cmake -DgRPC_INSTALL=ON \ + -DgRPC_BUILD_TESTS=OFF \ + -DCMAKE_INSTALL_PREFIX=$GRPC_INSTALL_DIR \ + ../.. +make -j4 +sudo make install +popd + +mkdir -p third_party/abseil-cpp/cmake/build +pushd third_party/abseil-cpp/cmake/build +cmake -DCMAKE_INSTALL_PREFIX=$GRPC_INSTALL_DIR \ + -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ + ../.. +make -j4 +sudo make install +popd From 8f8d5c9a9c47fec7ed041ee74d5dd82103853669 Mon Sep 17 00:00:00 2001 From: Shehab Hosny Date: Fri, 30 Apr 2021 17:32:11 +0200 Subject: [PATCH 4/6] Update README.md Update for successful build and install --- README.md | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 837b6c94..8a051688 100644 --- a/README.md +++ b/README.md @@ -16,20 +16,33 @@ sudo apt-get install clang libc++-dev ### Download and Install grpc ```shell -git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc grpc_base -cd grpc_base -git submodule update --init +export GRPC_INSTALL_DIR=$HOME/.local +mkdir -p $GRPC_INSTALL_DIR +export PATH="$GRPC_INSTALL_DIR/bin:$PATH" + +sudo apt install -y cmake -## In gcc 8.2 I got an error which I could fix with (see https://github.com/grpc/grpc/issues/17781) -## with the following two export lines. (uncomment and run if you gat an error when calling make). -#export CFLAGS='-g -O2 -w' -#export CXXFLAGS='-g -O2 -w' +git clone --recurse-submodules -b v1.35.0 https://github.com/grpc/grpc grpc_base +cd grpc_base mkdir -p cmake/build -cd cmake/build -cmake ../.. -make -sudo ldconfig +pushd cmake/build +cmake -DgRPC_INSTALL=ON \ + -DgRPC_BUILD_TESTS=OFF \ + -DCMAKE_INSTALL_PREFIX=$GRPC_INSTALL_DIR \ + ../.. +make -j4 +sudo make install +popd + +mkdir -p third_party/abseil-cpp/cmake/build +pushd third_party/abseil-cpp/cmake/build +cmake -DCMAKE_INSTALL_PREFIX=$GRPC_INSTALL_DIR \ + -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ + ../.. +make -j4 +sudo make install +popd ``` # Original From 9afccb954d55604a794a71348dac8a6cac4497bd Mon Sep 17 00:00:00 2001 From: Shehab Hosny Date: Fri, 30 Apr 2021 18:43:29 +0200 Subject: [PATCH 5/6] Update install --- install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install b/install index 48669c3c..eeb27a6e 100644 --- a/install +++ b/install @@ -5,7 +5,8 @@ export PATH="$GRPC_INSTALL_DIR/bin:$PATH" sudo apt install -y cmake sudo apt install -y build-essential autoconf libtool pkg-config -git clone --recurse-submodules -b v1.35.0 https://github.com/grpc/grpc grpc_base +LATEST_VER=$(curl -L "https://api.github.com/repos/grpc/grpc/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")') +git clone --recurse-submodules -b $LATEST_VER https://github.com/grpc/grpc grpc_base cd grpc_base mkdir -p cmake/build From 0cc01e4610bbad62304d78f067f738a6a7c3100b Mon Sep 17 00:00:00 2001 From: Shehab Hosny Date: Fri, 30 Apr 2021 18:43:51 +0200 Subject: [PATCH 6/6] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8a051688..0f6d99c7 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,8 @@ export PATH="$GRPC_INSTALL_DIR/bin:$PATH" sudo apt install -y cmake -git clone --recurse-submodules -b v1.35.0 https://github.com/grpc/grpc grpc_base +LATEST_VER=$(curl -L "https://api.github.com/repos/grpc/grpc/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")') +git clone --recurse-submodules -b $LATEST_VER https://github.com/grpc/grpc grpc_base cd grpc_base mkdir -p cmake/build