FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Cache protobuf3 build in TravisCI · daeinki/CaffeOnACL@994a033 · GitHub

Repository navigation

Commit 994a033

Browse files
committed
Cache protobuf3 build in TravisCI
1 parent 6f15463 commit 994a033

2 files changed

Lines changed: 24 additions & 16 deletions

File tree

‎.travis.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ env:
2828
- BUILD_NAME="cudnn-cmake" WITH_CMAKE=true WITH_CUDA=true WITH_CUDNN=true
2929

3030
cache:
31+
timeout: 604800 # 1 week
3132
apt: true
33+
directories:
34+
- ~/protobuf3
3235

3336
before_install:
3437
- source ./scripts/travis/defaults.sh

‎scripts/travis/install-deps.sh‎

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,30 @@ else
4040
python3-skimage
4141

4242
# build Protobuf3 since it's needed for Python3
43-
echo "Building protobuf3 from source ..."
43+
PROTOBUF3_DIR=~/protobuf3
4444
pushd .
45-
PROTOBUF3_DIR=~/protobuf3-build
46-
rm -rf $PROTOBUF3_DIR
47-
mkdir $PROTOBUF3_DIR
45+
if [ -d "$PROTOBUF3_DIR" ] && [ -e "$PROTOBUF3_DIR/src/protoc" ]; then
46+
echo "Using cached protobuf3 build ..."
47+
cd $PROTOBUF3_DIR
48+
else
49+
echo "Building protobuf3 from source ..."
50+
rm -rf $PROTOBUF3_DIR
51+
mkdir $PROTOBUF3_DIR
4852

49-
# install some more dependencies required to build protobuf3
50-
apt-get install -y --no-install-recommends \
51-
curl \
52-
dh-autoreconf \
53-
unzip
53+
# install some more dependencies required to build protobuf3
54+
apt-get install -y --no-install-recommends \
55+
curl \
56+
dh-autoreconf \
57+
unzip
5458

55-
wget https://github.com/google/protobuf/archive/v3.0.0-beta-3.tar.gz -O protobuf3.tar.gz
56-
tar -xzf protobuf3.tar.gz -C $PROTOBUF3_DIR --strip 1
57-
rm protobuf3.tar.gz
58-
cd $PROTOBUF3_DIR
59-
./autogen.sh
60-
./configure --prefix=/usr
61-
make --jobs=$NUM_THREADS
59+
wget https://github.com/google/protobuf/archive/v3.0.0-beta-3.tar.gz -O protobuf3.tar.gz
60+
tar -xzf protobuf3.tar.gz -C $PROTOBUF3_DIR --strip 1
61+
rm protobuf3.tar.gz
62+
cd $PROTOBUF3_DIR
63+
./autogen.sh
64+
./configure --prefix=/usr
65+
make --jobs=$NUM_THREADS
66+
fi
6267
make install
6368
popd
6469
fi

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL