Skip to content

Instantly share code, notes, and snippets.

@KuanYuChang
Created March 19, 2021 03:39
Show Gist options
  • Save KuanYuChang/436800efbb5f1a043f36e3a5249aa63e to your computer and use it in GitHub Desktop.
Save KuanYuChang/436800efbb5f1a043f36e3a5249aa63e to your computer and use it in GitHub Desktop.
Tested on Giselle
#!/usr/bin/env bash
# Cause the script to exit on any errors
# Reference: https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -euo pipefail
# install dependencies
sudo apt install autoconf automake libtool curl make g++ unzip
# clone git repo
git clone https://github.com/protocolbuffers/protobuf.git
# cloned the submodules and generated the configure script
cd protobuf
git checkout v3.6.1
git submodule update --init --recursive
./autogen.sh
# build and install
sed -i 's/\-DNDEBUG\"/\-DNDEBUG -fPIC\"/g' configure
./configure
make -j8
make check -j8
sudo make install
sudo ldconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment