Cache protobuf3 build in TravisCI

This commit is contained in:
Luke Yeager 2016-06-01 10:37:14 -07:00
Родитель 6f15463657
Коммит 994a033a72
2 изменённых файлов: 24 добавлений и 16 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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