unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Add FastTree
@ 2015-06-19  7:24 Ben Woodcroft
  2015-06-19 10:13 ` Alex Kost
  0 siblings, 1 reply; 9+ messages in thread
From: Ben Woodcroft @ 2015-06-19  7:24 UTC (permalink / raw)
  To: guix-devel@gnu.org

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

Hi,

I was a bit confused the best way to package FastTree as it is so simple 
- the install instructions just give how to run gcc and I couldn't find 
anything similar (enough for me) in other .scm files.

I'm also not clear which version of gcc should be chosen - I chose 5.1 
as it was new, but it also compiles with other versions.

During development of this patch I noticed badly specified system* does 
not throw an error - is there a way to do this so?

And more generally, there's no equivalent of make check here, should one 
be manually specified?

Thanks,
ben

[-- Attachment #2: 0001-gnu-Add-fasttree.patch --]
[-- Type: text/x-patch, Size: 3466 bytes --]

From b89cd0e855adc05e0f8ef6e2d6cdf6132af076e9 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Fri, 19 Jun 2015 17:01:56 +1000
Subject: [PATCH] gnu: Add fasttree

* gnu/packages/bioinformatics.scm (fasttree): New variable.
---
 gnu/packages/bioinformatics.scm | 63 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 12c9175..311635b 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -34,6 +34,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages file)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages machine-learning)
@@ -780,6 +781,68 @@ analysis (from RNA-Seq), transcription factor binding quantification in
 ChIP-Seq, and analysis of metagenomic data.")
     (license license:artistic2.0)))
 
+(define-public fasttree
+  (package
+   (name "fasttree")
+   (version "2.1.8")
+   (source (origin
+             (method url-fetch)
+             (uri (string-append
+                   "http://www.microbesonline.org/fasttree/FastTree-"
+                   version
+                   ".c"
+                   ))
+             (sha256
+              (base32
+               "0dzqc9vr9iiiw21y159xfjl2z90vw0y7r4x6456pcaxiy5hd2wmi"))))
+   (build-system trivial-build-system)
+   (arguments
+    '(#:modules ((guix build utils))
+      #:builder
+      (begin
+        (use-modules (guix build utils) (system base compile))
+        (let ((source (assoc-ref %build-inputs "source"))
+              (gcc (assoc-ref %build-inputs "gcc"))
+              (glibc (assoc-ref %build-inputs "glibc"))
+              (binutils (assoc-ref %build-inputs "binutils"))
+              (out    (assoc-ref %outputs "out")))          
+          (setenv "PATH" (string-append binutils "/bin:" gcc "/bin"))
+          (setenv "LIBRARY_PATH" (string-append glibc "/lib"))
+          (let ((bin (string-append out "/bin")))
+            (mkdir-p bin)
+            (system* "gcc"
+                     "-O3"
+                     "-finline-functions"
+                     "-funroll-loops"
+                     "-Wall"
+                     "-o"
+                     (string-append bin "/FastTree")
+                     source
+                     "-lm")
+            (system* "gcc"
+                     "-DOPENMP"
+                     "-fopenmp"
+                     "-O3"
+                     "-finline-functions"
+                     "-funroll-loops"
+                     "-Wall"
+                     "-o"
+                     (string-append bin "/FastTreeMP")
+                     source
+                     "-lm"))))))
+   (native-inputs
+    `(("gcc", gcc-5.1)
+      ("binutils" ,binutils)
+      ("glibc" ,glibc)))
+   (home-page "http://www.microbesonline.org/fasttree")
+   (synopsis "FastTree infers approximately-maximum-likelihood
+phylogenetic trees from alignments of nucleotide or protein sequences")
+   (description
+    "FastTree can handle alignments with up to a million of sequences in
+a reasonable amount of time and memory.  For large alignments, FastTree is
+100-1,000 times faster than PhyML 3.0 or RAxML 7.")
+   (license license:gpl2+)))
+
 (define-public fastx-toolkit
   (package
     (name "fastx-toolkit")
-- 
2.1.4


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

end of thread, other threads:[~2015-06-21  7:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-19  7:24 [PATCH] Add FastTree Ben Woodcroft
2015-06-19 10:13 ` Alex Kost
2015-06-19 22:30   ` Ben Woodcroft
2015-06-20  5:32     ` Ben Woodcroft
2015-06-20 17:17       ` Mark H Weaver
2015-06-20 23:12         ` Ben Woodcroft
2015-06-21  4:41           ` Mark H Weaver
2015-06-21  6:52             ` Ben Woodcroft
2015-06-21  7:32               ` Mark H Weaver

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