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

Multi-thread example: --threads 1 (compile error) #1355

Closed
veripoolbot opened this issue Sep 28, 2018 · 5 comments
Closed

Multi-thread example: --threads 1 (compile error) #1355

veripoolbot opened this issue Sep 28, 2018 · 5 comments
Assignees
Labels
area: configure/compiling Issue involves configuring or compilating Verilator itself resolution: abandoned Closed; not enough information or otherwise never finished

Comments

@veripoolbot
Copy link
Contributor


Author Name: Danilo Ramos
Original Redmine Issue: 1355 from https://www.veripool.org

Original Assignee: Wilson Snyder (@wsnyder)


Hello.

Is there a multi-thread example? If I just enable --threads 1 I got a compile error which I cannot go through.

I have never done a multi-thread C++ project. Is there something I am missing? Maybe I forgot to include something in main.c file?

Thanks,
Danilo.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-09-30T10:29:46Z


Googling "undefined reference to `TLS init function" says this is a gcc bug. What version of GCC are you using?

gcc 4.7 has this bug:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59364

gcc 7 has this bug:

facebook/folly@e6b2e78

While we might be able to find a workaround, this suggests trouble ahead, perhaps you could either not use threading or a different GCC?

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Danilo Ramos
Original Date: 2018-10-03T14:57:36Z


Sorry the delay. Yes, I am using gcc 7.
I am trying to compile gcc 8 and check. I will report later.

I don't need threading for the moment, just curious about it and wanted to test it.

Thanks for verilator.
Danilo.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Danilo Ramos
Original Date: 2018-10-04T03:52:51Z


Hi. With gcc 8 the error was:

/usr/local/share/verilator/include/verilated.h:121:10: error: ‘mutex’ in namespace ‘std’ does not namea type
      std::mutex m_mutex;  // Mutex
           ^~~~~
/usr/local/share/verilator/include/verilated.h:121:5: note: ‘std::mutex’ is defined in header ‘<mutex>’; did you forget to ‘#include <mutex>’?
/usr/local/share/verilator/include/verilated.h:44:1:
+#include <mutex>
 #endif

Best regards,
Danilo.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-10-05T00:54:12Z


Mutex is already included on line 42 of verilated.h, so I don't understand the GCC error.

Also gcc 8.2.0 works for me. Please see if from the git directory typing "test_regress/t/t_EXAMPLE.pl --vltmt" passes or fails. If it passes describe the steps that give you the error, if it fails not sure what's still strange on your platform.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-03-10T16:26:20Z


Didn't hear back so closing this for now, if you figured it out please post back here. Thanks.

@veripoolbot veripoolbot added area: configure/compiling Issue involves configuring or compilating Verilator itself resolution: abandoned Closed; not enough information or otherwise never finished labels Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: configure/compiling Issue involves configuring or compilating Verilator itself resolution: abandoned Closed; not enough information or otherwise never finished
Projects
None yet
Development

No branches or pull requests

2 participants