4
4
set -e
5
5
6
6
MAKE=" make --jobs=$NUM_THREADS "
7
-
8
7
# Install apt packages where the Ubuntu 12.04 default and ppa works for Caffe
9
8
10
9
# This ppa is for gflags and glog
11
10
add-apt-repository -y ppa:tuleu/precise-backports
12
11
apt-get -y update
13
12
apt-get install \
14
13
wget git curl \
15
- python-dev python-numpy \
14
+ python-dev python-numpy python3-dev \
16
15
libleveldb-dev libsnappy-dev libopencv-dev \
17
- libboost-dev libboost-system-dev libboost-python-dev libboost-thread-dev \
18
16
libprotobuf-dev protobuf-compiler \
19
17
libatlas-dev libatlas-base-dev \
20
18
libhdf5-serial-dev libgflags-dev libgoogle-glog-dev \
@@ -24,9 +22,10 @@ apt-get install \
24
22
# if needed. By default, Aptitude in Ubuntu 12.04 installs CMake 2.8.7, but
25
23
# Caffe requires a minimum CMake version of 2.8.8.
26
24
if $WITH_CMAKE ; then
27
- add-apt-repository -y ppa:ubuntu-sdk-team/ppa
28
- apt-get -y update
29
- apt-get -y install cmake
25
+ # cmake 3 will make sure that the python interpreter and libraries match
26
+ wget http://www.cmake.org/files/v3.2/cmake-3.2.3-Linux-x86_64.sh -O cmake3.sh
27
+ chmod +x cmake3.sh
28
+ ./cmake3.sh --prefix=/usr/ --skip-license --exclude-subdir
30
29
fi
31
30
32
31
# Install CUDA, if needed
@@ -60,10 +59,37 @@ rm -f $LMDB_FILE
60
59
61
60
# Install the Python runtime dependencies via miniconda (this is much faster
62
61
# than using pip for everything).
63
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
64
- chmod +x miniconda.sh
65
- ./miniconda.sh -b
66
- export PATH=/home/travis/miniconda/bin:$PATH
67
- conda update --yes conda
68
- conda install --yes numpy scipy matplotlib scikit-image pip
69
- pip install protobuf
62
+ export PATH=$CONDA_DIR /bin:$PATH
63
+ if [ ! -d $CONDA_DIR ]; then
64
+ if [ " $PYTHON_VERSION " -eq " 3" ]; then
65
+ wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
66
+ else
67
+ wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
68
+ fi
69
+ chmod +x miniconda.sh
70
+ ./miniconda.sh -b -p $CONDA_DIR
71
+
72
+ conda update --yes conda
73
+ conda install --yes numpy scipy matplotlib scikit-image pip
74
+ # Let conda install boost (so that boost_python matches)
75
+ conda install --yes -c https://conda.binstar.org/menpo boost=1.56.0
76
+ fi
77
+
78
+ # install protobuf 3 (just use the miniconda3 directory to avoid having to setup the path again)
79
+ if [ " $PYTHON_VERSION " -eq " 3" ] && [ ! -e " $CONDA_DIR /bin/protoc" ]; then
80
+ pushd .
81
+ wget https://github.com/google/protobuf/archive/v3.0.0-alpha-3.1.tar.gz -O protobuf-3.tar.gz
82
+ tar -C /tmp -xzvf protobuf-3.tar.gz
83
+ cd /tmp/protobuf-3* /
84
+ ./autogen.sh
85
+ ./configure --prefix=$CONDA_DIR
86
+ $MAKE
87
+ $MAKE install
88
+ popd
89
+ fi
90
+
91
+ if [ " $PYTHON_VERSION " -eq " 3" ]; then
92
+ pip install --pre protobuf
93
+ else
94
+ pip install protobuf
95
+ fi
0 commit comments