install.sh 1009 Bytes
Newer Older
Matthieu Boileau's avatar
Matthieu Boileau committed
1 2 3 4
#!/bin/bash

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

5 6
source ../common.sh

Matthieu Boileau's avatar
Matthieu Boileau committed
7 8 9 10 11
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}
Matthieu Boileau's avatar
Matthieu Boileau committed
12
WORK_DIR=${BASE_WORK_DIR}/${SUB_DIR}
Matthieu Boileau's avatar
Matthieu Boileau committed
13 14 15
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"
Matthieu Boileau's avatar
Matthieu Boileau committed
16
export INSTALL_DIR=${BASE_INSTALL_DIR}/${SUB_DIR}
Matthieu Boileau's avatar
Matthieu Boileau committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

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"
Matthieu Boileau's avatar
Matthieu Boileau committed
35 36
# (now handle by Saltstack:)
# echo "$INSTALL_DIR/libintelocl.so" > /etc/OpenCL/vendors/intel.icd
Matthieu Boileau's avatar
Matthieu Boileau committed
37 38 39 40
}

install_lib