From a9ecac2538ac0ab3d1ce42ec34b0ea18699f7844 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 30 Dec 2020 00:23:21 -0600 Subject: [PATCH] tensorflow1: disable sysctl.h in hwloc We need to override tensorflow's hwloc configuration, since it forces sysctl.h usage which is removed since glibc 2.31. This does not appear to effect tensorflow2. See also https://github.com/tensorflow/tensorflow/issues/45861 Fixes #104801 --- pkgs/development/python-modules/tensorflow/1/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/python-modules/tensorflow/1/default.nix b/pkgs/development/python-modules/tensorflow/1/default.nix index 599f809f8646..4dd30e4687ad 100644 --- a/pkgs/development/python-modules/tensorflow/1/default.nix +++ b/pkgs/development/python-modules/tensorflow/1/default.nix @@ -258,6 +258,11 @@ let substituteInPlace tensorflow/tools/pip_package/setup.py \ --replace "numpy >= 1.16.0, < 1.19.0" "numpy >= 1.16.0" + + # glibc 2.31+ does not have sys/sysctl.h + # see https://github.com/tensorflow/tensorflow/issues/45861 + substituteInPlace third_party/hwloc/BUILD.bazel\ + --replace "#define HAVE_SYS_SYSCTL_H 1" "#undef HAVE_SYS_SYSCTL_H" ''; preConfigure = let