unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Add MOSAIK.
@ 2015-10-16 15:43 Ricardo Wurmus
  2015-10-19 15:51 ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Ricardo Wurmus @ 2015-10-16 15:43 UTC (permalink / raw)
  To: guix-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-gnu-Add-MOSAIK.patch --]
[-- Type: text/x-patch, Size: 2807 bytes --]

From 2f5755ddad550cf811f97ad6889eea2a7171a1c3 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Date: Fri, 16 Oct 2015 17:41:07 +0200
Subject: [PATCH] gnu: Add MOSAIK.

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

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 069e52f..e339a70 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -2248,6 +2248,52 @@ viewer.")
                                    (string-append bin "/samtools")))))
            (delete 'patch-tests)))))))
 
+(define-public mosaik
+  (let ((commit "5c25216d"))
+    (package
+      (name "mosaik")
+      (version "2.2.30")
+      (source (origin
+                ;; There are no release tarballs nor tags.
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/wanpinglee/MOSAIK.git")
+                      (commit commit)))
+                (file-name (string-append name "-" version))
+                (sha256
+                 (base32
+                  "17gj3s07cm77r41z92awh0bim7w7q7fbn0sf5nkqmcm1vw052qgw"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:tests? #f ; no tests
+         #:make-flags (list "CC=gcc")
+         #:phases
+         (modify-phases %standard-phases
+           (replace 'configure
+                    (lambda _ (chdir "src") #t))
+           (replace 'install
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((bin (string-append (assoc-ref outputs "out")
+                                                "/bin")))
+                        (mkdir-p bin)
+                        (copy-recursively "../bin" bin)
+                        #t))))))
+      (inputs
+       `(("perl" ,perl)
+         ("zlib" ,zlib)))
+      (home-page "https://code.google.com/p/mosaik-aligner/")
+      (synopsis "Map nucleotide sequence reads to reference genomes")
+      (description
+       "MOSAIK is a program for mapping second and third-generation sequencing
+reads to a reference genome.  MOSAIK can align reads generated by all the
+major sequencing technologies, including Illumina, Applied Biosystems SOLiD,
+Roche 454, Ion Torrent and Pacific BioSciences SMRT.")
+      ;; MOSAIK is released under the GPLv2+ with the exception of third-party
+      ;; code released into the public domain:
+      ;; 1. fastlz by Ariya Hidayat - http://www.fastlz.org/
+      ;; 2. MD5 implementation - RSA Data Security, RFC 1321
+      (license (list license:gpl2+ license:public-domain)))))
+
 (define-public ngs-sdk
   (package
     (name "ngs-sdk")
-- 
2.1.0

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

* Re: [PATCH] Add MOSAIK.
  2015-10-16 15:43 [PATCH] Add MOSAIK Ricardo Wurmus
@ 2015-10-19 15:51 ` Ludovic Courtès
  2015-10-23  8:02   ` Andreas Enge
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2015-10-19 15:51 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

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

> From 2f5755ddad550cf811f97ad6889eea2a7171a1c3 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
> Date: Fri, 16 Oct 2015 17:41:07 +0200
> Subject: [PATCH] gnu: Add MOSAIK.
>
> * gnu/packages/bioinformatics.scm (mosaik): New variable.

LGTM, thanks!

Ludo'.

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

* Re: [PATCH] Add MOSAIK.
  2015-10-19 15:51 ` Ludovic Courtès
@ 2015-10-23  8:02   ` Andreas Enge
  2015-10-23  8:42     ` Ricardo Wurmus
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Enge @ 2015-10-23  8:02 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Mosaik fails on all architectures except for x86_64. Should it be disabled
or are there configure flags to make it work elsewhere?

Andreas

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

* Re: [PATCH] Add MOSAIK.
  2015-10-23  8:02   ` Andreas Enge
@ 2015-10-23  8:42     ` Ricardo Wurmus
  2015-10-27 11:42       ` Efraim Flashner
  0 siblings, 1 reply; 7+ messages in thread
From: Ricardo Wurmus @ 2015-10-23  8:42 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel

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

> Mosaik fails on all architectures except for x86_64. Should it be disabled
> or are there configure flags to make it work elsewhere?

I think this is caused by ‘includes/linux.inc’, which is unconditionally
included by default.

Disabling the line

    include includes/$(BLD_PLATFORM).inc

should be sufficient to fix this.

Alternatively, we could set BLD_PLATFORM (to something other than just
“linux” on non-x86_64) and patch “include” to read “-include”, so that
it doesn’t cause an error when the file does not exist.

That’s what the attached patch does.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-mosaik-Enable-optimizations-only-on-x86_64.patch --]
[-- Type: text/x-patch, Size: 1587 bytes --]

From 156df9fcf8a7b9a5f61b29db366f6b780082c81a Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Date: Fri, 23 Oct 2015 10:35:00 +0200
Subject: [PATCH] gnu: mosaik: Enable optimizations only on x86_64.

* gnu/packages/bioinformatics.scm (mosaik)[arguments]: Set BLD_PLATFORM
  make flag; add build phase to make include optional.
---
 gnu/packages/bioinformatics.scm | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index e1ae107..6424dde 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -2266,9 +2266,21 @@ viewer.")
       (build-system gnu-build-system)
       (arguments
        `(#:tests? #f ; no tests
-         #:make-flags (list "CC=gcc")
+         #:make-flags
+         (list "CC=gcc"
+               (string-append "BLD_PLATFORM="
+                              (let ((system ,(or (%current-target-system)
+                                                 (%current-system))))
+                                (if (string-prefix? "x86_64" system)
+                                    "linux"
+                                    system))))
          #:phases
          (modify-phases %standard-phases
+           (add-after 'unpack 'make-optimization-optional
+            (lambda _
+              (substitute* "src/Makefile"
+                (("^include") "-include"))
+              #t))
            (replace 'configure
                     (lambda _ (chdir "src") #t))
            (replace 'install
-- 
2.1.0


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

* Re: [PATCH] Add MOSAIK.
  2015-10-23  8:42     ` Ricardo Wurmus
@ 2015-10-27 11:42       ` Efraim Flashner
  2015-10-27 12:51         ` Ricardo Wurmus
  0 siblings, 1 reply; 7+ messages in thread
From: Efraim Flashner @ 2015-10-27 11:42 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

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

On Fri, 23 Oct 2015 10:42:49 +0200
Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> wrote:

> > Mosaik fails on all architectures except for x86_64. Should it be disabled
> > or are there configure flags to make it work elsewhere?  
> 
> I think this is caused by ‘includes/linux.inc’, which is unconditionally
> included by default.
> 
> Disabling the line
> 
>     include includes/$(BLD_PLATFORM).inc
> 
> should be sufficient to fix this.
> 
> Alternatively, we could set BLD_PLATFORM (to something other than just
> “linux” on non-x86_64) and patch “include” to read “-include”, so that
> it doesn’t cause an error when the file does not exist.
> 
> That’s what the attached patch does.
> 

I ran `./pre-inst-env guix build -s i686-linux mosaik` and the build failed for me.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] Add MOSAIK.
  2015-10-27 11:42       ` Efraim Flashner
@ 2015-10-27 12:51         ` Ricardo Wurmus
  2015-10-27 15:50           ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Ricardo Wurmus @ 2015-10-27 12:51 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel


Efraim Flashner <efraim@flashner.co.il> writes:

> On Fri, 23 Oct 2015 10:42:49 +0200
> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> wrote:
>
>> > Mosaik fails on all architectures except for x86_64. Should it be disabled
>> > or are there configure flags to make it work elsewhere?  
>> 
>> I think this is caused by ‘includes/linux.inc’, which is unconditionally
>> included by default.
>> 
>> Disabling the line
>> 
>>     include includes/$(BLD_PLATFORM).inc
>> 
>> should be sufficient to fix this.
>> 
>> Alternatively, we could set BLD_PLATFORM (to something other than just
>> “linux” on non-x86_64) and patch “include” to read “-include”, so that
>> it doesn’t cause an error when the file does not exist.
>> 
>> That’s what the attached patch does.
>> 
>
> I ran `./pre-inst-env guix build -s i686-linux mosaik` and the build failed for me.

I can confirm this.  Too bad.  The reason is that “ssw.c” uses macros
from emmintrin.h that are always inlined.  Inlining fails here due to
“target specific option mismatch”.

Does this only happen when cross-compiling or will this also happen if
it’s built natively on i686?

~~ Ricardo

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

* Re: [PATCH] Add MOSAIK.
  2015-10-27 12:51         ` Ricardo Wurmus
@ 2015-10-27 15:50           ` Ludovic Courtès
  0 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2015-10-27 15:50 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

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

> Efraim Flashner <efraim@flashner.co.il> writes:

[...]

>> I ran `./pre-inst-env guix build -s i686-linux mosaik` and the build failed for me.
>
> I can confirm this.  Too bad.  The reason is that “ssw.c” uses macros
> from emmintrin.h that are always inlined.  Inlining fails here due to
> “target specific option mismatch”.
>
> Does this only happen when cross-compiling or will this also happen if
> it’s built natively on i686?

It happens natively: The -s above does a native build (for
cross-compilation, it’s --target, which must be passed a full GNU
triplet.)

Ludo’.

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

end of thread, other threads:[~2015-10-27 15:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-16 15:43 [PATCH] Add MOSAIK Ricardo Wurmus
2015-10-19 15:51 ` Ludovic Courtès
2015-10-23  8:02   ` Andreas Enge
2015-10-23  8:42     ` Ricardo Wurmus
2015-10-27 11:42       ` Efraim Flashner
2015-10-27 12:51         ` Ricardo Wurmus
2015-10-27 15:50           ` Ludovic Courtès

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