G ++: no such instruction with AVX

When I compiled the program that I wrote in C ++ (for the latest version of Macbook pro, which, of course, supports the AVX instruction set), I received the following errors. I am using the latest version of g ++ obtained from Macports. Do you have any ideas on what I can do to fix the error without limiting the set of instructions available to the compiler? Is there any package in which I should try to update?

g++-mp-4.7 -std=c++11 -Wall -Ofast -march=native -fno-rtti src/raw_to_json.cpp -o bin/raw_to_json.bin
/var/folders/83/tjczqmxn1y9166m642_rxdlw0000gn/T//cc0hIx0w.s:1831:no such instruction: `vpxor %xmm0, %xmm0,%xmm0'
/var/folders/83/tjczqmxn1y9166m642_rxdlw0000gn/T//cc0hIx0w.s:1847:no such instruction: `vmovdqa %xmm0, 96(%rsp)'
/var/folders/83/tjczqmxn1y9166m642_rxdlw0000gn/T//cc0hIx0w.s:1848:no such instruction: `vmovdqa %xmm0, 112(%rsp)'
/var/folders/83/tjczqmxn1y9166m642_rxdlw0000gn/T//cc0hIx0w.s:1849:no such instruction: `vmovdqa %xmm0, 128(%rsp)'
/var/folders/83/tjczqmxn1y9166m642_rxdlw0000gn/T//cc0hIx0w.s:1850:no such instruction: `vmovdqa %xmm0, 144(%rsp)'
/var/folders/83/tjczqmxn1y9166m642_rxdlw0000gn/T//cc0hIx0w.s:1851:no such instruction: `vmovdqa %xmm0, 160(%rsp)'

Thanks for the help!

+5
source share
2 answers

Fixed thanks to Conrado PLG's answer to his own question here . In short, I had to do the following:

  • as, /opt/local/bin/../local/libexec/as/x86_64/as.
  • script , , /opt/local/bin/../local/libexec/as/x86_64/as.
  • sudo chmod +x script.

, - , script.

+4

, , -Wa,-q . man- as ( 1.38):

-q clang (1) GNU.

+6

All Articles