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 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>
(&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=-<u></u>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=<u></u>-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=<u></u>-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>
On Wed, Oct 17, 2012 at 10:12 PM, Jochen Hub &lt;<a href="mailto:jhub@gwdg.de" target="_blank">jhub@gwdg.de</a><br></div></div><div class="im">
&lt;mailto:<a href="mailto:jhub@gwdg.de" target="_blank">jhub@gwdg.de</a>&gt;&gt; wrote:<br>
<br>
    Hi all,<br>
<br>
    many thanks for the help. I now compiled with gcc 4.7 and with<br>
    manually adding export CFLAGS=-mfma4 (that is what you meant,<br>
    right?). Now the warning does not appear any more.<br>
<br>
    I am not sure though how Gromacs performed on this hardware using<br>
    these settings, as the AVX kernels are apparently not in release-4.6.<br>
<br>
    Thanks,<br>
    Jochen<br>
<br>
<br>
    Am 10/17/12 5:12 PM, schrieb Szilárd Páll:<br>
<br>
        On Wed, Oct 17, 2012 at 4:46 PM, Berk Hess &lt;<a href="mailto:hess@kth.se" target="_blank">hess@kth.se</a><br>
        &lt;mailto:<a href="mailto:hess@kth.se" target="_blank">hess@kth.se</a>&gt;<br></div><div class="im">
        &lt;mailto:<a href="mailto:hess@kth.se" target="_blank">hess@kth.se</a> &lt;mailto:<a href="mailto:hess@kth.se" target="_blank">hess@kth.se</a>&gt;&gt;&gt; wrote:<br>
<br>
             Hi,<br>
<br>
             Apparently icc can compile the code, so than it&#39;s not<br>
        strange that<br>
             you end up in this situation. But we should avoid this from<br>
        happening.<br>
             SSE4.1 would be the next supported level, but you really<br>
        want the<br>
             vex instructions and not plain SSE, as the latter is much<br>
        slower.<br>
<br>
<br>
        AMD explicitly states that only up to -msse3 should be used on<br>
        Bulldozer<br>
        and I have never tried to generate SSE4.1 instructions with icc<br>
        and run<br>
        it on AMD. I would not be surprised if it didn&#39;t work.<br>
<br>
        --<br>
        Szilárd<br>
<br>
             The best thing would be to use gcc, preferably 4.7.<br>
<br>
             Cheers,<br>
<br>
             Berk<br>
<br>
             ----- Reply message -----<br>
             From: &quot;Szilárd Páll&quot; &lt;<a href="mailto:szilard.pall@cbr.su.se" target="_blank">szilard.pall@cbr.su.se</a><br>
        &lt;mailto:<a href="mailto:szilard.pall@cbr.su.se" target="_blank">szilard.pall@cbr.su.se</a><u></u>&gt;<br></div><div class="im">
             &lt;mailto:<a href="mailto:szilard.pall@cbr.su.se" target="_blank">szilard.pall@cbr.su.se</a><br>
        &lt;mailto:<a href="mailto:szilard.pall@cbr.su.se" target="_blank">szilard.pall@cbr.su.se</a><u></u>&gt;__&gt;&gt;<br>
             To: &quot;Discussion list for GROMACS development&quot;<br>
             &lt;<a href="mailto:gmx-developers@gromacs.org" target="_blank">gmx-developers@gromacs.org</a><br>
        &lt;mailto:<a href="mailto:gmx-developers@gromacs.org" target="_blank">gmx-developers@<u></u>gromacs.org</a>&gt;<br></div><div class="im">
        &lt;mailto:<a href="mailto:gmx-developers@" target="_blank">gmx-developers@</a>__<a href="http://gromacs.org" target="_blank">groma<u></u>cs.org</a><br>
        &lt;mailto:<a href="mailto:gmx-developers@gromacs.org" target="_blank">gmx-developers@<u></u>gromacs.org</a>&gt;&gt;&gt;<br>
             Subject: [gmx-developers] warning Emulating FMA<br>
        instructions - this<br>
             is probably not what you want!<br>
             Date: Wed, Oct 17, 2012 15:25<br>
<br>
<br>
             Hi,<br>
<br>
             First of all, as far as I know, the new icc 13 can not generate<br>
             AMD-compatible FMA4/XOP (v12 surely cant:<br></div>
        <a href="http://developer.amd.com/__Assets/CompilerOptQuickRef-__62004200.pdf" target="_blank">http://developer.amd.com/__<u></u>Assets/CompilerOptQuickRef-__<u></u>62004200.pdf</a><br>
        &lt;<a href="http://developer.amd.com/Assets/CompilerOptQuickRef-62004200.pdf" target="_blank">http://developer.amd.com/<u></u>Assets/CompilerOptQuickRef-<u></u>62004200.pdf</a>&gt;),<div class="im"><br>
             so I find it strange that you&#39;ve ended up with<br>
             GMX_ACCELERATION=AVX_128_FMA using an Intel compiler --<br>
        unless you<br>
             set the acceleration manually. To get FMA4 support you need<br>
        to use a<br>
             recent gcc version, the newer the better. The Verlet<br>
        kernels don&#39;t<br>
             benefit much from FMA4, so if you want to, you can use Intel<br>
             Compiler, but then you need to set the acceleration to SSE2<br>
        (max<br>
             SSE3 works, but we don&#39;t use these instructions).<br>
<br>
             On Wed, Oct 17, 2012 at 11:14 AM, Jochen Hub &lt;<a href="mailto:jhub@gwdg.de" target="_blank">jhub@gwdg.de</a><br>
        &lt;mailto:<a href="mailto:jhub@gwdg.de" target="_blank">jhub@gwdg.de</a>&gt;<br></div><div class="im">
             &lt;mailto:<a href="mailto:jhub@gwdg.de" target="_blank">jhub@gwdg.de</a> &lt;mailto:<a href="mailto:jhub@gwdg.de" target="_blank">jhub@gwdg.de</a>&gt;&gt;&gt; wrote:<br>
<br>
                 Hi developers,<br>
<br>
                 does anyone know how to interpret this icc warning:<br>
<br>
                 [  8%]<br>
<br></div>
        /home/jhub/src/gromacs/____<u></u>include/gmx_x86_avx_128_fma.h(<u></u>____88):<div class="im"><br>
<br>
                 warning #1224: #warning directive: Emulating FMA<br>
        instructions -<br>
                 this is probably not what you want!<br>
<br>
                    #warning Emulating FMA instructions - this is<br>
        probably not<br>
                 what you want!<br>
<br>
<br>
             This warning is related to a bug in the build system,<br>
        you&#39;ll need to<br>
             add the -mfma4 flag to the compiler flags manually.<br>
<br>
             --<br>
             Szilard<br>
<br>
<br>
                 I am compiling 46-release on a Interlagos 6378 with<br>
        OpenMPI and<br>
                 icc 13.0.0 20120731. My cmake line is:<br>
<br>
                 cmake $gmxsrc \<br></div>
                      -DFFTW_LIBRARY=$FFTW_LOCATION/<u></u>____lib/libfftw3f.a \<br>
                      -DFFTW3F_INCLUDE_DIR=$FFTW____<u></u>_LOCATION/include \<br>
<br>
          -DFFTW3F_LIBRARIES=$FFTW_____<u></u>LOCATION/lib/libfftw3f.a \<div class="im"><br>
<br>
                      -DCMAKE_INSTALL_PREFIX=$(pwd) \<br>
                      -DGMX_X11=OFF \<br>
                      -DCMAKE_CXX_COMPILER=$MPICXX \<br>
                      -DCMAKE_C_COMPILER=$MPICC \<br>
                      -DGMX_MPI=ON \<br>
                      -DGMX_PREFER_STATIC_LIBS=ON \<br>
                      -DGMX_GPU=OFF<br>
<br>
                 and cmake reported:<br>
<br>
                 -- Performing Test GNU_AVX_CFLAG<br>
                 -- Performing Test GNU_AVX_CFLAG - Success<br>
                 -- Enabling 128-bit AVX Gromacs acceleration (with<br>
                 fused-multiply add), and it will help compiler<br>
        optimization.<br>
<br>
                 Thanks a lot,<br>
                 Jochen<br>
<br>
<br>
<br>
<br>
                 --<br></div>
                 ------------------------------<u></u>____---------------------<div class="im"><br>
<br>
                 Dr. Jochen Hub<br>
                 Computational Molecular Biophysics Group<br>
                 Institute for Microbiology and Genetics<br>
                 Georg-August-University of Göttingen<br>
                 Justus-von-Liebig-Weg 11, 37077 Göttingen, Germany.<br>
                 Phone: <a href="tel:%2B49-551-39-14189" value="+495513914189" target="_blank">+49-551-39-14189</a> &lt;tel:%2B49-551-39-14189&gt;<br></div>
        &lt;tel:%2B49-551-39-14189&gt;<br>
        <a href="http://cmb.bio.uni-goettingen." target="_blank">http://cmb.bio.uni-goettingen.</a><u></u>____de/<br>
                 &lt;<a href="http://cmb.bio.uni-__goettingen.de/" target="_blank">http://cmb.bio.uni-__<u></u>goettingen.de/</a><br>
        &lt;<a href="http://cmb.bio.uni-goettingen.de/" target="_blank">http://cmb.bio.uni-<u></u>goettingen.de/</a>&gt;&gt;<br>
                 ------------------------------<u></u>____---------------------<div class="im"><br>
                 --<br>
                 gmx-developers mailing list<br>
        <a href="mailto:gmx-developers@gromacs.org" target="_blank">gmx-developers@gromacs.org</a> &lt;mailto:<a href="mailto:gmx-developers@gromacs.org" target="_blank">gmx-developers@<u></u>gromacs.org</a>&gt;<br></div>

        &lt;mailto:<a href="mailto:gmx-developers@" target="_blank">gmx-developers@</a>__<a href="http://gromacs.org" target="_blank">groma<u></u>cs.org</a><br>
        &lt;mailto:<a href="mailto:gmx-developers@gromacs.org" target="_blank">gmx-developers@<u></u>gromacs.org</a>&gt;&gt;<br>
        <a href="http://lists.gromacs.org/____mailman/listinfo/gmx-____developers" target="_blank">http://lists.gromacs.org/____<u></u>mailman/listinfo/gmx-____<u></u>developers</a><br>
        &lt;<a href="http://lists.gromacs.org/__mailman/listinfo/gmx-__developers" target="_blank">http://lists.gromacs.org/__<u></u>mailman/listinfo/gmx-__<u></u>developers</a>&gt;<div class="im"><br>
<br>
<br>
        &lt;<a href="http://lists.gromacs.org/__mailman/listinfo/gmx-__developers" target="_blank">http://lists.gromacs.org/__<u></u>mailman/listinfo/gmx-__<u></u>developers</a><br>
        &lt;<a href="http://lists.gromacs.org/mailman/listinfo/gmx-developers" target="_blank">http://lists.gromacs.org/<u></u>mailman/listinfo/gmx-<u></u>developers</a>&gt;&gt;<br>
                 Please don&#39;t post (un)subscribe requests to the list.<br>
        Use the<br>
                 www interface or send it to<br></div>
        gmx-developers-request@__<a href="http://groma__cs.org" target="_blank">groma<u></u>__cs.org</a> &lt;<a href="http://gromacs.org" target="_blank">http://gromacs.org</a>&gt;<br>
                 &lt;mailto:<a href="mailto:gmx-developers-__request@gromacs.org" target="_blank">gmx-developers-__<u></u>request@gromacs.org</a><div class="im"><br>
        &lt;mailto:<a href="mailto:gmx-developers-request@gromacs.org" target="_blank">gmx-developers-<u></u>request@gromacs.org</a>&gt;&gt;.<br>
<br>
<br>
<br>
             --<br>
             gmx-developers mailing list<br>
        <a href="mailto:gmx-developers@gromacs.org" target="_blank">gmx-developers@gromacs.org</a> &lt;mailto:<a href="mailto:gmx-developers@gromacs.org" target="_blank">gmx-developers@<u></u>gromacs.org</a>&gt;<br></div>

        &lt;mailto:<a href="mailto:gmx-developers@" target="_blank">gmx-developers@</a>__<a href="http://gromacs.org" target="_blank">groma<u></u>cs.org</a><div class="im"><br>
        &lt;mailto:<a href="mailto:gmx-developers@gromacs.org" target="_blank">gmx-developers@<u></u>gromacs.org</a>&gt;&gt;<br>
<br>
        <a href="http://lists.gromacs.org/__mailman/listinfo/gmx-__developers" target="_blank">http://lists.gromacs.org/__<u></u>mailman/listinfo/gmx-__<u></u>developers</a><br>
        &lt;<a href="http://lists.gromacs.org/mailman/listinfo/gmx-developers" target="_blank">http://lists.gromacs.org/<u></u>mailman/listinfo/gmx-<u></u>developers</a>&gt;<br>
             Please don&#39;t post (un)subscribe requests to the list. Use the<br>
             www interface or send it to<br>
        gmx-developers-request@__<a href="http://gromacs.org" target="_blank">groma<u></u>cs.org</a><br>
        &lt;mailto:<a href="mailto:gmx-developers-request@gromacs.org" target="_blank">gmx-developers-<u></u>request@gromacs.org</a>&gt;<br></div>
             &lt;mailto:<a href="mailto:gmx-developers-__request@gromacs.org" target="_blank">gmx-developers-__<u></u>request@gromacs.org</a><br>
        &lt;mailto:<a href="mailto:gmx-developers-request@gromacs.org" target="_blank">gmx-developers-<u></u>request@gromacs.org</a>&gt;&gt;.<div class="im"><br>
<br>
<br>
<br>
<br>
<br>
    --<br>
    ------------------------------<u></u>__---------------------<br>
    Dr. Jochen Hub<br>
    Computational Molecular Biophysics Group<br>
    Institute for Microbiology and Genetics<br>
    Georg-August-University of Göttingen<br>
    Justus-von-Liebig-Weg 11, 37077 Göttingen, Germany.<br>
    Phone: <a href="tel:%2B49-551-39-14189" value="+495513914189" target="_blank">+49-551-39-14189</a> &lt;tel:%2B49-551-39-14189&gt;<br>
    <a href="http://cmb.bio.uni-goettingen." target="_blank">http://cmb.bio.uni-goettingen.</a><u></u>__de/ &lt;<a href="http://cmb.bio.uni-goettingen.de/" target="_blank">http://cmb.bio.uni-<u></u>goettingen.de/</a>&gt;<br>

    ------------------------------<u></u>__---------------------<br>
<br>
<br>
</div></blockquote>
<br>
-- <br><div class="im">
------------------------------<u></u>---------------------<br>
Dr. Jochen Hub<br>
Computational Molecular Biophysics Group<br>
Institute for Microbiology and Genetics<br>
Georg-August-University of Göttingen<br>
Justus-von-Liebig-Weg 11, 37077 Göttingen, Germany.<br>
Phone: <a href="tel:%2B49-551-39-14189" value="+495513914189" target="_blank">+49-551-39-14189</a><br>
<a href="http://cmb.bio.uni-goettingen.de/" target="_blank">http://cmb.bio.uni-goettingen.<u></u>de/</a><br>
------------------------------<u></u>---------------------<br></div><div class="im">
-- <br>
gmx-developers mailing list<br>
<a href="mailto:gmx-developers@gromacs.org" target="_blank">gmx-developers@gromacs.org</a><br>
</div><a href="http://lists.gromacs.org/mailman/listinfo/gmx-developers" target="_blank">http://lists.gromacs.org/<u></u>mailman/listinfo/gmx-<u></u>developers</a><br>
Please don&#39;t post (un)subscribe requests to the list. Use the www interface or send it to <a href="mailto:gmx-developers-request@gromacs.org" target="_blank">gmx-developers-request@<u></u>gromacs.org</a>.<br>
</blockquote></div><br></div></div></div>