Adding mlpack to gem5 results in build error

73 Views Asked by At

I try to add the mlpack library to gem5 in order to conduct an experiment. I have installed successfully the mlpack library on my Ubuntu 18.04 system. Then added the following includes in one of my modules:

#include <mlpack/methods/sparse_autoencoder/sparse_autoencoder_impl.hpp>
#include <mlpack/prereqs.hpp>

Build fails when reaches mlpack with a strange error within 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'

A code snippet from logging.hh where the error line is located:

#define exit_message(logger, ...)  do {                                                    \
    base_message(logger, __VA_ARGS__);              \
    logger.exit_helper();                           \
} while (0)

It seems that the problem occurs due to the macro "fatal" that is defined in gem5: logging.hh documentation

This question remains unsolved since there might be a workaround for it. I have already published this issue in gem5 mailing list.

0

There are 0 best solutions below