summary refs log tree commit diff
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2015-09-04 12:29:22 +0200
committerBjørn Forsman <bjorn.forsman@gmail.com>2015-09-10 10:35:40 +0200
commit22321f2e58335cd39051c9403975b1015cfa68e0 (patch)
tree0a15a269aea5103200e6a5115454178aab55f0ee
parent220e02506fe2ad533eec8b4381f29e52326d2982 (diff)
downloadnixlib-22321f2e58335cd39051c9403975b1015cfa68e0.tar
nixlib-22321f2e58335cd39051c9403975b1015cfa68e0.tar.gz
nixlib-22321f2e58335cd39051c9403975b1015cfa68e0.tar.bz2
nixlib-22321f2e58335cd39051c9403975b1015cfa68e0.tar.lz
nixlib-22321f2e58335cd39051c9403975b1015cfa68e0.tar.xz
nixlib-22321f2e58335cd39051c9403975b1015cfa68e0.tar.zst
nixlib-22321f2e58335cd39051c9403975b1015cfa68e0.zip
cudatoolkit: don't move $out/include to $out/usr_include
This effectively reverts 86c283824f76d849acbe6
("If cuda headers are presented to nix [...]") and all the following
workarounds that was added due to that commit.

As far as I can tell[1] this hack isn't needed anymore. And moving
includes to $out/usr_include causes pain for cudatoolkit users, so
better get rid of it.

In patches that did more than the $out/usr_include workaround, I only
changed the line back to $out/include instead of re-generating the
patches and fully removing the changed line.

[1]: I build tested blender and caffe, and temporarily added
recurseIntoAttrs to rPackages and haskellPackages so that nox-review
could get proper coverage. However, many of the packages do not build
even before this patch. I also built CUDA samples with cudatoolkit7
that ran fine.
-rw-r--r--pkgs/development/compilers/cudatoolkit/generic.nix3
-rw-r--r--pkgs/development/compilers/cudatoolkit/setup-hook.sh8
-rw-r--r--pkgs/development/haskell-modules/configuration-common.nix2
-rw-r--r--pkgs/development/r-modules/default.nix3
-rw-r--r--pkgs/development/r-modules/patches/CARramps.patch12
-rw-r--r--pkgs/development/r-modules/patches/WideLM.patch2
-rw-r--r--pkgs/development/r-modules/patches/gputools.patch2
-rw-r--r--pkgs/development/r-modules/patches/iFes.patch13
-rw-r--r--pkgs/development/r-modules/patches/magma_cuda_include.patch12
-rw-r--r--pkgs/development/r-modules/patches/rpud.patch2
10 files changed, 5 insertions, 54 deletions
diff --git a/pkgs/development/compilers/cudatoolkit/generic.nix b/pkgs/development/compilers/cudatoolkit/generic.nix
index d7bc718ea60f..d4970b278bbe 100644
--- a/pkgs/development/compilers/cudatoolkit/generic.nix
+++ b/pkgs/development/compilers/cudatoolkit/generic.nix
@@ -59,7 +59,6 @@ in 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
 
     # let's remove the 32-bit libraries, they confuse the lib64->lib mover
     rm -rf $out/lib
@@ -70,8 +69,6 @@ in stdenv.mkDerivation rec {
     fi
   '';
 
-  setupHook = ./setup-hook.sh;
-
   meta = {
     license = lib.licenses.unfree;
   };
diff --git a/pkgs/development/compilers/cudatoolkit/setup-hook.sh b/pkgs/development/compilers/cudatoolkit/setup-hook.sh
deleted file mode 100644
index 1b75a2e91ba2..000000000000
--- a/pkgs/development/compilers/cudatoolkit/setup-hook.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-addIncludePath () {
-    if test -d "$1/usr_include"
-    then
-        export NIX_CFLAGS_COMPILE="${NIX_CFLAGS_COMPILE} -I$1/usr_include"
-    fi
-}
-
-envHooks=(${envHooks[@]} addIncludePath)
diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix
index 334331af7bd1..dca155e6988d 100644
--- a/pkgs/development/haskell-modules/configuration-common.nix
+++ b/pkgs/development/haskell-modules/configuration-common.nix
@@ -53,7 +53,7 @@ self: super: {
     configureFlags = (drv.configureFlags or []) ++
       pkgs.lib.optional pkgs.stdenv.is64bit "--extra-lib-dirs=${pkgs.cudatoolkit}/lib64" ++ [
       "--extra-lib-dirs=${pkgs.cudatoolkit}/lib"
-      "--extra-include-dirs=${pkgs.cudatoolkit}/usr_include"
+      "--extra-include-dirs=${pkgs.cudatoolkit}/include"
     ];
     preConfigure = ''
       unset CC          # unconfuse the haskell-cuda configure script
diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix
index c24d5af7ddfb..62d39d768f9f 100644
--- a/pkgs/development/r-modules/default.nix
+++ b/pkgs/development/r-modules/default.nix
@@ -1566,7 +1566,6 @@ let
     });
 
     iFes = old.iFes.overrideDerivation (attrs: {
-      patches = [ ./patches/iFes.patch ];
       CUDA_HOME = "${pkgs.cudatoolkit}";
     });
 
@@ -1661,7 +1660,7 @@ let
       patches = [ ./patches/gmatrix.patch ];
       CUDA_LIB_PATH = "${pkgs.cudatoolkit}/lib64";
       R_INC_PATH = "${pkgs.R}/lib/R/include";
-      CUDA_INC_PATH = "${pkgs.cudatoolkit}/usr_include";
+      CUDA_INC_PATH = "${pkgs.cudatoolkit}/include";
     });
 
     # It seems that we cannot override meta attributes with overrideDerivation.
