From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marius Bakke Subject: [PATCH] gnu: Add dlib. Date: Sat, 13 Aug 2016 18:15:59 +0100 Message-ID: <8737m837zk.fsf@ike.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYcXi-00061u-8S for guix-devel@gnu.org; Sat, 13 Aug 2016 13:16:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bYcXe-0000vW-1D for guix-devel@gnu.org; Sat, 13 Aug 2016 13:16:17 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:38859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYcXb-0000un-Ng for guix-devel@gnu.org; Sat, 13 Aug 2016 13:16:13 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2E7FF20446 for ; Sat, 13 Aug 2016 13:16:01 -0400 (EDT) Received: from localhost (unknown [46.16.214.129]) by mail.messagingengine.com (Postfix) with ESMTPA id BAB72CCDC0 for ; Sat, 13 Aug 2016 13:16:00 -0400 (EDT) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel --=-=-= Content-Type: text/plain Hi, This adds the dlib machine learning toolkit. Cheers, Marius --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-Add-dlib.patch Content-Transfer-Encoding: quoted-printable >From 9a24f0bfd8a0375928d7accdc0ef744f4fa304a0 Mon Sep 17 00:00:00 2001 From: Marius Bakke 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 | 55 +++++++++++++++++++++++++++++++++++= +++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learn= ing.scm index f96672c..6db0333 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 =C2=A9 2015, 2016 Ricardo Wurmus ;;; Copyright =C2=A9 2016 Efraim Flashner +;;; Copyright =C2=A9 2016 Marius Bakke ;;; ;;; 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)) =20 (define-public libsvm (package @@ -467,3 +470,53 @@ geometric models.") "This package provides functions for feed-forward neural networks wit= h a single hidden layer, and for multinomial log-linear models.") (license (list license:gpl2+ license:gpl3+)))) + +(define-public dlib + (package + (name "dlib") + (version "19.0") + (source (origin + (method url-fetch) + (uri (string-append + "http://dlib.net/files/dlib-" version ".tar.bz2")) + (sha256 + (base32 + "0a4xilzhb78ffpcyq2fipri80bmlgrl5ngr7r3jygdr9p7v3z4dn")) + (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 + (let ((test-dir (string-append "../dlib-" ,version "/dlib/test/buil= d"))) + (modify-phases %standard-phases + (add-before 'check 'build-test-suite + ;; No test target, so we build and run the unit tests here. + (lambda _ + (mkdir-p test-dir) + (chdir test-dir) + (zero? (system* "cmake" "..")) + (zero? (system* "cmake" "--build" "." "--config" "Release")= ))) + (replace 'check + (lambda _ (zero? (system* "./dtest" "--runall")))) + (add-after 'check 'ascend-to-build-directory + (lambda _ (chdir "../../../../build") #t)))))) + (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 appli= cations 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 envi= ronments.") + (home-page "http://dlib.net") + (license license:boost1.0))) --=20 2.9.2 --=-=-=--