On Thu, Oct 18, 2012 at 1:24 PM, Berk Hess <span dir="ltr">&lt;<a href="mailto:hess@kth.se" target="_blank">hess@kth.se</a>&gt;</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&#39;t know of any other reason for -mfma4 to be omitted. Here&#39;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&#39;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&#39;m not even sure that cmake is not
      supposed to pick up CLAGS as well and it&#39;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">&lt;<a href="mailto:jhub@gwdg.de" target="_blank">jhub@gwdg.de</a>&gt;</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>
                &lt; CMAKE_C_FLAGS:STRING=&#39;-mavx  -Wall -Wno-unused
                -Wunused-value  &#39;<br>
                ---<br>
                &gt; 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>
                      (&quot;+&quot; in the diff) was generated by running
                      &quot;CFLAGS=-march=native cmake...&quot;:<br>
                      <br>
                        //Flags used by the compiler during all build
                      types<br>
                      -CMAKE_C_FLAGS:STRING=&#39;-msse2  -Wall -Wno-unused
                      -Wunused-value  &#39;<br>
                      +CMAKE_C_FLAGS:STRING=&#39;-msse2  -march=native &#39;<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 &quot;considered to be best basic
                      set of options&quot;, 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&#39;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&#39;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>