Merge pull request #261509 from SuperSandro2000/dlib

dlib: build with fftw, blas and webp
This commit is contained in:
Mario Rodas 2023-12-01 18:11:26 -05:00 committed by GitHub
commit f889c8f562
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,15 @@
{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, libpng, libjpeg
, guiSupport ? false, libX11
{ stdenv
, lib
, fetchFromGitHub
, cmake
, pkg-config
, fftw
, libpng
, libjpeg
, libwebp
, openblas
, guiSupport ? false
, libX11
# see http://dlib.net/compile.html
, sse4Support ? stdenv.hostPlatform.sse4_1Support
@ -23,12 +33,20 @@ stdenv.mkDerivation rec {
'';
cmakeFlags = [
"-DUSE_DLIB_USE_CUDA=${if cudaSupport then "1" else "0"}"
"-DUSE_SSE4_INSTRUCTIONS=${if sse4Support then "yes" else "no"}"
"-DUSE_AVX_INSTRUCTIONS=${if avxSupport then "yes" else "no"}" ];
(lib.cmakeBool "USE_DLIB_USE_CUDA" cudaSupport)
(lib.cmakeBool "USE_SSE4_INSTRUCTIONS" sse4Support)
(lib.cmakeBool "USE_AVX_INSTRUCTIONS" avxSupport)
];
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ libpng libjpeg ] ++ lib.optional guiSupport libX11;
buildInputs = [
fftw
libpng
libjpeg
libwebp
openblas
] ++ lib.optional guiSupport libX11;
meta = with lib; {
description = "A general purpose cross-platform C++ machine learning library";