nixpkgs/pkgs/development/python-modules/numexpr/default.nix
Benjamin Hipple 6206a342e0 mkl: include Intel's libiomp.so in the MKL RPM unpack
Since Intel's default openmp implementation is available in the same src
tarball, we can just include it in the package. This means that `mkl` now "just
works" without any environment variables, fragile setup-hooks, or forced
propagation.

Since the openmp implementation is only needed at runtime (and for test cases),
users can substitute a different one if they prefer by exporting it with
`LD_PRELOAD`, which is how Intel recommends handling this. If they do not do so,
`libiomp.so` lives next to `libmkl_rt.so` and thus will be in the RPATH as a
sane default.

Since this still comes from the same src tarball, we can ship it without losing
the fixed-output derivation; likewise, since Hydra is not building or caching
these, shipping these proprietary packages costs no bandwidth for the nix
community.
2018-12-19 22:05:22 +01:00

45 lines
905 B
Nix

{ lib
, buildPythonPackage
, fetchPypi
, python
, numpy
}:
buildPythonPackage rec {
pname = "numexpr";
version = "2.6.8";
src = fetchPypi {
inherit pname version;
sha256 = "ee8bc7201aa2f1962c67d27c326a11eef9df887d7b87b1278a1d4e722bf44375";
};
# Remove existing site.cfg, use the one we built for numpy.
preBuild = ''
rm site.cfg
ln -s ${numpy.cfg} site.cfg
'';
propagatedBuildInputs = [ numpy ];
# Run the test suite.
# It requires the build path to be in the python search path.
checkPhase = ''
pushd $out
${python}/bin/${python.executable} <<EOF
import sys
import numexpr
r = numexpr.test()
if not r.wasSuccessful():
sys.exit(1)
EOF
popd
'';
meta = {
description = "Fast numerical array expression evaluator for NumPy";
homepage = "https://github.com/pydata/numexpr";
license = lib.licenses.mit;
};
}