forked from mirrors/nixpkgs
If cuda headers are presented to nix in $out/include they are added to future gcc calls via a -isystem flag. However, cuda does not allow kernel calls from template function if these are located in system-headers. We thus move headers from $out/include to $out/usr_include and add a custom hook to add these headers via -I.
This commit is contained in:
parent
01bbc61364
commit
86c283824f
|
@ -51,8 +51,11 @@ stdenv.mkDerivation rec {
|
|||
perl ./install-linux.pl --prefix="$out"
|
||||
rm $out/tools/CUDA_Occupancy_Calculator.xls
|
||||
perl ./install-sdk-linux.pl --prefix="$sdk" --cudaprefix="$out"
|
||||
mv $out/include $out/usr_include
|
||||
'';
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
|
||||
meta = {
|
||||
license = [ "nonfree" ];
|
||||
};
|
||||
|
|
|
@ -51,8 +51,11 @@ stdenv.mkDerivation rec {
|
|||
perl ./install-linux.pl --prefix="$out"
|
||||
rm $out/tools/CUDA_Occupancy_Calculator.xls
|
||||
perl ./install-sdk-linux.pl --prefix="$sdk" --cudaprefix="$out"
|
||||
mv $out/include $out/usr_include
|
||||
'';
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
|
||||
meta = {
|
||||
license = [ "nonfree" ];
|
||||
};
|
||||
|
|
8
pkgs/development/compilers/cudatoolkit/setup-hook.sh
Normal file
8
pkgs/development/compilers/cudatoolkit/setup-hook.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
addIncludePath () {
|
||||
if test -d "$1/usr_include"
|
||||
then
|
||||
export NIX_CFLAGS_COMPILE="${NIX_CFLAGS_COMPILE} -I$1/usr_include"
|
||||
fi
|
||||
}
|
||||
|
||||
envHooks=(${envHooks[@]} addIncludePath)
|
Loading…
Reference in a new issue