@@ -2,41 +2,85 @@ sudo: required
2
2
dist : trusty
3
3
language : cpp
4
4
5
+ env :
6
+ global :
7
+ - OPENCL_REGISTRY=https://www.khronos.org/registry/cl
8
+ - OPENCL_ROOT=${TRAVIS_BUILD_DIR}/bin/opencl
9
+
5
10
matrix :
6
11
include :
7
12
- os : linux
8
13
compiler : gcc
9
- env : BTYPE=Release
10
14
- os : osx
11
15
compiler : clang
12
- env : BTYPE=Release
13
16
14
17
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
25
63
26
64
install :
27
65
- pwd
28
66
- 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
35
80
36
81
script :
37
- - make config=release_x64
82
+ - ls `pwd`/Bin/Release/x64/
38
83
- export LD_LIBRARY_PATH=`pwd`/Bin/Release/x64/:${LD_LIBRARY_PATH}
39
84
- cd UnitTest
40
85
- ../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