2021-02-05 17:12:51 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, libpng, libjpeg
|
2020-04-24 23:36:52 +00:00
|
|
|
, guiSupport ? false, libX11
|
|
|
|
|
|
|
|
# see http://dlib.net/compile.html
|
2021-03-09 03:18:52 +00:00
|
|
|
, sse4Support ? stdenv.hostPlatform.sse4_1Support
|
2020-09-25 04:45:31 +00:00
|
|
|
, avxSupport ? stdenv.hostPlatform.avxSupport
|
2020-04-24 23:36:52 +00:00
|
|
|
, cudaSupport ? true
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "dlib";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "19.24.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "davisking";
|
|
|
|
repo = "dlib";
|
|
|
|
rev ="v${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "sha256-Z1fScuaIHjj2L1uqLIvsZ7ARKNjM+iaA8SAtWUTPFZk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
rm -rf dlib/external
|
|
|
|
'';
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
cmakeFlags = [
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DUSE_DLIB_USE_CUDA=${if cudaSupport then "1" else "0"}"
|
2021-03-09 03:18:52 +00:00
|
|
|
"-DUSE_SSE4_INSTRUCTIONS=${if sse4Support then "yes" else "no"}"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DUSE_AVX_INSTRUCTIONS=${if avxSupport then "yes" else "no"}" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ libpng libjpeg ] ++ lib.optional guiSupport libX11;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A general purpose cross-platform C++ machine learning library";
|
|
|
|
homepage = "http://www.dlib.net";
|
|
|
|
license = licenses.boost;
|
|
|
|
maintainers = with maintainers; [ christopherpoole ma27 ];
|
2022-09-09 14:08:57 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|