[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] gnu: Add dlib.
From: |
Marius Bakke |
Subject: |
Re: [PATCH] gnu: Add dlib. |
Date: |
Mon, 15 Aug 2016 12:51:15 +0100 |
User-agent: |
Notmuch/0.22 (https://notmuchmail.org) Emacs/24.5.2 (x86_64-unknown-linux-gnu) |
>> + (build-system cmake-build-system)
>> + (arguments
>> + `(#:phases
>> + (let ((test-dir (string-append "../dlib-" ,version
>> "/dlib/test/build")))
>
> I think it's better to move this 'let' inside the phase: ...
>
>> + (modify-phases %standard-phases
>> + (replace 'check
>> + ;; No test target, so we build and run the unit tests here.
>> + (lambda _
>
> ... here.
You're right. I tried that in an early iteration and it failed; I
assumed "version" was not available in that scope. Must have noobed
something else since it works fine now.. :)
>> + (mkdir-p test-dir)
>> + (with-directory-excursion test-dir
>> + (zero? (system* "cmake" ".."))
>> + (zero? (system* "cmake" "--build" "." "--config"
>> "Release"))
>> + (zero? (system* "./dtest" "--runall")))))))))
>
> There is no point in the first 2 'zero?' calls as their returning
> values will be lost, rather:
>
> (and (zero? (system* "cmake" ".."))
> (zero? (system* "cmake" "--build" "." "--config" "Release"))
> (zero? (system* "./dtest" "--runall")))
Thanks for pointing that out; fixed.
>> + (native-inputs
>> + `(("pkg-config" ,pkg-config)))
>> + (inputs
>> + `(("lapack" ,lapack)
>> + ("libjpeg" ,libjpeg)
>> + ("libpng" ,libpng)
>> + ("libx11" ,libx11)
>> + ("openblas" ,openblas)
>> + ("zlib" ,zlib)))
>> + (synopsis "Toolkit for making machine learning and data analysis
>> applications in C++")
>> + (description
>> + "Dlib is a modern C++ toolkit containing machine learning algorithms
>> and tools. It
>> +is used in both industry and academia in a wide range of domains including
>> robotics,
>> +embedded devices, mobile phones, and large high performance computing
>> environments.")
>
> As for me, the above lines (in synopsis and description) are too long, I
> would stay inside 72-78 columns.
Disagreeing with the linter, are we? ;) I've trimmed the lengths a bit.
Thanks!
>From 8ffcd39f9c8e3cea7ae925341cc19dc3b45941a3 Mon Sep 17 00:00:00 2001
From: Marius Bakke <address@hidden>
Date: Sat, 13 Aug 2016 11:26:10 +0100
Subject: [PATCH] gnu: Add dlib.
* gnu/packages/machine-learning.scm (dlib): New variable.
---
gnu/packages/machine-learning.scm | 54 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 53 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/machine-learning.scm
b/gnu/packages/machine-learning.scm
index f96672c..674af10 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015, 2016 Ricardo Wurmus <address@hidden>
;;; Copyright © 2016 Efraim Flashner <address@hidden>
+;;; Copyright © 2016 Marius Bakke <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -32,13 +33,15 @@
#:use-module (gnu packages compression)
#:use-module (gnu packages dejagnu)
#:use-module (gnu packages gcc)
+ #:use-module (gnu packages image)
#:use-module (gnu packages maths)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages statistics)
#:use-module (gnu packages swig)
- #:use-module (gnu packages xml))
+ #:use-module (gnu packages xml)
+ #:use-module (gnu packages xorg))
(define-public libsvm
(package
@@ -467,3 +470,52 @@ geometric models.")
"This package provides functions for feed-forward neural networks with a
single hidden layer, and for multinomial log-linear models.")
(license (list license:gpl2+ license:gpl3+))))
+
+(define-public dlib
+ (package
+ (name "dlib")
+ (version "19.1")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "http://dlib.net/files/dlib-" version ".tar.bz2"))
+ (sha256
+ (base32
+ "0p2pvcdalc6jhb6r99ybvjd9x74sclr0ngswdg9j2xl5pj7knbr4"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ ;; Delete ~13MB of bundled dependencies.
+ (delete-file-recursively "dlib/external")
+ (delete-file-recursively "docs/dlib/external")))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda _
+ ;; No test target, so we build and run the unit tests here.
+ (let ((test-dir (string-append "../dlib-" ,version
"/dlib/test/build")))
+ (mkdir-p test-dir)
+ (with-directory-excursion test-dir
+ (and (zero? (system* "cmake" ".."))
+ (zero? (system* "cmake" "--build" "." "--config"
"Release"))
+ (zero? (system* "./dtest" "--runall"))))))))))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (inputs
+ `(("lapack" ,lapack)
+ ("libjpeg" ,libjpeg)
+ ("libpng" ,libpng)
+ ("libx11" ,libx11)
+ ("openblas" ,openblas)
+ ("zlib" ,zlib)))
+ (synopsis
+ "Toolkit for making machine learning and data analysis applications in
C++")
+ (description
+ "Dlib is a modern C++ toolkit containing machine learning algorithms and
+tools. It is used in both industry and academia in a wide range of domains
+including robotics, embedded devices, mobile phones, and large high performance
+computing environments.")
+ (home-page "http://dlib.net")
+ (license license:boost1.0)))
--
2.9.2
- [PATCH] gnu: Add dlib., Marius Bakke, 2016/08/13
- Re: [PATCH] gnu: Add dlib., Leo Famulari, 2016/08/14
- Re: [PATCH] gnu: Add dlib., Marius Bakke, 2016/08/14
- Re: [PATCH] gnu: Add dlib., Alex Kost, 2016/08/15
- Re: [PATCH] gnu: Add dlib.,
Marius Bakke <=
- Re: [PATCH] gnu: Add dlib., Leo Famulari, 2016/08/15
- Re: [PATCH] gnu: Add dlib., Marius Bakke, 2016/08/15
- Re: [PATCH] gnu: Add dlib., Leo Famulari, 2016/08/15
- Re: [PATCH] gnu: Add dlib., Ben Woodcroft, 2016/08/15
- Re: [PATCH] gnu: Add dlib., Marius Bakke, 2016/08/16
- Re: [PATCH] gnu: Add dlib., Leo Famulari, 2016/08/16
- Re: [PATCH] gnu: Add dlib., Ben Woodcroft, 2016/08/16
- Re: [PATCH] gnu: Add dlib., Leo Famulari, 2016/08/16
- Re: [PATCH] gnu: Add dlib., Ben Woodcroft, 2016/08/16
- Re: [PATCH] gnu: Add dlib., Ben Woodcroft, 2016/08/17