2012-05-20 19:38:03 +02:00
|
|
|
{ stdenv, fetchurl, patchelf, perl, ncurses, expat, python, zlib
|
2013-08-27 14:11:23 +02:00
|
|
|
, xlibs, gtk2, glib, fontconfig, freetype, unixODBC, alsaLib
|
2012-05-20 19:38:03 +02:00
|
|
|
} :
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2013-08-27 12:23:49 +02:00
|
|
|
name = "cudatoolkit-5.5.22";
|
2012-05-20 19:38:03 +02:00
|
|
|
|
|
|
|
dontPatchELF = true;
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
src =
|
|
|
|
if stdenv.system == "x86_64-linux" then
|
|
|
|
fetchurl {
|
2013-08-27 12:23:49 +02: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 19:38:03 +02:00
|
|
|
}
|
|
|
|
else throw "cudatoolkit does not support platform ${stdenv.system}";
|
|
|
|
|
2014-01-29 15:46:22 +01:00
|
|
|
outputs = [ "out" "sdk" ];
|
|
|
|
|
2012-05-20 19:38:03 +02: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 14:11:23 +02:00
|
|
|
gtk2 glib fontconfig freetype unixODBC alsaLib
|
2012-05-20 19:38:03 +02:00
|
|
|
];
|
|
|
|
|
2014-12-17 19:11:30 +01:00
|
|
|
rpath = "${stdenv.lib.makeLibraryPath runtimeDependencies}:${stdenv.cc.gcc}/lib64";
|
2012-05-20 19:38:03 +02:00
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
sh $src --keep --noexec
|
2013-08-27 12:23:49 +02:00
|
|
|
cd pkg/run_files
|
|
|
|
sh cuda-linux64-rel-5.5.22-16488124.run --keep --noexec
|
2014-01-29 15:46:22 +01:00
|
|
|
sh cuda-samples-linux-5.5.22-16488124.run --keep --noexec
|
2012-05-20 19:38:03 +02:00
|
|
|
cd pkg
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
find . -type f -executable -exec patchelf \
|
2014-12-17 19:11:30 +01:00
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2012-05-20 19:38:03 +02:00
|
|
|
'{}' \; || true
|
|
|
|
find . -type f -exec patchelf \
|
2014-12-17 19:11:30 +01:00
|
|
|
--set-rpath $rpath:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64:$(cat $NIX_CC/nix-support/orig-gcc)/lib \
|
2012-05-20 19:38:03 +02:00
|
|
|
--force-rpath \
|
|
|
|
'{}' \; || true
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2014-01-29 15:46:22 +01:00
|
|
|
mkdir $out $sdk
|
2012-05-20 19:38:03 +02:00
|
|
|
perl ./install-linux.pl --prefix="$out"
|
2014-06-11 21:32:13 +02:00
|
|
|
rm $out/tools/CUDA_Occupancy_Calculator.xls
|
2014-01-29 15:46:22 +01:00
|
|
|
perl ./install-sdk-linux.pl --prefix="$sdk" --cudaprefix="$out"
|
2014-06-23 15:11:34 +02:00
|
|
|
mv $out/include $out/usr_include
|
2012-05-20 19:38:03 +02:00
|
|
|
'';
|
|
|
|
|
2014-06-23 15:11:34 +02:00
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
2012-05-20 19:38:03 +02:00
|
|
|
meta = {
|
|
|
|
license = [ "nonfree" ];
|
|
|
|
};
|
|
|
|
}
|