Skip to content

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

@mauneyc-LANL

Description

@mauneyc-LANL

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:

  • Reduced header dependencies, leading to faster compilation for some code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions