[gmx-developers] Re: hidden compiler flags in 4.6?

Szilárd Páll szilard.pall at cbr.su.se
Sat Feb 2 23:45:28 CET 2013


PS:  Commit 446d5dab<http://redmine.gromacs.org/projects/gromacs/repository/revisions/446d5dab2d0e07d00ff073978eb74e1ae8bad872>
falsely
claims to fix Issue #1040, but in my opinion that is not the case
especially because of the latter problem which will cause performance
degradation in some cases due to the O3 -> O2 (default) switch.

--
Szilárd


On Sat, Feb 2, 2013 at 11:42 PM, Szilárd Páll <szilard.pall at cbr.su.se>wrote:

> Hi,
>
> With the compiler flag handling changed between beta3 and final, now it is
> completely impossible to check or modify compiler flags we generate.
>
> I might have missed the discussion on this during code review, but I
> simply consider this a bug. It is pretty much impossible to know what
> compiler flags are being used - at least not at build time, not even by
> looking at the cache, and not without first compiling a binary and checking
> the "-version" output.
>
> Not only that this is a rather annoying, making it impossible to change
> the default compiler options is a very naive behavior. We can not assume
> that whatever flags we use will be optimal and will not potentially
> conflict with something the user adds. Here's the example:
>
> CC=icc cmake $PATH_TO_SRC -DGMX_GPU=OFF -DGMX_CPU_ACCELERATION=SSE4.1
> -DCMAKE_C_FAGLS_RELEASE="-xHOST"
>
> This should be a perfectly reasonable setup, but icc does not like
> the combination of -msse4.1 and -xHOST and will issue a warning for each
> compiler invocation. Removing -msse4.1 and keeping -xHOST only would be an
> easy cosmetic fix, but it is currently impossible to do. Of course, this is
> a mostly harmless case, but it illustrates the issue and I'm pretty certain
> that such a limitation will cause trouble to not only developers, but
> advanced users, sysadmins, etc.
>
> Additionally, there is another issue with the bove example: manually
> passing CMAKE_C_FAGLS_RELEASE will overwrite the default release flags (-O3
> -DNDEBUG). This leads to another issue: passing any additional release flag
> will lead to -O2 being used as this is the default with most compilers (and
> -O3 get overridden). Consequently, if one wants to *append* and
> optimization flag, this can only be done post-configure by modifying the
> cache, but not during configure which goes against the principle we tried
> to adhere to that users should be able to flexibly configure GROMACS by
> using a single command.
>
> I think the above issues need fixing asap, preferably by 4.6.1, but I'm
> not familiar with the code, so I can't suggest a concrete solution.
>
> Cheers,
> --
> Szilárd
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20130202/87afab73/attachment.html>


More information about the gromacs.org_gmx-developers mailing list