laristra / flecsi

A mirror of FleCSI's internal gitlab repository.
Other
67 stars 34 forks source link

build fails with gcc10, missing header in utils/demangle.cc #641

Open mauneyc-LANL opened 4 years ago

mauneyc-LANL commented 4 years ago

After a system update on my laptop, which bumped my system gcc to 10.1.1-1, I began encountering an error on spack install

>> 163    /tmp/mauneyc/spack-stage/spack-stage-flecsi-1-naxy3b4vp77p3v6a6w6xulc5gdogmzr5/spack-src/flecsi/utils/dema
            ngle.cc:24:33: error: return type 'std::string' {aka 'class std::__cxx11::basic_string<char>'} is incomple
            te
     164       24 | demangle(const char * const name) {
     165          |                                 ^
  >> 166    make[2]: *** [CMakeFiles/FleCSI.dir/build.make:125: CMakeFiles/FleCSI.dir/flecsi/utils/demangle.cc.o] Erro
            r 1
  >> 167    /tmp/mauneyc/spack-stage/spack-stage-flecsi-1-3pxuibyz4zfrgg7vou7ireuspdvgdc6f/spack-src/flecsi/utils/dema
            ngle.cc:28:58: error: 'free' is not a member of 'std'
     168       28 |     abi::__cxa_demangle(name, NULL, NULL, &status), std::free};
     169          |                                                          ^~~~
  >> 170    /tmp/mauneyc/spack-stage/spack-stage-flecsi-1-3pxuibyz4zfrgg7vou7ireuspdvgdc6f/spack-src/flecsi/utils/dema
            ngle.cc:28:62: error: no matching function for call to 'std::unique_ptr<char, void (*)(void*)>::unique_ptr
            (<brace-enclosed initializer list>)'
     171       28 |     abi::__cxa_demangle(name, NULL, NULL, &status), std::free};

this error persists when using master branch.

adding #include <string> in utils/demangle.cc fixes the error.

This may be due to a change in GCC header dependencies. From the release notes on libstdc++ changes:

cferenba commented 4 years ago

@mauneyc-LANL - Thanks for reporting this. The fix is in !227 on gitlab which is awaiting merge.