Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  Voneline
  WFH
General Info
  Papers

Issue #1355

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

Added by Danilo Ramos 11 months ago. Updated 5 months ago.

Status:
NotEnoughInfo
Priority:
Normal
Assignee:
Category:
Configure/Make/Compiling
% Done:

0%


Description

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.

verilator_multithread_compilefailed.txt View (2.08 KB) Danilo Ramos, 09/28/2018 06:47 PM

History

#1 Updated by Wilson Snyder 11 months ago

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:

https://github.com/facebook/folly/commit/e6b2e78a072040c865fb0e2ca0a1f28018a39ee7

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

#2 Updated by Wilson Snyder 11 months ago

  • Status changed from New to AskedReporter

#3 Updated by Danilo Ramos 11 months ago

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.

#4 Updated by Danilo Ramos 11 months ago

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.

#5 Updated by Wilson Snyder 11 months ago

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.

#6 Updated by Wilson Snyder 5 months ago

  • Status changed from AskedReporter to NotEnoughInfo

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

Also available in: Atom