dlib: add flag to disable AVX support
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
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
{ stdenv, lib, fetchFromGitHub, cmake, pkgconfig, libpng, libjpeg
|
||||
, guiSupport ? false, libX11
|
||||
|
||||
# see http://dlib.net/compile.html
|
||||
, avxSupport ? true
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
@@ -17,6 +20,8 @@ stdenv.mkDerivation rec {
|
||||
rm -rf dlib/external
|
||||
'';
|
||||
|
||||
cmakeFlags = [ "-DUSE_AVX_INSTRUCTIONS=${if avxSupport then "yes" else "no"}" ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
nativeBuildInputs = [ cmake pkgconfig ];
|
||||
buildInputs = [ libpng libjpeg ] ++ lib.optional guiSupport libX11;
|
||||
|
||||
Reference in New Issue
Block a user