forked from ispc/ispc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
189 lines (183 loc) · 8.08 KB
/
.travis.yml
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# Copyright (c) 2018-2020, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Author: Dmitry Babokin
# "minimal" instead of "cpp", because of https://github.com/travis-ci/travis-ci/issues/8363
# Otherwise during python invocation PATH is prepended by /usr/bin and it yields wrong llvm-as.
language: minimal
sudo: required
services:
- docker
dist: xenial
# Note, global env variables are not used, even though they would make sense, because they appear first in
# web view and hide matrix env variables.
# Matrix expansion is not supported in builds stages, see: https://github.com/travis-ci/travis-ci/issues/8295
# Using tags as workaround to reduce amount of copy-pasting.
my_tag: &my_tag
stage: test
before_install:
- sudo apt-get update
- sudo apt-get install -y libc6-dev-i386 g++-multilib lib32stdc++6
- if [ -n "$WASM_FLAGS" ]; then source scripts/install_emscripten.sh && emcc --version; fi
- if [ -n "$WASM_FLAGS" ]; then source scripts/install_v8.sh && v8 -e "console.log(\"V8 WORKS\")"; fi
- wget https://cmake.org/files/v3.17/cmake-3.17.3-Linux-x86_64.sh && mkdir /opt/cmake && sh cmake-3.17.3-Linux-x86_64.sh --prefix=/opt/cmake --skip-license && sudo ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake && rm cmake-3.17.3-Linux-x86_64.sh
- export PATH=/opt/cmake/bin:$PATH
- cmake --version
- wget $LLVM_REPO/releases/download/llvm-$LLVM_VERSION-ispc-dev/$LLVM_TAR
- tar xvf $LLVM_TAR
- export PATH=`pwd`/bin-$LLVM_VERSION/bin:$PATH
script:
- mkdir build_$LLVM_VERSION && cd build_$LLVM_VERSION
- cmake -DCMAKE_INSTALL_PREFIX=$TRAVIS_BUILD_DIR -DISPC_INCLUDE_BENCHMARKS=ON $WASM_FLAGS ../
# Build ispc and check_isa utility. Run lit tests.
- make ispc check_isa check-all -j4
# Build benchmarks and test them.
- make ispc_benchmarks && make test
# Add ispc to the PATH
- export PATH=$ISPC_HOME/build_$LLVM_VERSION/bin:$PATH && cd $ISPC_HOME
- check_isa
- ispc --support-matrix
- ./check_env.py
# Run examples
- if [ -z "$WASM_FLAGS" ]; then ./perf.py -n 1; fi
# Run tests for latest LLVM version
- if [ "$LLVM_VERSION" == "10.0" -a -z "$WASM_FLAGS" ]; then ./run_tests.py; ./run_tests.py -a x86; fi
stages:
- check format
- test
jobs:
include:
# Check source formatting
- stage: check format
os: linux
dist: focal
addons:
apt:
packages:
- clang-format
env: LLVM_VERSION=10.0 OS=Ubuntu20.04
before_install:
script:
- ./check_format.sh clang-format-10
# LLVM 10.0 + Ubuntu 16.04: build, lit tests, examples (build + run), benchmarks (build + trial run), tests
- <<: *my_tag
env:
- LLVM_VERSION=10.0 OS=Ubuntu16.04
- LLVM_TAR=llvm-10.0.1-ubuntu16.04-Release+Asserts-x86.arm.wasm.tar.xz
- LLVM_REPO=https://github.com/dbabokin/llvm-project
- ISPC_HOME=$TRAVIS_BUILD_DIR
# LLVM 9.0 + Ubuntu 16.04: build, lit tests, examples (build + run), benchmarks (build + trial run)
- <<: *my_tag
env:
- LLVM_VERSION=9.0 OS=Ubuntu16.04
- LLVM_TAR=llvm-9.0.1-ubuntu16.04-Release+Asserts-x86.arm.wasm.tar.xz
- LLVM_REPO=https://github.com/dbabokin/llvm-project
- ISPC_HOME=$TRAVIS_BUILD_DIR
# LLVM 8.0 + Ubuntu 16.04: build, lit tests, examples (build + run), benchmarks (build + trial run)
- <<: *my_tag
env:
- LLVM_VERSION=8.0 OS=Ubuntu16.04
- LLVM_TAR=llvm-8.0.1-ubuntu16.04-Release+Asserts-x86.arm.wasm.tar.xz
- LLVM_REPO=https://github.com/dbabokin/llvm-project
- ISPC_HOME=$TRAVIS_BUILD_DIR
# WASM enabled build
# LLVM 10.0 + Ubuntu 16.04: build, lit tests, examples (build), benchmarks (build + trial run)
- <<: *my_tag
env:
- LLVM_VERSION=10.0 OS=Ubuntu16.04 WASM_FLAGS="-DWASM_ENABLED=ON"
- LLVM_TAR=llvm-10.0.1-ubuntu16.04-Release+Asserts-x86.arm.wasm.tar.xz
- LLVM_REPO=https://github.com/dbabokin/llvm-project
- ISPC_HOME=$TRAVIS_BUILD_DIR
# ARM build
# LLVM 10.0 + Ubuntu 18.04:
# - ARM only (default): build, lit tests, examples (build)
# - ARM + x86: build, lit tests, examples (build), tests (aarch64)
- stage: test
os: linux
arch: arm64
dist: bionic
env:
- LLVM_VERSION=10.0 OS=Ubuntu18.04aarch64
- LLVM_TAR=llvm-10.0.1-ubuntu16.04aarch64-Release+Asserts-x86.arm.wasm.tar.xz
- LLVM_REPO=https://github.com/dbabokin/llvm-project
- ISPC_HOME=$TRAVIS_BUILD_DIR
before_install:
- sudo apt-get update
- dpkg --print-architecture
- dpkg --print-foreign-architectures
- sudo apt-get install flex libc6-dev libc6-dev-armhf-cross libc6-dev-i386-cross libc6-dev-i386-amd64-cross
- find /usr -name cdefs.h
- if [[ "${TRAVIS_CPU_ARCH}" == "arm64" ]]; then
sudo apt-get install libuv1 rhash libstdc++6;
wget https://anaconda.org/conda-forge/cmake/3.17.0/download/linux-aarch64/cmake-3.17.0-h28c56e5_0.tar.bz2;
mkdir $HOME/cmake;
tar -xjvf cmake-3.17.0-h28c56e5_0.tar.bz2 -C $HOME/cmake;
export PATH=$HOME/cmake/bin:$PATH;
fi
- wget $LLVM_REPO/releases/download/llvm-$LLVM_VERSION-ispc-dev/$LLVM_TAR
- tar xvf $LLVM_TAR
- export PATH=`pwd`/bin-$LLVM_VERSION/bin:$PATH
script:
- mkdir build-arm && cd build-arm
- cmake ..
- make -j4
- make check-all
- bin/ispc --support-matrix
- cd ..
- mkdir build-all && cd build-all
- cmake .. -DX86_ENABLED=ON
- make -j4
- make check-all
- bin/ispc --support-matrix
- cp bin/ispc ..
- cd ..
- export ISPC_HOME=`pwd`
- ./run_tests.py --arch=aarch64 --target=neon-i32x4
# macOS build
# LLVM 10.0 + macOS 10.15 Catalina: build, lit tests, examples (build)
- stage: test
os: osx
osx_image: xcode11.4
env:
- LLVM_VERSION=10.0 OS=macOS10.15
- LLVM_TAR=llvm-10.0.1-macos10.15-Release+Asserts-x86.arm.wasm.tar.xz
- LLVM_REPO=https://github.com/dbabokin/llvm-project
- ISPC_HOME=$TRAVIS_BUILD_DIR
before_install:
- wget $LLVM_REPO/releases/download/llvm-$LLVM_VERSION-ispc-dev/$LLVM_TAR
- tar xvf $LLVM_TAR
- export PATH=`pwd`/bin-$LLVM_VERSION/bin:$PATH
- brew update && brew install bison
- export PATH=/usr/local/opt/bison/bin:$PATH
script:
- mkdir build && cd build
- cmake ..
- make -j4
- make check-all