error in compilation with gfortran 5.4.0, -march=native


Clicked A Few Times
Dear all,

I compiled nwchem-6.3 on CentOS release 6.8, with gfortran-5.4.0, mpich2-1.5.
I got the following error message:




gfortran -c -m64 -ffast-math -fdefault-integer-8 -Warray-bounds -O3 -mfpmath=sse -ffast-math -fprefetch-loop-arrays -fno-aggressive-loop-optimizations -march=native -mtune=native -I. -I/export/home/ylniu/program/nwchem/nwchem-6.3-gfortran/src/include -I/export/home/ylniu/program/nwchem/nwchem-6.3-gfortran/src/tools/install/include -DGFORTRAN -DEXT_INT -DLINUX -DLINUX64 -DCHKUNDFLW -DGCC4 -DGCC46 -DPARALLEL_DIAG geom_hnd.F
/tmp/cctq1pa4.s: Assembler messages:
/tmp/cctq1pa4.s:358: Error: no such instruction: `vpbroadcastq %xmm6,%ymm0'
/tmp/cctq1pa4.s:359: Error: suffix or operands invalid for `vpaddq'
/tmp/cctq1pa4.s:373: Error: suffix or operands invalid for `vpaddq'
/tmp/cctq1pa4.s:693: Error: no such instruction: `vgatherqpd %ymm12,(%r8,%ymm2,8),%ymm3'
/tmp/cctq1pa4.s:695: Error: no such instruction: `vgatherqpd %ymm13,(%r8,%ymm10,8),%ymm2'
/tmp/cctq1pa4.s:707: Error: no such instruction: `vgatherqpd %ymm15,(%r8,%ymm3,8),%ymm2'




I found that when I delete "-march=native" option, there is no error output.

And I found that in the file: src/config/makefile.h
1987 ifeq ($(GNU_GE_4_6),true)
1988 FOPTIMIZE += -march=native -mtune=native
1989 else

I searched the option of gfortran compiler:
http://www.linuxcommand.org/man_pages/gfortran1.html
      gfortran [-c?-S?-E]
[-g] [-pg] [-Olevel]
[-Wwarn...] [-pedantic]
[-Idir...] [-Ldir...]
[-Dmacro[=defn]...] [-Umacro]
[-foption...] [-mmachine-option...]
[-o outfile] infile...

So, my question is:
What does "-march=native -mtune=native" mean? Is it necessary to keep this option? Can I delete this option for the whole compilation?

Forum Vet
Yes, you can delete that line. The only drawback is a potential degradation in performance.
However, since you cannot compile it using that option, ...

Clicked A Few Times
Thanks very much for your so quick reply! It is a pity that I can compile successfully with gfortran 4.4.7 with the options "-march=native -mtune=native". But it failed with gfortran 5.4.0. And it is hard to google the detail of such options for me. Now I know that the drawback of the degradation in performance. And thanks again for your kindly reply.

Forum Vet
Quote:Ylniu Dec 9th 5:23 am
Thanks very much for your so quick reply! It is a pity that I can compile successfully with gfortran 4.4.7 with the options "-march=native -mtune=native". But it failed with gfortran 5.4.0. And it is hard to google the detail of such options for me. Now I know that the drawback of the degradation in performance. And thanks again for your kindly reply.


The options "-march=native -mtune=native" are used only for gfortran 4.6 and later

Your failure is due to the fact that the gfortran 5.4.0 requires a more recent version of /usr/bin/as
See related question
http://nwchemgit.github.io/Special_AWCforum/st/id2207

Clicked A Few Times
Quote:Edoapra Dec 9th 5:40 pm
Quote:Ylniu Dec 9th 5:23 am
Thanks very much for your so quick reply! It is a pity that I can compile successfully with gfortran 4.4.7 with the options "-march=native -mtune=native". But it failed with gfortran 5.4.0. And it is hard to google the detail of such options for me. Now I know that the drawback of the degradation in performance. And thanks again for your kindly reply.


The options "-march=native -mtune=native" are used only for gfortran 4.6 and later

Your failure is due to the fact that the gfortran 5.4.0 requires a more recent version of /usr/bin/as
See related question
http://nwchemgit.github.io/Special_AWCforum/st/id2207





Thanks for your explanation! The original gcc version of my linux system is gcc-4.4.7. I setup new gcc-5.4.0 in the directory: /opt/gcc-5.4.0. But I don't know how to obtain new as (different from /usr/bin/as) from the compilation of gcc-5.4.0. Can you provide some clues to get a new version of "as" command?


Forum >> NWChem's corner >> Compiling NWChem