Skip to content

Commit 6d58212

Browse files
committed
[travis] Refactored ci
1 parent 6b07fae commit 6d58212

File tree

1 file changed

+65
-21
lines changed

1 file changed

+65
-21
lines changed

.travis.yml

Lines changed: 65 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,85 @@ sudo: required
22
dist: trusty
33
language: cpp
44

5+
env:
6+
global:
7+
- OPENCL_REGISTRY=https://www.khronos.org/registry/cl
8+
- OPENCL_ROOT=${TRAVIS_BUILD_DIR}/bin/opencl
9+
510
matrix:
611
include:
712
- os: linux
813
compiler: gcc
9-
env: BTYPE=Release
1014
- os: osx
1115
compiler: clang
12-
env: BTYPE=Release
1316

1417
before_install:
15-
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get --yes update; fi
16-
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt-get update -qq; fi
17-
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install -qq gcc-6 g++-6; fi
18-
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 90; fi
19-
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90; fi
20-
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get --yes install libopenimageio-dev; fi
21-
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get --yes install libglew-dev; fi
22-
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get --yes install freeglut3-dev; fi
23-
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get --yes install ocl-icd-opencl-dev; fi # opencl-dev, nvidia-opencl-dev, ocl-icd-opencl-dev
24-
# - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install gcc; fi
18+
# opencl-dev is a virtual package: we need to choose nvidia-opencl-dev, ocl-icd-opencl-dev
19+
- if [ ${TRAVIS_OS_NAME} == "linux" ]; then
20+
sudo apt-get --yes update;
21+
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt-get update -qq;
22+
sudo apt-get install -qq gcc-6 g++-6;
23+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 90;
24+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90;
25+
sudo apt-get --yes install libopenimageio-dev;
26+
sudo apt-get --yes install libglew-dev;
27+
sudo apt-get --yes install freeglut3-dev;
28+
sudo apt-get --yes install ocl-icd-opencl-dev;
29+
fi
30+
- if [ ${TRAVIS_OS_NAME} == "osx" ]; then cat /System/Library/Frameworks/OpenCL.framework/Headers/cl.h | grep -i version; fi
31+
# - if [ ${TRAVIS_OS_NAME}= "osx" ]; then brew install gcc; fi
32+
# osx image does not contain cl.hpp file; download from Khronos
33+
- if [ ${TRAVIS_OS_NAME} == "osx" ]; then
34+
pushd /System/Library/Frameworks/OpenCL.framework/Versions/A/Headers/;
35+
sudo wget -w 1 -np -nd -nv -A h,hpp ${OPENCL_REGISTRY}/api/2.1/cl.hpp;
36+
popd;
37+
fi
38+
# The following linux logic is necessary because of Travis's move to the GCE platform, which does not
39+
# currently contain packages for fglrx: https://github.com/travis-ci/travis-ci/issues/5221
40+
# We build our own linkable .so file
41+
- if [ ${TRAVIS_OS_NAME} == "linux" ]; then
42+
mkdir -p ${OPENCL_ROOT};
43+
pushd ${OPENCL_ROOT};
44+
travis_retry git clone --depth 1 https://github.com/KhronosGroup/OpenCL-ICD-Loader.git;
45+
mv ./OpenCL-ICD-Loader/* .;
46+
travis_retry git clone --depth 1 https://github.com/KhronosGroup/OpenCL-Headers.git inc/CL;
47+
pushd inc/CL;
48+
travis_retry wget -w 1 -np -nd -nv -A h,hpp ${OPENCL_REGISTRY}/api/2.1/cl.hpp;
49+
popd;
50+
mkdir -p lib;
51+
pushd lib;
52+
cmake -G "Unix Makefiles" ..;
53+
make;
54+
cp ./bin/libOpenCL.so .;
55+
popd;
56+
pushd inc/CL;
57+
travis_retry git fetch origin opencl12:opencl12;
58+
git checkout opencl12;
59+
popd;
60+
mv inc/ include/;
61+
popd;
62+
fi
2563

2664
install:
2765
- pwd
2866
- ls
29-
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then g++ --version; fi
30-
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then ./Tools/premake/linux64/premake5 --help || true; fi
31-
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then ./Tools/premake/linux64/premake5 --allow_cpu_devices --safe_math --os=linux --verbose gmake || true; fi
32-
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then ./Tools/premake/osx/premake5 --help || true; fi
33-
# - if [ "$TRAVIS_OS_NAME" = "osx" ]; then ./Tools/premake/osx/premake5 --use_embree --use_opencl --embed_kernels --allow_cpu_devices --safe_math; fi
34-
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then ./Tools/premake/osx/premake5 --allow_cpu_devices --safe_math --os=macosx --verbose gmake; fi
67+
- if [ ${TRAVIS_OS_NAME} == "linux" ]; then
68+
g++ --version;
69+
./Tools/premake/linux64/premake5 --help || true;
70+
./Tools/premake/linux64/premake5 --allow_cpu_devices --safe_math --os=linux --verbose gmake;
71+
make config=release_x64;
72+
ldd `pwd`/Bin/Release/x64/libRadeonRays64.so;
73+
fi
74+
- if [ ${TRAVIS_OS_NAME} == "osx" ]; then
75+
./Tools/premake/osx/premake5 --help || true;
76+
./Tools/premake/osx/premake5 --allow_cpu_devices --safe_math --os=macosx --verbose gmake;
77+
make config=release_x64;
78+
otool -L `pwd`/Bin/Release/x64/libRadeonRays64.dylib;
79+
fi
3580

3681
script:
37-
- make config=release_x64
82+
- ls `pwd`/Bin/Release/x64/
3883
- export LD_LIBRARY_PATH=`pwd`/Bin/Release/x64/:${LD_LIBRARY_PATH}
3984
- cd UnitTest
4085
- ../Bin/Release/x64/UnitTest64 --gtest_list_tests
41-
- ../Bin/Release/x64/UnitTest64
42-
86+
# - ../Bin/Release/x64/UnitTest64 --gtest_catch_exceptions=0

0 commit comments

Comments
 (0)