On Thu, Oct 18, 2012 at 1:24 PM, Berk Hess <span dir="ltr"><<a href="mailto:hess@kth.se" target="_blank">hess@kth.se</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>It seems that for many other packages
it does work, so we might want to comply with that.<br>
<br>
But here we seem to have another issue: -mfma4 was not added
automatically.<br>
CMakeLists.txt never checks for this. Did Erik simply forget to do
so?<br></div></div></blockquote><div><br></div><div>I assume so, I don't know of any other reason for -mfma4 to be omitted. Here's the very detailed bug report, just in case if somebody wants to refer to it when fixing it ;)</div>
<div><a href="http://redmine.gromacs.org/issues/1023">http://redmine.gromacs.org/issues/1023</a></div><div><br></div><div>Cheers,</div>Szilárd<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><div>
<br>
Cheers,<br>
<br>
Berk<div><div class="h5"><br>
<br>
On 10/18/2012 01:01 PM, Szilárd Páll wrote:<br>
</div></div></div><div><div class="h5">
<blockquote type="cite">
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.
<div> <br>
</div>
<div>Any comments? Should CFLAGS work?<br>
<div><br>
<div>--<br>
Szilárd<br>
<br>
<br>
<div class="gmail_quote">On Thu, Oct 18, 2012 at 9:43 AM,
Jochen Hub <span dir="ltr"><<a href="mailto:jhub@gwdg.de" target="_blank">jhub@gwdg.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Following Szilard, I tried to use<br>
<br>
cmake -DCMAKE_C_FLAGS=-mfma4 ...<br>
<br>
instead of export CFLAGS=-mfma4 to add the -mfma4 flag.
Now, the only difference in CMakeCache.txt is<br>
<br>
< CMAKE_C_FLAGS:STRING='-mavx -Wall -Wno-unused
-Wunused-value '<br>
---<br>
> CMAKE_C_FLAGS:STRING=-mavx -Wall -Wno-unused
-Wunused-value -mfma4<br>
<br>
which is just what I wanted, right? (and the warning on
emulating FMA instructions does not appear any more).<br>
<br>
Jochen<br>
<br>
<br>
Am 10/17/12 11:28 PM, schrieb Szilárd Páll:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div> <br>
That way of calling CMake triggers an interesting
bug in the option<br>
generator and CFLAGS will essentially override
part of the<br>
auto-generated compiler options. Diff of relevant
lines in<br>
CMakeCache.txt are below, the only difference is
that the second file<br>
("+" in the diff) was generated by running
"CFLAGS=-march=native cmake...":<br>
<br>
//Flags used by the compiler during all build
types<br>
-CMAKE_C_FLAGS:STRING='-msse2 -Wall -Wno-unused
-Wunused-value '<br>
+CMAKE_C_FLAGS:STRING='-msse2 -march=native '<br>
//Flags used by the compiler during debug
builds.<br>
-CMAKE_C_FLAGS_DEBUG:STRING=-fno-inline -g<br>
+CMAKE_C_FLAGS_DEBUG:STRING=-g<br>
-//Flags used by the compiler during release
builds.<br>
-CMAKE_C_FLAGS_RELEASE:STRING=-fomit-frame-pointer
-funroll-all-loops<br>
-fexcess-precision=fast -O3 -DNDEBUG<br>
+//Flags used by the compiler during release
builds (/MD /Ob1 /Oi<br>
+// /Ot /Oy /Gs will produce slightly less
optimized but smaller<br>
+// files).<br>
+CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG<br>
<br>
As this messes with "considered to be best basic
set of options", we<br>
could state that CFLAGS should not be used, but it
might be a better<br>
alternative to make the configuration prepend the
CFLAG to the<br>
CMAKE_C_FLAGS and keep our generated set of flags
as well.<br>
<br>
I'm not sure which options is best. Thoughts?<br>
<br>
--<br>
Szilárd<br>
<br>
<br>
</div>
</div>
</blockquote>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
<br>
</div></div></div>
<br>--<br>
gmx-developers mailing list<br>
<a href="mailto:gmx-developers@gromacs.org">gmx-developers@gromacs.org</a><br>
<a href="http://lists.gromacs.org/mailman/listinfo/gmx-developers" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-developers</a><br>
Please don't post (un)subscribe requests to the list. Use the<br>
www interface or send it to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br></blockquote></div><br>