> how does Debian set these flags.

Via the environment variables (CFLAGS & friends). They are then picked
up by the build system, e.g., SCons.

> What is the issue with [...]

There's nothing wrong with any of these options as long as there is
there is a way to turn them off. If you're building production code
for a machine, you might not want `-Wall` or `-g` because you're not
debugging, but shipping. Or maybe you want to optimize for binary
size, then you go for `-Os` and not `-O3`. Ultimately, the choice of
compiler and compile options is best left to the person who actually
compiles the code, and it shouldn't be hardcoded in the build system.
That said, some sane common defaults can be provided (with the
possibility to turn them off).

> But that is not what we want the user to use ob Debian systems

There is a difference between a user of a Debian system who builds
Mixxx in his $HOME, and the actual Debian package. For the former, I
concur that it's perfectly okay to default to `optimize=portable` or
whatever you deem best for the average user.

> optimize=disable

Unfortunately, "optimize" isn't very explanatory. Does this concern
only the "-Ox" flag? What I would vote for is a build option that
allows me to remove *all* custom compiler flags (just like CMake's
CMAKE_BUILD_TYPE=None).

Cheers,
Nico


On Mon, Feb 2, 2015 at 3:56 PM, Daniel Schürmann <dasch...@mixxx.org> wrote:
> Hi Nico,
>
> how does Debian set these flags. Is there a building script with some
> arguments, resulting in in this options?
> This commit switches from CXX to CC flags
> https://github.com/daschuer/mixxx/commit/7d3fe7d9df55d5805e514f82b6968e168903936a
> So it should work.
>
> After merging https://github.com/mixxxdj/mixxx/pull/436
> We will have the option, which should include no optimization compiler
> flags:
>
> optimize=disable
>
> But that is not what we want the user to use ob Debian systems even if
> "-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat
> -Werror=format-security -D_FORTIFY_SOURCE=2" is added.
>
> The user should use a
>
> optimize=portable
>
> build.
>
> We may add an additional option to optimize for Debian builds.
>
> What is the issue with -Wall -Wextra? I hope we can finally eliminate all
> warnings an build with -Werror.
>
> What is the issue with -O3 and -funroll-loops?
>
> I have checked the engine execution time and "-O3 -ffast-math -funroll-loops
> -fomit-frame-pointer" has proven to produce the fastest results.
>
> -fomit-frame-pointer is not default for optimized builds in any case:
> "-O also turns on -fomit-frame-pointer on machines where doing so does not
> interfere with debugging."
> see also:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16373
>
>
>
>
>
>
>
>
>
>
> 2015-02-02 12:28 GMT+01:00 Nico Schlömer <nico.schloe...@gmail.com>:
>>
>> Debian sets
>> ```
>>  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat
>> -Werror=format-security -D_FORTIFY_SOURCE=2
>> ```
>> and Mixxx nonchalantly adds
>> ```
>> -pipe -Wall -Wextra -g -pthread -O3 -ffast-math -funroll-loops
>> -fomit-frame-pointer
>> ```
>> It'd be arguably cleaner if Mixxx had a option that does *not* add any
>> flags, for example for someone who is not interested in `-Wall
>> -Wextra` or `-O3` (the former really doesn't seem like something you'd
>> want to ship for production builds). CMake, for example, typically
>> handles this via `CMAKE_BUILD_TYPE=None`.
>> Also, the effect of `-funroll` loops is debatable and should possibly
>> not be enabled by default.
>> As a side note, `-fomit-frame-pointer` is
>> ```
>> Enabled at levels -O, -O2, -O3, -Os.
>> ```
>> so we can get rid of this entirely.
>>
>> Cheers,
>> Nico
>>
>> On Sun, Feb 1, 2015 at 9:52 PM, Daniel Schürmann <dasch...@mixxx.org>
>> wrote:
>> > IMHO there is currently no way to bypass the Scons build flags.
>> > We may introduce such a way, but what is the use case to provide
>> > build flags from a Linux distributor?
>> >
>> > Even in a autotools project, they are set inside the build scrips
>> > maintained by the project.
>> > However I be aware that there is a complete tool-chain to automate
>> > various task in the build process.
>> >
>> > Which flags are set by Debian we have to be aware of?
>> >
>> >
>> > Am 01.02.2015 um 20:31 schrieb Nico Schlömer:
>> >
>> >>> Do you have special requirements.
>> >>
>> >> Well, I don't want SCons to interfere with the build flags I (/Debian)
>> >> provide.
>> >>
>> >> What are the SCons flags I'll have to set?
>> >>
>> >> Cheers,
>> >> Nico
>> >>
>> >>
>> >>
>> >>
>> >> On Sun, Feb 1, 2015 at 9:06 PM, Daniel Schürmann <dasch...@mixxx.org>
>> >> wrote:
>> >>>
>> >>> Hi Nico,
>> >>>
>> >>> the build flags are generated from the various scons flags controlled
>> >>> by
>> >>> build/features.py and build/depends.py
>> >>> Please note that there is a pending pull request, that cleans up the
>> >>> flags a bit.
>> >>> https://github.com/mixxxdj/mixxx/pull/436
>> >>>
>> >>> Do you have special requirements.
>> >>>
>> >>> Kind regards,
>> >>>
>> >>> Daniel
>> >>>
>> >>>
>> >>> Am 01.02.2015 um 19:33 schrieb Nico Schlömer:
>> >>>>
>> >>>> Hi all,
>> >>>>
>> >>>> How can I build Mixxx with build flags entirely determined by the
>> >>>> environment? Currently, I'm getting
>> >>>> ```
>> >>>> [...]
>> >>>> Building with CC: gcc
>> >>>> Building with CXX: g++
>> >>>> Building with CCFLAGS: -pipe -Wall -Wextra -g -pthread -O3
>> >>>> -ffast-math
>> >>>> -funroll-loops -fomit-frame-pointer
>> >>>> Building with CPPDEFINES: -Damd64 -DMIXXX_BUILD_DEBUG -D__LINUX__
>> >>>> -D__UNIX__ -DSETTINGS_PATH=\".mixxx/\" -DSETTINGS_FILE=\"mixxx.cfg\"
>> >>>> -DUNIX_SHARE_PATH=\"/usr/share/mixxx\"
>> >>>> -DUNIX_LIB_PATH=\"/usr/lib/mixxx\" -D__PORTAUDIO__ -DQT_SHARED
>> >>>> -DQT_TABLET_SUPPORT -DQT_CORE_LIB -DQT_GUI_LIB -DQT_OPENGL_LIB
>> >>>> -DQT_XML_LIB -DQT_SVG_LIB -DQT_SQL_LIB -DQT_SCRIPT_LIB
>> >>>> -DQT_NETWORK_LIB -DQT_SHARED -D__SNDFILE__ -D__MAD__ -D__HID__
>> >>>> -D__BULK__ -D__VINYLCONTROL__ -D__SHOUTCAST__ -DHAVE_FFTW3
>> >>>> -D__AUTODJCRATES__ -D__SQLITE3__
>> >>>> Building with CXXFLAGS: -g -O2 -fstack-protector
>> >>>> --param=ssp-buffer-size=4 -Wformat -Werror=format-security
>> >>>> -D_FORTIFY_SOURCE=2
>> >>>> ```
>> >>>> where the CXXFLAGS are from the environment and the CCFLAGS from...
>> >>>> Well, I have no idea where from actually.
>> >>>>
>> >>>> Cheers,
>> >>>> Nico
>> >>>>
>> >>>>
>> >>>>
>> >>>> ------------------------------------------------------------------------------
>> >>>> Dive into the World of Parallel Programming. The Go Parallel Website,
>> >>>> sponsored by Intel and developed in partnership with Slashdot Media,
>> >>>> is
>> >>>> your
>> >>>> hub for all things parallel software development, from weekly thought
>> >>>> leadership blogs to news, videos, case studies, tutorials and more.
>> >>>> Take
>> >>>> a
>> >>>> look and join the conversation now.
>> >>>> http://goparallel.sourceforge.net/
>> >>>> _______________________________________________
>> >>>> Get Mixxx, the #1 Free MP3 DJ Mixing software Today
>> >>>> http://mixxx.org
>> >>>>
>> >>>>
>> >>>> Mixxx-devel mailing list
>> >>>> Mixxx-devel@lists.sourceforge.net
>> >>>> https://lists.sourceforge.net/lists/listinfo/mixxx-devel
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> ------------------------------------------------------------------------------
>> >>> Dive into the World of Parallel Programming. The Go Parallel Website,
>> >>> sponsored by Intel and developed in partnership with Slashdot Media,
>> >>> is
>> >>> your
>> >>> hub for all things parallel software development, from weekly thought
>> >>> leadership blogs to news, videos, case studies, tutorials and more.
>> >>> Take
>> >>> a
>> >>> look and join the conversation now. http://goparallel.sourceforge.net/
>> >>> _______________________________________________
>> >>> Get Mixxx, the #1 Free MP3 DJ Mixing software Today
>> >>> http://mixxx.org
>> >>>
>> >>>
>> >>> Mixxx-devel mailing list
>> >>> Mixxx-devel@lists.sourceforge.net
>> >>> https://lists.sourceforge.net/lists/listinfo/mixxx-devel
>> >
>> >
>
>

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Get Mixxx, the #1 Free MP3 DJ Mixing software Today
http://mixxx.org


Mixxx-devel mailing list
Mixxx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

Reply via email to