|
| 1 | +sudo: required |
| 2 | +dist: trusty |
| 3 | +language: cpp |
| 4 | + |
| 5 | +env: |
| 6 | + global: |
| 7 | + - OPENCL_REGISTRY=https://www.khronos.org/registry/cl |
| 8 | + - OPENCL_ROOT=${TRAVIS_BUILD_DIR}/bin/opencl |
| 9 | + |
| 10 | +matrix: |
| 11 | + include: |
| 12 | + - os: linux |
| 13 | + compiler: gcc |
| 14 | + - os: osx |
| 15 | + compiler: clang |
| 16 | + |
| 17 | +before_install: |
| 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 |
| 63 | + |
| 64 | +install: |
| 65 | + - pwd |
| 66 | + - ls |
| 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 --tutorials 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 --tutorials gmake; |
| 77 | + make config=release_x64; |
| 78 | + otool -L `pwd`/Bin/Release/x64/libRadeonRays64.dylib; |
| 79 | + fi |
| 80 | + |
| 81 | +script: |
| 82 | + - ls `pwd`/Bin/Release/x64/ |
| 83 | + - export LD_LIBRARY_PATH=`pwd`/Bin/Release/x64/:${LD_LIBRARY_PATH} |
| 84 | + - cd UnitTest |
| 85 | + - ../Bin/Release/x64/UnitTest64 --gtest_list_tests |
| 86 | +# - ../Bin/Release/x64/UnitTest64 --gtest_catch_exceptions=0 |
0 commit comments