forked from PixarAnimationStudios/OpenUSD
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
343 lines (301 loc) · 10.4 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
#
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
# USD requires several dependencies that are available via
# apt-get if using the trusty build environment.
language: cpp
branches:
only:
- master
- dev
addons: &linux_addons
apt:
sources: &linux_sources
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.5
- llvm-toolchain-precise-3.6
- llvm-toolchain-precise-3.7
- llvm-toolchain-precise-3.8
- llvm-toolchain-precise
env:
global:
- USE_CCACHE=1
- CCACHE_COMPRESS=1
- CCACHE_MAXSIZE=500M
- CCACHE_CPP2=1
cache:
apt: true
ccache: true
directories:
- $HOME/.ccache
- $HOME/openexr
- $HOME/osd
- $HOME/oiio
- $HOME/ptex
- $HOME/tbb43_20141023oss
- $HOME/tbb2017_20160722oss
matrix:
### Mark failure as soon as one single entry does
fast_finish: true
exclude:
### Note: Workaround travis-ci/travis-ci#4681
- os: osx
- os: linux
include:
- os: linux
sudo: required
dist: trusty
compiler: clang-3.5
### FIXME: $PATH error using clang++ with USD CMake and ccache
env: COMPILER=/usr/local/clang-3.5.0/bin/clang++ CCOMPILER=/usr/local/clang-3.5.0/bin/clang
- os: linux
sudo: required
dist: trusty
addons:
apt:
sources: *linux_sources
packages: ['clang-3.6', 'libstdc++-5-dev']
compiler: clang-3.6
env: COMPILER=clang++-3.6 CCOMPILER=clang-3.6
- os: linux
sudo: required
dist: trusty
addons:
apt:
sources: *linux_sources
packages: ['clang-3.7', 'libstdc++-5-dev']
compiler: clang-3.7
env: COMPILER=clang++-3.7 CCOMPILER=clang-3.7
- os: linux
sudo: required
dist: trusty
addons:
apt:
sources: *linux_sources
packages: ['clang-3.8', 'libstdc++-6-dev']
compiler: clang-3.8
env: COMPILER=clang++-3.8 CCOMPILER=clang-3.8
- os: linux
sudo: required
dist: trusty
compiler: gcc-4.8
env: COMPILER=g++-4.8 CCOMPILER=gcc-4.8
- os: linux
sudo: required
dist: trusty
addons: *linux_addons
addons:
apt:
sources: *linux_sources
packages: g++-4.9
compiler: gcc-4.9
env: COMPILER=g++-4.9 CCOMPILER=gcc-4.9
- os: linux
sudo: required
dist: trusty
addons:
apt:
sources: *linux_sources
packages: g++-5
compiler: gcc-5
env: COMPILER=g++-5 CCOMPILER=gcc-5
- os: linux
sudo: required
dist: trusty
addons:
apt:
sources: *linux_sources
packages: g++-6
compiler: gcc-6
env: COMPILER=g++-6 CCOMPILER=gcc-6
- os: osx
osx_image: xcode7.3
compiler: clang
env: COMPILER=clang++ CCOMPILER=clang
- os: osx
osx_image: xcode8
compiler: clang
env: COMPILER=clang++ CCOMPILER=clang
- os: osx
osx_image: xcode8.2
compiler: clang
env: COMPILER=clang++ CCOMPILER=clang
before_install:
- |
$COMPILER -v
export CXX="ccache $COMPILER"
export CC="ccache $CCOMPILER"
### Return time remaining from 40 minutes since start of script and
### make sure remaining time is more than argument (if given)
function TimeRemaing {
TIMEOUT=40
REMAIN=$(expr $TIMEOUT - $SECONDS / 60)
if [[ $REMAIN -lt 0 || (! -z "$1" && $REMAIN -lt $1 ) ]]; then
return
fi
echo $REMAIN
}
### Show the build script in its entirety
#cat "$HOME/build.sh" | curl -sT - chunk.io
install:
######
### DEPENDENCIES FOR USD CORE
#####
- |
### DEPENDENCIES FOR USD CORE
### Intel TBB v4.3 update 1
USD_TBB=tbb43_20141023oss
if [ $TRAVIS_OS_NAME == 'linux' ]; then
### Intel TBB 4.4 Update 5 (clang & c++11 needs libc++ until this release)
if [[ $COMPILER == *clang* ]]; then
if [ -d "$HOME/$USD_TBB" ]; then
rm -rf $HOME/$USD_TBB
fi
USD_TBB=tbb2017_20160722oss
TBB_URL=https://www.threadingbuildingblocks.org/sites/default/files/software_releases/linux/${USD_TBB}_lin_0.tgz
TBB_FLAGS="-DCMAKE_CXX_FLAGS=-DTBB_USE_GLIBCXX_VERSION=40800"
else
TBB_URL=https://www.threadingbuildingblocks.org/sites/default/files/software_releases/linux/${USD_TBB}_lin.tgz
fi
sudo apt-get -qq update
### boost v1.55
### We install only the packages we need for faster turnaround
sudo apt-get install libboost-iostreams1.55.0 libboost-iostreams1.55-dev \
libboost-python1.55.0 libboost-python1.55-dev libboost-regex1.55.0 \
libboost-regex1.55-dev libboost-system1.55.0 libboost-system1.55-dev \
libboost-program-options1.55.0 libboost-program-options1.55-dev \
libboost-filesystem1.55.0 libboost-filesystem1.55-dev \
libboost-thread1.55.0 libboost-thread1.55-dev
### double-conversion
### USD docs currently claim we require 1.1.1, but apt-get gives us 2.0.1 on trusty.
### Building 1.1.1 as a shared library is annoying, so we'll go with this for now.
sudo apt-get install libdouble-conversion-dev
### For OpenSubdiv 3.0.5
sudo apt-get install libxrandr-dev libxcursor-dev libxinerama-dev libglfw-dev
### For USDIMAGING
sudo apt-get install libglew-dev python-pyside pyside-tools
### Travis python bin is at /opt/python2.7, but apt installs to /usr/lib/python2.7
export PYTHONPATH="$PYTHONPATH:/usr/lib/python2.7/dist-packages"
elif [ $TRAVIS_OS_NAME == 'osx' ] ; then
TBB_URL=https://www.threadingbuildingblocks.org/sites/default/files/software_releases/mac/${USD_TBB}_osx.tgz
brew install ccache
brew install glew double-conversion boost-python
brew install pyside
### This is where timeout is hiding
PATH="$PATH:/usr/local/opt/coreutils/libexec/gnubin"
fi
- |
### Intel TBB
if [ ! -d "$HOME/$USD_TBB/lib" ]; then
wget "$TBB_URL" -O /tmp/tbb.tgz;
tar -xzf /tmp/tbb.tgz -C $HOME;
else
echo 'Using cached TBB: $USD_TBB';
fi
export TBB_FLAGS="$TBB_FLAGS -DTBB_ROOT_DIR=$HOME/$USD_TBB"
- |
### Python Dependencies
pip install jinja2 PyOpenGL
ls -l /usr/lib/python2.7/dist-packages
python -c "import PySide"
- |
echo `TimeRemaing`
### ilmbase and OpenEXR 2.2.0
if [[ ! -z $(TimeRemaing 15) && ! -d "$HOME/openexr/lib" ]]; then
wget http://download.savannah.nongnu.org/releases/openexr/ilmbase-2.2.0.tar.gz -O /tmp/ilmbase.tgz;
tar -xzf /tmp/ilmbase.tgz -C $HOME;
pushd $HOME/ilmbase-2.2.0;
./configure --prefix=$HOME/openexr;
make -j4 install;
popd;
wget http://download.savannah.nongnu.org/releases/openexr/openexr-2.2.0.tar.gz -O /tmp/openexr.tgz;
tar -xzf /tmp/openexr.tgz -C $HOME;
pushd $HOME/openexr-2.2.0;
./configure --prefix=$HOME/openexr --with-pkg-config=no LDFLAGS="-Wl,-rpath -Wl,$HOME/openexr/lib";
make -j4 install;
popd;
else
echo 'Using cached OpenEXR';
fi
- |
echo `TimeRemaing`
### OpenSubdiv 3.0.5
if [[ ! -z $(TimeRemaing 15) && ! -d "$HOME/osd/lib" ]]; then
wget https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v3_0_5.tar.gz -O /tmp/osd.tgz;
tar -xzf /tmp/osd.tgz -C $HOME;
pushd $HOME/OpenSubdiv-3_0_5;
mkdir build && cd build;
cmake -DCMAKE_INSTALL_PREFIX=$HOME/osd -DNO_EXAMPLES=1 -DNO_TUTORIALS=1 -DNO_REGRESSION=1 -D NO_MAYA=1 -D NO_PTEX=1 -D NO_DOC=1 -D NO_OMP=1 -D NO_TBB=1 -D NO_CUDA=1 -D NO_OPENCL=1 -D NO_CLEW=1 ..;
make -j4 install;
popd;
else
echo 'Using cached OpenSubdiv';
fi
- |
echo `TimeRemaing`
### OpenImageIO 1.5.11
if [[ ! -z $(TimeRemaing 15) && ! -d "$HOME/oiio/lib" ]]; then
wget https://github.com/OpenImageIO/oiio/archive/Release-1.5.11.tar.gz -O /tmp/oiio.tgz;
tar -xzf /tmp/oiio.tgz -C $HOME;
pushd $HOME/oiio-Release-1.5.11;
mkdir build && cd build;
cmake -DCMAKE_INSTALL_PREFIX=$HOME/oiio -DILMBASE_HOME=$HOME/openexr -DOPENEXR_HOME=$HOME/openexr -DSTOP_ON_WARNING=OFF ..;
make -j4 install;
popd;
else
echo 'Using cached OpenImageIO';
fi
- |
### Ptex 2.0.30
echo `TimeRemaing`
if [[ ! -z $(TimeRemaing 10) && ! -d "$HOME/ptex/lib" ]]; then
wget https://github.com/wdas/ptex/archive/v2.0.30.tar.gz -O /tmp/ptex.tgz;
tar -xzf /tmp/ptex.tgz -C $HOME;
pushd $HOME/ptex-2.0.30/src;
make -j4;
mv $HOME/ptex-2.0.30/install/* $HOME/ptex;
popd;
else
echo 'Using cached Ptex';
fi
script:
- |
### Timeout after we've run for 40 min so there is time to upload caches, and
### only start the build if we have more than 5 minutes left
echo `TimeRemaing`
USD_TIMEOUT=`TimeRemaing 5`
if [ ! -z $USD_TIMEOUT ]; then
mkdir build && cd build
echo "cmake $TBB_FLAGS -DOPENEXR_LOCATION=$HOME/openexr -DOIIO_LOCATION=$HOME/oiio -DOPENSUBDIV_ROOT_DIR=$HOME/osd -DPTEX_LOCATION=$HOME/ptex -DPXR_VALIDATE_GENERATED_CODE=OFF .."
cmake $TBB_FLAGS -DOPENEXR_LOCATION=$HOME/openexr -DOIIO_LOCATION=$HOME/oiio -DOPENSUBDIV_ROOT_DIR=$HOME/osd -DPTEX_LOCATION=$HOME/ptex -DPXR_VALIDATE_GENERATED_CODE=OFF ..
echo "Building with -j4, for ${USD_TIMEOUT} seconds"
# If Travis timesout, objects can be corrupted in the cache & cause link errors
echo timeout -s SIGTERM "${USD_TIMEOUT}s" make -j4
timeout -s SIGTERM "${USD_TIMEOUT}m" make -j4
# Default install location is /usr/local; we need sudo access to write there.
sudo make install
else
echo 'Skipped build of USD (USD_TIMEOUT was: $USD_TIMEOUT)'
### Last command must generate an error, so build marked as failing
bash -c "exit 174"
fi