all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH 2/2] gnu: zita-convolver: Drop the '-march=native' optimization.
@ 2016-01-06 15:48 宋文武
  2016-01-06 21:13 ` Ricardo Wurmus
  0 siblings, 1 reply; 6+ messages in thread
From: 宋文武 @ 2016-01-06 15:48 UTC (permalink / raw)
  To: guix-devel; +Cc: 宋文武

* gnu/packages/audio.scm (zita-convolver)[source]: Add snippet.
---
 gnu/packages/audio.scm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 7cdf586..ebae5d5 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -1839,6 +1839,11 @@ result.")
                     "http://kokkinizita.linuxaudio.org"
                     "/linuxaudio/downloads/zita-convolver-"
                     version ".tar.bz2"))
+              (snippet
+               ;; Don't optimize for a specific processor architecture.
+               '(substitute* "libs/Makefile"
+                  (("^CXXFLAGS \\+= -march=native") "")))
+              (modules '((guix build utils)))
               (sha256
                (base32
                 "14qrnczhp5mbwhky64il7kxc4hl1mmh495v60va7i2qnhasr6zmz"))))
-- 
2.5.0

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

* Re: [PATCH 2/2] gnu: zita-convolver: Drop the '-march=native' optimization.
  2016-01-06 15:48 [PATCH 2/2] gnu: zita-convolver: Drop the '-march=native' optimization 宋文武
@ 2016-01-06 21:13 ` Ricardo Wurmus
  2016-01-07  3:58   ` 宋文武
  0 siblings, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2016-01-06 21:13 UTC (permalink / raw)
  To: 宋文武; +Cc: guix-devel


> +              (snippet
> +               ;; Don't optimize for a specific processor architecture.
> +               '(substitute* "libs/Makefile"
> +                  (("^CXXFLAGS \\+= -march=native") "")))
> +              (modules '((guix build utils)))

Is this to avoid that packages are optimised for the CPU of the build
slave?  If so, could we instead pass different optimisation flags for
different architectures?  For a convolver I’d prefer to have *some*
optimisation, even if it’s just the greatest common divisor.

~~ Ricardo

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

* Re: [PATCH 2/2] gnu: zita-convolver: Drop the '-march=native' optimization.
  2016-01-06 21:13 ` Ricardo Wurmus
@ 2016-01-07  3:58   ` 宋文武
  2016-01-07  8:37     ` Ricardo Wurmus
  0 siblings, 1 reply; 6+ messages in thread
From: 宋文武 @ 2016-01-07  3:58 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Ricardo Wurmus <rekado@elephly.net> writes:

