我非常绝望……我正在使用Ubuntu 18.04.3 LTS作为一个机器人类,我必须使用make命令来构建他们的项目(在从git克隆它之后)。过了一段时间后,我收到了以下内容:enter image description here (...)
make[1]: Entering directory '/home/fia/robotics-course/rai/rai/ry'
* UpToDate ../../rai/Kin/libKin.so
* UpToDate ../../rai/Core/libCore.so
* UpToDate ../../rai/KOMO/libKOMO.so
* UpToDate ../../rai/LGP/libLGP.so
g++ -g -march=native -Wall -DRAI_PYBIND `python3-config --cflags` -Wno-terminate -fPIC -std=c++14 -o lgp-py.o -c lgp-py.cpp
* UpToDate ../../rai/Operate/libOperate.so
g++ -g -march=native -Wall -DRAI_PYBIND `python3-config --cflags` -Wno-terminate -fPIC -std=c++14 -o ry.o -c ry.cpp
* UpToDate ../../rai/Perception/libPerception.so
* UpToDate ../../rai/RosCom/libRosCom.so
g++ -L/home/fia/robotics-course/rai/lib -L/usr/local/lib -o libry.so ./lgp-py.o ./ry.o -lCore -lKin -lKOMO -lLGP -lOperate -lRosCom -lPerception `python3-config --ldflags` -lrt -shared
lto1: internal compiler error: in lto_tag_to_tree_code, at lto-streamer.h:1005
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
lto-wrapper: fatal error: g++ returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
../../build/generic.mk:299: recipe for target 'libry.so' failed
make[1]: *** [libry.so] Error 1
make[1]: Target 'default' not remade because of errors.
make[1]: Leaving directory '/home/fia/robotics-course/rai/rai/ry'
***** FAILED rai/rai/ry/libry.so
我假设“内部编译器错误”这一行告诉我哪里出了问题,但我不知道如何解决它……我重新安装了g++,也重新下载了几次git存储库,但似乎都不起作用。我已经想过可能是我的操作系统有问题?我已经想过重新安装Ubuntu了.
所以,如果任何人有一个想法,我将非常感谢!关于Fia
发布于 2019-11-13 23:17:25
“内部编译器错误”听起来像是编译器中有一个bug,所以这里有一些想法来尝试解决这个问题。
您可以尝试使用clang++而不是g++来编译它。使用以下命令安装它:
sudo apt-get install clang
然后使用如下代码进行构建:
CC=clang CXX=clang++ LD=clang make
因为该错误提到了lto
,所以您还可以关闭链接时间优化:
LDFLAGS=-fno-lto make
https://stackoverflow.com/questions/58840044
复制相似问题