2012-05-20 18:38:03 +01:00
|
|
|
{ stdenv, fetchurl, patchelf, perl, ncurses, expat, python, zlib
|
2013-08-27 13:11:23 +01:00
|
|
|
, xlibs, gtk2, glib, fontconfig, freetype, unixODBC, alsaLib
|
2012-05-20 18:38:03 +01:00
|
|
|
} :
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2013-08-27 11:23:49 +01:00
|
|
|
name = "cudatoolkit-5.5.22";
|
2012-05-20 18:38:03 +01:00
|
|
|
|
|
|
|
dontPatchELF = true;
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
src =
|
|
|
|
if stdenv.system == "x86_64-linux" then
|
|
|
|
fetchurl {
|
2013-08-27 11:23:49 +01:00
|
|
|
url = http://developer.download.nvidia.com/compute/cuda/5_5/rel/installers/cuda_5.5.22_linux_64.run;
|
|
|
|
sha256 = "b997e1dbe95704e0e806e0cedc5fd370a385351fef565c7bae0917baf3a29aa4";
|
2012-05-20 18:38:03 +01:00
|
|
|
}
|
|
|
|
else throw "cudatoolkit does not support platform ${stdenv.system}";
|
|
|
|
|
2014-01-29 14:46:22 +00:00
|
|
|
outputs = [ "out" "sdk" ];
|
|
|
|
|
2012-05-20 18:38:03 +01:00
|
|
|
buildInputs = [ perl ];
|
|
|
|
|
|
|
|
runtimeDependencies = [
|
|
|
|
ncurses expat python zlib
|
|
|
|
xlibs.libX11 xlibs.libXext xlibs.libXrender xlibs.libXt xlibs.libXtst xlibs.libXi xlibs.libXext
|
2013-08-27 13:11:23 +01:00
|
|
|
gtk2 glib fontconfig freetype unixODBC alsaLib
|
2012-05-20 18:38:03 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
rpath = "${stdenv.lib.makeLibraryPath runtimeDependencies}:${stdenv.gcc.gcc}/lib64";
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
sh $src --keep --noexec
|
2013-08-27 11:23:49 +01:00
|
|
|
cd pkg/run_files
|
|
|
|
sh cuda-linux64-rel-5.5.22-16488124.run --keep --noexec
|
2014-01-29 14:46:22 +00:00
|
|
|
sh cuda-samples-linux-5.5.22-16488124.run --keep --noexec
|
2012-05-20 18:38:03 +01:00
|
|
|
cd pkg
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
find . -type f -executable -exec patchelf \
|
|
|
|
--set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
|
|
|
|
'{}' \; || true
|
|
|
|
find . -type f -exec patchelf \
|
2013-08-27 13:11:23 +01:00
|
|
|
--set-rpath $rpath:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64:$(cat $NIX_GCC/nix-support/orig-gcc)/lib \
|
2012-05-20 18:38:03 +01:00
|
|
|
--force-rpath \
|
|
|
|
'{}' \; || true
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2014-01-29 14:46:22 +00:00
|
|
|
mkdir $out $sdk
|
2012-05-20 18:38:03 +01:00
|
|
|
perl ./install-linux.pl --prefix="$out"
|
2014-01-29 14:46:22 +00:00
|
|
|
perl ./install-sdk-linux.pl --prefix="$sdk" --cudaprefix="$out"
|
2012-05-20 18:38:03 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
license = [ "nonfree" ];
|
|
|
|
};
|
|
|
|
}
|