15 assert (!blas.isILP64) && (!lapack.isILP64);
20 text = (lib.generators.toINI {} {
21 ${blas.implementation} = {
22 include_dirs = "${lib.getDev blas}/include:${lib.getDev lapack}/include";
23 library_dirs = "${blas}/lib:${lapack}/lib";
24 runtime_library_dirs = "${blas}/lib:${lapack}/lib";
25 libraries = "lapack,lapacke,blas,cblas";
28 include_dirs = "${lib.getDev lapack}/include";
29 library_dirs = "${lapack}/lib";
30 runtime_library_dirs = "${lapack}/lib";
33 include_dirs = "${lib.getDev blas}/include";
34 library_dirs = "${blas}/lib";
35 runtime_library_dirs = "${blas}/lib";
39 in buildPythonPackage rec {
42 format = "pyproject.toml";
45 inherit pname version;
47 sha256 = "e5cf3fdf13401885e8eea8170624ec96225e2174eb0c611c6f26dd33b489e3ff";
50 nativeBuildInputs = [ gfortran pytest cython setuptoolsBuildHook ];
51 buildInputs = [ blas lapack ];
53 patches = lib.optionals python.hasDistutilsCxxPatch [
54 # We patch cpython/distutils to fix https://bugs.python.org/issue1222585
55 # Patching of numpy.distutils is needed to prevent it from undoing the
57 ./numpy-distutils-C++_1.16.patch
61 sed -i 's/-faltivec//' numpy/distutils/system_info.py
62 export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES
63 export OMP_NUM_THREADS=$((NIX_BUILD_CORES > 64 ? 64 : NIX_BUILD_CORES))
70 enableParallelBuilding = true;
72 doCheck = !isPyPy; # numpy 1.16+ hits a bug in pypy's ctypes, using either numpy or pypy HEAD fixes this (https://github.com/numpy/numpy/issues/13807)
77 ${python.interpreter} -c 'import numpy; numpy.test("fast", verbose=10)'
83 # just for backwards compatibility
85 blasImplementation = blas.implementation;
90 # - test_large_file_support: takes a long time and can cause the machine to run out of disk space
91 NOSE_EXCLUDE="test_large_file_support";
94 description = "Scientific tools for Python";
95 homepage = "https://numpy.org/";
96 license = lib.licenses.bsd3;
97 maintainers = with lib.maintainers; [ fridh ];