aboutsummaryrefslogtreecommitdiff
path: root/gnu/installer/record.scm
blob: 5e0264682fcea030fea9bf89cd7e8282bc7381ca (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2020 Florian Pelz <pelzflorian@pelzflorian.de>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu installer record)
  #:use-module (guix records)
  #:use-module (srfi srfi-1)
  #:export (<installer>
            installer
            make-installer
            installer?
            installer-name
            installer-init
            installer-exit
            installer-exit-error
            installer-final-page
            installer-keymap-page
            installer-locale-page
            installer-menu-page
            installer-network-page
            installer-substitutes-page
            installer-timezone-page
            installer-hostname-page
            installer-user-page
            installer-partition-page
            installer-services-page
            installer-welcome-page
            installer-parameters-menu
            installer-parameters-page
            installer-dump-page
            installer-run-command
            installer-report-page))


;;;
;;; Installer record.
;;;

;; The <installer> record contains pages that will be run to prompt the user
;; for the system configuration. The goal of the installer is to produce a
;; complete <operating-system> record and install it.

(define-record-type* <installer>
  installer make-installer
  installer?
  ;; symbol
  (name installer-name)
  ;; procedure: void -> void
  (init installer-init)
  ;; procedure: void -> void
  (exit installer-exit)
  ;; procedure (key arguments) -> (action)
  (exit-error installer-exit-error)
  ;; procedure void -> void
  (final-page installer-final-page)
  ;; procedure (layouts context) -> (list layout variant options)
  (keymap-page installer-keymap-page)
  ;; procedure: (#:key supported-locales iso639-languages iso3166-territories)
  ;; -> glibc-locale
  (locale-page installer-locale-page)
  ;; procedure: (steps) -> step-id
  (menu-page installer-menu-page)
  ;; procedure void -> void
  (network-page installer-network-page)
  ;; procedure void -> void
  (substitutes-page installer-substitutes-page)
  ;; procedure (zonetab) -> posix-timezone
  (timezone-page installer-timezone-page)
  ;; procedure void -> void
  (hostname-page installer-hostname-page)
  ;; procedure void -> void
  (user-page installer-user-page)
  ;; procedure void -> void
  (partition-page installer-partition-page)
  ;; procedure void -> void
  (services-page installer-services-page)
  ;; procedure (logo #:pci-database) -> void
  (welcome-page installer-welcome-page)
  ;; procedure (menu-proc) -> void
  (parameters-menu installer-parameters-menu)
  ;; procedure (keyboard-layout-selection) -> void
  (parameters-page installer-parameters-page)
  ;; procedure (dump) -> void
  (dump-page installer-dump-page)
  ;; procedure command -> bool
  (run-command installer-run-command)
  ;; procedure (report) -> void
  (report-page installer-report-page))
(build-system pyproject-build-system) (native-inputs (list python-setuptools python-wheel)) (propagated-inputs (list python-autograd python-scipy)) (home-page "https://github.com/CamDavidsonPilon/autograd-gamma") (synopsis "Autograd-compatible approximations to the gamma family of functions") (description "This package provides Autograd-compatible approximations to the gamma family of functions.") (license license:expat))) (define-public python-fasttext (package (inherit fasttext) (name "python-fasttext") (build-system pyproject-build-system) (propagated-inputs (list python-numpy python-scipy)) (inputs (list fasttext)) (native-inputs (list pybind11 python-setuptools python-wheel)))) (define-public python-funsor (package (name "python-funsor") (version "0.4.5") (source (origin (method url-fetch) (uri (pypi-uri "funsor" version)) (sha256 (base32 "0cgysij0dix0fikyz2x4f8jvaskm5s5a04s07chzaz2dw1fpxdq8")))) (build-system pyproject-build-system) (arguments ; disable flaky test (list #:test-flags '(list "-k" "not test_integrate_variable[x23-i]"))) (propagated-inputs (list python-makefun python-multipledispatch python-numpy python-opt-einsum python-typing-extensions)) (native-inputs (list python-black python-flake8 python-isort python-nbsphinx python-pandas python-pillow python-pyro-api python-pytest python-pytest-xdist python-requests python-scipy python-setuptools python-sphinx python-sphinx-gallery python-sphinx-rtd-theme python-torchvision python-wheel)) (home-page "https://github.com/pyro-ppl/funsor") (synopsis "Tensor-like library for functions and distributions") (description "This package provides a tensor-like library for functions and distributions.") (license license:asl2.0))) (define-public fann ;; The last release is >100 commits behind, so we package from git. (let ((commit "d71d54788bee56ba4cf7522801270152da5209d7")) (package (name "fann") (version (string-append "2.2.0-1." (string-take commit 8))) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/libfann/fann") (commit commit))) (file-name (string-append name "-" version "-checkout")) (sha256 (base32 "0ibwpfrjs6q2lijs8slxjgzb2llcl6rk3v2ski4r6215g5jjhg3x")))) (build-system cmake-build-system) (arguments `(#:phases (modify-phases %standard-phases (replace 'check (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out"))) (with-directory-excursion (string-append (getcwd) "/tests") (invoke "./fann_tests")))))))) (home-page "http://leenissen.dk/fann/wp/") (synopsis "Fast Artificial Neural Network") (description "FANN is a neural network library, which implements multilayer artificial neural networks in C with support for both fully connected and sparsely connected networks.") (license license:lgpl2.1)))) (define-public libsvm (package (name "libsvm") (version "3.23") (source (origin (method url-fetch) (uri (string-append "https://www.csie.ntu.edu.tw/~cjlin/libsvm/" name "-" version ".tar.gz")) (sha256 (base32 "0jpaq0rr92x38p4nk3gjan79ip67m6p80anb28z1d8601miysyi5")))) (build-system gnu-build-system) (arguments `(#:tests? #f ; no "check" target #:phases (modify-phases %standard-phases (delete 'configure) (add-after 'build 'build-lib (lambda _ (invoke "make" "lib"))) (replace 'install ; no ‘install’ target (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (bin (string-append out "/bin/")) (lib (string-append out "/lib/")) (inc (string-append out "/include/libsvm"))) (mkdir-p bin) (for-each (lambda (file) (copy-file file (string-append bin file))) '("svm-train" "svm-predict" "svm-scale")) (mkdir-p lib) (install-file "libsvm.so.2" lib) (mkdir-p inc) (install-file "svm.h" inc))))))) (home-page "https://www.csie.ntu.edu.tw/~cjlin/libsvm/") (synopsis "Library for Support Vector Machines") (description "LIBSVM is a machine learning library for support vector classification, (C-SVC, nu-SVC), regression (epsilon-SVR, nu-SVR) and distribution estimation (one-class SVM). It supports multi-class classification.") (license license:bsd-3))) (define-public python-libsvm (package (inherit libsvm) (name "python-libsvm") (build-system gnu-build-system) (arguments `(#:tests? #f ; no "check" target #:make-flags '("-C" "python") #:phases (modify-phases %standard-phases (delete 'configure) (replace 'install ; no ‘install’ target (lambda* (#:key inputs outputs #:allow-other-keys) (let ((site (string-append (assoc-ref outputs "out") "/lib/python" (string-take (string-take-right (assoc-ref inputs "python") 5) 3) "/site-packages/"))) (substitute* "python/svm.py" (("../libsvm.so.2") "libsvm.so.2")) (mkdir-p site) (for-each (lambda (file) (copy-file file (string-append site (basename file)))) (find-files "python" "\\.py")) (copy-file "libsvm.so.2" (string-append site "libsvm.so.2"))) #t))))) (inputs (list python)) (synopsis "Python bindings of libSVM"))) (define-public python-ml-collections (package (name "python-ml-collections") (version "0.1.1") (source (origin (method url-fetch) (uri (pypi-uri "ml_collections" version)) (sha256 (base32 "1k38psfzqsqnl99fl578bd07zdmvfkja61r3sgjs2fj3xircrvrz")))) (build-system pyproject-build-system) (arguments (list #:phases #~(modify-phases %standard-phases (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? ;; TODO: we can't seem to run the config_flags tests, because ;; the installed Python files conflict with those from the ;; source directory, resulting in constants to be defined more ;; than once. (invoke "pytest" "ml_collections/config_dict/tests" ;; This one fails because we're testing the __main__ ;; class, not config_dict_test. "-k" "not testJSONConversionBestEffort"))))))) (propagated-inputs (list python-absl-py python-contextlib2 python-pyyaml python-six)) (native-inputs (list python-mock python-pytest python-setuptools python-wheel)) (home-page "https://github.com/google/ml_collections") (synopsis "Python collections designed for Machine Learning usecases") (description "ML Collections is a library of Python collections designed for Machine Learning usecases.") (license license:asl2.0))) (define-public ghmm ;; The latest release candidate is several years and a couple of fixes have ;; been published since. This is why we download the sources from the SVN ;; repository. (let ((svn-revision 2341)) (package (name "ghmm") (version (string-append "0.9-rc3-0." (number->string svn-revision))) (source (origin (method svn-fetch) (uri (svn-reference (url "http://svn.code.sf.net/p/ghmm/code/trunk") (revision svn-revision))) (file-name (string-append name "-" version "-checkout")) (sha256 (base32 "07kdsngvr4n1qxpqzv1nlay7g41d6jzjppa8vzmrg220s8ing87z")))) (build-system gnu-build-system) (arguments `(#:imported-modules (,@%default-gnu-imported-modules (guix build python-build-system)) #:modules ((guix build python-build-system) ,@%default-gnu-modules) #:phases (modify-phases %standard-phases (add-after 'unpack 'enter-dir (lambda _ (chdir "ghmm"))) (add-after 'enter-dir 'fix-runpath (lambda* (#:key outputs #:allow-other-keys) (substitute* "ghmmwrapper/setup.py" (("^(.*)extra_compile_args = \\[" line indent) (string-append indent "extra_link_args = [\"-Wl,-rpath=" (assoc-ref outputs "out") "/lib\"],\n" line "\"-Wl,-rpath=" (assoc-ref outputs "out") "/lib\", "))))) (add-after 'enter-dir 'disable-broken-tests (lambda _ (substitute* "tests/Makefile.am" ;; GHMM_SILENT_TESTS is assumed to be a command. (("TESTS_ENVIRONMENT.*") "") ;; Do not build broken tests. (("chmm .*") "") (("read_fa .*") "") (("mcmc .*") "") (("label_higher_order_test.*$") "label_higher_order_test\n")) ;; These Python unittests are broken as there is no gato. ;; See https://sourceforge.net/p/ghmm/support-requests/3/ (substitute* "ghmmwrapper/ghmmunittests.py" (("^(.*)def (testNewXML|testMultipleTransitionClasses|testNewXML)" line indent) (string-append indent "@unittest.skip(\"Disabled by Guix\")\n" line)))))))) (inputs `(("python" ,python-2) ; only Python 2 is supported ("libxml2" ,libxml2))) (native-inputs (list pkg-config dejagnu swig autoconf automake libtool)) (home-page "http://ghmm.org") (synopsis "Hidden Markov Model library") (description "The General Hidden Markov Model library (GHMM) is a C library with additional Python bindings implementing a wide range of types of @dfn{Hidden Markov Models} (HMM) and algorithms: discrete, continuous emissions, basic training, HMM clustering, HMM mixtures.") (license license:lgpl2.0+)))) (define-public guile-aiscm (package (name "guile-aiscm") (version "0.25.2") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/wedesoft/aiscm") (commit "v0.25.2"))) (file-name (git-file-name name version)) (sha256 (base32 "1sagpxwrqxkn5b9zqzd07c9r7swmw45q672pa8fy6s71iw6a0x77")))) (build-system gnu-build-system) (arguments (list #:make-flags #~(list (string-append "GUILE_CACHE=" #$output "/lib/guile/3.0/site-ccache") (string-append "GUILE_EXT=" #$output "/lib/guile/3.0/extensions") (string-append "GUILE_SITE=" #$output "/share/guile/site/3.0")) #:phases '(modify-phases %standard-phases (add-after 'unpack 'build-reproducibly (lambda _ (substitute* "doc/Makefile.am" (("\\$\\(DATE\\)") "1970-01-01")))) (add-after 'unpack 'find-clearsilver (lambda* (#:key inputs #:allow-other-keys) (substitute* "configure.ac" (("/usr/local/include/ClearSilver") (string-append (assoc-ref inputs "clearsilver") "/include/ClearSilver"))) (substitute* "aiscm/Makefile.am" (("-lneo_utl" m) (string-append m " -lstreamhtmlparser"))) (setenv "C_INCLUDE_PATH" (string-append (assoc-ref inputs "clearsilver") "/include/ClearSilver:" (or (getenv "C_INCLUDE_PATH") ""))))) (add-after 'unpack 'use-llvm-config (lambda _ (substitute* "m4/ax_llvmc.m4" (("llvm-config-11") "llvm-config") ;; For some reason this library is not on the link list. (("(LLVM_LIBS=\"\\$\\(\\$ac_llvm_config_path --libs \\$1\\))\"" _ m) (string-append m " -lLLVMMCJIT\""))) ;; Because of this message: ;; symbol lookup error: ./.libs/libguile-aiscm-core.so: undefined symbol: LLVMInitializeX86TargetInfo ;; This probably needs to differ when building on architectures ;; other than x86_64. (substitute* "aiscm/Makefile.am" (("LLVM_LIBS\\)") "LLVM_LIBS) \ -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info")))) ;; This test fails because our version of tensorflow is too old ;; to provide tf-string-length. (add-after 'unpack 'disable-broken-test (lambda _ (substitute* "tests/test_tensorflow.scm" (("\\(test-eqv \"determine string length" m) (string-append "#;" m))))) ;; Use Clang instead of GCC. (add-before 'configure 'prepare-build-environment (lambda _ (setenv "AR" "llvm-ar") (setenv "NM" "llvm-nm") (setenv "CC" "clang") (setenv "CXX" "clang++")))))) (inputs (list clearsilver ffmpeg-4 freeglut guile-3.0 imagemagick libgc libjpeg-turbo libomp libxi libxmu libxpm libxt libxv mesa mjpegtools pandoc pulseaudio tensorflow)) (native-inputs (list clang-13 llvm-13 pkg-config protobuf-c-for-aiscm autoconf automake gettext-minimal libtool which)) (home-page "https://wedesoft.github.io/aiscm/") (synopsis "Guile extension for numerical arrays and tensors") (description "AIscm is a Guile extension for numerical arrays and tensors. Performance is achieved by using the LLVM JIT compiler.") (license license:gpl3+))) (define-public guile-aiscm-next (deprecated-package "guile-aiscm-next" guile-aiscm)) (define-public llama-cpp (let ((tag "b4549")) (package (name "llama-cpp") (version (string-append "0.0.0-" tag)) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/ggerganov/llama.cpp") (commit tag))) (file-name (git-file-name name tag)) (sha256 (base32 "1xf2579q0r8nv06kj8padi6w9cv30w58vdys65nq8yzm3dy452a1")) (patches (search-patches "llama-cpp-vulkan-optional.patch")))) (build-system cmake-build-system) (arguments (list #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON" "-DGGML_VULKAN=ON" "-DGGML_BLAS=ON" "-DGGML_BLAS_VENDOR=OpenBLAS" (string-append "-DBLAS_INCLUDE_DIRS=" #$(this-package-input "openblas") "/include") (string-append "-DBLAS_LIBRARIES=" #$(this-package-input "openblas") "/lib/libopenblas.so") "-DGGML_NATIVE=OFF" ;no '-march=native' "-DGGML_FMA=OFF" ;and no '-mfma', etc. "-DGGML_AVX2=OFF" "-DGGML_AVX512=OFF" "-DGGML_AVX512_VBMI=OFF" "-DGGML_AVX512_VNNI=OFF") #:modules '((ice-9 textual-ports) (guix build utils) ((guix build python-build-system) #:prefix python:) (guix build cmake-build-system)) #:imported-modules `(,@%cmake-build-system-modules (guix build python-build-system)) #:phases #~(modify-phases %standard-phases (add-after 'unpack 'patch-paths (lambda* (#:key inputs #:allow-other-keys) (substitute* "ggml/src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp" (("\"/bin/sh\"") (string-append "\"" (search-input-file inputs "/bin/sh") "\""))))) (add-after 'unpack 'disable-unrunable-tests (lambda _ ;; test-eval-callback downloads ML model from network, cannot ;; run in Guix build environment (substitute* '("examples/eval-callback/CMakeLists.txt") (("COMMAND llama-eval-callback") "COMMAND true llama-eval-callback")))) (add-before 'install 'install-python-scripts (lambda _ (let ((bin (string-append #$output "/bin/"))) (define (make-script script) (let ((suffix (if (string-suffix? ".py" script) "" ".py"))) (call-with-input-file (string-append "../source/" script suffix) (lambda (input) (call-with-output-file (string-append bin script) (lambda (output) (format output "#!~a/bin/python3\n~a" #$(this-package-input "python") (get-string-all input)))))) (chmod (string-append bin script) #o555))) (mkdir-p bin) (make-script "convert_hf_to_gguf") (make-script "convert_llama_ggml_to_gguf") (make-script "convert_hf_to_gguf_update.py")))) (add-after 'install-python-scripts 'wrap-python-scripts (assoc-ref python:%standard-phases 'wrap)) (add-after 'install 'remove-tests (lambda* (#:key outputs #:allow-other-keys) (for-each delete-file (find-files (string-append (assoc-ref outputs "out") "/bin") "^test-"))))))) (inputs (list python vulkan-headers vulkan-loader)) (native-inputs (list pkg-config shaderc bash)) (propagated-inputs (list python-numpy python-pytorch python-sentencepiece openblas)) (properties '((tunable? . #true))) ;use AVX512, FMA, etc. when available (home-page "https://github.com/ggerganov/llama.cpp") (synopsis "Port of Facebook's LLaMA model in C/C++") (description "This package provides a port to Facebook's LLaMA collection of foundation language models. It requires models parameters to be downloaded independently to be able to run a LLaMA model.") (license license:expat)))) (define-public whisper-cpp (package (name "whisper-cpp") (version "1.7.3") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/ggerganov/whisper.cpp") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0rrkgrx8akw91b77kl36i03i39a79r0p69glhhidm28qfw02icjx")) (patches (search-patches "whisper-cpp-enable-tests.patch")))) (build-system cmake-build-system) (arguments (list #:configure-flags #~(list "-DWHISPER_STANDALONE=TRUE" "-DWHISPER_SDL2=TRUE" "-DWHISPER_BUILD_TESTS=TRUE" ; "-DWHISPER_FFMPEG=TRUE" ; TODO "-DBUILD_SHARED_LIBS=ON" "-DGGML_BLAS=ON" "-DGGML_BLAS_VENDOR=OpenBLAS" (string-append "-DBLAS_INCLUDE_DIRS=" #$(this-package-input "openblas") "/include") (string-append "-DBLAS_LIBRARIES=" #$(this-package-input "openblas") "/lib/libopenblas.so") "-DGGML_NATIVE=OFF" ;no '-march=native' "-DGGML_FMA=OFF" ;and no '-mfma', etc. "-DGGML_AVX2=OFF" "-DGGML_AVX512=OFF" "-DGGML_AVX512_VBMI=OFF" "-DGGML_AVX512_VNNI=OFF") #:phases #~(modify-phases %standard-phases #$@(if (not (target-64bit?)) '((add-after 'unpack 'skip-failing-tests (lambda _ ;; 32-bit system ;; large model does not fit in RAM in 32-bit system, ;; disable large model test (substitute* "tests/CMakeLists.txt" (("LABELS \"large\"") "DISABLED true"))))) '())))) (native-inputs (list pkg-config)) (inputs (list openblas sdl2)) (synopsis "OpenAI's Whisper model in C/C++") (description "This package is a high-performance inference of OpenAI's Whisper automatic speech recognition (ASR) model, implemented in plain C/C++ without dependencies, with @itemize @item AVX intrinsics support for x86 architectures @item VSX intrinsics support for POWER architectures @item Mixed F16 / F32 precision @item 4-bit and 5-bit integer quantization support @item Zero memory allocations at runtime @item Support for CPU-only inference @item Efficient GPU support for NVIDIA @item OpenVINO Support @item C-style API @end itemize") (properties '((tunable? . #true))) ;use AVX512, FMA, etc. when available (home-page "https://github.com/ggerganov/whisper.cpp") (license license:expat))) (define-public mcl (package (name "mcl") (version "14.137") (source (origin (method url-fetch) (uri (string-append "http://micans.org/mcl/src/mcl-" (string-replace-substring version "." "-") ".tar.gz")) (sha256 (base32 "15xlax3z31lsn62vlg94hkm75nm40q4679amnfg13jm8m2bnhy5m")))) (build-system gnu-build-system) (arguments `(#:configure-flags (list "--enable-blast" "CFLAGS=-fcommon"))) (inputs (list perl)) (home-page "https://micans.org/mcl/") (synopsis "Clustering algorithm for graphs") (description "The MCL algorithm is short for the @dfn{Markov Cluster Algorithm}, a fast and scalable unsupervised cluster algorithm for graphs (also known as networks) based on simulation of (stochastic) flow in graphs.") ;; In the LICENCE file and web page it says "The software is licensed ;; under the GNU General Public License, version 3.", but in several of ;; the source code files it suggests GPL3 or later. ;; http://listserver.ebi.ac.uk/pipermail/mcl-users/2016/000376.html (license license:gpl3))) (define-public ocaml-mcl (package (name "ocaml-mcl") (version "12-068oasis4") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/fhcrc/mcl") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0009dc3h2jp3qg5val452wngpqnbfyhbcxylghq0mrjqxx0jdq5p")))) (build-system ocaml-build-system) (arguments `(#:phases (modify-phases %standard-phases (add-before 'configure 'patch-paths (lambda _ (substitute* "setup.ml" (("LDFLAGS=-fPIC") (string-append "LDFLAGS=-fPIC\"; \"SHELL=" (which "sh"))) (("-std=c89") "-std=gnu99 -fcommon") ;; This is a mutable string, which is no longer supported. Use ;; a byte buffer instead. (("String.make \\(String.length s\\)") "Bytes.make (String.length s)") ;; These two belong together. (("OASISString.replace_chars") "Bytes.to_string (OASISString.replace_chars") ((" s;") " s);")) (substitute* "myocamlbuild.ml" (("std=c89") "std=gnu99 -fcommon")) ;; Since we build with a more recent OCaml, we have to use C99 or ;; later. This causes problems with the old C code. (substitute* "src/impala/matrix.c" (("restrict") "restrict_")) #t))))) (native-inputs (list ocamlbuild)) (home-page "https://github.com/fhcrc/mcl") (synopsis "OCaml wrappers around MCL") (description "This package provides OCaml bindings for the MCL graph clustering algorithm.") (license license:gpl3))) (define-public openmm (package (name "openmm") (version "8.1.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/openmm/openmm") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "064vv6zaci30pj38z5lwfqscxssm67jqxkz30hcya9vm4ng831d5")))) (build-system cmake-build-system) (arguments (list #:configure-flags '(list "-DOPENMM_BUILD_SHARED_LIB=TRUE" "-DOPENMM_BUILD_C_AND_FORTRAN_WRAPPERS=TRUE" "-DOPENMM_BUILD_PYTHON_WRAPPERS=TRUE" "-DOPENMM_BUILD_CUDA_LIB=FALSE") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'patch-python-build-system (lambda _ (substitute* "wrappers/python/CMakeLists.txt" (("install --root=\\\\\\$ENV\\{DESTDIR\\}/") (string-append "install --prefix=" #$output " --root=/ --single-version-externally-managed"))))) (add-after 'install 'install-python (lambda _ (invoke "make" "PythonInstall")))))) (inputs (list python-wrapper)) (propagated-inputs (list python-numpy)) (native-inputs (list doxygen gfortran opencl-headers python-cython swig)) (home-page "https://github.com/openmm/openmm/") (synopsis "Toolkit for molecular simulation") (description "OpenMM is a toolkit for molecular simulation. It can be used either as a stand-alone application for running simulations, or as a library you call from your own code.") ;; See https://github.com/openmm/openmm/issues/4278#issuecomment-1772982471 (license license:expat))) (define-public randomjungle (package (name "randomjungle") (version "2.1.0") (source (origin (method url-fetch) (uri (string-append "https://www.imbs.uni-luebeck.de/fileadmin/files/Software" "/randomjungle/randomjungle-" version ".tar_.gz")) (file-name (string-append name "-" version ".tar.gz")) (patches (search-patches "randomjungle-disable-static-build.patch")) (sha256 (base32 "12c8rf30cla71swx2mf4ww9mfd8jbdw5lnxd7dxhyw1ygrvg6y4w")))) (build-system gnu-build-system) (arguments `(#:configure-flags (list "--disable-static" (string-append "--with-boost=" (assoc-ref %build-inputs "boost"))) #:phases (modify-phases %standard-phases (add-after 'unpack 'fix-compatibility-errors (lambda _ (substitute* "src/library/IAM2WayImportance.h" (("= std::make_pair.*") "= std::minmax(varID1, varID2);")) (substitute* "src/library/DataFrame.h" (("isFirst\\?.*") "if (isFirst) { isFirst = false; } else { os << par.delimiter; }\n")))) (add-before 'configure 'set-CXXFLAGS (lambda _ (setenv "CXXFLAGS" "-fpermissive ")))))) (inputs (list boost gsl libxml2 zlib)) (native-inputs (list gfortran-7 (list gfortran-7 "lib"))) ;; Non-portable assembly instructions are used so building fails on ;; platforms other than x86_64 or i686. (supported-systems '("x86_64-linux" "i686-linux")) (home-page "https://www.imbs.uni-luebeck.de/forschung/software/details.html#c224") (synopsis "Implementation of the Random Forests machine learning method") (description "Random Jungle is an implementation of Random Forests. It is supposed to analyse high dimensional data. In genetics, it can be used for analysing big Genome Wide Association (GWA) data. Random Forests is a powerful machine learning method. Most interesting features are variable selection, missing value imputation, classifier creation, generalization error estimation and sample proximities between pairs of cases.") (license license:gpl3+))) (define-public r-rcppml/devel (let ((commit "e685b3bd7909d3ae74c98f85f81bc0bb679bce23") (revision "1")) (package (name "r-rcppml-devel") (version (git-version "0.5.6" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/zdebruine/RcppML") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "18ykh9s9h3x79az7qm3pg48iqm0nmkh2wkppc9wx0lq7kjfqm67a")))) (properties `((upstream-name . "RcppML"))) (build-system r-build-system) (propagated-inputs (list r-matrix r-rcpp)) (native-inputs (list r-knitr r-testthat)) (home-page "https://github.com/zdebruine/RcppML") (synopsis "Rcpp machine learning Library") (description "This package provides fast machine learning algorithms including matrix factorization and divisive clustering for large sparse and dense matrices.") (license license:gpl3+)))) (define-public openfst (package (name "openfst") (version "1.8.2") (source (origin (method url-fetch) (uri (string-append "http://www.openfst.org/twiki/pub/FST/" "FstDownload/openfst-" version ".tar.gz")) (sha256 (base32 "0hlbdmjjf1jgsvi3d2hwni5lz3l9a5bzj6ijpbawa8a7cbrpp66y")))) (build-system gnu-build-system) (arguments '(#:configure-flags '("--enable-ngram-fsts"))) (home-page "https://www.openfst.org") (synopsis "Library for weighted finite-state transducers") (description "OpenFst is a library for constructing, combining, optimizing, and searching weighted finite-state transducers (FSTs).") (license license:asl2.0))) ;; This is a temporary addition to bypass upstream issues with the kaldi ;; package. (define-public openfst-1.7.3 (package (inherit openfst) (version "1.7.3") (source (origin (method url-fetch) (uri (string-append "http://www.openfst.org/twiki/pub/FST/" "FstDownload/openfst-" version ".tar.gz")) (sha256 (base32 "038a60w7y8qnbxmcrsim9rafz9mihsny8xv50jpzlr7rl166pp5q")))) (arguments '(#:configure-flags '("--enable-ngram-fsts" "CXXFLAGS=-std=c++14") #:make-flags '("CXXFLAGS=-std=c++14"))))) (define openfst-for-vosk (package (inherit openfst) (version "1.8.0") (source (origin (method url-fetch) (uri (string-append "http://www.openfst.org/twiki/pub/FST/" "FstDownload/openfst-" version ".tar.gz")) (sha256 (base32 "0h2lfhhihg63b804hrcljnkggijbjmp84i5g8q735wb09y9z2c4p")))) (arguments '(#:configure-flags '("--enable-shared" "--enable-far" "--enable-ngram-fsts" "--enable-lookahead-fsts" "--with-pic" "--disable-bin"))))) (define-public sentencepiece (package (name "sentencepiece") (version "0.1.97") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/google/sentencepiece") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1kzfkp2pk0vabyw3wmkh16h11chzq63mzc20ddhsag5fp6s91ajg")))) (build-system cmake-build-system) (arguments (list #:tests? #f)) ;no tests (native-inputs (list gperftools)) (home-page "https://github.com/google/sentencepiece") (synopsis "Unsupervised tokenizer for Neural Network-based text generation") (description "SentencePiece is an unsupervised text tokenizer and detokenizer mainly for Neural Network-based text generation systems where the vocabulary size is predetermined prior to the neural model training. SentencePiece implements subword units---e.g., byte-pair-encoding (BPE) and unigram language model---with the extension of direct training from raw sentences. SentencePiece allows us to make a purely end-to-end system that does not depend on language-specific pre- or post-processing.") (license license:asl2.0))) (define-public python-hopcroftkarp ;; This commit fixes a broken import, but has not been released to PyPI. (let ((commit "2846e1dd3265d95d2bddb0cf4190b830cbb4efe6") (revision "1")) (package (name "python-hopcroftkarp") (version (git-version "1.2.5" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/sofiatolaosebikan/hopcroftkarp") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "018ilrp41fcclmb5lsml3aijwbmhbq3m7wy65hr1fryj0avic8fr")))) (build-system pyproject-build-system) (native-inputs (list python-setuptools python-wheel)) (home-page "https://github.com/sofiatolaosebikan/hopcroftkarp") (synopsis "Implementation of the Hopcroft-Karp algorithm") (description "This package implements the Hopcroft-Karp algorithm, producing a maximum cardinality matching from a bipartite graph.") (license license:gpl3)))) (define-public python-persim (package (name "python-persim") (version "0.3.2") (source (origin (method url-fetch) (uri (pypi-uri "persim" version)) (sha256 (base32 "0q8wfakx8q4h3ryvw8cba0v6z7xn9139qkrzs3mi1ggyzacnx9d7")))) (build-system pyproject-build-system) (propagated-inputs (list python-deprecated python-hopcroftkarp python-joblib python-matplotlib python-numpy python-scikit-learn python-scipy)) (native-inputs (list python-pytest python-pytest-cov python-setuptools python-wheel)) (home-page "https://persim.scikit-tda.org") (synopsis "Tools for analyzing persistence diagrams in Python") (description "This package includes a variety of tools used to analyze persistence diagrams. It currently houses implementations of @itemize @item Persistence images @item Persistence landscapes @item Bottleneck distance @item Modified Gromov–Hausdorff distance @item Sliced Wasserstein kernel @item Heat kernel @item Diagram plotting @end itemize ") (license license:expat))) ; MIT License (define-public python-pot (package (name "python-pot") (version "0.9.5") (source (origin (method url-fetch) (uri (pypi-uri "pot" version)) (sha256 (base32 "0hk0dmjgnpwka0a7gyzrcq155wzlvzcrsav3qaizyg0wymzywi4n")) (snippet '(delete-file "ot/lp/emd_wrap.cpp")))) (build-system pyproject-build-system) (propagated-inputs (list python-autograd python-numpy python-pytorch python-pytorch-geometric python-pymanopt python-scikit-learn python-scipy)) (native-inputs (list python-cython python-setuptools python-wheel)) (home-page "https://github.com/PythonOT/POT") (synopsis "Python Optimal Transport Library") (description "This Python library provides several solvers for optimization problems related to Optimal Transport for signal, image processing and machine learning.") (license license:expat))) (define-public python-pymanopt (package (name "python-pymanopt") (version "2.2.1") (source (origin (method url-fetch) (uri (pypi-uri "pymanopt" version)) (sha256 (base32 "1nm1yz5hbj1valqq23r8c1g9rhfdndfswlqv6xrnvc3f8fd95167")))) (build-system pyproject-build-system) (arguments (list ;; Tests require jax and tensorflow, which are optional. #:tests? #false #:phases '(modify-phases %standard-phases ;; This is probably a bad idea. We don't have scipy 1.13 just yet. (add-after 'unpack 'relax-requirements (lambda _ (substitute* "pyproject.toml" ((",!=1.12\\.\\*") ""))))))) (propagated-inputs (list python-numpy python-scipy)) (native-inputs (list python-autograd python-flake8 python-flake8-bugbear python-isort python-matplotlib python-pytest python-pytest-cov python-setuptools python-setuptools-scm python-wheel)) (home-page "https://pymanopt.org/") (synopsis "Toolbox for optimization on Riemannian manifolds") (description "This package is a toolbox for optimization on Riemannian manifolds with support for automatic differentiation.") (license license:bsd-3))) (define-public python-ripser (package (name "python-ripser") (version "0.6.4") (source (origin (method url-fetch) (uri (pypi-uri "ripser" version)) (sha256 (base32 "1575nwsn6b29z7w1mjk23ri83bxq2b4ld979hpgm174642a3x6vs")))) (build-system pyproject-build-system) (propagated-inputs (list python-numpy python-persim python-scikit-learn python-scipy)) (native-inputs (list python-cython python-pytest python-setuptools python-wheel)) (home-page "https://ripser.scikit-tda.org") (synopsis "Persistent homology library for Python") (description "This package implements a variety of persistent homology algorithms. It provides an interface for @itemize @item computing persistence cohomology of sparse and dense data sets @item visualizing persistence diagrams @item computing lowerstar filtrations on images @item computing representative cochains @end itemize ") (license license:expat))) ; MIT License (define-public python-sacrebleu (package (name "python-sacrebleu") (version "2.3.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/mjpost/sacrebleu") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1al4qf9wsq5l453qqb6clims62ns0s07wb9rfbf4hbpr1f2iv7zv")))) (build-system pyproject-build-system) (arguments (list #:test-flags ;; These all need internet access. '(list "-k" "not test_api_get_source \ and not test_api_get_reference \ and not test_maybe_download \ and not test_process_to_text \ and not test_get_files_and_fieldnames \ and not test_source_and_references \ and not test_wmt22_references") #:phases '(modify-phases %standard-phases ;; Needed for tests. (add-before 'check 'set-HOME (lambda _ (setenv "HOME" "/tmp")))))) (propagated-inputs (list python-colorama python-lxml python-numpy python-portalocker python-regex python-tabulate)) (native-inputs (list python-pytest python-setuptools python-wheel)) (home-page "https://github.com/mjpost/sacrebleu") (synopsis "Compute shareable, comparable, and reproducible BLEU, chrF, and TER scores") (description "This is a package for hassle-free computation of shareable, comparable, and reproducible BLEU, chrF, and TER scores for natural language processing.") (license license:asl2.0))) (define-public python-sentencepiece (package (name "python-sentencepiece") (version "0.1.97") (source (origin (method url-fetch) (uri (pypi-uri "sentencepiece" version)) (sha256 (base32 "0v0z9ryl66432zajp099bcbnwkkldzlpjvgnjv9bq2vi19g300f9")))) (build-system python-build-system) (native-inputs (list pkg-config)) (propagated-inputs (list sentencepiece)) (home-page "https://github.com/google/sentencepiece") (synopsis "SentencePiece python wrapper") (description "This package provides a Python wrapper for the SentencePiece unsupervised text tokenizer.") (license license:asl2.0))) (define-public python-spacy-legacy (package (name "python-spacy-legacy") (version "3.0.12") (source (origin (method url-fetch) (uri (pypi-uri "spacy-legacy" version)) (sha256 (base32 "0x57aw1qgjrzgapsv1cwymqlck2anqm1bisvryhpq7bfkc66wzdk")))) (build-system pyproject-build-system) ;; This package depends on spacy, which depends on this package. (arguments (list #:tests? #false)) (native-inputs (list python-pytest python-setuptools python-wheel)) (home-page "https://spacy.io") (synopsis "Legacy registered functions for spaCy backwards compatibility") (description "This package contains legacy registered functions for spaCy backwards compatibility.") (license license:expat))) (define-public python-spacy-loggers (package (name "python-spacy-loggers") (version "1.0.4") (source (origin (method url-fetch) (uri (pypi-uri "spacy-loggers" version)) (sha256 (base32 "0a5zjfxd0mci7pwda24ihg55whalpmjby4bvpgar2013f6zq7yg6")))) (build-system pyproject-build-system) ;; This package depends on spacy, which depends on this package. (arguments (list #:tests? #false)) (native-inputs (list python-pytest python-setuptools python-wheel)) (home-page "https://github.com/explosion/spacy-loggers") (synopsis "Logging utilities for SpaCy") (description "This package provides logging utilities for the SpaCy natural language processing framework.") (license license:expat))) (define-public python-spacy (package (name "python-spacy") (version "3.5.3") (source (origin (method url-fetch) (uri (pypi-uri "spacy" version)) (sha256 (base32 "13141hc966d8nxbnlwj01vhndgq0rq4nmii3qkb3hrap45kiv5rm")))) (build-system pyproject-build-system) (arguments (list #:test-flags '(list "-k" (string-append ;; We don't do that around here. "not test_download_compatibility" ;; This needs to download a model. " and not test_validate_compatibility_table" ;; This tries to run the application with typer, which fails ;; with an unspecified error, possibly because the build ;; container doesn't have /bin/sh. " and not test_project_assets")) #:phases '(modify-phases %standard-phases (add-after 'build 'build-ext (lambda _ (invoke "python" "setup.py" "build_ext" "--inplace" "-j" (number->string (parallel-job-count)))))))) (propagated-inputs (list python-catalogue python-cymem python-jinja2 python-langcodes python-murmurhash python-numpy python-packaging python-pathy python-preshed python-pydantic python-requests python-setuptools python-smart-open python-spacy-legacy python-spacy-loggers python-srsly python-thinc python-tqdm python-typer python-typing-extensions python-wasabi)) (native-inputs (list python-cython python-pytest python-mock python-wheel)) (home-page "https://spacy.io") (synopsis "Natural Language Processing (NLP) in Python") (description "SpaCy is a library for advanced Natural Language Processing in Python and Cython. It comes with pretrained pipelines and currently supports tokenization and training for 70+ languages. It features state-of-the-art speed and neural network models for tagging, parsing, named entity recognition, text classification and more, multi-task learning with pretrained transformers like BERT, as well as a production-ready training system and easy model packaging, deployment and workflow management.") (license license:expat))) (define-public shogun (package (name "shogun") (version "6.1.3") (source (origin (method url-fetch) (uri (string-append "ftp://shogun-toolbox.org/shogun/releases/" (version-major+minor version) "/sources/shogun-" version ".tar.bz2")) (sha256 (base32 "1rn9skm3nw6hr7mr3lgp2gfqhi7ii0lyxck7qmqnf8avq349s5jp")) (modules '((guix build utils) (ice-9 rdelim))) (snippet '(begin ;; Remove non-free sources and files referencing them (for-each delete-file (find-files "src/shogun/classifier/svm/" "SVMLight\\.(cpp|h)")) (for-each delete-file (find-files "examples/undocumented/libshogun/" (string-append "(classifier_.*svmlight.*|" "evaluation_cross_validation_locked_comparison).cpp"))) ;; Remove non-free functions. (define (delete-ifdefs file) (with-atomic-file-replacement file (lambda (in out) (let loop ((line (read-line in 'concat)) (skipping? #f)) (if (eof-object? line) #t (let ((skip-next? (or (and skipping? (not (string-prefix? "#endif //USE_SVMLIGHT" line))) (string-prefix? "#ifdef USE_SVMLIGHT" line)))) (when (or (not skipping?) (and skipping? (not skip-next?))) (display line out)) (loop (read-line in 'concat) skip-next?))))))) (for-each delete-ifdefs (append (find-files "src/shogun/classifier/mkl" "^MKLClassification\\.cpp") (find-files "src/shogun/classifier/svm" "^SVMLightOneClass\\.(cpp|h)") (find-files "src/shogun/multiclass" "^ScatterSVM\\.(cpp|h)") (find-files "src/shogun/kernel/" "^(Kernel|CombinedKernel|ProductKernel)\\.(cpp|h)") (find-files "src/shogun/regression/svr" "^(MKLRegression|SVRLight)\\.(cpp|h)") (find-files "src/shogun/transfer/domain_adaptation" "^DomainAdaptationSVM\\.(cpp|h)"))) #t)))) (build-system cmake-build-system) (arguments '(#:tests? #f ;no check target #:phases (modify-phases %standard-phases (add-after 'unpack 'delete-broken-symlinks (lambda _ (for-each delete-file '("applications/arts/data" "applications/asp/data" "applications/easysvm/data" "applications/msplicer/data" "applications/ocr/data" "examples/meta/data" "examples/undocumented/data")) #t)) (add-after 'unpack 'change-R-target-path (lambda* (#:key outputs #:allow-other-keys) (substitute* '("src/interfaces/r/CMakeLists.txt" "examples/meta/r/CMakeLists.txt") (("\\$\\{R_COMPONENT_LIB_PATH\\}") (string-append (assoc-ref outputs "out") "/lib/R/library/"))) #t)) (add-after 'unpack 'fix-octave-modules (lambda* (#:key outputs #:allow-other-keys) (substitute* "src/interfaces/octave/CMakeLists.txt" (("^include_directories\\(\\$\\{OCTAVE_INCLUDE_DIRS\\}") "include_directories(${OCTAVE_INCLUDE_DIRS} ${OCTAVE_INCLUDE_DIRS}/octave") ;; change target directory (("\\$\\{OCTAVE_OCT_LOCAL_API_FILE_DIR\\}") (string-append (assoc-ref outputs "out") "/share/octave/packages"))) (substitute* '("src/interfaces/octave/swig_typemaps.i" "src/interfaces/octave/sg_print_functions.cpp") ;; "octave/config.h" and "octave/oct-obj.h" deprecated in Octave. (("octave/config\\.h") "octave/octave-config.h") (("octave/oct-obj.h") "octave/ovl.h")) #t)) (add-after 'unpack 'move-rxcpp (lambda* (#:key inputs #:allow-other-keys) (let ((rxcpp-dir "shogun/third-party/rxcpp")) (mkdir-p rxcpp-dir) (install-file (assoc-ref inputs "rxcpp") rxcpp-dir) #t))) (add-before 'build 'set-HOME ;; $HOME needs to be set at some point during the build phase (lambda _ (setenv "HOME" "/tmp") #t))) #:configure-flags (list "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE" "-DUSE_SVMLIGHT=OFF" ;disable proprietary SVMLIGHT "-DBUILD_META_EXAMPLES=OFF" ;requires unpackaged ctags ;;"-DINTERFACE_JAVA=ON" ;requires unpackaged jblas ;;"-DINTERFACE_RUBY=ON" ;requires unpackaged ruby-narray ;;"-DINTERFACE_PERL=ON" ;"FindPerlLibs" does not exist ;;"-DINTERFACE_LUA=ON" ;fails because lua doesn't build pkgconfig file "-DINTERFACE_OCTAVE=ON" "-DINTERFACE_PYTHON=ON" "-DINTERFACE_R=ON"))) (inputs `(("python" ,python) ("numpy" ,python-numpy) ("r-minimal" ,r-minimal) ("octave" ,octave-cli) ("swig" ,swig) ("eigen" ,eigen) ("hdf5" ,hdf5) ("atlas" ,atlas) ("arpack" ,arpack-ng) ("openblas" ,openblas) ("glpk" ,glpk) ("libxml2" ,libxml2) ("lzo" ,lzo) ("zlib" ,zlib))) (native-inputs (list pkg-config rxcpp)) ;; Non-portable SSE instructions are used so building fails on platforms ;; other than x86_64. (supported-systems '("x86_64-linux")) (home-page "https://shogun-toolbox.org/") (synopsis "Machine learning toolbox") (description "The Shogun Machine learning toolbox provides a wide range of unified and efficient Machine Learning (ML) methods. The toolbox seamlessly combines multiple data representations, algorithm classes, and general purpose tools. This enables both rapid prototyping of data pipelines and extensibility in terms of new algorithms.") (license license:gpl3+))) (define-public onnx (package (name "onnx") (version "1.17.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/onnx/onnx") (commit (string-append "v" version)))) (sha256 (base32 "1i6bh4z2xzz1maykr0xmrwfybm6i3g38vnx7hsls8hr58rdr30zn")) (file-name (git-file-name name version)) (patches (search-patches "onnx-shared-libraries.patch" "onnx-skip-model-downloads.patch")) (modules '((guix build utils))) (snippet '(delete-file-recursively "third_party")))) (build-system pyproject-build-system) (arguments (list ;; python-nbval depends transitively on Rust. #:tests? (->bool (member (or (%current-target-system) (%current-system)) (package-transitive-supported-systems python-nbval))) #:phases #~(modify-phases %standard-phases (add-before 'buil