Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
520 views
in Technique[技术] by (71.8m points)

gcc - Could not build gem5 on a machine with anaconda: "lto1: fatal error: bytecode stream"

When I tried to build gem5 with command scons build/X86/gem5.opt -j12, I received an error message saying

lto1: fatal error: bytecode stream in file '/home/beihai/anaconda3/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.a' generated with LTO version 6.0 instead of the expected 8.1

I think it might be the problem of wrong gcc version. But I do not know how to fix it.

My system is Kubuntu 20.04

By running gcc -v, I got the global gcc version gcc version 9.3.0

By running /home/beihai/anaconda/envs/gem5build/bin/x86_64-conda_cos6-linux-gnu-gcc -v, I got the anaconda gcc version gcc version 7.3.0 (crosstoll-NG 1.23.0.449-a04d0)

Please tell me how to fix this problem.

question from:https://stackoverflow.com/questions/65602198/could-not-build-gem5-on-a-machine-with-anaconda-lto1-fatal-error-bytecode-st

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I came across almost the same issue, except that mine said "LTO version 6.0 instead of the expected 6.2".

I searched for general solution for LTO compatibility issue and got some inspiration from this link: https://github.com/rust-lang/rust/issues/57176 Quick take from the above link: "I've looked into how this is related to python and found that the error only happens with python installed through anaconda."

So I removed my entire anaconda software package, and removed the build directory inside Gem5, and rerun the scon commands with an additional "--force-lto" arguments, now the installation is successful. Hope it can solve your issue as well.

The command I used: "scons --force-lto build/X86/gem5.opt -j6"

My setups is: Ubuntu 18 withe kernel 4.15.0-134-generic g++ --version = g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...