gem5源码地址:https://gem5.googlesource.com/public/gem5
GitHub镜像:https://github.com/gem5/gem5
安装参考:
http://www.gem5.org/documentation/learning_gem5/part1/building/
http://www.gem5.org/documentation/general_docs/building#dependencies
参考官网的依赖推荐:
http://www.gem5.org/documentation/general_docs/building#dependencies
如果expected的版本比前者低,说明可能需要提高gcc的版本。
一般不会出现这种问题,基本上系统默认的gcc版本是没问题的。
build/ARM/arch/arm/lib.o.partial: In function `ArmSemihosting::callTmpNam(ThreadContext*, unsigned long, unsigned long, unsigned long)':
xxx/build/ARM/arch/arm/semihosting.cc:453: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
build/ARM/base/lib.o.partial: In function `Stats::Hdf5::begin()':
xxx/build/ARM/base/stats/hdf5.cc:82: undefined reference to `H5::CommonFG::openGroup(char const*) const'
build/ARM/base/lib.o.partial: In function `Stats::Hdf5::beginGroup(char const*)':
xxx/build/ARM/base/stats/hdf5.cc:109: undefined reference to `H5::CommonFG::openGroup(char const*) const'
xxx/build/ARM/base/stats/hdf5.cc:113: undefined reference to `H5::CommonFG::createGroup(char const*, unsigned long) const'
xxx/build/ARM/base/stats/hdf5.cc:111: undefined reference to `H5::CommonFG::createGroup(char const*, unsigned long) const'
build/ARM/base/lib.o.partial: In function `Stats::Hdf5::addMetaData(H5::DataSet&, char const*, double)':
xxx/build/ARM/base/stats/hdf5.cc:310: undefined reference to `H5::H5Location::createAttribute(char const*, H5::DataType const&, H5::DataSpace const&, H5::PropList const&) const'
build/ARM/base/lib.o.partial: In function `Stats::Hdf5::addMetaData(H5::DataSet&, char const*, std::vector > const&)':
xxx/build/ARM/base/stats/hdf5.cc:278: undefined reference to `H5::H5Location::createAttribute(char const*, H5::DataType const&, H5::DataSpace const&, H5::PropList const&) const'
build/ARM/base/lib.o.partial: In function `Stats::Hdf5::addMetaData(H5::DataSet&, char const*, std::__cxx11::basic_string, std::allocator > const&)':
xxx/build/ARM/base/stats/hdf5.cc:300: undefined reference to `H5::H5Location::createAttribute(char const*, H5::DataType const&, H5::DataSpace const&, H5::PropList const&) const'
build/ARM/base/lib.o.partial: In function `Stats::Hdf5::appendStat(Stats::Info const&, int, unsigned long long*, double const*)':
xxx/build/ARM/base/stats/hdf5.cc:228: undefined reference to `H5::CommonFG::openDataSet(std::__cxx11::basic_string, std::allocator > const&) const'
xxx/build/ARM/base/stats/hdf5.cc:251: undefined reference to `H5::CommonFG::createDataSet(std::__cxx11::basic_string, std::allocator > const&, H5::DataType const&, H5::DataSpace const&, H5::DSetCreatPropList const&) const'
build/ARM/base/lib.o.partial: In function `Stats::Hdf5::addMetaData(H5::DataSet&, char const*, std::__cxx11::basic_string, std::allocator > const&)':
xxx/build/ARM/base/stats/hdf5.cc:300: undefined reference to `H5::H5Location::createAttribute(char const*, H5::DataType const&, H5::DataSpace const&, H5::PropList const&) const'
collect2: error: ld returned 1 exit status
scons: *** [build/ARM/gem5.opt] Error 1
scons: building terminated because of errors.
一般来说,warning的问题是可以忽略(不绝对),尝试过的方法有:
(1) 在编译命令后面加上“-wno-deprecated-copy”,即
scons build/ARM/gem5.opt -j8 -wno-deprecated-copy
虽然没有报错,但实际上编译不成功,可以看到gem5/build目录下没有生成gem5.opt文件。
参考:
【1】https://stackoverflow.com/questions/58932201/having-hdf5-cc-causes-errors-in-gem5-build
【2】https://gem5-review.googlesource.com/c/public/gem5/+/31754
(2) 在编译命令后面加上“USE_HDF5=0”,即:
scons build/ARM/gem5.opt -j10 USE_HDF5=0
编译成功了,可以看到gem5/build目录下生成gem5.opt文件。
(3) 重新下载源码
git clone https://gem5.googlesource.com/public/gem5
(4) python-config的版本不是自己想要的
因为是在服务器上进行编译的,所以可能会出现总是识别成python的其他版本,那么可以尝试使用venv搭建一个虚拟环境之后再进行编译。
已放弃 (核心已转储)
大多原因是kernel、bootloader、disk的路径不正确,仔细检查路径拼写是否正确。
fatal condition domain_id == SrcClockDomain::emptyDomainID occurred: DVFS: Controlled domain system.littleCluster.clk_domain needs to have a properly assigned ID.
安装官网教程
http://www.gem5.org/documentation/learning_gem5/part2/arm_dvfs_support/