Allow compiling Dynare with Clang (failing on local_state_space_iteration_2.cc)

To preface, I am aware GCC is the official way to build Dynare.

However, from Homebrew side, we are trying to fix up some mixed OpenMP usage across dependencies (libgomp vs libomp). This currently requires a hack to get Meson to use GCC and libomp together so I wanted to try compiling code with Clang.

The build failed on local_state_space_iteration_2.cc due to https://github.com/llvm/llvm-project/issues/33025

Partly reverting 6ff7d4c5 fixes build as Clang doesn't support structured bindings in OpenMP code yet. So I wanted to check if std::tie can be used there (optionally in an #ifdef __clang__).

With modification,

  • LLVM Clang 20+ successfully compiles Dynare
  • Apple Clang (in Xcode 16.3 - 26) and LLVM Clang 18-19 would need -fexperimental-library to expose jthreads.
  • Anything older is expected to fail as jthreads was not implemented.
Assignee Loading
Time tracking Loading