Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile error for --timing using clang 15.0.0 #5106

Closed
mxg opened this issue May 8, 2024 · 4 comments
Closed

compile error for --timing using clang 15.0.0 #5106

mxg opened this issue May 8, 2024 · 4 comments
Labels
area: portability Issue involves operating system/compiler portability resolution: duplicate Closed; issue or pull request already exists

Comments

@mxg
Copy link

mxg commented May 8, 2024

Apparently, in clang-15.0.0, the <coroutine> header file is part of the regular set of header files and is no longer in the experimental subdirectory. Building a design using --timing, which requires the <coroutine> header fails.

I am running on MacOS Sonoma version 14.4.1 using clang-15.0.0

The following code in verilated_timing.h always attempts to include experimental/coroutine instead of coroutine when versions of clang newer than 13.

// clang-format off
// Some preprocessor magic to support both Clang and GCC coroutines with both libc++ and libstdc++
#if defined _LIBCPP_VERSION  // libc++
# if __clang_major__ > 13  // Clang > 13 warns that coroutine types in std::experimental are deprecated
#  pragma clang diagnostic push
#  pragma clang diagnostic ignored "-Wdeprecated-experimental-coroutine"
# endif
# include <experimental/coroutine>
  namespace std {
      using namespace experimental;  // Bring std::experimental into the std namespace
  }
#else
# if defined __clang__ && defined __GLIBCXX__ && !defined __cpp_impl_coroutine
#  define __cpp_impl_coroutine 1  // Clang doesn't define this, but it's needed for libstdc++
# endif
# include <coroutine>
# if __clang_major__ < 14
   namespace std {  // Bring coroutine library into std::experimental, as Clang < 14 expects it to be there
       namespace experimental {
           using namespace std;
       }
   }
# endif
#endif
// clang-format on
@mxg mxg added the new New issue not seen by maintainers label May 8, 2024
@wsnyder
Copy link
Member

wsnyder commented May 8, 2024

See #5031

@mxg
Copy link
Author

mxg commented May 9, 2024

I look forward to PR#5031 being merged to main

@wsnyder
Copy link
Member

wsnyder commented May 10, 2024

Note #5031 still needs changes to check using configure.ac (see the ticket), perhaps you can help that.

@wsnyder wsnyder added area: portability Issue involves operating system/compiler portability status: ready Issue is ready for someone to fix; then goes to 'status: assigned' resolution: duplicate Closed; issue or pull request already exists and removed new New issue not seen by maintainers status: ready Issue is ready for someone to fix; then goes to 'status: assigned' labels May 10, 2024
@wsnyder wsnyder closed this as not planned Won't fix, can't repro, duplicate, stale May 10, 2024
@mxg
Copy link
Author

mxg commented May 11, 2024

Note #5031 still needs changes to check using configure.ac (see the ticket), perhaps you can help that.

I'm happy to help, but I need to figure out what you expect. The PR has code in configure.ac to check for <coroutine> and changes in verilated_timing.h. I'm not an autoconf expert, but if you could help me with what you're looking for, I can do the heavy lifting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: portability Issue involves operating system/compiler portability resolution: duplicate Closed; issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants