mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-17 01:24:47 +00:00
Merge pull request #261509 from SuperSandro2000/dlib
dlib: build with fftw, blas and webp
This commit is contained in:
commit
f889c8f562
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user