unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#30266] Add FANN
@ 2018-01-27 12:55 Mark Meyer
  2018-01-28  2:13 ` Ben Woodcroft
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Meyer @ 2018-01-27 12:55 UTC (permalink / raw)
  To: 30266

[-- Attachment #1: Type: text/plain, Size: 127 bytes --]

Hi,
this is a patch to add FANN, the fast artificial neural network to Guix.

Cheers, Mark

-- 
  Mark Meyer
  mark@ofosos.org

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-fann.patch --]
[-- Type: text/x-patch; name="0001-gnu-Add-fann.patch", Size: 2048 bytes --]

From 63b1eca352d9ce97724bb832617c4fa9c28403e0 Mon Sep 17 00:00:00 2001
From: Mark Meyer <mark@ofosos.org>
Date: Sat, 27 Jan 2018 13:53:14 +0100
Subject: [PATCH] gnu: Add fann.

* gnu/packages/ai.scm (fann): New variable.
---
 gnu/local.mk        |  1 +
 gnu/packages/ai.scm | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
 create mode 100644 gnu/packages/ai.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 80d6a8d4c..d30d0cc9e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -53,6 +53,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/admin.scm			\
   %D%/packages/adns.scm				\
   %D%/packages/algebra.scm			\
+  %D%/packages/ai.scm				\
   %D%/packages/aidc.scm				\
   %D%/packages/android.scm			\
   %D%/packages/animation.scm			\
diff --git a/gnu/packages/ai.scm b/gnu/packages/ai.scm
new file mode 100644
index 000000000..5b2da2e70
--- /dev/null
+++ b/gnu/packages/ai.scm
@@ -0,0 +1,32 @@
+(define-module (gnu packages ai)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix utils)
+  #:use-module (guix download)
+  #:use-module (guix packages)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix git-download)
+  #:use-module (gnu packages))
+
+(define-public libfann
+  (package
+    (name "libfann")
+    (version "d71d54788b")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/libfann/fann.git")
+                    (commit version)))
+              (sha256
+               (base32
+                "0ibwpfrjs6q2lijs8slxjgzb2llcl6rk3v2ski4r6215g5jjhg3x"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f))
+    (home-page "http://leenissen.dk/fann/wp/")
+    (synopsis "Fast Artificial Neural Network")
+    (description
+     "FANN is a free open source 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)))
+
-- 
2.15.1


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

* [bug#30266] Add FANN
  2018-01-27 12:55 [bug#30266] Add FANN Mark Meyer
@ 2018-01-28  2:13 ` Ben Woodcroft
  2018-02-01 15:32   ` Mark Meyer
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Woodcroft @ 2018-01-28  2:13 UTC (permalink / raw)
  To: Mark Meyer, 30266

[-- Attachment #1: Type: text/plain, Size: 2785 bytes --]

Hi Mark,

Thanks for the patch.

> +(define-module (gnu packages ai)
> +  #:use-module ((guix licenses) #:prefix license:)
> +  #:use-module (guix utils)
> +  #:use-module (guix download)
> +  #:use-module (guix packages)
> +  #:use-module (guix build-system cmake)
> +  #:use-module (guix git-download)
> +  #:use-module (gnu packages))
I think machine-learning.scm would be a good home for this package, so a 
new file wouldn't be needed.


> +
> +(define-public libfann
> +  (package
> +    (name "libfann")
> +    (version "d71d54788b")

The last release is 129 commits behind and it has been some time, so I 
think you are right - we should package from a git commit.

Usually we package from git using this style though (i.e. reason for not 
using the release, use of 'file-name', and a version that includes the 
last release followed by '-1.<commit>').

   ;; There are no recent releases so we package from git.
   (let ((commit "da121155a977197cab9fbb15953ca1b40b11eb87"))
     (package
       (name "newick-utils")
       (version (string-append "1.6-1." (string-take commit 8)))
       (source (origin
                 (method git-fetch)
                 (uri (git-reference
                       (url "https://github.com/tjunier/newick_utils.git")
                       (commit commit)))
                 (file-name (string-append name "-" version "-checkout"))
                 (sha256
                  (base32
"1hkw21rq1mwf7xp0rmbb2gqc0i6p11108m69i7mr7xcjl268pxnb"))))


> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url"https://github.com/libfann/fann.git")
> +                    (commit version)))
> +              (sha256
> +               (base32
> +                "0ibwpfrjs6q2lijs8slxjgzb2llcl6rk3v2ski4r6215g5jjhg3x"))))
> +    (build-system cmake-build-system)
> +    (arguments
> +     `(#:tests? #f))
I see from the website:

> Once you have installed the library you can test it out by going to 
> the examples directory and type |make runtest|, which will compile the 
> examples and run a few of them to test that everything is working.
Is that possible? Ideally, since there are tests it would be good to run 
them.

> +    (home-page"http://leenissen.dk/fann/wp/")
> +    (synopsis "Fast Artificial Neural Network")
> +    (description
> +     "FANN is a free open source 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)))
Otherwise LGTM. Can you send an updated patch please?

Thanks, ben


[-- Attachment #2: Type: text/html, Size: 3903 bytes --]

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

* [bug#30266] Add FANN
  2018-01-28  2:13 ` Ben Woodcroft
@ 2018-02-01 15:32   ` Mark Meyer
  2018-02-02 13:12     ` bug#30266: " Ben Woodcroft
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Meyer @ 2018-02-01 15:32 UTC (permalink / raw)
  To: Ben Woodcroft, 30266


[-- Attachment #1.1: Type: text/plain, Size: 2980 bytes --]

Thanks for the good feedback. Please consider the attached patch.

Best, Mark

On Sun, Jan 28, 2018, at 03:13, Ben Woodcroft wrote:
> Hi Mark,


> Thanks for the patch.


>> +(define-module (gnu packages ai) +  #:use-module ((guix licenses)
>> #:prefix license:) +  #:use-module (guix utils) +  #:use-module (guix
>> download) +  #:use-module (guix packages) +  #:use-module (guix build-
>> system cmake) +  #:use-module (guix git-download) +  #:use-module
>> (gnu packages))> I think machine-learning.scm would be a good home for this package, so
> a new file wouldn't be needed.> 
> 


>


>> + +(define-public libfann +  (package +    (name "libfann") +
>>   (version "d71d54788b")> 


> The last release is 129 commits behind and it has been some time, so I
> think you are right - we should package from a git commit.> Usually we package from git using this style though (i.e. reason for
> not using the release, use of 'file-name', and a version that includes
> the last release followed by '-1.<commit>').>   ;; There are no recent releases so we package from git.
>    (let ((commit "da121155a977197cab9fbb15953ca1b40b11eb87"))
>      (package
>        (name "newick-utils")
>        (version (string-append "1.6-1." (string-take commit 8)))
>        (source (origin
>                  (method git-fetch)
>                  (uri (git-reference
>                        (url "
>                        https://github.com/tjunier/newick_utils.git")>                        (commit commit)))
>                  (file-name (string-append name "-" version "-
>                  checkout"))>                  (sha256
>                   (base32
>                    "1hkw21rq1mwf7xp0rmbb2gqc0i6p11108m69i7mr7xcjl268p-
>                    xnb"))))> 


>


>> +    (source (origin +              (method git-fetch) +
>>      (uri (git-reference +                    (url "
>>      https://github.com/libfann/fann.git") +
>>      (commit version))) +              (sha256 +
>>      (base32 +                "0ibwpfrjs6q2lijs8slxjgzb2llcl6rk3v2sk-
>>      i4r6215g5jjhg3x")))) +    (build-system cmake-build-system) +
>>      (arguments +     `(#:tests? #f))> I see from the website:
> 


>


>> Once you have installed the library you can test it out by going to
>> the examples directory and type make runtest, which will compile the
>> examples and run a few of them to test that everything is working.> Is that possible? Ideally, since there are tests it would be good to
> run them.> 
>
>> +    (home-page "http://leenissen.dk/fann/wp/") +    (synopsis "Fast
>>      Artificial Neural Network") +    (description +     "FANN is a
>>      free open source 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)))> Otherwise LGTM. Can you send an updated patch please?
> 


> Thanks, ben



--
Mark Meyer
mark@ofosos.org


[-- Attachment #1.2: Type: text/html, Size: 4884 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-fann.patch --]
[-- Type: text/x-patch; name="0001-gnu-Add-fann.patch", Size: 2595 bytes --]

From 7c6eaae56bc9ef57b60ceacf49a33cdd5966b361 Mon Sep 17 00:00:00 2001
From: Mark Meyer <mark@ofosos.org>
Date: Thu, 1 Feb 2018 15:07:58 +0100
Subject: [PATCH] gnu: Add fann.

* gnu/packages/machine-learning.scm (fann): New variable.
---
 gnu/packages/machine-learning.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index bd13cedcb..faa4bdf7f 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018 Mark Meyer <mark@ofosos.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -31,6 +32,7 @@
   #: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 autotools)
   #:use-module (gnu packages boost)
@@ -50,6 +52,35 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg))
 
+(define-public fann
+  (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.git")
+                      (commit version)))
+                (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 free open source 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")
-- 
2.15.1


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

* bug#30266: Add FANN
  2018-02-01 15:32   ` Mark Meyer
@ 2018-02-02 13:12     ` Ben Woodcroft
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Woodcroft @ 2018-02-02 13:12 UTC (permalink / raw)
  To: Mark Meyer, 30266-done

[-- Attachment #1: Type: text/plain, Size: 3426 bytes --]

Thanks Mark. I made a few small changes and pushed the patch as 
a9b34762391e6f3b066aef6fc1ebc614ec88db86.


On 02/02/18 01:32, Mark Meyer wrote:
> Thanks for the good feedback. Please consider the attached patch.
>
> Best, Mark
>
> On Sun, Jan 28, 2018, at 03:13, Ben Woodcroft wrote:
>>
>> Hi Mark,
>>
>> Thanks for the patch.
>>
>>> +(define-module (gnu packages ai)
>>> +  #:use-module ((guix licenses) #:prefix license:)
>>> +  #:use-module (guix utils)
>>> +  #:use-module (guix download)
>>> +  #:use-module (guix packages)
>>> +  #:use-module (guix build-system cmake)
>>> +  #:use-module (guix git-download)
>>> +  #:use-module (gnu packages))
>> I think machine-learning.scm would be a good home for this package, 
>> so a new file wouldn't be needed.
>>
>>
>>
>>> +
>>> +(define-public libfann
>>> +  (package
>>> +    (name "libfann")
>>> +    (version "d71d54788b")
>>
>>
>> The last release is 129 commits behind and it has been some time, so 
>> I think you are right - we should package from a git commit.
>>
>> Usually we package from git using this style though (i.e. reason for 
>> not using the release, use of 'file-name', and a version that 
>> includes the last release followed by '-1.<commit>').
>>
>>   ;; There are no recent releases so we package from git.
>>   (let ((commit "da121155a977197cab9fbb15953ca1b40b11eb87"))
>>     (package
>>       (name "newick-utils")
>>       (version (string-append "1.6-1." (string-take commit 8)))
>>       (source (origin
>>                 (method git-fetch)
>>                 (uri (git-reference
>>                       (url 
>> "https://github.com/tjunier/newick_utils.git" 
>> <https://github.com/tjunier/newick_utils.git>)
>>                       (commit commit)))
>>                 (file-name (string-append name "-" version "-checkout"))
>>                 (sha256
>>                  (base32
>> "1hkw21rq1mwf7xp0rmbb2gqc0i6p11108m69i7mr7xcjl268pxnb"))))
>>
>>
>>> +    (source (origin
>>> +              (method git-fetch)
>>> +              (uri (git-reference
>>> +                    (url"https://github.com/libfann/fann.git" 
>>> <https://github.com/libfann/fann.git>)
>>> +                    (commit version)))
>>> +              (sha256
>>> +               (base32
>>> +                "0ibwpfrjs6q2lijs8slxjgzb2llcl6rk3v2ski4r6215g5jjhg3x"))))
>>> +    (build-system cmake-build-system)
>>> +    (arguments
>>> +     `(#:tests? #f))
>> I see from the website:
>>
>>
>>
>>> Once you have installed the library you can test it out by going to 
>>> the examples directory and type |make runtest|, which will compile 
>>> the examples and run a few of them to test that everything is working.
>> Is that possible? Ideally, since there are tests it would be good to 
>> run them.
>>
>>
>>> +    (home-page"http://leenissen.dk/fann/wp/" <http://leenissen.dk/fann/wp/>)
>>> +    (synopsis "Fast Artificial Neural Network")
>>> +    (description
>>> +     "FANN is a free open source 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)))
>> Otherwise LGTM. Can you send an updated patch please?
>>
>>
>> Thanks, ben
>>
>
> --
> Mark Meyer
> mark@ofosos.org
>


[-- Attachment #2: Type: text/html, Size: 5927 bytes --]

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

end of thread, other threads:[~2018-02-02 15:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-27 12:55 [bug#30266] Add FANN Mark Meyer
2018-01-28  2:13 ` Ben Woodcroft
2018-02-01 15:32   ` Mark Meyer
2018-02-02 13:12     ` bug#30266: " Ben Woodcroft

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).