mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
TravisCI Overhaul
Summary:
Uncached build: https://travis-ci.org/lukeyeager/caffe2/builds/239677224
Cached build: https://travis-ci.org/lukeyeager/caffe2/builds/239686725
* Parallel builds everywhere
* All builds use CCache for quick build times (help from https://github.com/pytorch/pytorch/pull/614, https://github.com/ccache/ccache/pull/145)
* Run ctests when available (continuation of https://github.com/caffe2/caffe2/pull/550)
* Upgraded from cuDNN v5 to v6
* Fixed MKL build (by updating pkg version)
* Fixed android builds (b6f905a67b (commitcomment-22404119))
* ~~Building NNPACK fails with no discernible error message (currently disabled entirely)~~
* ~~Android builds continue to fail with existing error:~~
* ~~OSX builds time-out:~~
| Before | After | Changes |
| --- | --- | --- |
| COMPILER=g++ | linux | without CUDA |
| COMPILER=g++-5 | linux-gcc5 | without CUDA |
| COMPILER=g++ | linux-cuda | updated to cuDNN v6 |
| BLAS=MKL | linux-mkl | updated pkg version |
| BUILD_TARGET=android | linux-android | |
| COMPILER=clang++ | osx | |
| BUILD_TARGET=ios | osx-ios | |
| BUILD_TARGET=android | osx-android | |
| QUICKTEST | **GONE** | |
| COMPILER=g++-4.8 | **GONE** | |
| COMPILER=g++-4.9 | **GONE** | |
Closes https://github.com/caffe2/caffe2/pull/735
Reviewed By: Yangqing
Differential Revision: D5228966
Pulled By: bwasti
fbshipit-source-id: 6cfa6f5ff05fbd5c2078beea79564f1f3b9812fe
This commit is contained in:
parent
96f19fefc0
commit
fda35fd19d
102
.travis.yml
102
.travis.yml
|
|
@ -1,94 +1,44 @@
|
|||
os: linux
|
||||
dist: trusty
|
||||
sudo: required
|
||||
language: cpp
|
||||
compiler: gcc
|
||||
|
||||
env:
|
||||
global:
|
||||
- BUILD_CCACHE_DIR=~/build/ccache
|
||||
- BUILD_NINJA_DIR=~/build/ninja
|
||||
matrix:
|
||||
- BUILD=linux
|
||||
- BUILD=linux-gcc5
|
||||
- BUILD=linux-cuda
|
||||
- BUILD=linux-mkl
|
||||
- BUILD=linux-android
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
# Note: the indices of the build below is used to generate detailed build
|
||||
# status in the README.md file. If you find yourself changing the indices,
|
||||
# make sure you change the build status lines in README.md accordingly too.
|
||||
include:
|
||||
# 1
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: COMPILER=g++
|
||||
# 2
|
||||
- os: osx
|
||||
- env: BUILD=osx
|
||||
os: osx
|
||||
compiler: clang
|
||||
env: COMPILER=clang++
|
||||
# 3
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: BUILD_TARGET=android
|
||||
# 4
|
||||
- os: osx
|
||||
- env: BUILD=osx-ios
|
||||
os: osx
|
||||
compiler: clang
|
||||
env: BUILD_TARGET=android
|
||||
# 5
|
||||
- os: osx
|
||||
- env: BUILD=osx-android
|
||||
os: osx
|
||||
compiler: clang
|
||||
env: BUILD_TARGET=ios
|
||||
# 6
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: COMPILER=g++
|
||||
env: BLAS=MKL
|
||||
# 7
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-4.8
|
||||
env: COMPILER=g++-4.8
|
||||
# 8
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-4.9
|
||||
env: COMPILER=g++-4.9
|
||||
# 9
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-5
|
||||
env: COMPILER=g++-5
|
||||
# 10
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: QUICKTEST
|
||||
install:
|
||||
- ./.travis/quicktest-install.sh
|
||||
- ./.travis/quicktest-build.sh
|
||||
script:
|
||||
- ./.travis/quicktest-test.sh
|
||||
allow_failures:
|
||||
- env: COMPILER=g++
|
||||
- env: COMPILER=clang++
|
||||
- env: COMPILER=g++-5
|
||||
- env: COMPILER=g++-4.9
|
||||
- env: COMPILER=g++-4.8
|
||||
- env: BUILD_TARGET=android
|
||||
- env: BUILD_TARGET=ios
|
||||
- env: BLAS=MKL
|
||||
|
||||
cache:
|
||||
apt: true
|
||||
directories:
|
||||
- $BUILD_CCACHE_DIR
|
||||
- $BUILD_NINJA_DIR
|
||||
- $HOME/.ccache
|
||||
|
||||
before_install:
|
||||
- source .travis/setup.sh
|
||||
|
||||
install:
|
||||
- ./.travis/install.sh
|
||||
- ./.travis/build.sh
|
||||
|
||||
script:
|
||||
- ./.travis/build.sh
|
||||
- ./.travis/test.sh
|
||||
|
|
|
|||
|
|
@ -1,48 +1,47 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
export CXX=$COMPILER
|
||||
|
||||
# just to make sure
|
||||
git submodule update --init --recursive
|
||||
LOCAL_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
ROOT_DIR=$(dirname "$LOCAL_DIR")
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
if [[ $BUILD_TARGET == 'android' ]]; then
|
||||
#***************#
|
||||
# Android build #
|
||||
#***************#
|
||||
export ANDROID_NDK=/opt/android_ndk
|
||||
sh ../scripts/build_android.sh
|
||||
elif [[ $BUILD_TARGET == 'ios' ]]; then
|
||||
#***************#
|
||||
# iOS build #
|
||||
#***************#
|
||||
# Note: we will only build arm64 in the travis case for faster compilation.
|
||||
# You might want to build a fat binary containng armv7, armv7s and arm64.
|
||||
# This can be done by simply not passing in the CMAKE_OSX_ARCHITECTURES flag.
|
||||
sh ../scripts/build_ios.sh -DCMAKE_OSX_ARCHITECTURES=arm64
|
||||
elif [[ $TRAVIS_OS_NAME == 'osx' ]]; then
|
||||
#************#
|
||||
# OS X build #
|
||||
#************#
|
||||
cmake .. \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
||||
-DUSE_OPENCV=OFF \
|
||||
&& make
|
||||
else
|
||||
#*************#
|
||||
# Linux build #
|
||||
#*************#
|
||||
if [[ $BLAS == 'MKL' ]]; then
|
||||
cmake .. \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
||||
-DBLAS=MKL \
|
||||
-DUSE_CUDA=OFF \
|
||||
&& make
|
||||
else
|
||||
cmake .. \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
||||
&& make
|
||||
fi
|
||||
# Special cases - run script and exit
|
||||
if [ "$BUILD_ANDROID" = 'true' ]; then
|
||||
export ANDROID_NDK=/opt/android_ndk
|
||||
sh "${ROOT_DIR}/scripts/build_android.sh"
|
||||
exit 0
|
||||
fi
|
||||
if [ "$BUILD_IOS" = 'true' ]; then
|
||||
sh "${ROOT_DIR}/scripts/build_ios.sh" -DCMAKE_OSX_ARCHITECTURES=arm64
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Configure
|
||||
CMAKE_ARGS=('-DCMAKE_VERBOSE_MAKEFILE=ON')
|
||||
if [ "$BUILD_CUDA" = 'true' ]; then
|
||||
CMAKE_ARGS+=('-DUSE_CUDA=ON')
|
||||
CMAKE_ARGS+=('-DCUDA_ARCH_NAME=Pascal')
|
||||
CMAKE_ARGS+=('-DCUDA_NVCC_EXECUTABLE=/usr/local/bin/nvcc')
|
||||
export PATH="/usr/local/cuda/bin:${PATH}"
|
||||
CMAKE_ARGS+=('-DUSE_NNPACK=OFF')
|
||||
else
|
||||
CMAKE_ARGS+=('-DUSE_CUDA=OFF')
|
||||
fi
|
||||
if [ "$BUILD_MKL" = 'true' ]; then
|
||||
CMAKE_ARGS+=('-DBLAS=MKL')
|
||||
fi
|
||||
if [ "$BUILD_TESTS" = 'false' ]; then
|
||||
CMAKE_ARGS+=('-DBUILD_TEST=OFF')
|
||||
fi
|
||||
cmake .. ${CMAKE_ARGS[*]}
|
||||
|
||||
# Build
|
||||
if [ "$TRAVIS_OS_NAME" = 'linux' ]; then
|
||||
cmake --build . -- "-j$(nproc)"
|
||||
elif [ "$TRAVIS_OS_NAME" = 'osx' ]; then
|
||||
cmake --build . -- "-j$(sysctl -n hw.ncpu)"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1,121 +1,211 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
if [[ $BUILD_TARGET == 'android' ]]; then
|
||||
#**********************************************#
|
||||
# Android installation, both on OS X and Linux #
|
||||
#**********************************************#
|
||||
APT_INSTALL_CMD='sudo apt-get install -y --no-install-recommends'
|
||||
|
||||
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
|
||||
brew install automake libtool
|
||||
# Install android ndk
|
||||
wget https://dl.google.com/android/repository/android-ndk-r13b-darwin-x86_64.zip
|
||||
sudo mkdir -p /opt/android_ndk
|
||||
sudo chmod a+rwx /opt/android_ndk
|
||||
unzip -qo android-ndk-r13b-darwin-x86_64.zip -d /opt/android_ndk
|
||||
else
|
||||
sudo apt-get install autotools-dev autoconf
|
||||
# Install android ndk
|
||||
wget https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip
|
||||
sudo mkdir -p /opt/android_ndk
|
||||
sudo chmod a+rwx /opt/android_ndk
|
||||
unzip -qo android-ndk-r13b-linux-x86_64.zip -d /opt/android_ndk
|
||||
fi
|
||||
|
||||
elif [[ $TRAVIS_OS_NAME == 'osx' ]]; then
|
||||
#*******************#
|
||||
# OS X installation #
|
||||
#*******************#
|
||||
|
||||
########################
|
||||
# Install dependencies #
|
||||
########################
|
||||
|
||||
brew install glog automake protobuf leveldb lmdb ninja
|
||||
sudo pip install numpy
|
||||
# Dependencies needed for NNPACK: PeachPy and confu
|
||||
sudo pip install --upgrade git+https://github.com/Maratyszcza/PeachPy
|
||||
sudo pip install --upgrade git+https://github.com/Maratyszcza/confu
|
||||
|
||||
else
|
||||
#********************#
|
||||
# Linux installation #
|
||||
#********************#
|
||||
|
||||
########################
|
||||
# Install dependencies #
|
||||
########################
|
||||
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
sudo apt-get update
|
||||
sudo apt-get install libprotobuf-dev protobuf-compiler libatlas-base-dev libgoogle-glog-dev liblmdb-dev libleveldb-dev libsnappy-dev python-dev python-pip libiomp-dev libopencv-dev libpthread-stubs0-dev
|
||||
# Dependency needed for NNPACK: the most recent version of ninja build
|
||||
git clone https://github.com/ninja-build/ninja.git /tmp/ninja
|
||||
pushd /tmp/ninja
|
||||
git checkout release
|
||||
python configure.py --bootstrap
|
||||
mkdir -p $HOME/.local/bin
|
||||
install -m 755 /tmp/ninja/ninja $HOME/.local/bin/ninja
|
||||
popd
|
||||
export PATH=$HOME/.local/bin:$PATH
|
||||
# Dependencies needed for NNPACK: PeachPy and confu
|
||||
pip install --upgrade git+https://github.com/Maratyszcza/PeachPy
|
||||
pip install --upgrade git+https://github.com/Maratyszcza/confu
|
||||
pip install numpy
|
||||
|
||||
#########################
|
||||
# Install MKL if needed #
|
||||
#########################
|
||||
|
||||
|
||||
if [[ $BLAS == 'MKL' ]]; then
|
||||
wget http://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
|
||||
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
|
||||
sudo sh -c 'echo deb http://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list'
|
||||
if [ "$TRAVIS_OS_NAME" = 'linux' ]; then
|
||||
####################
|
||||
# apt dependencies #
|
||||
####################
|
||||
sudo apt-get update
|
||||
sudo apt-get install intel-mkl-64bit-2017.2-050
|
||||
fi
|
||||
$APT_INSTALL_CMD \
|
||||
asciidoc \
|
||||
autoconf \
|
||||
automake \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
ccache \
|
||||
docbook-xml \
|
||||
docbook-xsl \
|
||||
git \
|
||||
gperf \
|
||||
libatlas-base-dev \
|
||||
libgoogle-glog-dev \
|
||||
libiomp-dev \
|
||||
libleveldb-dev \
|
||||
liblmdb-dev \
|
||||
libopencv-dev \
|
||||
libprotobuf-dev \
|
||||
libpthread-stubs0-dev \
|
||||
libsnappy-dev \
|
||||
protobuf-compiler \
|
||||
python-dev \
|
||||
python-pip \
|
||||
software-properties-common \
|
||||
xsltproc
|
||||
|
||||
################
|
||||
# Install CUDA #
|
||||
################
|
||||
# Install ccache symlink wrappers
|
||||
pushd /usr/local/bin
|
||||
sudo ln -sf "$(which ccache)" gcc
|
||||
sudo ln -sf "$(which ccache)" g++
|
||||
popd
|
||||
|
||||
source /etc/lsb-release
|
||||
if [ "$BUILD_GCC5" = 'true' ]; then
|
||||
################
|
||||
# Install GCC5 #
|
||||
################
|
||||
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
sudo apt-get update
|
||||
$APT_INSTALL_CMD g++-5
|
||||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 \
|
||||
--slave /usr/bin/g++ g++ /usr/bin/g++-5
|
||||
fi
|
||||
|
||||
REPO="ubuntu1404"
|
||||
if [ "${DISTRIB_RELEASE}" == "16.04" ]; then
|
||||
REPO="ubuntu1604"
|
||||
fi
|
||||
if [ "$BUILD_CUDA" = 'true' ]; then
|
||||
##################
|
||||
# Install ccache #
|
||||
##################
|
||||
# Needs specific branch to work with nvcc (ccache/ccache#145)
|
||||
if [ -e "${BUILD_CCACHE_DIR}/ccache" ]; then
|
||||
echo "Using cached ccache build at \"$BUILD_CCACHE_DIR\" ..."
|
||||
else
|
||||
git clone https://github.com/colesbury/ccache -b ccbin "$BUILD_CCACHE_DIR"
|
||||
pushd "$BUILD_CCACHE_DIR"
|
||||
./autogen.sh
|
||||
./configure
|
||||
make "-j$(nproc)"
|
||||
popd
|
||||
fi
|
||||
|
||||
CUDA_REPO_PKG="cuda-repo-${REPO}_8.0.44-1_amd64.deb"
|
||||
CUDA_PKG_VERSION="8-0"
|
||||
CUDA_VERSION="8.0"
|
||||
# Overwrite ccache symlink wrappers
|
||||
pushd /usr/local/bin
|
||||
sudo ln -sf "${BUILD_CCACHE_DIR}/ccache" gcc
|
||||
sudo ln -sf "${BUILD_CCACHE_DIR}/ccache" g++
|
||||
sudo ln -sf "${BUILD_CCACHE_DIR}/ccache" nvcc
|
||||
popd
|
||||
|
||||
wget "http://developer.download.nvidia.com/compute/cuda/repos/${REPO}/x86_64/${CUDA_REPO_PKG}"
|
||||
sudo dpkg -i "${CUDA_REPO_PKG}"
|
||||
rm -f "${CUDA_REPO_PKG}"
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
"cuda-core-${CUDA_PKG_VERSION}" \
|
||||
"cuda-cublas-dev-${CUDA_PKG_VERSION}" \
|
||||
"cuda-cudart-dev-${CUDA_PKG_VERSION}" \
|
||||
"cuda-curand-dev-${CUDA_PKG_VERSION}" \
|
||||
"cuda-driver-dev-${CUDA_PKG_VERSION}" \
|
||||
"cuda-nvrtc-dev-${CUDA_PKG_VERSION}"
|
||||
#################
|
||||
# Install CMake #
|
||||
#################
|
||||
# Newer version required to get cmake+ccache+nvcc to work
|
||||
_cmake_installer=/tmp/cmake.sh
|
||||
wget -O "$_cmake_installer" https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh
|
||||
sudo bash "$_cmake_installer" --prefix=/usr/local --skip-license
|
||||
rm -rf "$_cmake_installer"
|
||||
|
||||
# manually create CUDA symlink
|
||||
sudo ln -sf /usr/local/cuda-$CUDA_VERSION /usr/local/cuda
|
||||
################
|
||||
# Install CUDA #
|
||||
################
|
||||
CUDA_REPO_PKG='cuda-repo-ubuntu1404_8.0.44-1_amd64.deb'
|
||||
CUDA_PKG_VERSION='8-0'
|
||||
CUDA_VERSION='8.0'
|
||||
wget "https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/${CUDA_REPO_PKG}"
|
||||
sudo dpkg -i "$CUDA_REPO_PKG"
|
||||
rm -f "$CUDA_REPO_PKG"
|
||||
sudo apt-get update
|
||||
$APT_INSTALL_CMD \
|
||||
"cuda-core-${CUDA_PKG_VERSION}" \
|
||||
"cuda-cublas-dev-${CUDA_PKG_VERSION}" \
|
||||
"cuda-cudart-dev-${CUDA_PKG_VERSION}" \
|
||||
"cuda-curand-dev-${CUDA_PKG_VERSION}" \
|
||||
"cuda-driver-dev-${CUDA_PKG_VERSION}" \
|
||||
"cuda-nvrtc-dev-${CUDA_PKG_VERSION}"
|
||||
# Manually create CUDA symlink
|
||||
sudo ln -sf /usr/local/cuda-$CUDA_VERSION /usr/local/cuda
|
||||
|
||||
#################
|
||||
# Install cudnn #
|
||||
#################
|
||||
#################
|
||||
# Install cuDNN #
|
||||
#################
|
||||
CUDNN_REPO_PKG='nvidia-machine-learning-repo-ubuntu1404_4.0-2_amd64.deb'
|
||||
CUDNN_PKG_VERSION='6.0.20-1+cuda8.0'
|
||||
wget "https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1404/x86_64/${CUDNN_REPO_PKG}"
|
||||
sudo dpkg -i "$CUDNN_REPO_PKG"
|
||||
rm -f "$CUDNN_REPO_PKG"
|
||||
sudo apt-get update
|
||||
$APT_INSTALL_CMD \
|
||||
"libcudnn6=${CUDNN_PKG_VERSION}" \
|
||||
"libcudnn6-dev=${CUDNN_PKG_VERSION}"
|
||||
fi
|
||||
|
||||
# Found here:
|
||||
# https://gitlab.com/nvidia/cuda/blob/ff2d7c34fe/8.0/devel/cudnn5/Dockerfile
|
||||
CUDNN_DOWNLOAD_SUM=c10719b36f2dd6e9ddc63e3189affaa1a94d7d027e63b71c3f64d449ab0645ce
|
||||
CUDNN_URL="http://developer.download.nvidia.com/compute/redist/cudnn/v5.1/cudnn-8.0-linux-x64-v5.1.tgz"
|
||||
curl -fsSL ${CUDNN_URL} -O
|
||||
echo "$CUDNN_DOWNLOAD_SUM cudnn-8.0-linux-x64-v5.1.tgz" | sha256sum -c --strict -
|
||||
sudo tar -xzf cudnn-8.0-linux-x64-v5.1.tgz -C /usr/local
|
||||
rm cudnn-8.0-linux-x64-v5.1.tgz
|
||||
sudo ldconfig
|
||||
if [ "$BUILD_MKL" = 'true' ]; then
|
||||
###############
|
||||
# Install MKL #
|
||||
###############
|
||||
_mkl_key=/tmp/mkl.pub
|
||||
wget -O "$_mkl_key" http://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
|
||||
sudo apt-key add "$_mkl_key"
|
||||
rm -f "$_mkl_key"
|
||||
echo 'deb http://apt.repos.intel.com/mkl all main' | sudo tee /etc/apt/sources.list.d/intel-mkl.list
|
||||
sudo apt-get update
|
||||
$APT_INSTALL_CMD intel-mkl-64bit-2017.3-056
|
||||
fi
|
||||
elif [ "$TRAVIS_OS_NAME" = 'osx' ]; then
|
||||
#####################
|
||||
# brew dependencies #
|
||||
#####################
|
||||
pip uninstall -y numpy # use brew version (opencv dependency)
|
||||
brew tap homebrew/science # for OpenCV
|
||||
brew install \
|
||||
automake \
|
||||
ccache \
|
||||
glog \
|
||||
leveldb \
|
||||
lmdb \
|
||||
opencv \
|
||||
protobuf
|
||||
|
||||
# Install ccache symlink wrappers
|
||||
pushd /usr/local/bin
|
||||
sudo ln -sf "$(which ccache)" clang
|
||||
sudo ln -sf "$(which ccache)" clang++
|
||||
popd
|
||||
else
|
||||
echo "OS \"$TRAVIS_OS_NAME\" is unknown"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
####################
|
||||
# pip dependencies #
|
||||
####################
|
||||
pip install numpy
|
||||
|
||||
if [ "$BUILD_ANDROID" = 'true' ]; then
|
||||
#######################
|
||||
# Install Android NDK #
|
||||
#######################
|
||||
_ndk_zip=/tmp/ndk.zip
|
||||
if [ "$TRAVIS_OS_NAME" = 'linux' ]; then
|
||||
$APT_INSTALL_CMD autotools-dev autoconf
|
||||
wget -O "$_ndk_zip" https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip
|
||||
elif [ "$TRAVIS_OS_NAME" = 'osx' ]; then
|
||||
brew install automake libtool
|
||||
wget -O "$_ndk_zip" https://dl.google.com/android/repository/android-ndk-r13b-darwin-x86_64.zip
|
||||
else
|
||||
echo "OS \"$TRAVIS_OS_NAME\" is unknown"
|
||||
exit 1
|
||||
fi
|
||||
_ndk_dir=/opt/android_ndk
|
||||
sudo mkdir -p "$_ndk_dir"
|
||||
sudo chmod a+rwx "$_ndk_dir"
|
||||
unzip -qo "$_ndk_zip" -d "$_ndk_dir"
|
||||
rm -f "$_ndk_zip"
|
||||
_versioned_dir=$(find $_ndk_dir/ -mindepth 1 -maxdepth 1 -type d)
|
||||
mv "$_versioned_dir"/* "$_ndk_dir"/
|
||||
rmdir "$_versioned_dir"
|
||||
fi
|
||||
|
||||
if [ "$BUILD_NNPACK" = 'true' ]; then
|
||||
#################
|
||||
# Install ninja #
|
||||
#################
|
||||
if [ "$TRAVIS_OS_NAME" = 'linux' ]; then
|
||||
# NNPACK needs a recent version
|
||||
if [ -e "${BUILD_NINJA_DIR}/ninja" ]; then
|
||||
echo "Using cached ninja build at \"$BUILD_NINJA_DIR\" ..."
|
||||
else
|
||||
git clone https://github.com/ninja-build/ninja.git -b release "$BUILD_NINJA_DIR"
|
||||
pushd "$BUILD_NINJA_DIR"
|
||||
python configure.py --bootstrap
|
||||
popd
|
||||
fi
|
||||
sudo install -m 755 "${BUILD_NINJA_DIR}/ninja" /usr/local/bin/ninja
|
||||
elif [ "$TRAVIS_OS_NAME" = 'osx' ]; then
|
||||
brew install ninja
|
||||
else
|
||||
echo "OS \"$TRAVIS_OS_NAME\" is unknown"
|
||||
exit 1
|
||||
fi
|
||||
pip install git+https://github.com/Maratyszcza/PeachPy
|
||||
pip install git+https://github.com/Maratyszcza/confu
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
export CXX=/usr/lib/ccache/g++
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
||||
-DUSE_CUDA=OFF -DUSE_NCCL=OFF -DUSE_GLOO=OFF \
|
||||
-DUSE_NNPACK=OFF
|
||||
make -j$(nproc)
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
libatlas-base-dev \
|
||||
libgoogle-glog-dev \
|
||||
libiomp-dev \
|
||||
libleveldb-dev \
|
||||
liblmdb-dev \
|
||||
libopencv-dev \
|
||||
libprotobuf-dev \
|
||||
libpthread-stubs0-dev \
|
||||
libsnappy-dev \
|
||||
protobuf-compiler \
|
||||
python-dev \
|
||||
python-pip
|
||||
|
||||
# Can't use deb packages because of TravisCI's virtualenv
|
||||
pip install numpy
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
cd build
|
||||
CTEST_OUTPUT_ON_FAILURE=1 make test -j$(nproc)
|
||||
38
.travis/setup.sh
Normal file
38
.travis/setup.sh
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#!/bin/bash
|
||||
# This script should be sourced, not executed
|
||||
set -e
|
||||
|
||||
export BUILD_ANDROID=false
|
||||
export BUILD_CUDA=false
|
||||
export BUILD_GCC5=false
|
||||
export BUILD_IOS=false
|
||||
export BUILD_MKL=false
|
||||
export BUILD_NNPACK=true
|
||||
export BUILD_TESTS=true
|
||||
|
||||
if [ "$BUILD" = 'linux' ]; then
|
||||
:
|
||||
elif [ "$BUILD" = 'linux-gcc5' ]; then
|
||||
export BUILD_GCC5=true
|
||||
elif [ "$BUILD" = 'linux-cuda' ]; then
|
||||
export BUILD_CUDA=true
|
||||
export BUILD_NNPACK=false
|
||||
export BUILD_TESTS=false
|
||||
elif [ "$BUILD" = 'linux-mkl' ]; then
|
||||
export BUILD_MKL=true
|
||||
elif [ "$BUILD" = 'linux-android' ]; then
|
||||
export BUILD_ANDROID=true
|
||||
export BUILD_TESTS=false
|
||||
elif [ "$BUILD" = 'osx' ]; then
|
||||
# TODO(lukeyeager): enable after caffe2/caffe2#768, caffe2/caffe2#785
|
||||
export BUILD_TESTS=false
|
||||
elif [ "$BUILD" = 'osx-ios' ]; then
|
||||
export BUILD_IOS=true
|
||||
export BUILD_TESTS=false
|
||||
elif [ "$BUILD" = 'osx-android' ]; then
|
||||
export BUILD_ANDROID=true
|
||||
export BUILD_TESTS=false
|
||||
else
|
||||
echo "BUILD \"$BUILD\" is unknown"
|
||||
exit 1
|
||||
fi
|
||||
15
.travis/test.sh
Executable file
15
.travis/test.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
LOCAL_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
ROOT_DIR=$(dirname "$LOCAL_DIR")
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
if [ "$BUILD_TESTS" = 'false' ]; then
|
||||
echo 'Skipping tests'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cd build
|
||||
CTEST_OUTPUT_ON_FAILURE=1 make test
|
||||
|
|
@ -84,6 +84,8 @@ function(caffe2_select_nvcc_arch_flags out_variable)
|
|||
set(__cuda_arch_bin "30 35")
|
||||
elseif(${CUDA_ARCH_NAME} STREQUAL "Maxwell")
|
||||
set(__cuda_arch_bin "50")
|
||||
elseif(${CUDA_ARCH_NAME} STREQUAL "Pascal")
|
||||
set(__cuda_arch_bin "60 61")
|
||||
elseif(${CUDA_ARCH_NAME} STREQUAL "All")
|
||||
set(__cuda_arch_bin ${Caffe2_known_gpu_archs})
|
||||
elseif(${CUDA_ARCH_NAME} STREQUAL "Auto")
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ function (Caffe2_print_configuration_summary)
|
|||
message(STATUS " BUILD_PYTHON : ${BUILD_PYTHON}")
|
||||
message(STATUS " Python version : ${PYTHONLIBS_VERSION_STRING}")
|
||||
message(STATUS " Python library : ${PYTHON_LIBRARIES}")
|
||||
message(STATUS " BUILD_TEST : ${BUILD_TEST}")
|
||||
|
||||
message(STATUS " USE_CUDA : ${USE_CUDA}")
|
||||
if(${USE_CUDA})
|
||||
|
|
|
|||
|
|
@ -64,5 +64,13 @@ cmake .. \
|
|||
-DUSE_OPENMP=OFF \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DCMAKE_CXX_FLAGS_RELEASE=-s \
|
||||
-DUSE_OPENCV=OFF \
|
||||
$@ \
|
||||
|| exit 1
|
||||
make
|
||||
|
||||
# Cross-platform parallel build
|
||||
if [ "$(uname)" = 'Darwin' ]; then
|
||||
cmake --build . -- "-j$(sysctl -n hw.ncpu)"
|
||||
else
|
||||
cmake --build . -- "-j$(nproc)"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -51,4 +51,4 @@ cmake .. \
|
|||
-DCMAKE_USE_PTHREADS_INIT=1 \
|
||||
$@ \
|
||||
|| exit 1
|
||||
make
|
||||
cmake --build . -- "-j$(sysctl -n hw.ncpu)"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user