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

标签 scons gem5

我正在尝试在全新安装的 Ubuntu 20.04 上安装 gem5,并使用 commit 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

然后,当我尝试使用构建 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 中实现的构建系统的结果,该系统只需要 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 系统上对我有用。

关于scons - gem5 scons 构建失败,错误为 "TypeError: argument should be integer or bytes-like object, not ' str'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61879640/

相关文章:

gem5 - gem5 CPU 型号之间有什么区别,哪一个对于我的模拟来说更准确?

python - 构建 gem5.opt 时,我得到 'ImportError: no module named six'

gem5 - Gem5 如何接受和解码来自用户的可执行文件?

c++ - Scons 重新编译我的代码

python - 如何在python脚本中设置环境变量

python - 未使用的变量错误,gem5

c++ - 为什么scons会忽略我在SConscript中的CXXFlags

scons - 当我有自定义构建器时,是什么触发 scons 构建文件?

openmp - 如何在 gem5 完整系统中编译和运行 C 程序(使用 OpenMP)?

c - Intel/ARM 内在函数等价