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.
then post a build.log showing the -O0 and emerge --info to go with it
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.
Created attachment 369702 [details] emerge --info
Created attachment 369704 [details] ardour build log
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.
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)
Created attachment 369714 [details] optimized build log
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.
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. :-/
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.
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
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).
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! :-)
Yo, no problem. Glad to help. Ah, and I also don't get any QA warnings for my CFLAGS.