summarylogtreecommitdiffstats
path: root/.travis.yml
blob: 221d9a8c985c4793ccd9ba92895b53d5db89a46a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
sudo: required
language: c

branches:
  only:
  - master

cache:
  directories:
  - ~/.ccache
  - ~/.pkg-cache
  - ~/.cache/yay
  - alice-vision
  - MeshSDFilter
  - nanoflann
  - osi_clp
  - ute_lib

addons:
  apt:
    packages:
    - moreutils

services:
- docker

arch:
  mount:
  - ~/.ccache:~/.ccache
  - ~/.pkg-cache:/var/cache/pacman/pkg
  - ~/.cache/yay:~/.cache/yay
  repos:
  - bartus=https://github.com/bartoszek/AUR-repo/raw/master
  packages:
  - ccache
  - moreutils
  - cuda
  - openblas-lapack
  - opengv-git
  - flann
  - coin-or-lemon
  - gcc-fortran
  - gsl
  - ceres-solver
  - geogram
  - popsift
  before_install:
# 1.Override `package-cleanup.hook` to preserve cache for travis.
# 2.Enable ccache
# 3.Multithreaded build and compress
# 4.Suppress all gcc warnings
  - |
     sudo mkdir /etc/pacman.d/hooks/
     sudo ln -s /dev/null /etc/pacman.d/hooks/package-cleanup.hook
     sudo sed -i '/^BUILDENV/s/\!ccache/ccache/' /etc/makepkg.conf
     sudo sed -i '/#MAKEFLAGS=/c MAKEFLAGS="-j2"' /etc/makepkg.conf
     sudo sed -i '/^COMPRESSXZ/s/\xz/xz -T 2/' /etc/makepkg.conf
     sudo sed -i '$a   CFLAGS="$CFLAGS -w"'   /etc/makepkg.conf
     sudo sed -i '$a CXXFLAGS="$CXXFLAGS -w"' /etc/makepkg.conf
  script:
#   Incorporate ccache in nvcc
  - |
     _gcc="$(readlink /opt/cuda/bin/gcc)"
     _gpp="$(readlink /opt/cuda/bin/g++)"
     sudo mv /opt/cuda/bin/nvcc /opt/cuda/bin/nvcc.bin
     sudo rm /opt/cuda/bin/g{cc,++}
     echo -e "#!/bin/sh -\n/usr/bin/ccache /opt/cuda/bin/nvcc.bin \"\$@\"" | sudo dd of=/opt/cuda/bin/nvcc
     echo -e "#!/bin/sh -\n/usr/bin/ccache $_gcc \"\$@\"" | sudo dd of=/opt/cuda/bin/gcc
     echo -e "#!/bin/sh -\n/usr/bin/ccache $_gpp \"\$@\"" | sudo dd of=/opt/cuda/bin/g++
     sudo chmod +x /opt/cuda/bin/{nvcc,g{cc,++}}
# Normalize TRAVIS variable
  - |
     [ "$TRAVIS" == "true" ] && TRAVIS=1 || TRAVIS=0
# Build
  - export CCACHE_LOGFILE=/tmp/ccache.log
  - export CCACHE_MAXSIZE=2G
  - export CCACHE_COMPILERCHECK=content
  - export CCACHE_PCH_EXTSUM=True
  - export CCACHE_SLOPPINESS=file_macro,include_file_ctime,include_file_mtime,locale,pch_defines,time_macros
  - ccache -p
# - ccache -C
  - ccache -s
  - ccache -z
  - |
    sudo pacman -U --noconfirm /var/cache/pacman/pkg/magma-2.5.0-2-x86_64.pkg.tar.xz || {
      git clone https://aur.archlinux.org/magma.git
      pushd magma
      git checkout 1e3ec19ca54c3
      timeout 35m makepkg -s --noconfirm > >(ts -s '[%.T]') || { makepkg -ceo; exit 314; }
      cp magma-2.5.0-2-x86_64.pkg.tar.xz /var/cache/pacman/pkg
      sudo pacman -U /var/cache/pacman/pkg/magma-2.5.0-2-x86_64.pkg.tar.xz
      #sudo pacman -S magma
    }
  - timeout 35m makepkg -s --noconfirm > >(ts -s '%.T'); _makepkg_return=$?
  - sudo pacman -Sc --noconfirm
  - ccache -s
  - ccache -z
  - exit $_makepkg_return
script:
#- "curl -s https://raw.githubusercontent.com/bartoszek/arch-travis/base64-encode/arch-travis.sh| timeout 40m bash > >(ts| ts -r '[%M:%.S]') 2>&1"
- "curl -s https://raw.githubusercontent.com/bartoszek/arch-travis/base64-encode/arch-travis.sh| timeout 40m bash"
- "echo pacman pkg cache size: $(du -h ~/.pkg-cache|cut -f1) in $(ls ~/.pkg-cache|wc -l) files"

#deploy:
#  on:
#    branch: master
#  skip_cleanup: true
#  provider: script
#  script: bash .travis_deploy.sh