Skip to content

Commit

Permalink
cudatoolkit: Fix building dependent packages
Browse files Browse the repository at this point in the history
- 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

  BVLC/caffe#4046

This fixes OpenSubdiv and Blender.

(cherry picked from commit 5ade8ff)
  • Loading branch information
edolstra committed Sep 29, 2016
1 parent 1f6fd50 commit 3851322
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkgs/development/compilers/cudatoolkit/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 3851322

Please sign in to comment.