unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Fix subread on non-x86_64
@ 2015-10-23 12:23 Ricardo Wurmus
  2015-10-26 14:45 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Ricardo Wurmus @ 2015-10-23 12:23 UTC (permalink / raw)
  To: guix-devel

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

Hi Guix,

the attached patch should fix the build of subread on non-x86_64 by
overriding the CC and CCFLAGS variables, which by default are set to
contain a lot of x86_64 optimisations.

~~ Ricardo


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

From 71a37b56d0962f0db4009bdb6a88c22025278a00 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Date: Fri, 23 Oct 2015 14:16:27 +0200
Subject: [PATCH] gnu: subread: Use SSE optimizations on x86_64 only.

* gnu/packages/bioinformatics.scm (subread)[arguments]: Override CC and
  CCFLAGS conditionally dependent on target system.
---
 gnu/packages/bioinformatics.scm | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 8a81150..ddaffd8 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -2814,7 +2814,21 @@ sequences.")
     (build-system gnu-build-system)
     (arguments
      `(#:tests? #f ;no "check" target
-       #:make-flags '("-f" "Makefile.Linux")
+       #:make-flags
+       (list (let ((system ,(or (%current-target-system)
+                                (%current-system)))
+                   (flags '("-ggdb" "-fomit-frame-pointer"
+                            "-ffast-math" "-funroll-loops"
+                            "-fmessage-length=0"
+                            "-O9" "-Wall" "-DMAKE_FOR_EXON"
+                            "-DMAKE_STANDALONE"
+                            "-DSUBREAD_VERSION=\\\"${SUBREAD_VERSION}\\\""))
+                   (flags64 '("-mmmx" "-msse" "-msse2" "-msse3")))
+               (if (string-prefix? "x86_64" system)
+                   (string-append "CCFLAGS=" (string-join (append flags flags64) " "))
+                   (string-append "CCFLAGS=" (string-join flags " "))))
+             "-f" "Makefile.Linux"
+             "CC=gcc ${CCFLAGS}")
        #:phases
        (alist-cons-after
         'unpack 'enter-dir
-- 
2.1.0


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

* Re: [PATCH] Fix subread on non-x86_64
  2015-10-23 12:23 [PATCH] Fix subread on non-x86_64 Ricardo Wurmus
@ 2015-10-26 14:45 ` Ludovic Courtès
  2015-10-27 11:08   ` Ricardo Wurmus
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2015-10-26 14:45 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

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

> the attached patch should fix the build of subread on non-x86_64 by
> overriding the CC and CCFLAGS variables, which by default are set to
> contain a lot of x86_64 optimisations.

Nice!  Could you add a comment explaining that?

> From 71a37b56d0962f0db4009bdb6a88c22025278a00 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
> Date: Fri, 23 Oct 2015 14:16:27 +0200
> Subject: [PATCH] gnu: subread: Use SSE optimizations on x86_64 only.
>
> * gnu/packages/bioinformatics.scm (subread)[arguments]: Override CC and
>   CCFLAGS conditionally dependent on target system.

[...]

> +               (if (string-prefix? "x86_64" system)
> +                   (string-append "CCFLAGS=" (string-join (append flags flags64) " "))
> +                   (string-append "CCFLAGS=" (string-join flags " "))))

The last argument to ‘string-join’ can be omitted here.

OK with these two changes.

It may be a good case for ‘guix challenge’ here: If things like
-mtune=native or FDO creep in, ‘guix challenge’ is likely to flag them.

Thanks,
Ludo’.

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

* Re: [PATCH] Fix subread on non-x86_64
  2015-10-26 14:45 ` Ludovic Courtès
@ 2015-10-27 11:08   ` Ricardo Wurmus
  0 siblings, 0 replies; 3+ messages in thread
From: Ricardo Wurmus @ 2015-10-27 11:08 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel


Ludovic Courtès <ludo@gnu.org> writes:

> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:
>
>> the attached patch should fix the build of subread on non-x86_64 by
>> overriding the CC and CCFLAGS variables, which by default are set to
>> contain a lot of x86_64 optimisations.
>
> Nice!  Could you add a comment explaining that?

Sure.

>> From 71a37b56d0962f0db4009bdb6a88c22025278a00 Mon Sep 17 00:00:00 2001
>> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
>> Date: Fri, 23 Oct 2015 14:16:27 +0200
>> Subject: [PATCH] gnu: subread: Use SSE optimizations on x86_64 only.
>>
>> * gnu/packages/bioinformatics.scm (subread)[arguments]: Override CC and
>>   CCFLAGS conditionally dependent on target system.
>
> [...]
>
>> +               (if (string-prefix? "x86_64" system)
>> +                   (string-append "CCFLAGS=" (string-join (append flags flags64) " "))
>> +                   (string-append "CCFLAGS=" (string-join flags " "))))
>
> The last argument to ‘string-join’ can be omitted here.

Okay.  Pushed with the above changes.
Thanks!

~~ Ricardo

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-23 12:23 [PATCH] Fix subread on non-x86_64 Ricardo Wurmus
2015-10-26 14:45 ` Ludovic Courtès
2015-10-27 11:08   ` 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).