[gmx-developers] warning Emulating FMA instructions - this is probably not what you want!

Berk Hess hess at kth.se
Thu Oct 18 13:24:58 CEST 2012


It seems that for many other packages it does work, so we might want to 
comply with that.

But here we seem to have another issue: -mfma4 was not added automatically.
CMakeLists.txt never checks for this. Did Erik simply forget to do so?

Cheers,

Berk

On 10/18/2012 01:01 PM, Szilárd Páll wrote:
> That's correct. The point I was trying to make is that we might end up 
> hearing about this issue in the future if people use CFLAGS just by 
> routine. I fact, I'm not even sure that cmake is not supposed to pick 
> up CLAGS as well and it's some later cmake pass rewriting compiler 
> options is that the current code is trying to overcome, but it ends up 
> loosing some options when CFLAGS is set.
>
> Any comments? Should CFLAGS work?
>
> --
> Szilárd
>
>
> On Thu, Oct 18, 2012 at 9:43 AM, Jochen Hub <jhub at gwdg.de 
> <mailto:jhub at gwdg.de>> wrote:
>
>     Following Szilard, I tried to use
>
>     cmake -DCMAKE_C_FLAGS=-mfma4 ...
>
>     instead of export CFLAGS=-mfma4 to add the -mfma4 flag. Now, the
>     only difference in CMakeCache.txt is
>
>     < CMAKE_C_FLAGS:STRING='-mavx  -Wall -Wno-unused -Wunused-value  '
>     ---
>     > CMAKE_C_FLAGS:STRING=-mavx  -Wall -Wno-unused -Wunused-value  -mfma4
>
>     which is just what I wanted, right? (and the warning on emulating
>     FMA instructions does not appear any more).
>
>     Jochen
>
>
>     Am 10/17/12 11:28 PM, schrieb Szilárd Páll:
>
>
>         That way of calling CMake triggers an interesting bug in the
>         option
>         generator and CFLAGS will essentially override part of the
>         auto-generated compiler options. Diff of relevant lines in
>         CMakeCache.txt are below, the only difference is that the
>         second file
>         ("+" in the diff) was generated by running
>         "CFLAGS=-march=native cmake...":
>
>           //Flags used by the compiler during all build types
>         -CMAKE_C_FLAGS:STRING='-msse2  -Wall -Wno-unused -Wunused-value  '
>         +CMAKE_C_FLAGS:STRING='-msse2  -march=native '
>           //Flags used by the compiler during debug builds.
>         -CMAKE_C_FLAGS_DEBUG:STRING=-fno-inline  -g
>         +CMAKE_C_FLAGS_DEBUG:STRING=-g
>         -//Flags used by the compiler during release builds.
>         -CMAKE_C_FLAGS_RELEASE:STRING=-fomit-frame-pointer
>         -funroll-all-loops
>         -fexcess-precision=fast  -O3 -DNDEBUG
>         +//Flags used by the compiler during release builds (/MD /Ob1 /Oi
>         +// /Ot /Oy /Gs will produce slightly less optimized but smaller
>         +// files).
>         +CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
>
>         As this messes with "considered to be best basic set of
>         options", we
>         could state that CFLAGS should not be used, but it might be a
>         better
>         alternative to make the configuration prepend the CFLAG to the
>         CMAKE_C_FLAGS and keep our generated set of flags as well.
>
>         I'm not sure which options is best. Thoughts?
>
>         --
>         Szilárd
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20121018/4b74cf59/attachment.html>


More information about the gromacs.org_gmx-developers mailing list