Merge pull request #37047 from dtzWill/fix/openblas-numpy-musl
openblas, numpy: fix w/musl
This commit is contained in:
commit
161253f0e0
@ -60,7 +60,7 @@ let
|
|||||||
TARGET = "ATHLON";
|
TARGET = "ATHLON";
|
||||||
DYNAMIC_ARCH = "1";
|
DYNAMIC_ARCH = "1";
|
||||||
CC = "gcc";
|
CC = "gcc";
|
||||||
USE_OPENMP = "1";
|
USE_OPENMP = if stdenv.hostPlatform.isMusl then "0" else "1";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
{lib, fetchPypi, python, buildPythonPackage, isPy27, isPyPy, gfortran, nose, blas}:
|
{lib, fetchPypi, python, buildPythonPackage, isPy27, isPyPy, gfortran, nose, blas, hostPlatform }:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "numpy";
|
pname = "numpy";
|
||||||
version = "1.14.1";
|
version = "1.14.2";
|
||||||
name = "${pname}-${version}";
|
name = "${pname}-${version}";
|
||||||
|
|
||||||
src = fetchPypi {
|
src = fetchPypi {
|
||||||
inherit pname version;
|
inherit pname version;
|
||||||
extension = "zip";
|
extension = "zip";
|
||||||
sha256 = "fa0944650d5d3fb95869eaacd8eedbd2d83610c85e271bd9d3495ffa9bc4dc9c";
|
sha256 = "facc6f925c3099ac01a1f03758100772560a0b020fb9d70f210404be08006bcb";
|
||||||
};
|
};
|
||||||
|
|
||||||
disabled = isPyPy;
|
disabled = isPyPy;
|
||||||
@ -20,6 +20,18 @@ buildPythonPackage rec {
|
|||||||
./numpy-distutils-C++.patch
|
./numpy-distutils-C++.patch
|
||||||
];
|
];
|
||||||
|
|
||||||
|
postPatch = lib.optionalString hostPlatform.isMusl ''
|
||||||
|
# Use fenv.h
|
||||||
|
sed -i \
|
||||||
|
numpy/core/src/npymath/ieee754.c.src \
|
||||||
|
numpy/core/include/numpy/ufuncobject.h \
|
||||||
|
-e 's/__GLIBC__/__linux__/'
|
||||||
|
# Don't use various complex trig functions
|
||||||
|
substituteInPlace numpy/core/src/private/npy_config.h \
|
||||||
|
--replace '#if defined(__GLIBC__)' "#if 1" \
|
||||||
|
--replace '#if !__GLIBC_PREREQ(2, 18)' "#if 1"
|
||||||
|
'';
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
sed -i 's/-faltivec//' numpy/distutils/system_info.py
|
sed -i 's/-faltivec//' numpy/distutils/system_info.py
|
||||||
export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES
|
export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES
|
||||||
|
Loading…
x
Reference in New Issue
Block a user