OpenBLAS: OpenBLAS fails on OS X with new -mavx2 flag

The flag -mavx2 was added on commit 43c2b0eb, which makes the building process fail on Mac OS X in Lapack code, with gcc8 as a fortran compiler:

make[2]: Entering directory /opt/local/var/macports/build/_Users_nicos_ports_local_math_OpenBLAS/OpenBLAS/work/OpenBLAS-0.3.5/lapack-netlib/SRC' /opt/local/bin/gfortran-mp-8 -O3 -m128bit-long-double -Wall -frecursive -m64 -fPIC -mavx2 -c -o sbdsvdx.o sbdsvdx.f /opt/local/bin/gfortran-mp-8 -O3 -m128bit-long-double -Wall -frecursive -m64 -fPIC -mavx2 -c -o spotrf2.o spotrf2.f /opt/local/bin/gfortran-mp-8 -O3 -m128bit-long-double -Wall -frecursive -m64 -fPIC -mavx2 -c -o sgetrf2.o sgetrf2.f /opt/local/bin/gfortran-mp-8 -O3 -m128bit-long-double -Wall -frecursive -m64 -fPIC -mavx2 -c -o sgbbrd.o sgbbrd.f /opt/local/bin/gfortran-mp-8 -O3 -m128bit-long-double -Wall -frecursive -m64 -fPIC -mavx2 -c -o sgbcon.o sgbcon.f /opt/local/bin/gfortran-mp-8 -O3 -m128bit-long-double -Wall -frecursive -m64 -fPIC -mavx2 -c -o sgbequ.o sgbequ.f /opt/local/bin/gfortran-mp-8 -O3 -m128bit-long-double -Wall -frecursive -m64 -fPIC -mavx2 -c -o sgbrfs.o sgbrfs.f /opt/local/bin/gfortran-mp-8 -O3 -m128bit-long-double -Wall -frecursive -m64 -fPIC -mavx2 -c -o sgbsv.o sgbsv.f /opt/local/var/macports/build/_Users_nicos_ports_local_math_OpenBLAS/OpenBLAS/work/.tmp/ccyLD1vQ.s:103:no such instruction: vxorps %xmm0, %xmm0,%xmm0’ /opt/local/var/macports/build/_Users_nicos_ports_local_math_OpenBLAS/OpenBLAS/work/.tmp/ccyLD1vQ.s:104:no such instruction: vcomiss (%r14), %xmm0' /opt/local/var/macports/build/_Users_nicos_ports_local_math_OpenBLAS/OpenBLAS/work/.tmp/ccyLD1vQ.s:111:no such instruction: vsqrtss (%r14), %xmm0,%xmm0’ /opt/local/var/macports/build/_Users_nicos_ports_local_math_OpenBLAS/OpenBLAS/work/.tmp/ccyLD1vQ.s:112:no such instruction: vmovss %xmm0, (%r14)' make[2]: *** [spotrf2.o] Error 1 make[2]: *** Waiting for unfinished jobs.... /opt/local/var/macports/build/_Users_nicos_ports_local_math_OpenBLAS/OpenBLAS/work/.tmp/cc2HvPr7.s:249:no such instruction: vmovd %esi, %xmm1’ /opt/local/var/macports/build/_Users_nicos_ports_local_math_OpenBLAS/OpenBLAS/work/.tmp/cc2HvPr7.s:252:no such instruction: vpbroadcastd %xmm1, %ymm1' /opt/local/var/macports/build/_Users_nicos_ports_local_math_OpenBLAS/OpenBLAS/work/.tmp/cc2HvPr7.s:257:no such instruction: vpaddd (%rcx,%rax), %ymm1,%ymm0’ /opt/local/var/macports/build/_Users_nicos_ports_local_math_OpenBLAS/OpenBLAS/work/.tmp/cc2HvPr7.s:258:no such instruction: vmovdqu %ymm0, (%rcx,%rax)' /opt/local/var/macports/build/_Users_nicos_ports_local_math_OpenBLAS/OpenBLAS/work/.tmp/cc2HvPr7.s:267:no such instruction: vzeroupper’ [snip]

Removing the flag enables the build to proceed correctly.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 19 (7 by maintainers)

Most upvoted comments

To me this looks as if your assembler (from macports version of GNU binutils package probably ?) is significantly older than your gcc. -mavx2 is supported since at least gcc/gfortran version 4.something, and it seems that your gfortran8 happily creates avx2-specific code that your assembler does not understand. Not sure how to handle this, perhaps I should add a compile test like for skylake-avx512 ?