I\'m building tensorflow from source with bazel, as described here:
https://www.tensorflow.org/install/install_sources
Following the installation doc, I
The error message tells me your program was compiled with instructions your processor doesn't have and a look at your build string makes me suspect of -mavx2
and -mfma
which AFAIK are implemented only in rather recent (and high-end) CPUs.
Please note, gcc will compile just fine with flags for instructions your CPU doesn't support, but the program won't run on your machine.
To make sure your CPU supports those flags, run in bash gcc -march=native -Q --help=target | grep enabled
and check that the output contains all the build flags you want to use (with the exception of -mfpmath
which doesn't show as enabled or disabled since it allows a list of output. For that you'll need to check the full gcc -march=...
command output).
To answer to your final comment, there is no way to "enable" these instructions, they are implemented in hardware and either they are available on your CPU, or they aren't.