summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-09-16 23:48:43 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-09-17 00:40:41 +0200
commit5ade8fff793908dbfed7c4b4f5ae904ae6326bfc (patch)
tree5547eae17ed8464a94b3f43f62743b727ffd50e9 /pkgs
parent09f58645ca6b579640f7e15a50cedd23d4ed3006 (diff)
downloadnixlib-5ade8fff793908dbfed7c4b4f5ae904ae6326bfc.tar
nixlib-5ade8fff793908dbfed7c4b4f5ae904ae6326bfc.tar.gz
nixlib-5ade8fff793908dbfed7c4b4f5ae904ae6326bfc.tar.bz2
nixlib-5ade8fff793908dbfed7c4b4f5ae904ae6326bfc.tar.lz
nixlib-5ade8fff793908dbfed7c4b4f5ae904ae6326bfc.tar.xz
nixlib-5ade8fff793908dbfed7c4b4f5ae904ae6326bfc.tar.zst
nixlib-5ade8fff793908dbfed7c4b4f5ae904ae6326bfc.zip
cudatoolkit: Fix building dependent packages
- Set a cmake flag to allow cmake to find CUDA automatically.

- Pass -D_FORCE_INLINES to work around

    /nix/store/8sl4jfs3nq0pkq4gg655s3axrxdx7z29-glibc-2.24-dev/include/string.h: In function 'void* __mempcpy_inline(void*, const void*, size_t)':
    /nix/store/8sl4jfs3nq0pkq4gg655s3axrxdx7z29-glibc-2.24-dev/include/string.h:650:42: error: 'memcpy' was not declared in this scope

  https://github.com/BVLC/caffe/issues/4046

This fixes OpenSubdiv and Blender.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/compilers/cudatoolkit/default.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkgs/development/compilers/cudatoolkit/default.nix b/pkgs/development/compilers/cudatoolkit/default.nix
index c13118977a17..7037bf3808f2 100644
--- a/pkgs/development/compilers/cudatoolkit/default.nix
+++ b/pkgs/development/compilers/cudatoolkit/default.nix
@@ -68,6 +68,14 @@ let
 
         # Change the #error on GCC > 4.9 to a #warning.
         sed -i $out/include/host_config.h -e 's/#error\(.*unsupported GNU version\)/#warning\1/'
+
+        # Ensure that cmake can find CUDA.
+        mkdir -p $out/nix-support
+        echo "cmakeFlags+=' -DCUDA_TOOLKIT_ROOT_DIR=$out'" >> $out/nix-support/setup-hook
+
+      '' + lib.optionalString (lib.versionOlder version "8.0") ''
+        # Hack to fix building against recent Glibc/GCC.
+        echo "NIX_CFLAGS_COMPILE+=' -D_FORCE_INLINES'" >> $out/nix-support/setup-hook
       '';
 
       meta = {