about summary refs log tree commit diff
path: root/pkgs/development/python-modules/dlib
diff options
context:
space:
mode:
authorDaniel Nagy <danielnagy@posteo.de>2021-02-24 21:56:27 +0100
committerDaniel Nagy <danielnagy@posteo.de>2021-02-25 22:49:08 +0100
commit7db40fa5d52ae4b7aaf3e145d006dd27cec2028e (patch)
treea99268fbefc4910f1b19a2a1bd99a349e852cdde /pkgs/development/python-modules/dlib
parentb6ef90c6c468d1d1aa94dd60d99d00b619b0a5a0 (diff)
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
Diffstat (limited to 'pkgs/development/python-modules/dlib')
-rw-r--r--pkgs/development/python-modules/dlib/default.nix6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkgs/development/python-modules/dlib/default.nix b/pkgs/development/python-modules/dlib/default.nix
index 204c1a985425f..58ceb16870a8b 100644
--- a/pkgs/development/python-modules/dlib/default.nix
+++ b/pkgs/development/python-modules/dlib/default.nix
@@ -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 ];