<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">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>
      <br>
      Cheers,<br>
      <br>
      Berk<br>
      <br>
      On 10/18/2012 01:01 PM, Szil&aacute;rd P&aacute;ll wrote:<br>
    </div>
    <blockquote
cite="mid:CANnYEw5u6ua76dVa2E6PVZRbiGfH+-5ULkWOa4P6tCkxFHDcbQ@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      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&nbsp;current&nbsp;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&aacute;rd<br>
            <br>
            <br>
            <div class="gmail_quote">On Thu, Oct 18, 2012 at 9:43 AM,
              Jochen Hub <span dir="ltr">&lt;<a moz-do-not-send="true"
                  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='-mavx &nbsp;-Wall -Wno-unused
                -Wunused-value &nbsp;'<br>
                ---<br>
                &gt; CMAKE_C_FLAGS:STRING=-mavx &nbsp;-Wall -Wno-unused
                -Wunused-value &nbsp;-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&aacute;rd P&aacute;ll:<br>
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  <div>
                    <div class="h5"> <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>
                      &nbsp; //Flags used by the compiler during all build
                      types<br>
                      -CMAKE_C_FLAGS:STRING='-msse2 &nbsp;-Wall -Wno-unused
                      -Wunused-value &nbsp;'<br>
                      +CMAKE_C_FLAGS:STRING='-msse2 &nbsp;-march=native '<br>
                      &nbsp; //Flags used by the compiler during debug
                      builds.<br>
                      -CMAKE_C_FLAGS_DEBUG:STRING=-fno-inline &nbsp;-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 &nbsp;-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&aacute;rd<br>
                      <br>
                      <br>
                    </div>
                  </div>
                </blockquote>
              </blockquote>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>