Skip to content

Commit

Permalink
Merge pull request #36 from Shehab7osny/patch-6
Browse files Browse the repository at this point in the history
Update Installation Steps for grpc
  • Loading branch information
nfultz authored Apr 30, 2021
2 parents 5e46144 + 0cc01e4 commit 8306bf8
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 13 deletions.
34 changes: 25 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,34 @@ 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'
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

make
cd grpc_base
mkdir -p cmake/build
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
sudo ldconfig
popd
```

# Original
Expand Down
30 changes: 26 additions & 4 deletions install
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc grpc_base
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

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
git submodule update --init
mkdir -p cmake/build
pushd cmake/build
cmake -DgRPC_INSTALL=ON \
-DgRPC_BUILD_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX=$GRPC_INSTALL_DIR \
../..
make -j4
sudo make install
popd

make
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
sudo ldconfig
popd

0 comments on commit 8306bf8

Please sign in to comment.