cudatoolkit: fix build with newer glibc versions

Packages that use CUDA would fail to build with missing defines.
This commit is contained in:
Franz Pletz 2017-12-12 13:16:51 +01:00
parent 3430b0e859
commit cd7c8e42c6
No known key found for this signature in database
GPG Key ID: 846FDED7792617B4

View File

@ -94,6 +94,9 @@ 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/'
# Fix builds with newer glibc version
sed -i "1 i#define _BITS_FLOATN_H" "$out/include/host_defines.h"
# Ensure that cmake can find CUDA.
mkdir -p $out/nix-support
echo "cmakeFlags+=' -DCUDA_TOOLKIT_ROOT_DIR=$out'" >> $out/nix-support/setup-hook