Install OpenCL from amdgpu-pro under Ubuntu non supported version

Below is the script which has to be run from the directory where the Ubuntu installation archive was extracted:

#!/bin/bash

dest=/tmp/extract

mkdir -p “$dest”
for f in libopencl1-amdgpu-pro_amd64.deb opencl-amdgpu-proamd64.deb opencl-amdgpu-pro-devamd64.deb opencl-amdgpu-pro-icdamd64.deb opencl-orca-amdgpu-pro-icd*_amd64.deb ; do
dpkg -x $f “$dest”
done

sudo mkdir -p /opt/amd/lib
cp “$dest/opt/amdgpu-pro/lib/x86_64-linux-gnu/*.so” /opt/amd/lib

sudo mkdir -p /etc/OpenCL/vendors
sudo cp “$dest/extract/etc/OpenCL/vendors/*.icd” /etc/OpenCL/vendors/

echo “/opt/amd/lib” | sudo tee /etc/ld.so.conf.d/amd.conf