python - 我该如何解决lto1 : internal compiler error: in lto_tag_to_tree_code, at lto-streamer.h:1005 that appears after 'make' command

标签 python c++ compiler-errors g++ internal-compiler-error

我非常绝望...我正在使用Ubuntu 18.04.3 LTS
对于机器人类(class),我不得不使用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 ...

因此,如果有人有想法,我将非常感谢!
问候
菲亚

最佳答案

“内部编译器错误”听起来像是编译器中有一个错误,因此这里有一些解决方法。

您可以尝试使用clang++而不是g++进行编译。使用以下方法安装:

sudo apt-get install clang

然后使用类似以下内容进行构建:
CC=clang CXX=clang++ LD=clang make

由于错误提到了lto,因此您还可以关闭链接时优化:
LDFLAGS=-fno-lto make

关于python - 我该如何解决lto1 : internal compiler error: in lto_tag_to_tree_code, at lto-streamer.h:1005 that appears after 'make' command,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58840044/

相关文章:

python - Flask/Jinja 列表中的下拉菜单

python - 使 django 应用程序在 127.0.0.1 :8000 accessible everywhere? 上运行

c++ - 如何自定义windows默认右键弹出菜单

c++ - 如何在模板中定义迭代器?

c# - 无法创建变量类型 'Item' 的实例,因为它没有 new() 约束

python - 图书对象不可迭代 : Trying to display similar objects of an instance based on a field

python - 名称错误 : name 'textSuface' is not defined

c++ - 在cuda中,内核函数中没有完全显示线程索引

c++ - 获取应用程序的内存使用错误

c++ - 打印 vector 成员。错误