diff --git a/pkgs/development/r-modules/patches/CARramps.patch b/pkgs/development/r-modules/patches/CARramps.patch
index 901ab1f69b72..add01b28fc15 100644
--- a/pkgs/development/r-modules/patches/CARramps.patch
+++ b/pkgs/development/r-modules/patches/CARramps.patch
@@ -1,15 +1,3 @@
-diff -ru -x '*~' CARramps_orig/configure CARramps/configure
---- CARramps_orig/configure	2011-12-01 22:27:06.000000000 +0900
-+++ CARramps/configure	2014-10-25 14:56:04.599337748 +0900
-@@ -2395,7 +2395,7 @@
- 
- 
- NCFLAGS="-arch=sm_13 -O2"
--CUDA_INC=${CUDA_HOME}/include
-+CUDA_INC=${CUDA_HOME}/usr_include
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CUDA headers" >&5
- $as_echo_n "checking for CUDA headers... " >&6; }
- as_ac_File=`$as_echo "ac_cv_file_${CUDA_INC}/cublas.h" | $as_tr_sh`
 diff -ru -x '*~' CARramps_orig/src/combo1colForR1Q_d.cu CARramps/src/combo1colForR1Q_d.cu
 --- CARramps_orig/src/combo1colForR1Q_d.cu	2011-12-01 22:27:06.000000000 +0900
 +++ CARramps/src/combo1colForR1Q_d.cu	2014-10-25 14:59:06.869299163 +0900
diff --git a/pkgs/development/r-modules/patches/WideLM.patch b/pkgs/development/r-modules/patches/WideLM.patch
index f86d66bf7468..02bbfb7e0dab 100644
--- a/pkgs/development/r-modules/patches/WideLM.patch
+++ b/pkgs/development/r-modules/patches/WideLM.patch
@@ -6,7 +6,7 @@ diff -ru -x '*~' WideLM_orig/src/Makefile.in WideLM/src/Makefile.in
  R_INCS := @R_INCL@ @RCPP_INCL@
  CC_ARGS := @CU_PARAMS@ -Xcompiler @R_CPIC@
 -CU_INCS := -I@CUDA_HOME@/include
-+CU_INCS := -I@CUDA_HOME@/usr_include
++CU_INCS := -I@CUDA_HOME@/include
  CU_ARCH := -gencode arch=compute_20,code=sm_20
  
  #linker options
diff --git a/pkgs/development/r-modules/patches/gputools.patch b/pkgs/development/r-modules/patches/gputools.patch
index 61cbcea93706..1eb0c8c33cad 100644
--- a/pkgs/development/r-modules/patches/gputools.patch
+++ b/pkgs/development/r-modules/patches/gputools.patch
@@ -5,7 +5,7 @@ diff -ru -x '*~' gputools_orig/src/Makefile gputools/src/Makefile
  
  R_HOME := $(shell R RHOME)
  
-+CUDA_INC := $(CUDA_HOME)/usr_include
++CUDA_INC := $(CUDA_HOME)/include
 +CUDA_LIB := $(CUDA_HOME)/lib
 +
  #compiler/preprocessor options
diff --git a/pkgs/development/r-modules/patches/iFes.patch b/pkgs/development/r-modules/patches/iFes.patch
deleted file mode 100644
index aca89b8d5a86..000000000000
--- a/pkgs/development/r-modules/patches/iFes.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -u3 -r iFes_orig/src/config.mk iFes/src/config.mk
---- iFes_orig/src/config.mk	2014-12-09 14:19:58.000000000 +0300
-+++ iFes/src/config.mk	2015-02-19 22:47:24.426804174 +0300
-@@ -12,7 +12,7 @@
- endif
- 
- # set CUDA_INC to CUDA header dir on your system
--CUDA_INC := $(CUDA_HOME)/include
-+CUDA_INC := $(CUDA_HOME)/usr_include
- 
- ARCH := $(shell uname -m)
- 
-
diff --git a/pkgs/development/r-modules/patches/magma_cuda_include.patch b/pkgs/development/r-modules/patches/magma_cuda_include.patch
deleted file mode 100644
index 67552325ae9b..000000000000
--- a/pkgs/development/r-modules/patches/magma_cuda_include.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ru -x '*~' magma_orig/configure magma/configure
---- magma_orig/configure	2013-04-03 11:07:42.000000000 +0900
-+++ magma/configure	2014-10-18 21:58:48.745890187 +0900
-@@ -2377,7 +2377,7 @@
- 
- 
- NCFLAGS="-arch=sm_13 -O2 -DADD_"
--CUDA_INC=${CUDA_HOME}/include
-+CUDA_INC=${CUDA_HOME}/usr_include
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CUDA headers" >&5
- $as_echo_n "checking for CUDA headers... " >&6; }
- as_ac_File=`$as_echo "ac_cv_file_${CUDA_INC}/cublas.h" | $as_tr_sh`
diff --git a/pkgs/development/r-modules/patches/rpud.patch b/pkgs/development/r-modules/patches/rpud.patch
index 45d20e6bd670..bb904b68989c 100644
--- a/pkgs/development/r-modules/patches/rpud.patch
+++ b/pkgs/development/r-modules/patches/rpud.patch
@@ -18,7 +18,7 @@ diff -ru -x '*~' rpud_orig/src/Makefile.in rpud/src/Makefile.in
  
  #compiler/preprocessor options
 -INCS := -I@CUDA_HOME@/include
-+INCS := -I@CUDA_HOME@/usr_include
++INCS := -I@CUDA_HOME@/include
  PARAMS := -Xcompiler "@R_INCLUDE@ @CPICFLAGS@"
  
  #linker options