gem5 scons 构建失败,"TypeError: argument should be integer or bytes-like object, not 'str'"



我正在尝试在全新安装的 Ubuntu 5 20.04 上使用提交 9fc9c67b4242c03f165951775be5cd0812f2a705。我用过 http://learning.gem5.org/book/part1/building.html 和 https://www.gem5.org/documentation/general_docs/building 作为我的向导。据我所知,我已经安装了所有必需的依赖项(一些依赖项在这两行中重复(

sudo apt install build-essential git m4 scons zlib1g zlib1g-dev libprotobuf-dev protobuf-compiler libprotoc-dev libgoogle-perftools-dev python-dev python
sudo apt install build-essential git m4 scons zlib1g zlib1g-dev 
libprotobuf-dev protobuf-compiler libprotoc-dev libgoogle-perftools-dev 
python-dev python libboost-all-dev

然后,当我尝试使用

git clone https://gem5.googlesource.com/public/gem5
cd gem5    
scons build/X86/gem5.opt -j8

执行"scons"行后,我得到以下输出:

scons: Reading SConscript files ...
Warning: Failed to find git repo directory: a bytes-like object is required, not 'str'
TypeError: argument should be integer or bytes-like object, not 'str':
File "/home/john/gem5/SConstruct", line 355:
main['GCC'] = CXX_version and CXX_version.find('g++') >= 0

我不确定如何解决此错误,甚至不确定为什么会发生此错误;我什至不知道这个错误在说什么。任何帮助将不胜感激。

是的。这是运行在 scons 中实现的构建系统的结果,期望只有 python2。

如果你被困在这里,你可以做些什么来编译,直到 gem 项目推送他们的 Python 3 + SCons 更改。

sudo apt-get install virtualenv
# create a virtualenv which uses python 2.7
virtualenv -p python2.7 venv27
# activate the virtualenv
. venv27/bin/activate
# Install SCons in the python 2.7 virtualenv
pip install scons
# This will now use the scons installed in a python 2.7 virtualenv.
scons build/X86/gem5.opt -j8

这在 Ubuntu 20.04 系统上对我有用。

相关内容

最新更新