Skip to content

Commit

Permalink
Cache protobuf3 build in TravisCI
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeyeager committed Jun 1, 2016
1 parent 6f15463 commit 994a033
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ env:
- BUILD_NAME="cudnn-cmake" WITH_CMAKE=true WITH_CUDA=true WITH_CUDNN=true

cache:
timeout: 604800 # 1 week
apt: true
directories:
- ~/protobuf3

before_install:
- source ./scripts/travis/defaults.sh
Expand Down
37 changes: 21 additions & 16 deletions scripts/travis/install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,30 @@ else
python3-skimage

# build Protobuf3 since it's needed for Python3
echo "Building protobuf3 from source ..."
PROTOBUF3_DIR=~/protobuf3
pushd .
PROTOBUF3_DIR=~/protobuf3-build
rm -rf $PROTOBUF3_DIR
mkdir $PROTOBUF3_DIR
if [ -d "$PROTOBUF3_DIR" ] && [ -e "$PROTOBUF3_DIR/src/protoc" ]; then
echo "Using cached protobuf3 build ..."
cd $PROTOBUF3_DIR
else
echo "Building protobuf3 from source ..."
rm -rf $PROTOBUF3_DIR
mkdir $PROTOBUF3_DIR

# install some more dependencies required to build protobuf3
apt-get install -y --no-install-recommends \
curl \
dh-autoreconf \
unzip
# install some more dependencies required to build protobuf3
apt-get install -y --no-install-recommends \
curl \
dh-autoreconf \
unzip

wget https://github.com/google/protobuf/archive/v3.0.0-beta-3.tar.gz -O protobuf3.tar.gz
tar -xzf protobuf3.tar.gz -C $PROTOBUF3_DIR --strip 1
rm protobuf3.tar.gz
cd $PROTOBUF3_DIR
./autogen.sh
./configure --prefix=/usr
make --jobs=$NUM_THREADS
wget https://github.com/google/protobuf/archive/v3.0.0-beta-3.tar.gz -O protobuf3.tar.gz
tar -xzf protobuf3.tar.gz -C $PROTOBUF3_DIR --strip 1
rm protobuf3.tar.gz
cd $PROTOBUF3_DIR
./autogen.sh
./configure --prefix=/usr
make --jobs=$NUM_THREADS
fi
make install
popd
fi
Expand Down

0 comments on commit 994a033

Please sign in to comment.