This repository has been archived by the owner on Aug 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
circle.yml
44 lines (43 loc) · 3.85 KB
/
circle.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
machine:
environment:
CACHE_DIR: /home/ubuntu/quantum/dev-resources/cache # doesn't like relative paths
OPENCL_SDK: $CACHE_DIR/opencl-sdk/intel_sdk_for_opencl_2016_ubuntu_6.0.0.1049_x64
OPENCL_CODE_BUILDER: $CACHE_DIR/opencl-code-builder/intel_sdk_for_ocl_applications_2014_ubuntu_5.0.0.43_x64
BASE_PKG: $OPENCL_CODE_BUILDER/rpm/opencl-1.2-base_5.0.0.43-2_amd64.deb
INTEL_PKG: $OPENCL_CODE_BUILDER/rpm/opencl-1.2-intel-cpu_5.0.0.43-2_amd64.deb
dependencies:
# http://yuleiming.com/install-intel-opencl-on-ubuntu-14-04/
# All this to get OpenCL to work with Ubuntu 14.04 on Intel :/
cache_directories:
- ./dev-resources/cache/opencl-sdk
- ./dev-resources/cache/opencl-code-builder
pre:
- sudo apt-get update
# Shouldn't use `ppa:ubuntu-toolchain-r/test` : http://askubuntu.com/questions/777803/apt-relocation-error-version-glibcxx-3-4-21-not-defined-in-file-libstdc-so-6
# install the g++ version OpenCL needs
- wget -c http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/gcc-5-base_5.4.0-6ubuntu1~16.04.9_amd64.deb && sudo dpkg -i gcc-5-base_5.4.0-6ubuntu1~16.04.9_amd64.deb && rm gcc-5-base_5.4.0-6ubuntu1~16.04.9_amd64.deb
- wget -c http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/libstdc++6_5.4.0-6ubuntu1~16.04.9_amd64.deb && sudo dpkg -i libstdc++6_5.4.0-6ubuntu1~16.04.9_amd64.deb && rm libstdc++6_5.4.0-6ubuntu1~16.04.9_amd64.deb
- sudo printf '\nLD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/:$LD_LIBRARY_PATH\n' >> /home/ubuntu/.bashrc
- strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep CXXABI_1.3.8 # version required by OpenCL; fail-fast
# various necessary utils
- sudo apt-get install rpm alien libnuma1 clinfo -y
- if [[ ! -e $OPENCL_SDK ]]; then (mkdir -p $CACHE_DIR/opencl-sdk || true) && cd $CACHE_DIR/opencl-sdk && wget -c http://registrationcenter-download.intel.com/akdlm/irc_nas/8555/intel_sdk_for_opencl_2016_ubuntu_6.0.0.1049_x64.tgz && tar -xzf intel_sdk_for_opencl_2016_ubuntu_6.0.0.1049_x64.tgz && rm intel_sdk_for_opencl_2016_ubuntu_6.0.0.1049_x64.tgz ; fi
- if [[ ! -e $OPENCL_CODE_BUILDER ]]; then (mkdir -p $CACHE_DIR/opencl-code-builder || true) && cd $CACHE_DIR/opencl-code-builder && wget -c http://registrationcenter.intel.com/irc_nas/5193/intel_code_builder_for_opencl_2015_ubuntu_5.0.0.43_x64.tgz && tar -xzf intel_code_builder_for_opencl_2015_ubuntu_5.0.0.43_x64.tgz && rm intel_code_builder_for_opencl_2015_ubuntu_5.0.0.43_x64.tgz; fi
- cd $OPENCL_CODE_BUILDER && sudo rpm --import PUBLIC_KEY.PUB
# convert from .rpm to .deb
- if [[ ! -e $BASE_PKG ]]; then cd $OPENCL_CODE_BUILDER/rpm && fakeroot alien --to-deb opencl-1.2-base-5.0.0.43-1.x86_64.rpm ; fi
- if [[ ! -e $INTEL_PKG ]]; then cd $OPENCL_CODE_BUILDER/rpm && fakeroot alien --to-deb opencl-1.2-intel-cpu-5.0.0.43-1.x86_64.rpm; fi
- sudo dpkg -i $BASE_PKG
- sudo dpkg -i $INTEL_PKG
- sudo touch /etc/ld.so.conf.d/intelOpenCL.conf
# install using Intel's installer
- cd $OPENCL_SDK && (printf 'ACCEPT_EULA=accept\nINSTALL_MODE=NONRPM\nCONTINUE_WITH_OPTIONAL_ERROR=yes\nPSET_INSTALL_DIR=/opt\nCONTINUE_WITH_INSTALLDIR_OVERWRITE=yes\nCOMPONENTS=DEFAULTS\nPSET_MODE=install\nPHONEHOME_SEND_USAGE_DATA=no\nSIGNING_ENABLED=yes') > silent-final.config && sudo ./install.sh --silent silent-final.config
- sudo ln /opt/intel/opencl-1.2-5.0.0.43/etc/intel64.icd /etc/OpenCL/vendors/intel64.icd
# set .bashrc env-vars
- sudo printf '\nexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/intel/opencl-1.2-5.0.0.43/lib64 && export PATH=$PATH:/opt/intel/intel-opencl-1.2-6.0.0.1049/opencl-sdk/include\n' >> /home/ubuntu/.bashrc
# check that it worked
- sudo clinfo | grep Intel
test:
override:
- case $CIRCLE_NODE_INDEX in 0) echo "lein test|backend" && lein "test|backend" ;; 1) echo "lein 'test|frontend'" && lein "test|frontend" ;; esac:
parallel: true