1 { lib, stdenv, fetchzip, rpmextract, ncurses5, numactl, zlib }:
3 stdenv.mkDerivation rec {
8 # https://github.com/NixOS/nixpkgs/issues/166886
10 "https://registrationcenter-download.intel.com/akdlm/irc_nas/11396/SRB5.0_linux64.zip"
11 "http://registrationcenter-download.intel.com/akdlm/irc_nas/11396/SRB5.0_linux64.zip"
12 "https://web.archive.org/web/20190526190814/http://registrationcenter-download.intel.com/akdlm/irc_nas/11396/SRB5.0_linux64.zip"
14 sha256 = "0qbp63l74s0i80ysh9ya8x7r79xkddbbz4378nms9i7a0kprg9p2";
18 buildInputs = [ rpmextract ];
22 libPath = lib.makeLibraryPath [
30 # Extract the RPMs contained within the source ZIP.
31 rpmextract source/intel-opencl-r${version}.x86_64.rpm
32 rpmextract source/intel-opencl-cpu-r${version}.x86_64.rpm
38 # Remove libOpenCL.so, since we use ocl-icd's libOpenCL.so instead and this would cause a clash.
39 rm opt/intel/opencl/libOpenCL.so*
41 # Patch shared libraries.
42 for lib in opt/intel/opencl/*.so; do
43 patchelf --set-rpath "${libPath}:$out/lib/intel-ocl" $lib || true
52 # Create ICD file, which just contains the path of the corresponding shared library.
53 echo "$out/lib/intel-ocl/libintelocl.so" > intel.icd
61 install -D -m 0755 opt/intel/opencl/*.so* -t $out/lib/intel-ocl
62 install -D -m 0644 opt/intel/opencl/*.{o,rtl,bin} -t $out/lib/intel-ocl
63 install -D -m 0644 opt/intel/opencl/{LICENSE,NOTICES} -t $out/share/doc/intel-ocl
64 install -D -m 0644 intel.icd -t $out/etc/OpenCL/vendors
72 description = "Official OpenCL runtime for Intel CPUs";
73 homepage = "https://software.intel.com/en-us/articles/opencl-drivers";
74 license = lib.licenses.unfree;
75 platforms = [ "x86_64-linux" ];
77 sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];