Skip to content

Commit 27653ce

Browse files
committed
Merge pull request #209 from TimmyLiu/develop
attempts to fix travis ci build with missing fglrx
2 parents c355d02 + d43c42b commit 27653ce

File tree

1 file changed

+37
-11
lines changed

1 file changed

+37
-11
lines changed

.travis.yml

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ language: cpp
1515
# sudo: false instructs travis to build our project in a docker VM (faster)
1616
# Can not yet install fglrx packages with 'false'
1717
sudo: required # false
18+
dist: trusty
1819

1920
# os: expands the build matrix to include multiple os's
2021
# disable linux, as we get sporadic failures on building boost, needs investigation
@@ -67,6 +68,8 @@ addons:
6768
env:
6869
global:
6970
- CLBLAS_ROOT=${TRAVIS_BUILD_DIR}/bin/make/release
71+
- OPENCL_REGISTRY=https://www.khronos.org/registry/cl
72+
- OPENCL_ROOT=${TRAVIS_BUILD_DIR}/bin/opencl
7073

7174
# The following filters our build matrix; we are interested in linux-gcc & osx-clang
7275
matrix:
@@ -78,13 +81,13 @@ matrix:
7881

7982
before_install:
8083
# Remove the following linux clause when fglrx can be installed with sudo: false
81-
- if [ ${TRAVIS_OS_NAME} == "linux" ]; then
82-
sudo apt-get update -qq &&
83-
sudo apt-get install -qq fglrx=2:13.350.1-0ubuntu0.0.1;
84-
fi
85-
- if [ ${TRAVIS_OS_NAME} == "linux" ]; then
86-
export OPENCL_ROOT="${TRAVIS_BUILD_DIR}/opencl-headers";
87-
fi
84+
#- if [ ${TRAVIS_OS_NAME} == "linux" ]; then
85+
# sudo apt-get update -qq &&
86+
# sudo apt-get install -qq fglrx=2:13.350.1-0ubuntu0.0.1;
87+
# fi
88+
#- if [ ${TRAVIS_OS_NAME} == "linux" ]; then
89+
# export OPENCL_ROOT="${TRAVIS_BUILD_DIR}/opencl-headers";
90+
# fi
8891
- if [ ${TRAVIS_OS_NAME} == "osx" ]; then
8992
brew update;
9093
brew outdated boost || brew upgrade boost;
@@ -98,10 +101,33 @@ before_install:
98101
install:
99102
# 'Precise' only distributes v1.1 opencl headers; download 1.2 headers from khronos website
100103
# Remove when the travis VM upgrades to 'trusty' or beyond
104+
#- if [ ${TRAVIS_OS_NAME} == "linux" ]; then
105+
# mkdir -p ${OPENCL_ROOT}/include/CL;
106+
# pushd ${OPENCL_ROOT}/include/CL;
107+
# wget -w 1 -r -np -nd -nv -A h,hpp https://www.khronos.org/registry/cl/api/1.2/;
108+
# popd;
109+
# fi
110+
# The following linux logic is necessary because of Travis's move to the GCE platform, which does not
111+
# currently contain packages for fglrx: https://github.com/travis-ci/travis-ci/issues/5221
112+
# We build our own linkable .so file
101113
- if [ ${TRAVIS_OS_NAME} == "linux" ]; then
102-
mkdir -p ${OPENCL_ROOT}/include/CL;
103-
pushd ${OPENCL_ROOT}/include/CL;
104-
wget -w 1 -r -np -nd -nv -A h,hpp https://www.khronos.org/registry/cl/api/1.2/;
114+
mkdir -p ${OPENCL_ROOT};
115+
pushd ${OPENCL_ROOT};
116+
wget ${OPENCL_REGISTRY}/specs/opencl-icd-1.2.11.0.tgz;
117+
tar -xf opencl-icd-1.2.11.0.tgz;
118+
mv ./icd/* .;
119+
mkdir -p inc/CL;
120+
pushd inc/CL;
121+
wget -r -w 1 -np -nd -nv -A h,hpp https://www.khronos.org/registry/cl/api/1.2/;
122+
wget -w 1 -np -nd -nv -A h,hpp https://www.khronos.org/registry/cl/api/2.1/cl.hpp;
123+
popd;
124+
mkdir -p lib;
125+
pushd lib;
126+
cmake -G "Unix Makefiles" ..;
127+
make;
128+
cp ../bin/libOpenCL.so .;
129+
popd;
130+
mv inc/ include/;
105131
popd;
106132
fi
107133
# osx image does not contain cl.hpp file; download from Khronos
@@ -115,7 +141,7 @@ install:
115141
before_script:
116142
- mkdir -p ${CLBLAS_ROOT}
117143
- pushd ${CLBLAS_ROOT}
118-
- cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TEST=OFF -DBUILD_CLIENT=ON -DOCL_VERSION=2.0 -DOPENCL_ROOT=${OPENCL_ROOT} ${TRAVIS_BUILD_DIR}/src
144+
- cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TEST=OFF -DBUILD_CLIENT=OFF -DOCL_VERSION=2.0 -DOPENCL_ROOT=${OPENCL_ROOT} ${TRAVIS_BUILD_DIR}/src
119145

120146
# use script: to execute build steps
121147
script:

0 commit comments

Comments
 (0)