enable both GPU and CPU builds + testing in travis
[platform/upstream/caffe.git] / .travis.yml
1 language: cpp
2
3 # Cache Ubuntu apt packages.
4 cache: apt
5
6 compiler:
7   - gcc
8 # Disable clang build: doesn't seem to work on Linux.
9 # (@jeffdonahue: Travis buildbot's failure behavior is similar to what I see
10 # building on Linux.)
11 #   - clang
12
13 before_install:
14   - echo $LANG
15   - echo $LC_ALL
16   - sudo apt-get -y update
17   - sudo apt-get -y install wget git curl python-dev python-numpy libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev protobuf-compiler libatlas-dev libatlas-base-dev bc
18
19 install:
20   # CMake 2.8.12
21 <<<<<<< HEAD
22   - wget http://www.cmake.org/files/v2.8/cmake-2.8.12.tar.gz -O /tmp/cmake.tar.gz && tar -C /tmp -xvf /tmp/cmake.tar.gz && rm /tmp/cmake.tar.gz
23   - cd /tmp/cmake-2.8.12 && ./bootstrap --prefix=/usr && make -j4 &&  sudo make install -j4 &&  cd - #&& rm -r /tmp/cmake-2.8.12
24 =======
25   - wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2-Linux-i386.tar.gz -O /tmp/cmake.tar.gz && tar -C /tmp -xvf /tmp/cmake.tar.gz && rm /tmp/cmake.tar.gz 
26   - cd /tmp/cmake-2.8.12.2-Linux-i386 && sudo cp * /usr/ -r && cd - && rm -r /tmp/cmake-2.8.12.2-Linux-i386
27 >>>>>>> cmake from binaries
28     #
29   - wget https://google-glog.googlecode.com/files/glog-0.3.3.tar.gz -O /tmp/glog-0.3.3.tar.gz && tar -C /tmp -xzvf /tmp/glog-0.3.3.tar.gz && rm /tmp/glog-0.3.3.tar.gz
30   - cd /tmp/glog-0.3.3 && ./configure && make -j4 && sudo make install -j4 && cd -
31   - wget https://github.com/schuhschuh/gflags/archive/master.zip -O /tmp/gflags-master.zip && pushd /tmp/ && unzip gflags-master.zip && cd gflags-master && mkdir build && cd build && export CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1 && sudo make install && popd
32   - curl http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1204/x86_64/cuda-repo-ubuntu1204_6.0-37_amd64.deb -o /tmp/cuda_install.deb && sudo dpkg -i /tmp/cuda_install.deb && rm /tmp/cuda_install.deb
33   - sudo apt-get -y update
34   # Install the minimal CUDA subpackages required to test Caffe build.
35   # For a full CUDA installation, add 'cuda' to the list of packages.
36   - sudo apt-get -y install cuda-core-6-0 cuda-extra-libs-6-0
37   # Create CUDA symlink at /usr/local/cuda
38   # (This would normally be created by the CUDA installer, but we create it
39   # manually since we did a partial installation.)
40   - sudo ln -s /usr/local/cuda-6.0 /usr/local/cuda
41   - curl https://gitorious.org/mdb/mdb/archive/7f038d0f15bec57b4c07aa3f31cd5564c88a1897.tar.gz -o /tmp/mdb.tar.gz && tar -C /tmp -xzvf /tmp/mdb.tar.gz && rm /tmp/mdb.tar.gz
42   - cd /tmp/mdb-mdb/libraries/liblmdb/ && make -j4 && sudo make install -j4 && cd -
43
44 before_script:
45   - mv Makefile.config.example Makefile.config
46   - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
47   - export NUM_THREADS=4
48
49 script:
50   # CMake build.
51   - mkdir build
52   - cd build
53     ## CPU-GPU build
54   - cmake -DBUILD_PYTHON=ON -DBUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release ..
55   - make --keep-going --jobs=$NUM_THREADS
56   - make clean && rm -rf *
57     ## CPU-only build
58   - cmake -DBUILD_PYTHON=ON -DBUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release -DCPU_ONLY=ON ..
59   - make --keep-going --jobs=$NUM_THREADS
60   - cd test && ./test --gtest_shuffle --gtest_filter="-*GPU*" && cd -
61   - make clean && rm -rf *
62     ## Cleaning
63   - cd ..
64   - rm -r build
65
66   # CPU-GPU: build only.
67   - export CPU_ONLY=0
68   - make --keep-going --jobs=$NUM_THREADS all
69   - make clean
70   # CPU-only: comprehensive.
71   - export CPU_ONLY=1
72   - make --keep-going --jobs=$NUM_THREADS all test warn lint
73   - make runtest
74   - make --jobs=$NUM_THREADS all
75   - make --jobs=$NUM_THREADS test
76   - make --jobs=$NUM_THREADS warn
77   - make --jobs=$NUM_THREADS lint
78   - make --jobs=$NUM_THREADS pycaffe
79
80 notifications:
81 # Emails are sent to the committer's git-configured email address by default,
82 # but only if they have access to the repository.  To enable Travis on your
83 # public fork of Caffe, just go to travis-ci.org and flip the switch on for
84 # your Caffe fork.  To configure your git email address, use:
85 #     git config --global user.email me@example.com
86   email:
87     on_success: always
88     on_failure: always
89
90 # IRC notifications disabled by default.
91 # Uncomment next 5 lines to send notifications to chat.freenode.net#caffe
92 #   irc:
93 #     channels:
94 #       - "chat.freenode.net#caffe"
95 #     template:
96 #       - "%{repository}/%{branch} (%{commit} - %{author}): %{message}"