unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add ghmm.
@ 2016-05-23 10:52 Ricardo Wurmus
  2016-05-23 17:01 ` Leo Famulari
  2016-05-31 15:09 ` Ricardo Wurmus
  0 siblings, 2 replies; 4+ messages in thread
From: Ricardo Wurmus @ 2016-05-23 10:52 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/machine-learning.scm (ghmm): New variable.
---
 gnu/packages/machine-learning.scm | 94 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 93 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index cbc7509..584aeae 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,12 +21,15 @@
   #: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 r)
   #:use-module (gnu packages)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages dejagnu)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages pkg-config)
@@ -107,6 +110,95 @@ classification.")
      `(("python" ,python)))
     (synopsis "Python bindings of libSVM")))
 
+(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))
+                (sha256
+                 (base32
+                  "0qbq1rqp94l530f043qzp8aw5lj7dng9wq0miffd7spd1ff638wq"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'enter-dir
+             (lambda _ (chdir "ghmm") #t))
+           (add-after 'enter-dir 'fix-PYTHONPATH
+             (lambda* (#:key outputs #:allow-other-keys)
+               ;; The Python tests fail as the library is assumed to be stored
+               ;; in ./build/lib.linux-i686-*.  To fix this we detect the CPU
+               ;; and use it in the path.
+               (substitute* "configure.in"
+                 (("AM_INIT_AUTOMAKE" line)
+                  (string-append line "\nAC_CANONICAL_HOST\n")))
+               (substitute* "ghmmwrapper/Makefile.am"
+                 (("i686") "@host_cpu@"))
+               #t))
+           (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\", ")))
+               #t))
+           (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)))
+               #t))
+           (add-before 'configure 'autogen
+             (lambda _
+               (zero? (system* "bash" "./autogen.sh")))))))
+      (inputs
+       `(("python" ,python-2) ; only Python 2 is supported
+         ("libxml2" ,libxml2)))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)
+         ("dejagnu" ,dejagnu)
+         ("swig" ,swig)
+         ("autoconf" ,autoconf)
+         ("automake" ,automake)
+         ("libtool" ,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, continous emissions, basic
+training, HMM clustering, HMM mixtures.")
+      (license license:lgpl2.0+))))
+
 (define-public randomjungle
   (package
     (name "randomjungle")
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: Add ghmm.
  2016-05-23 10:52 [PATCH] gnu: Add ghmm Ricardo Wurmus
@ 2016-05-23 17:01 ` Leo Famulari
  2016-05-24  6:38   ` Ricardo Wurmus
  2016-05-31 15:09 ` Ricardo Wurmus
  1 sibling, 1 reply; 4+ messages in thread
From: Leo Famulari @ 2016-05-23 17:01 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

On Mon, May 23, 2016 at 12:52:00PM +0200, Ricardo Wurmus wrote:
> * gnu/packages/machine-learning.scm (ghmm): New variable.

> +(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.

Wow, seems there are quite a few more things fixed in this package
definition!

I think if the software works for you, then it's okay. The added phases
look good to me and it builds on my x86_64 hardware.

> +      (home-page "http://ghmm.org")

Does this render in your browser? For Firefox, it serves some HTML sans
<body> which includes a note about my browser not supporting frames.
Chromium and Epiphany work. Not a blocker, just a curiosity...

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: Add ghmm.
  2016-05-23 17:01 ` Leo Famulari
@ 2016-05-24  6:38   ` Ricardo Wurmus
  0 siblings, 0 replies; 4+ messages in thread
From: Ricardo Wurmus @ 2016-05-24  6:38 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel


Leo Famulari <leo@famulari.name> writes:

> On Mon, May 23, 2016 at 12:52:00PM +0200, Ricardo Wurmus wrote:
>> * gnu/packages/machine-learning.scm (ghmm): New variable.
>
>> +(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.
>
> Wow, seems there are quite a few more things fixed in this package
> definition!
>
> I think if the software works for you, then it's okay. The added phases
> look good to me and it builds on my x86_64 hardware.

Thanks for checking!

>> +      (home-page "http://ghmm.org")
>
> Does this render in your browser? For Firefox, it serves some HTML sans
> <body> which includes a note about my browser not supporting frames.
> Chromium and Epiphany work. Not a blocker, just a curiosity...

Yes, it renders fine.  Looks good in Icecat on my personal machine and
in Firefox on my Fedora workstation in the office.

~~ Ricardo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: Add ghmm.
  2016-05-23 10:52 [PATCH] gnu: Add ghmm Ricardo Wurmus
  2016-05-23 17:01 ` Leo Famulari
@ 2016-05-31 15:09 ` Ricardo Wurmus
  1 sibling, 0 replies; 4+ messages in thread
From: Ricardo Wurmus @ 2016-05-31 15:09 UTC (permalink / raw)
  To: guix-devel


Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> writes:

> * gnu/packages/machine-learning.scm (ghmm): New variable.

This has just been pushed.

~~ Ricardo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-31 15:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-23 10:52 [PATCH] gnu: Add ghmm Ricardo Wurmus
2016-05-23 17:01 ` Leo Famulari
2016-05-24  6:38   ` Ricardo Wurmus
2016-05-31 15:09 ` Ricardo Wurmus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).