cudatoolkit: remove OpenCL library

libOpenCL is provided by ocl-icd with implementation in NVIDIA driver instead.
This commit is contained in:
Nikolay Amiantov 2017-02-28 17:15:22 +03:00
parent c4eee0c4f1
commit 044a49febf

View File

@ -22,7 +22,7 @@ let
} }
else throw "cudatoolkit does not support platform ${stdenv.system}"; else throw "cudatoolkit does not support platform ${stdenv.system}";
outputs = [ "out" "lib" "doc" ]; outputs = [ "out" "doc" ];
buildInputs = [ perl ]; buildInputs = [ perl ];
@ -51,11 +51,7 @@ let
patchelf \ patchelf \
--set-interpreter "''$(cat $NIX_CC/nix-support/dynamic-linker)" $i --set-interpreter "''$(cat $NIX_CC/nix-support/dynamic-linker)" $i
fi fi
if [[ $i =~ libOpenCL ]]; then rpath2=$rpath:$lib/lib:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64
rpath2=
else
rpath2=$rpath:$lib/lib:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64
fi
patchelf --set-rpath $rpath2 --force-rpath $i patchelf --set-rpath $rpath2 --force-rpath $i
done < <(find . -type f -print0) done < <(find . -type f -print0)
''; '';
@ -84,18 +80,19 @@ let
mkdir -p $out/nix-support mkdir -p $out/nix-support
echo "cmakeFlags+=' -DCUDA_TOOLKIT_ROOT_DIR=$out'" >> $out/nix-support/setup-hook echo "cmakeFlags+=' -DCUDA_TOOLKIT_ROOT_DIR=$out'" >> $out/nix-support/setup-hook
# Move some libraries to the lib output so that programs that # Remove OpenCL libraries as they are provided by ocl-icd and driver.
# depend on them don't pull in this entire monstrosity. rm -f $out/lib64/libOpenCL*
mkdir -p $lib/lib
mv -v $out/lib64/libOpenCL* $lib/lib/
'' + lib.optionalString (lib.versionOlder version "8.0") '' '' + lib.optionalString (lib.versionOlder version "8.0") ''
# Hack to fix building against recent Glibc/GCC. # Hack to fix building against recent Glibc/GCC.
echo "NIX_CFLAGS_COMPILE+=' -D_FORCE_INLINES'" >> $out/nix-support/setup-hook echo "NIX_CFLAGS_COMPILE+=' -D_FORCE_INLINES'" >> $out/nix-support/setup-hook
''; '';
meta = { meta = with stdenv.lib; {
license = lib.licenses.unfree; description = "A compiler for NVIDIA GPUs, math libraries, and tools";
homepage = "https://developer.nvidia.com/cuda-toolkit";
platforms = platforms.linux;
license = licenses.unfree;
}; };
}; };