Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 500516 - media-sound/ardour-3* should run waf-utils_src_configure with --optimize option
Summary: media-sound/ardour-3* should run waf-utils_src_configure with --optimize option
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Professional Audio Applications Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-06 13:45 UTC by Mikkl
Modified: 2014-02-07 15:54 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,5.60 KB, text/plain)
2014-02-06 14:15 UTC, Mikkl
Details
ardour build log (ardour-build.log,10.30 KB, text/plain)
2014-02-06 14:15 UTC, Mikkl
Details
optimized build log (ardour-optimized-build.log,9.37 KB, text/plain)
2014-02-06 18:23 UTC, Mikkl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikkl 2014-02-06 13:45:56 UTC
Ardour 3 builds require the "--optimize" flag to be set for the waf configure phase in order to build an optimized version. Otherwise, a debug build is built with compiler optimization flag set to "-O0". This results in a relatively slow GUI performance and an overall high DSP usage compared to an optimized build. I have replaced the line
		$(use debug && echo "--stl-debug") \
with
		$(use debug && echo "--stl-debug" || echo "--optimize") \
in my custom ebuilds in order to get an optimized build.
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2014-02-06 13:56:00 UTC
then post a build.log showing the -O0 and emerge --info to go with it
Comment 2 Mikkl 2014-02-06 14:14:45 UTC
OK, here come the emerge --info and build logs. Global configuration says:

 * Debuggable build                                  : True

and CFLAGS are listed as:

 * C compiler flags                                  : ['-I/var/tmp/portage/media-sound/ardour-3.5.308/work/ardour-3.5.308', '-O0', '-g', '-fshow-column', '-DWAF_BUILD', '-rdynamic', '-DARCH_X86', '-mmmx', '-msse', '-mfpmath=sse', '-DUSE_XMMINTRIN', '-DBUILD_SSE_OPTIMIZATIONS', '-DLXVST_64BIT', '-Wall', '-Wpointer-arith', '-Wcast-qual', '-Wcast-align', '-DBOOST_SYSTEM_NO_DEPRECATED', '-D_ISOC9X_SOURCE', '-D_LARGEFILE64_SOURCE', '-D_FILE_OFFSET_BITS=64', '-DENABLE_NLS', '-Wstrict-prototypes', '-Wmissing-prototypes'] 
 * C++ compiler flags                                : ['-I/var/tmp/portage/media-sound/ardour-3.5.308/work/ardour-3.5.308', '-O0', '-g', '-fshow-column', '-DWAF_BUILD', '-rdynamic', '-DARCH_X86', '-mmmx', '-msse', '-mfpmath=sse', '-DUSE_XMMINTRIN', '-DBUILD_SSE_OPTIMIZATIONS', '-DLXVST_64BIT', '-Wall', '-Wpointer-arith', '-Wcast-qual', '-Wcast-align', '-DBOOST_SYSTEM_NO_DEPRECATED', '-D_ISOC9X_SOURCE', '-D_LARGEFILE64_SOURCE', '-D_FILE_OFFSET_BITS=64', '-DENABLE_NLS', '-Woverloaded-virtual', '-D__STDC_LIMIT_MACROS', '-D__STDC_FORMAT_MACROS', '-DHAVE_FFTW3']

although debug USE flag is not set.
Comment 3 Mikkl 2014-02-06 14:15:20 UTC
Created attachment 369702 [details]
emerge --info
Comment 4 Mikkl 2014-02-06 14:15:38 UTC
Created attachment 369704 [details]
ardour build log
Comment 5 Andreas Schürch gentoo-dev 2014-02-06 17:37:49 UTC
Thanks Mikkl, you are right!

But i get some QA warnings with --optimize. Do you also get them? 
If so, do you use midi or the eq plugin? Do you experience crashes?

* QA Notice: Package triggers severe warnings which indicate that it
 *            may exhibit random runtime failures.
 * ../libs/ardour/midi_ring_buffer.cc:60:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * ../libs/ardour/midi_ring_buffer.cc:151:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * ../gtk2_ardour/plugin_eq_gui.cc:74:69: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * Please do not file a Gentoo bug and instead report the above QA
 * issues directly to the upstream developers of this software.
Comment 6 Samuli Suominen (RETIRED) gentoo-dev 2014-02-06 17:43:34 UTC
I see it's completely ignoring your CFLAGS, I don't see eg. -march=native anywhere in the build.log except in the beginning (which is meaningless)
Comment 7 Mikkl 2014-02-06 18:23:33 UTC
Created attachment 369714 [details]
optimized build log
Comment 8 Mikkl 2014-02-06 18:39:37 UTC
Samuli, that's true. I noticed, this is for the debug build only, however. I have attached a build log for the optimized build. As you can see, it then picks up the CFLAGS etc. but some of them are overridden with some default values. For example, my "-O2" flag is overridden with "-O3". But as I can read in Ardour's wscript file, this should not be the case:

    # don't prepend optimization flags if "-O<something>" is present
    prepend_opt_flags = True
    for flag in optimization_flags:
        if flag.startswith("-O"):
            prepend_opt_flags = False
            break

    if prepend_opt_flags:
        optimization_flags[:0] = [
                "-O3",
                "-fomit-frame-pointer",
                "-ffast-math",
                "-fstrength-reduce"
                ]

Maybe I'll have a look at that later, but that should normally be a problem on Ardour's end then?

Andreas, I do get the same warnings. I've been using Ardour for quite some time now and haven't experienced crashes other than the apperent ones that have been fixed over time.
Comment 9 Andreas Schürch gentoo-dev 2014-02-06 18:50:03 UTC
We will need the --arch=$CFLAGS also to avoid at least the double -O's...
But I'm fighting with escaping it properly, as it cuts the quotes and waf configure fails. :-/
Comment 10 Mikkl 2014-02-06 20:15:07 UTC
Hmm, for me --arch="${CFLAGS}" works. The flags are already present in conf.env['CFLAGS'] and are later duplicated by conf.env.append_value('CFLAGS', optimization_flags), but at least no unwanted flags are used.
Comment 11 Andreas Schürch gentoo-dev 2014-02-07 07:20:52 UTC
ok, how about that one? We just replace the flags with an empty string on the second instance...
sed 's/'FLAGS\'\,\ optimization_flags'/'FLAGS\'\,\ \'\''/g' -i "${S}"/wscript
Comment 12 Mikkl 2014-02-07 10:23:38 UTC
While the duplicates do not mean any harm, I think it's a good idea because it's also working for you and looks cleaner. That would also mean we have full control over the flags and don't allow flags that Ardour thinks are OK. Since we never use "--arch" but want our flags to be treated as in "--arch" I think that would be the way to go (# ARCH="..." overrides all).
Comment 13 Andreas Schürch gentoo-dev 2014-02-07 14:26:15 UTC
As i couldn't reproduce the QA issues on other installs, i submitted this to the tree now for 3.5.308-r1 and 9999. (the older 3.X versions will get removed soon...)

Thanks Mikkle! :-)
Comment 14 Mikkl 2014-02-07 15:54:32 UTC
Yo, no problem. Glad to help.
Ah, and I also don't get any QA warnings for my CFLAGS.