>> +              (snippet
>> +               ;; Don't optimize for a specific processor architecture.
>> +               '(substitute* "libs/Makefile"
>> +                  (("^CXXFLAGS \\+= -march=native") "")))
>> +              (modules '((guix build utils)))
>
> Is this to avoid that packages are optimised for the CPU of the build
> slave?
Yes, using that from hydra will crash guitarix for me.
Same as: <https://bugs.archlinux.org/task/36248>.

> If so, could we instead pass different optimisation flags for
> different architectures?  For a convolver I’d prefer to have *some*
> optimisation, even if it’s just the greatest common divisor.
I don't familiar with optimization flags, but according to:
  <https://wiki.gentoo.org/wiki/GCC_optimization#Optimizing>
I think '-march=native' should be dropped definitely, it enable all
the CPU specified instruction set when building on the slave.
And it's not clear to me what *some* flags are, suppose we don't want
any CPU specified (-msse3, -msse4, etc.) thing.

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

* Re: [PATCH 2/2] gnu: zita-convolver: Drop the '-march=native' optimization.
  2016-01-07  3:58   ` 宋文武
@ 2016-01-07  8:37     ` Ricardo Wurmus
  2016-01-07 13:20       ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2016-01-07  8:37 UTC (permalink / raw)
  To: 宋文武; +Cc: guix-devel


宋文武 <iyzsong@member.fsf.org> writes:

> Ricardo Wurmus <rekado@elephly.net> writes:
>
>>> +              (snippet
>>> +               ;; Don't optimize for a specific processor architecture.
>>> +               '(substitute* "libs/Makefile"
>>> +                  (("^CXXFLAGS \\+= -march=native") "")))
>>> +              (modules '((guix build utils)))
>>
>> Is this to avoid that packages are optimised for the CPU of the build
>> slave?
> Yes, using that from hydra will crash guitarix for me.
> Same as: <https://bugs.archlinux.org/task/36248>.

Guitarix also crashes for me on i686 — and I thought it was something to
do with my machine or the broken build of eigen.

>> If so, could we instead pass different optimisation flags for
>> different architectures?  For a convolver I’d prefer to have *some*
>> optimisation, even if it’s just the greatest common divisor.
> I don't familiar with optimization flags, but according to:
>   <https://wiki.gentoo.org/wiki/GCC_optimization#Optimizing>
> I think '-march=native' should be dropped definitely, it enable all
> the CPU specified instruction set when building on the slave.
> And it's not clear to me what *some* flags are, suppose we don't want
> any CPU specified (-msse3, -msse4, etc.) thing.

Okay.  I think removing “-march=native” is worth doing anyway, so let’s
ignore adding optimisation flags for now.

Thank you!

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

* Re: [PATCH 2/2] gnu: zita-convolver: Drop the '-march=native' optimization.
  2016-01-07  8:37     ` Ricardo Wurmus
@ 2016-01-07 13:20       ` Ludovic Courtès
  2016-01-07 14:53         ` 宋文武
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2016-01-07 13:20 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Ricardo Wurmus <rekado@elephly.net> skribis:

> 宋文武 <iyzsong@member.fsf.org> writes:
>
>> Ricardo Wurmus <rekado@elephly.net> writes:
>>
>>>> +              (snippet
>>>> +               ;; Don't optimize for a specific processor architecture.
>>>> +               '(substitute* "libs/Makefile"
>>>> +                  (("^CXXFLAGS \\+= -march=native") "")))
>>>> +              (modules '((guix build utils)))
>>>
>>> Is this to avoid that packages are optimised for the CPU of the build
>>> slave?
>> Yes, using that from hydra will crash guitarix for me.
>> Same as: <https://bugs.archlinux.org/task/36248>.
>
> Guitarix also crashes for me on i686 — and I thought it was something to
> do with my machine or the broken build of eigen.

Eigen is a header-only library, so what matters is the optimization
flags passed when building the software that uses Eigen.

>>> If so, could we instead pass different optimisation flags for
>>> different architectures?  For a convolver I’d prefer to have *some*
>>> optimisation, even if it’s just the greatest common divisor.

It’s likely that zita-convolver has -O2 or similar *in addition* to
-march=native, because the latter is no substitute for the former.

Could you check that in the makefiles?

But yeah, the patch is a good idea anyway.

Thanks,
Ludo’.

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

* Re: [PATCH 2/2] gnu: zita-convolver: Drop the '-march=native' optimization.
  2016-01-07 13:20       ` Ludovic Courtès
@ 2016-01-07 14:53         ` 宋文武
  0 siblings, 0 replies; 6+ messages in thread
From: 宋文武 @ 2016-01-07 14:53 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

ludo@gnu.org (Ludovic Courtès) writes:

> Ricardo Wurmus <rekado@elephly.net> skribis:
>
>> 宋文武 <iyzsong@member.fsf.org> writes:
>>
>>> Ricardo Wurmus <rekado@elephly.net> writes:
>>>
>>>>> +              (snippet
>>>>> +               ;; Don't optimize for a specific processor architecture.
>>>>> +               '(substitute* "libs/Makefile"
>>>>> +                  (("^CXXFLAGS \\+= -march=native") "")))
>>>>> +              (modules '((guix build utils)))
>>>>
>>>> Is this to avoid that packages are optimised for the CPU of the build
>>>> slave?
>>> Yes, using that from hydra will crash guitarix for me.
>>> Same as: <https://bugs.archlinux.org/task/36248>.
>>
>> Guitarix also crashes for me on i686 — and I thought it was something to
>> do with my machine or the broken build of eigen.
Pushed, hopefully this will fix it on i686 too.
>
> Eigen is a header-only library, so what matters is the optimization
> flags passed when building the software that uses Eigen.
>
>>>> If so, could we instead pass different optimisation flags for
>>>> different architectures?  For a convolver I’d prefer to have *some*
>>>> optimisation, even if it’s just the greatest common divisor.
>
> It’s likely that zita-convolver has -O2 or similar *in addition* to
> -march=native, because the latter is no substitute for the former.
>
> Could you check that in the makefiles?
Yes, it actually has:
  CXXFLAGS =+ -ffast-math -funroll-loops -O3

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

end of thread, other threads:[~2016-01-07 14:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-06 15:48 [PATCH 2/2] gnu: zita-convolver: Drop the '-march=native' optimization 宋文武
2016-01-06 21:13 ` Ricardo Wurmus
2016-01-07  3:58   ` 宋文武
2016-01-07  8:37     ` Ricardo Wurmus
2016-01-07 13:20       ` Ludovic Courtès
2016-01-07 14:53         ` 宋文武

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.