mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 03:17:13 +00:00
9732c44225
Especially older hardware doesn't support AVX instructions. DLib is still functional there, but significantly slower[1]. By setting `avxInstructions` to false, DLib will be compiled without this feature. [1] http://dlib.net/compile.html
19 lines
587 B
Nix
19 lines
587 B
Nix
{ buildPythonPackage, dlib, python, pytest, avxSupport ? true }:
|
|
|
|
buildPythonPackage {
|
|
inherit (dlib) name src nativeBuildInputs buildInputs meta;
|
|
|
|
# although AVX can be enabled, we never test with it. Some Hydra machines
|
|
# fail because of this, however their build results are probably used on hardware
|
|
# with AVX support.
|
|
checkPhase = ''
|
|
${python.interpreter} nix_run_setup test --no USE_AVX_INSTRUCTIONS
|
|
'';
|
|
|
|
setupPyBuildFlags = [ "--${if avxSupport then "yes" else "no"} USE_AVX_INSTRUCTIONS" ];
|
|
|
|
patches = [ ./build-cores.patch ];
|
|
|
|
checkInputs = [ pytest ];
|
|
}
|