summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorphilkr <philkr@users.noreply.github.com>2015-07-08 14:30:29 -0700
committerphilkr <philkr@users.noreply.github.com>2015-07-20 21:33:33 -0700
commit4d3b1844fc70ab52fe9e22343f9a1154617be6a4 (patch)
treef71162b5f5a09bb7bad7dff24f939a8daca0ad02 /scripts
parentff4e2861c15b45d46498c926d2f869b6a82975bb (diff)
downloadcaffeonacl-4d3b1844fc70ab52fe9e22343f9a1154617be6a4.tar.gz
caffeonacl-4d3b1844fc70ab52fe9e22343f9a1154617be6a4.tar.bz2
caffeonacl-4d3b1844fc70ab52fe9e22343f9a1154617be6a4.zip
Travis scripts for python3 and pytest for cmake. Also fixes CUDA CMake build issue #2722.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/travis/travis_build_and_test.sh11
-rwxr-xr-xscripts/travis/travis_install.sh52
-rwxr-xr-xscripts/travis/travis_setup_makefile_config.sh4
3 files changed, 52 insertions, 15 deletions
diff --git a/scripts/travis/travis_build_and_test.sh b/scripts/travis/travis_build_and_test.sh
index 8ff63f31..9ba737e2 100755
--- a/scripts/travis/travis_build_and_test.sh
+++ b/scripts/travis/travis_build_and_test.sh
@@ -7,8 +7,17 @@ MAKE="make --jobs=$NUM_THREADS --keep-going"
if $WITH_CMAKE; then
mkdir build
cd build
- cmake -DBUILD_python=ON -DCMAKE_BUILD_TYPE=Release -DCPU_ONLY=ON ..
+ CPU_ONLY=" -DCPU_ONLY=ON"
+ if ! $WITH_CUDA; then
+ CPU_ONLY=" -DCPU_ONLY=OFF"
+ fi
+ PYTHON_ARGS=""
+ if [ "$PYTHON_VERSION" = "3" ]; then
+ PYTHON_ARGS="$PYTHON_ARGS -Dpython_version=3 -DBOOST_LIBRARYDIR=$CONDA_DIR/lib/"
+ fi
+ cmake -DBUILD_python=ON -DCMAKE_BUILD_TYPE=Release $CPU_ONLY $PYTHON_ARGS -DCMAKE_INCLUDE_PATH="$CONDA_DIR/include/" -DCMAKE_LIBRARY_PATH="$CONDA_DIR/lib/" ..
$MAKE
+ $MAKE pytest
if ! $WITH_CUDA; then
$MAKE runtest
$MAKE lint
diff --git a/scripts/travis/travis_install.sh b/scripts/travis/travis_install.sh
index b6e6f6ce..d6c6e228 100755
--- a/scripts/travis/travis_install.sh
+++ b/scripts/travis/travis_install.sh
@@ -4,7 +4,6 @@
set -e
MAKE="make --jobs=$NUM_THREADS"
-
# Install apt packages where the Ubuntu 12.04 default and ppa works for Caffe
# This ppa is for gflags and glog
@@ -12,9 +11,8 @@ add-apt-repository -y ppa:tuleu/precise-backports
apt-get -y update
apt-get install \
wget git curl \
- python-dev python-numpy \
+ python-dev python-numpy python3-dev\
libleveldb-dev libsnappy-dev libopencv-dev \
- libboost-dev libboost-system-dev libboost-python-dev libboost-thread-dev \
libprotobuf-dev protobuf-compiler \
libatlas-dev libatlas-base-dev \
libhdf5-serial-dev libgflags-dev libgoogle-glog-dev \
@@ -24,9 +22,10 @@ apt-get install \
# if needed. By default, Aptitude in Ubuntu 12.04 installs CMake 2.8.7, but
# Caffe requires a minimum CMake version of 2.8.8.
if $WITH_CMAKE; then
- add-apt-repository -y ppa:ubuntu-sdk-team/ppa
- apt-get -y update
- apt-get -y install cmake
+ # cmake 3 will make sure that the python interpreter and libraries match
+ wget http://www.cmake.org/files/v3.2/cmake-3.2.3-Linux-x86_64.sh -O cmake3.sh
+ chmod +x cmake3.sh
+ ./cmake3.sh --prefix=/usr/ --skip-license --exclude-subdir
fi
# Install CUDA, if needed
@@ -60,10 +59,37 @@ rm -f $LMDB_FILE
# Install the Python runtime dependencies via miniconda (this is much faster
# than using pip for everything).
-wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
-chmod +x miniconda.sh
-./miniconda.sh -b
-export PATH=/home/travis/miniconda/bin:$PATH
-conda update --yes conda
-conda install --yes numpy scipy matplotlib scikit-image pip
-pip install protobuf
+export PATH=$CONDA_DIR/bin:$PATH
+if [ ! -d $CONDA_DIR ]; then
+ if [ "$PYTHON_VERSION" -eq "3" ]; then
+ wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
+ else
+ wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
+ fi
+ chmod +x miniconda.sh
+ ./miniconda.sh -b -p $CONDA_DIR
+
+ conda update --yes conda
+ conda install --yes numpy scipy matplotlib scikit-image pip
+ # Let conda install boost (so that boost_python matches)
+ conda install --yes -c https://conda.binstar.org/menpo boost=1.56.0
+fi
+
+# install protobuf 3 (just use the miniconda3 directory to avoid having to setup the path again)
+if [ "$PYTHON_VERSION" -eq "3" ] && [ ! -e "$CONDA_DIR/bin/protoc" ]; then
+ pushd .
+ wget https://github.com/google/protobuf/archive/v3.0.0-alpha-3.1.tar.gz -O protobuf-3.tar.gz
+ tar -C /tmp -xzvf protobuf-3.tar.gz
+ cd /tmp/protobuf-3*/
+ ./autogen.sh
+ ./configure --prefix=$CONDA_DIR
+ $MAKE
+ $MAKE install
+ popd
+fi
+
+if [ "$PYTHON_VERSION" -eq "3" ]; then
+ pip install --pre protobuf
+else
+ pip install protobuf
+fi
diff --git a/scripts/travis/travis_setup_makefile_config.sh b/scripts/travis/travis_setup_makefile_config.sh
index ba326262..1440be2a 100755
--- a/scripts/travis/travis_setup_makefile_config.sh
+++ b/scripts/travis/travis_setup_makefile_config.sh
@@ -12,7 +12,9 @@ if $WITH_CUDA; then
fi
cat << 'EOF' >> Makefile.config
-ANACONDA_HOME := $(HOME)/miniconda
+# Travis' nvcc doesn't like newer boost versions
+NVCCFLAGS := -Xcudafe --diag_suppress=cc_clobber_ignored -Xcudafe --diag_suppress=useless_using_declaration -Xcudafe --diag_suppress=set_but_not_used
+ANACONDA_HOME := $(CONDA_DIR)
PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
$(ANACONDA_HOME)/include/python2.7 \
$(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include