install.sh 974 Bytes
Newer Older
Matthieu Boileau's avatar
Matthieu Boileau committed
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
#!/bin/bash

# See https://wiki.tiker.net/OpenCLHowTo#Installing_the_Intel_CPU_ICD

set -x 
export LIB_NAME="intel-opencl"
export LIB_VERSION="1.2-6.4.0.37"

export LIB_FULLNAME=${LIB_NAME}-${LIB_VERSION}
SUB_DIR=${LIB_NAME}/${LIB_VERSION}
WORK_DIR=/data/software/sources/${SUB_DIR}
SRC_DIR=${WORK_DIR}/${LIB_FULLNAME}
ARCHIVE=${WORK_DIR}/opencl_runtime_16.1.2_x64_rh_6.4.0.37.tgz
URL="http://registrationcenter-download.intel.com/akdlm/irc_nas/12556/opencl_runtime_16.1.2_x64_rh_6.4.0.37.tgz"
export INSTALL_DIR=/data/software/install/${SUB_DIR}

install_lib()
{

if [[ ! -f $ARCHIVE ]]; then
  mkdir -p $WORK_DIR
  wget $URL -O $ARCHIVE
fi

if [[ ! -d $SRC_DIR ]]; then
  tar zxf $ARCHIVE --directory $WORK_DIR
fi

cd $WORK_DIR

mkdir -p "$INSTALL_DIR"
rpm2cpio opencl_runtime_16.1.2_x64_rh_*/rpm/opencl-*-intel-cpu-*.x86_64.rpm | cpio -idmv
cp ./opt/intel/opencl-*/lib64/* "$INSTALL_DIR"
echo "$INSTALL_DIR/libintelocl.so" > /etc/OpenCL/vendors/intel.icd
}

install_lib