我尝试将mlpack库添加到gem5中以进行实验。我已经在Ubuntu 18.04系统上成功安装了mlpack库。然后在我的一个模块中添加了以下内容:
#include <mlpack/methods/sparse_autoencoder/sparse_autoencoder_impl.hpp>
#include <mlpack/prereqs.hpp>
当到达mlpack并在gem5 logging.hh中出现奇怪错误时,构建失败:
/usr/include/mlpack/core/util/prefixedoutstream.hpp: In constructor 'mlpack::util::PrefixedOutStream::PrefixedOutStream(std::ostream&, const char*, bool, bool)':
build/RISCV/base/logging.hh:155:36: error: expected identifier before 'do'
#define exit_message(logger, ...) do { \
^
build/RISCV/base/logging.hh:155:36: error: expected '{' before 'do'
logging.hh中错误行所在的代码段:
#define exit_message(logger, ...) do { \
base_message(logger, __VA_ARGS__); \
logger.exit_helper(); \
} while (0)
似乎是由于定义了宏“致命”而发生了问题 在gem5中:logging.hh documentation
这个问题仍然没有解决,因为可能有解决方法。 我已经在gem5邮件列表中发布了此问题。