Compile errors with Assembler messages

泪湿孤枕 提交于 2019-12-01 10:55:13
RobertaRavanelli

You can use the command below to see what is your CPU (for the compiler): gcc -march=native -Q --help=target | grep march

Then you can add your cpu type in the ccmake CMAKE_CXX_FLAGS option, for me: CMAKE_CXX_FLAGS = -march=corei7-avx

Swagatika

You can add -march=native -mno-avx This worked for me.

In my CMakeLists.txt, I added the above to the CMAKE_CXX_FLAGS :

SET(CMAKE_CXX_FLAGS "-ggdb -O3 -fPIC -std=c++0x -march=native -mno-avx")

[Source can be found in this page.]

I faced this issue when trying to install glove.

The problem I faced was resolved by upgrading the g++ version installed in my ubuntu 14.04 machine.

My original g++ version was 4.6.4 and I upgraded it to the g++-5 (5.4.1 when I upgraded it).

dasons

There are error message from assembler, which means assembler doesn't know these assembly code, for example vfmadd312ss.

This happens when compiler generate some CPU only assembly code, for example intel E5 with arch core-avx2 have extra instruction set advanced vector extensions, but if "as" is tool old to know the new CPUs, this error would happen.

Try a new version Binutils, the latest is 2.29 now.

If you compile code from another tool, for example bazel, make sure it will call the new "as".

RBB

I have met the same error messages, I removed the -march=native from CXXFLAGS and CFLAGS in my makefile, it works in my case. But since you didn't put out your makefile, I am not sure this will works in your case, any way you can have a try.

You probably need to enable advanced vector extensions when compiling (and use toolchain that supports this). Try -march=core-avx2 or something similar.

If you compiled library yourself, it is possible you need to configure it to not use AVX.

Have you tried using a different compiler?

I had assembler errors in a project using Point Cloud Library. It was possibly due to using Ubuntu 12.04 on an core i7 processor (see https://github.com/uzh-rpg/rpg_svo/issues/7).

I was able to compile by installing the 'clang' compiler

sudo apt-get install clang

and then running cmake with:

cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ .
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!