diff options
author | Franz Geffke <franz@pantherx.org> | 2023-11-06 20:08:14 +0000 |
---|---|---|
committer | Franz Geffke <franz@pantherx.org> | 2023-11-06 20:08:14 +0000 |
commit | 47b4c9c854915df93893dbaa993accfacf9027fe (patch) | |
tree | 4f9b1742d63fcfbc94cc6b8d84f76c4d00c3a0b7 /px/packages/machine-learning.scm | |
parent | 0b426d7b7ed8e176bf464ef9e0683f74a6c9d20f (diff) |
rewrite: apply guix-reference formatting; cleanup some module imports
Diffstat (limited to 'px/packages/machine-learning.scm')
-rw-r--r-- | px/packages/machine-learning.scm | 165 |
1 files changed, 62 insertions, 103 deletions
diff --git a/px/packages/machine-learning.scm b/px/packages/machine-learning.scm index 0d104a6..bbfac2a 100644 --- a/px/packages/machine-learning.scm +++ b/px/packages/machine-learning.scm @@ -1,53 +1,17 @@ (define-module (px packages machine-learning) - #:use-module ((guix licenses) #:prefix license:) + #:use-module ((guix licenses) + #:prefix license:) #:use-module (guix packages) #:use-module (guix utils) #:use-module (guix download) #:use-module (guix svn-download) #:use-module (guix build-system cmake) - #:use-module (guix build-system gnu) - #:use-module (guix build-system ocaml) - #:use-module (guix build-system python) - #:use-module (guix build-system r) #:use-module (guix git-download) - #:use-module (gnu packages) - #:use-module (gnu packages adns) - #:use-module (gnu packages algebra) - #:use-module (gnu packages audio) - #:use-module (gnu packages autotools) - #:use-module (gnu packages base) - #:use-module (gnu packages bash) - #:use-module (gnu packages boost) - #:use-module (gnu packages check) #:use-module (gnu packages compression) - #:use-module (gnu packages cran) - #:use-module (gnu packages databases) - #:use-module (gnu packages dejagnu) - #:use-module (gnu packages gcc) - #:use-module (gnu packages glib) - #:use-module (gnu packages graphviz) - #:use-module (gnu packages gstreamer) #:use-module (gnu packages image) - #:use-module (gnu packages linux) #:use-module (gnu packages maths) - #:use-module (gnu packages mpi) - #:use-module (gnu packages ocaml) - #:use-module (gnu packages onc-rpc) - #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) - #:use-module (gnu packages protobuf) - #:use-module (gnu packages python) - #:use-module (gnu packages python-science) - #:use-module (gnu packages python-web) - #:use-module (gnu packages python-xyz) - #:use-module (gnu packages rpc) - #:use-module (gnu packages serialization) - #:use-module (gnu packages sphinx) - #:use-module (gnu packages statistics) - #:use-module (gnu packages sqlite) - #:use-module (gnu packages swig) - #:use-module (gnu packages web) - #:use-module (gnu packages xml) + #:use-module (gnu packages onc-rpc) #:use-module (gnu packages xorg) #:use-module (ice-9 match)) @@ -55,73 +19,68 @@ (package (name "dlib") (version "19.21") - (source (origin - (method url-fetch) - (uri (string-append - "http://dlib.net/files/dlib-" version ".tar.bz2")) - (sha256 - (base32 - "0g7mgm6l6nw9hlw2zckf59jcd2y2lf907n88hjschkccmq1qlwmy")) - (modules '((guix build utils))) - (snippet - '(begin - ;; Delete ~13MB of bundled dependencies. - (delete-file-recursively "dlib/external") - (delete-file-recursively "docs/dlib/external") - #t)))) + (source + (origin + (method url-fetch) + (uri (string-append "http://dlib.net/files/dlib-" version ".tar.bz2")) + (sha256 + (base32 "0g7mgm6l6nw9hlw2zckf59jcd2y2lf907n88hjschkccmq1qlwmy")) + (modules '((guix build utils))) + (snippet '(begin + ;; Delete ~13MB of bundled dependencies. + (delete-file-recursively "dlib/external") + (delete-file-recursively "docs/dlib/external") #t)))) (build-system cmake-build-system) (arguments `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON") - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'disable-asserts - (lambda _ - ;; config.h recommends explicitly enabling or disabling asserts - ;; when building as a shared library. By default neither is set. - (substitute* "dlib/config.h" - (("^//#define DLIB_DISABLE_ASSERTS") "#define DLIB_DISABLE_ASSERTS")) - #t)) - (add-after 'disable-asserts 'disable-failing-tests - (lambda _ - ;; One test times out on MIPS, so we need to disable it. - ;; Others are flaky on some platforms. - (let* ((system ,(or (%current-target-system) - (%current-system))) - (disabled-tests (cond - ((string-prefix? "mips64" system) - '("object_detector" ; timeout - "data_io")) - ((string-prefix? "armhf" system) - '("learning_to_track")) - ((string-prefix? "i686" system) - '("optimization")) - (else '())))) - (for-each - (lambda (test) - (substitute* "dlib/test/makefile" - (((string-append "SRC \\+= " test "\\.cpp")) ""))) - disabled-tests) - #t))) - (replace 'check - (lambda _ - ;; No test target, so we build and run the unit tests here. - (let ((test-dir (string-append "../dlib-" ,version "/dlib/test"))) - (with-directory-excursion test-dir - (invoke "make" "-j" (number->string (parallel-job-count))) - (invoke "./dtest" "--runall")) - #t)))))) - (native-inputs - `(("pkg-config" ,pkg-config) - ;; For tests. - ("libnsl" ,libnsl))) - (inputs - `(("giflib" ,giflib) - ("lapack" ,lapack) - ("libjpeg" ,libjpeg-turbo) - ("libpng" ,libpng) - ("libx11" ,libx11) - ("openblas" ,openblas) - ("zlib" ,zlib))) + #:phases (modify-phases %standard-phases + (add-after 'unpack 'disable-asserts + (lambda _ + ;; config.h recommends explicitly enabling or disabling asserts + ;; when building as a shared library. By default neither is set. + (substitute* "dlib/config.h" + (("^//#define DLIB_DISABLE_ASSERTS") + "#define DLIB_DISABLE_ASSERTS")) #t)) + (add-after 'disable-asserts 'disable-failing-tests + (lambda _ + ;; One test times out on MIPS, so we need to disable it. + ;; Others are flaky on some platforms. + (let* ((system ,(or (%current-target-system) + (%current-system))) + (disabled-tests (cond + ((string-prefix? "mips64" + system) + '("object_detector" ;timeout + "data_io")) + ((string-prefix? "armhf" system) + '("learning_to_track")) + ((string-prefix? "i686" system) + '("optimization")) + (else '())))) + (for-each (lambda (test) + (substitute* "dlib/test/makefile" + (((string-append "SRC \\+= " test + "\\.cpp")) + ""))) disabled-tests) #t))) + (replace 'check + (lambda _ + ;; No test target, so we build and run the unit tests here. + (let ((test-dir (string-append "../dlib-" + ,version "/dlib/test"))) + (with-directory-excursion test-dir + (invoke "make" "-j" + (number->string (parallel-job-count))) + (invoke "./dtest" "--runall")) #t)))))) + (native-inputs `(("pkg-config" ,pkg-config) + ;; For tests. + ("libnsl" ,libnsl))) + (inputs `(("giflib" ,giflib) + ("lapack" ,lapack) + ("libjpeg" ,libjpeg-turbo) + ("libpng" ,libpng) + ("libx11" ,libx11) + ("openblas" ,openblas) + ("zlib" ,zlib))) (synopsis "Toolkit for making machine learning and data analysis applications in C++") (description |