AutoPas / AutoPas

Autopas is a node-level auto-tuned particle simulation library developed in the context of the TaLPas project.
https://autopas.github.io
BSD 2-Clause "Simplified" License
35 stars 9 forks source link

FCC doesn't know std::transform_reduce() #746

Open FG-TUM opened 1 year ago

FG-TUM commented 1 year ago

Describe the bug FCC 4.8.1 in Clang mode doesn't know std::transform_reduce() which is part of C++17. Seems to be missing in its std lib.

To Reproduce Compile md-flex with FCC.

Compiler Version

FCC (FCC) 4.8.1 20220831
clang: Fujitsu C/C++ Compiler 4.8.1 (Jul 27 2022 13:00:20) (based on LLVM 7.1.0)
Target: aarch64-unknown-linux-gnu

Workaround Currently std::transform_reduce() is only used in ArrayUtils::balanceVectors(). There one can simply replace the call with:

  // const size_t numElem = std::transform_reduce(vecvec.begin(), vecvec.end(), 0, std::plus<>(),
  //                                              [&](auto &vec) { return innerContainerToVec(vec).size(); });
  const size_t numElem = [&]() {
      size_t n = 0;
      for( auto &vec : vecvec) {
          n += innerContainerToVec(vec).size();
      }
      return n;
  }();
FG-TUM commented 1 year ago

@dmartin13 if you test something on the ARM cluster this will affect you.