MacOS 上构建 gem5
MacOS 中只存在 python3,但是scons 只认 python,不在 系统中创建 软连接,一个是因为比较难操作;另一个是尽量不要更改系统。所以独立构件python 和scons:
1,安装python
下载源代码:
Python Source Releases | Python.org
下载了 3.9.22版本
解压:
tar zxf Python-3.9.22.tgz
构建:
./configure --prefix=/Users/a123456/ex_python/local/python3.9.22 --enable-optimake -jmake install
创建软连接 python,因为 scons 需要使用python这个名字,
ln -s /Users/a123456/ex_python/local/python3.9.22/bin/python3.9 /Users/a123456/ex_python/local/python3.9.22/bin/python
加入到PATH:
export PATH=$PATH:/Users/a123456/ex_python/local/python3.9.22/bin
2,安装 scons
下载:
https://sourceforge.net/projects/scons/files/scons/
下载3.1.2,版本不要更高,否则gem5 构建会失败。
解压:
tar zxf scons-3.1.2.tar.gzcd scons-3.1.2/
安装:
python setup.py install --standard-lib
注:这里调用的 python 是第一节中构建的python。故,scons 也会被安装到 这个python 目录中。
3,构建 gem5
下载源码:
git clone ...
cd gem5/
构建 AMDGPU:
scons build/VEGA_X86/gem5.opt -j 12
构建中:
构建OK: