* [PATCH] Move Shogun.
@ 2015-08-14 14:50 Ricardo Wurmus
2015-08-14 14:52 ` Thompson, David
2015-08-14 14:53 ` Andreas Enge
0 siblings, 2 replies; 4+ messages in thread
From: Ricardo Wurmus @ 2015-08-14 14:50 UTC (permalink / raw)
To: guix-devel
[-- Attachment #1: Type: text/plain, Size: 170 bytes --]
Shogun is a machine learning framework, so it really should be located
in the machine-learning module rather than bioinformatics.
The attached patch moves the package.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Move-shogun-to-machine-learing.scm.patch --]
[-- Type: text/x-patch, Size: 14987 bytes --]
From 6559d442a78125a242666e1a0c7124536662638c Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Date: Fri, 14 Aug 2015 16:48:52 +0200
Subject: [PATCH] gnu: Move shogun to machine-learing.scm.
* gnu/packages/bioinformatics.scm (shogun): Move from here...
* gnu/packages/machine-learning.scm (shogun): ...to here.
---
gnu/packages/bioinformatics.scm | 140 -------------------------------------
gnu/packages/machine-learning.scm | 143 ++++++++++++++++++++++++++++++++++++++
2 files changed, 143 insertions(+), 140 deletions(-)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 75a80fa..d7e4da6 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -46,7 +46,6 @@
#:use-module (gnu packages protobuf)
#:use-module (gnu packages python)
#:use-module (gnu packages statistics)
- #:use-module (gnu packages swig)
#:use-module (gnu packages tbb)
#:use-module (gnu packages textutils)
#:use-module (gnu packages vim)
@@ -2538,145 +2537,6 @@ features; exactSNP: a SNP caller that discovers SNPs by testing signals
against local background noises.")
(license license:gpl3+)))
-(define-public shogun
- (package
- (name "shogun")
- (version "4.0.0")
- (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
- "159nlijnb7mnrv9za80wnm1shwvy45hgrqzn51hxy7gw4z6d6fdb"))
- (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 (find-files "src/shogun/kernel/"
- "^Kernel\\.(cpp|h)"))))))
- (build-system cmake-build-system)
- (arguments
- '(#:tests? #f ;no check target
- #:phases
- (alist-cons-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/documented/data"
- "examples/documented/matlab_static"
- "examples/documented/octave_static"
- "examples/undocumented/data"
- "examples/undocumented/matlab_static"
- "examples/undocumented/octave_static"
- "tests/integration/data"
- "tests/integration/matlab_static"
- "tests/integration/octave_static"
- "tests/integration/python_modular/tests"))
- #t)
- (alist-cons-after
- 'unpack 'change-R-target-path
- (lambda* (#:key outputs #:allow-other-keys)
- (substitute* '("src/interfaces/r_modular/CMakeLists.txt"
- "src/interfaces/r_static/CMakeLists.txt"
- "examples/undocumented/r_modular/CMakeLists.txt")
- (("\\$\\{R_COMPONENT_LIB_PATH\\}")
- (string-append (assoc-ref outputs "out")
- "/lib/R/library/")))
- #t)
- (alist-cons-after
- 'unpack 'fix-octave-modules
- (lambda* (#:key outputs #:allow-other-keys)
- (substitute* '("src/interfaces/octave_modular/CMakeLists.txt"
- "src/interfaces/octave_static/CMakeLists.txt")
- (("^include_directories\\(\\$\\{OCTAVE_INCLUDE_DIRS\\}")
- "include_directories(${OCTAVE_INCLUDE_DIRS} ${OCTAVE_INCLUDE_DIRS}/octave"))
-
- ;; change target directory
- (substitute* "src/interfaces/octave_modular/CMakeLists.txt"
- (("\\$\\{OCTAVE_OCT_LOCAL_API_FILE_DIR\\}")
- (string-append (assoc-ref outputs "out")
- "/share/octave/packages")))
- #t)
- (alist-cons-before
- 'build 'set-HOME
- ;; $HOME needs to be set at some point during the build phase
- (lambda _ (setenv "HOME" "/tmp") #t)
- %standard-phases))))
- #:configure-flags
- (list "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
- "-DUSE_SVMLIGHT=OFF" ;disable proprietary SVMLIGHT
- ;;"-DJavaModular=ON" ;requires unpackaged jblas
- ;;"-DRubyModular=ON" ;requires unpackaged ruby-narray
- ;;"-DPerlModular=ON" ;"FindPerlLibs" does not exist
- ;;"-DLuaModular=ON" ;fails because lua doesn't build pkgconfig file
- "-DOctaveModular=ON"
- "-DOctaveStatic=ON"
- "-DPythonModular=ON"
- "-DPythonStatic=ON"
- "-DRModular=ON"
- "-DRStatic=ON"
- "-DCmdLineStatic=ON")))
- (inputs
- `(("python" ,python)
- ("numpy" ,python-numpy)
- ("r" ,r)
- ("octave" ,octave)
- ("swig" ,swig)
- ("hdf5" ,hdf5)
- ("atlas" ,atlas)
- ("arpack" ,arpack-ng)
- ("lapack" ,lapack)
- ("glpk" ,glpk)
- ("libxml2" ,libxml2)
- ("lzo" ,lzo)
- ("zlib" ,zlib)))
- (native-inputs
- `(("pkg-config" ,pkg-config)))
- (home-page "http://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 allows to
-combine 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 vcftools
(package
(name "vcftools")
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 30209f5..467b44c 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -21,13 +21,17 @@
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (guix download)
+ #:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
#:use-module (gnu packages)
#:use-module (gnu packages boost)
#:use-module (gnu packages compression)
#:use-module (gnu packages gcc)
#:use-module (gnu packages maths)
+ #: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))
(define-public libsvm
@@ -144,3 +148,142 @@ 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 shogun
+ (package
+ (name "shogun")
+ (version "4.0.0")
+ (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
+ "159nlijnb7mnrv9za80wnm1shwvy45hgrqzn51hxy7gw4z6d6fdb"))
+ (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 (find-files "src/shogun/kernel/"
+ "^Kernel\\.(cpp|h)"))))))
+ (build-system cmake-build-system)
+ (arguments
+ '(#:tests? #f ;no check target
+ #:phases
+ (alist-cons-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/documented/data"
+ "examples/documented/matlab_static"
+ "examples/documented/octave_static"
+ "examples/undocumented/data"
+ "examples/undocumented/matlab_static"
+ "examples/undocumented/octave_static"
+ "tests/integration/data"
+ "tests/integration/matlab_static"
+ "tests/integration/octave_static"
+ "tests/integration/python_modular/tests"))
+ #t)
+ (alist-cons-after
+ 'unpack 'change-R-target-path
+ (lambda* (#:key outputs #:allow-other-keys)
+ (substitute* '("src/interfaces/r_modular/CMakeLists.txt"
+ "src/interfaces/r_static/CMakeLists.txt"
+ "examples/undocumented/r_modular/CMakeLists.txt")
+ (("\\$\\{R_COMPONENT_LIB_PATH\\}")
+ (string-append (assoc-ref outputs "out")
+ "/lib/R/library/")))
+ #t)
+ (alist-cons-after
+ 'unpack 'fix-octave-modules
+ (lambda* (#:key outputs #:allow-other-keys)
+ (substitute* '("src/interfaces/octave_modular/CMakeLists.txt"
+ "src/interfaces/octave_static/CMakeLists.txt")
+ (("^include_directories\\(\\$\\{OCTAVE_INCLUDE_DIRS\\}")
+ "include_directories(${OCTAVE_INCLUDE_DIRS} ${OCTAVE_INCLUDE_DIRS}/octave"))
+
+ ;; change target directory
+ (substitute* "src/interfaces/octave_modular/CMakeLists.txt"
+ (("\\$\\{OCTAVE_OCT_LOCAL_API_FILE_DIR\\}")
+ (string-append (assoc-ref outputs "out")
+ "/share/octave/packages")))
+ #t)
+ (alist-cons-before
+ 'build 'set-HOME
+ ;; $HOME needs to be set at some point during the build phase
+ (lambda _ (setenv "HOME" "/tmp") #t)
+ %standard-phases))))
+ #:configure-flags
+ (list "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
+ "-DUSE_SVMLIGHT=OFF" ;disable proprietary SVMLIGHT
+ ;;"-DJavaModular=ON" ;requires unpackaged jblas
+ ;;"-DRubyModular=ON" ;requires unpackaged ruby-narray
+ ;;"-DPerlModular=ON" ;"FindPerlLibs" does not exist
+ ;;"-DLuaModular=ON" ;fails because lua doesn't build pkgconfig file
+ "-DOctaveModular=ON"
+ "-DOctaveStatic=ON"
+ "-DPythonModular=ON"
+ "-DPythonStatic=ON"
+ "-DRModular=ON"
+ "-DRStatic=ON"
+ "-DCmdLineStatic=ON")))
+ (inputs
+ `(("python" ,python)
+ ("numpy" ,python-numpy)
+ ("r" ,r)
+ ("octave" ,octave)
+ ("swig" ,swig)
+ ("hdf5" ,hdf5)
+ ("atlas" ,atlas)
+ ("arpack" ,arpack-ng)
+ ("lapack" ,lapack)
+ ("glpk" ,glpk)
+ ("libxml2" ,libxml2)
+ ("lzo" ,lzo)
+ ("zlib" ,zlib)))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (home-page "http://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 allows to
+combine 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+)))
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Move Shogun.
2015-08-14 14:50 [PATCH] Move Shogun Ricardo Wurmus
@ 2015-08-14 14:52 ` Thompson, David
2015-08-14 14:53 ` Andreas Enge
1 sibling, 0 replies; 4+ messages in thread
From: Thompson, David @ 2015-08-14 14:52 UTC (permalink / raw)
To: Ricardo Wurmus; +Cc: guix-devel
On Fri, Aug 14, 2015 at 10:50 AM, Ricardo Wurmus
<ricardo.wurmus@mdc-berlin.de> wrote:
> Shogun is a machine learning framework, so it really should be located
> in the machine-learning module rather than bioinformatics.
>
> The attached patch moves the package.
LGTM.
- Dave
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Move Shogun.
2015-08-14 14:50 [PATCH] Move Shogun Ricardo Wurmus
2015-08-14 14:52 ` Thompson, David
@ 2015-08-14 14:53 ` Andreas Enge
2015-08-14 15:18 ` Ricardo Wurmus
1 sibling, 1 reply; 4+ messages in thread
From: Andreas Enge @ 2015-08-14 14:53 UTC (permalink / raw)
To: Ricardo Wurmus; +Cc: guix-devel
On Fri, Aug 14, 2015 at 04:50:53PM +0200, Ricardo Wurmus wrote:
> Subject: [PATCH] gnu: Move shogun to machine-learing.scm.
Tiny typo: "learning" with "n". I would use:
gnu: shogun: Move the package to the module machine-learning.
Andreas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Move Shogun.
2015-08-14 14:53 ` Andreas Enge
@ 2015-08-14 15:18 ` Ricardo Wurmus
0 siblings, 0 replies; 4+ messages in thread
From: Ricardo Wurmus @ 2015-08-14 15:18 UTC (permalink / raw)
To: Andreas Enge; +Cc: guix-devel
Andreas Enge <andreas@enge.fr> writes:
> On Fri, Aug 14, 2015 at 04:50:53PM +0200, Ricardo Wurmus wrote:
>> Subject: [PATCH] gnu: Move shogun to machine-learing.scm.
>
> Tiny typo: "learning" with "n". I would use:
> gnu: shogun: Move the package to the module machine-learning.
Thanks. I changed the summary line to something similar and pushed.
~~ Ricardo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-08-14 15:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-14 14:50 [PATCH] Move Shogun Ricardo Wurmus
2015-08-14 14:52 ` Thompson, David
2015-08-14 14:53 ` Andreas Enge
2015-08-14 15:18 ` Ricardo Wurmus
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.