Merge pull request #623 from BVLC/cmake
[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   - export NUM_THREADS=4
17   - alias make="make --jobs=$NUM_THREADS"
18   - sudo add-apt-repository ppa:ubuntu-sdk-team/ppa -y
19   - sudo apt-get -y update
20   - sudo apt-get -y install wget git curl python-dev python-numpy libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-dev libboost-system-dev libboost-python-dev libhdf5-serial-dev protobuf-compiler libatlas-dev libatlas-base-dev bc cmake
21
22 install:
23   - 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
24   - cd /tmp/glog-0.3.3 && ./configure && make && sudo make install && cd -
25   - 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
26   - 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
27   - sudo apt-get -y update
28   # Install the minimal CUDA subpackages required to test Caffe build.
29   # For a full CUDA installation, add 'cuda' to the list of packages.
30   - sudo apt-get -y install cuda-core-6-0 cuda-extra-libs-6-0
31   # Create CUDA symlink at /usr/local/cuda
32   # (This would normally be created by the CUDA installer, but we create it
33   # manually since we did a partial installation.)
34   - sudo ln -s /usr/local/cuda-6.0 /usr/local/cuda
35   - 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
36   - cd /tmp/mdb-mdb/libraries/liblmdb/ && make && sudo make install && cd -
37
38 before_script:
39   - mv Makefile.config.example Makefile.config
40   - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
41
42 script:
43   # CMake build
44   - mkdir build
45   - cd build
46   ## CPU-GPU: build only
47   - cmake -DBUILD_PYTHON=ON -DBUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release ..
48   - make --keep-going
49   - make clean && rm -rf *
50    ## CPU-only: comprehensive
51   - cmake -DBUILD_PYTHON=ON -DBUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release -DCPU_ONLY=ON ..
52   - make --keep-going
53   - make runtest
54   - make lint
55   - make clean
56     ## Cleanup CMake build
57   - cd ..
58   - rm -rf build
59
60   # Make build
61   ## CPU-GPU: build only
62   - export CPU_ONLY=0
63   - make --keep-going all
64   - make clean
65   ## CPU-only: comprehensive
66   - export CPU_ONLY=1
67   - make --keep-going all test warn lint
68   - make runtest
69   - make all
70   - make test
71   - make warn
72   - make lint
73   - make pycaffe
74
75 notifications:
76 # Emails are sent to the committer's git-configured email address by default,
77 # but only if they have access to the repository.  To enable Travis on your
78 # public fork of Caffe, just go to travis-ci.org and flip the switch on for
79 # your Caffe fork.  To configure your git email address, use:
80 #     git config --global user.email me@example.com
81   email:
82     on_success: always
83     on_failure: always
84
85 # IRC notifications disabled by default.
86 # Uncomment next 5 lines to send notifications to chat.freenode.net#caffe
87 #   irc:
88 #     channels:
89 #       - "chat.freenode.net#caffe"
90 #     template:
91 #       - "%{repository}/%{branch} (%{commit} - %{author}): %{message}"