From 8f7cec22975b172500ce5e83ecdcc23aea6fb262 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Tue, 17 Nov 2020 08:31:06 -0800 Subject: [PATCH] python3Packages.numpy: fix tests for >64 core machines --- pkgs/development/python-modules/numpy/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/python-modules/numpy/default.nix b/pkgs/development/python-modules/numpy/default.nix index b8faccb155b5..622f784fb8ba 100644 --- a/pkgs/development/python-modules/numpy/default.nix +++ b/pkgs/development/python-modules/numpy/default.nix @@ -58,9 +58,13 @@ in buildPythonPackage rec { ./numpy-distutils-C++.patch ]; + # we default openblas to build with 64 threads + # if a machine has more than 64 threads, it will segfault + # see https://github.com/xianyi/OpenBLAS/issues/2993 preConfigure = '' sed -i 's/-faltivec//' numpy/distutils/system_info.py export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES + export OMP_NUM_THREADS=$((NIX_BUILD_CORES > 64 ? 64 : NIX_BUILD_CORES)) ''; preBuild = ''