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 {
|
2014-06-19 12:24:21 +01:00
|
|
|
name = "cudatoolkit-6.0.37";
|
2012-05-20 18:38:03 +01:00
|
|
|
|
|
|
|
dontPatchELF = true;
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
src =
|
|
|
|
if stdenv.system == "x86_64-linux" then
|
|
|
|
fetchurl {
|
2014-06-19 12:24:21 +01:00
|
|
|
url = http://developer.download.nvidia.com/compute/cuda/6_0/rel/installers/cuda_6.0.37_linux_64.run;
|
|
|
|
sha256 = "991e436c7a6c94ec67cf44204d136adfef87baa3ded270544fa211179779bc40";
|
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
|
2014-06-19 12:24:21 +01:00
|
|
|
sh cuda-linux64-rel-6.0.37-18176142.run --keep --noexec
|
|
|
|
sh cuda-samples-linux-6.0.37-18176142.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-06-11 20:32:13 +01:00
|
|
|
rm $out/tools/CUDA_Occupancy_Calculator.xls
|
2014-01-29 14:46:22 +00:00
|
|
|
perl ./install-sdk-linux.pl --prefix="$sdk" --cudaprefix="$out"
|
2014-06-23 14:11:34 +01:00
|
|
|
mv $out/include $out/usr_include
|
2012-05-20 18:38:03 +01:00
|
|
|
'';
|
|
|
|
|
2014-06-23 14:11:34 +01:00
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
2012-05-20 18:38:03 +01:00
|
|
|
meta = {
|
|
|
|
license = [ "nonfree" ];
|
|
|
|
};
|
|
|
|
}
|
2014-06-19 12:24:21 +01:00
|
|
|
|