[gem5和Scons TypeError进行安装

问题描述 投票:2回答:1

我正在尝试在Ubuntu 20.04的全新安装上安装gem5,并使用commit 9fc9c67b4242c03f165951775be5cd0812f2a705。我用过了http://learning.gem5.org/book/part1/building.htmlhttps://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

然后,当我尝试使用构建gem5时

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 gem5
1个回答
1
投票

是。这是运行以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系统上为我工作。

© www.soinside.com 2019 - 2024. All rights reserved.