python3Packages.dlib: support sse4 instructions

My understanding of the line that is removed is, that the logic is
wrong. According to the setup.py file[0] it says that:

> To exclude certain options in the cmake config use --no:
>     for example:
>     --no USE_AVX_INSTRUCTIONS: will set -DUSE_AVX_INSTRUCTIONS=no

This means, that a true value of `avxSupport` will deactivate it in the
setup, which is not what we want.

[0]: https://github.com/davisking/dlib/blob/v19.21/setup.py#L22
This commit is contained in:
Daniel Nagy 2021-02-24 21:56:27 +01:00
parent b6ef90c6c4
commit 7db40fa5d5
No known key found for this signature in database
GPG key ID: 1B8E8DCB576FB671

View file

@ -1,4 +1,5 @@
{ buildPythonPackage, stdenv, lib, dlib, python, pytest, more-itertools
, sse4Support ? stdenv.hostPlatform.sse4_1Support
, avxSupport ? stdenv.hostPlatform.avxSupport
}:
@ -12,7 +13,10 @@ buildPythonPackage {
${python.interpreter} nix_run_setup test --no USE_AVX_INSTRUCTIONS
'';
setupPyBuildFlags = lib.optional avxSupport "--no USE_AVX_INSTRUCTIONS";
setupPyBuildFlags = [
"--set USE_SSE4_INSTRUCTIONS=${if sse4Support then "yes" else "no"}"
"--set USE_AVX_INSTRUCTIONS=${if avxSupport then "yes" else "no"}"
];
patches = [ ./build-cores.patch ];