Hi, I’m trying to build a Python package (fcmaes) which uses a C library (MKL). I wrote this default.nix
:
{ lib, buildPythonPackage, fetchPypi, python, scipy, mkl }:
buildPythonPackage rec {
pname = "fcmaes";
version = "0.9.5.7";
src = fetchPypi {
inherit pname version;
sha256 = "1za05afp6x98dmdj61brkkdfzkgv0ixyafp8zh94fa001vs2qrvl";
};
propagatedBuildInputs = [
scipy
mkl
];
# preCheck = ''
# export LD_LIBRARY_PATH=${lib.strings.makeLibraryPath [ mkl ]}:$LD_LIBRARY_PATH;
# '';
meta = with lib; {
description = "Fast Python implementation of the CMA-ES optimization algorithm";
homepage = "https://github.com/dietmarwo/fast-cma-es";
license = licenses.mit;
maintainers = [ maintainers.juliendehos ];
};
}
but I get this error when I build the package:
OSError: libmkl_rt.so: cannot open shared object file: No such file or directory
I can build the package if I uncomment the preCheck
attribute but I still have the error when I try to use the package. How can I include correctly the MKL path in the package?