[gmx-developers] hidden compiler flags in 4.6?

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


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/8a52974c/attachment.html>


More information about the gromacs.org_gmx-developers mailing list