Multi-thread example: --threads 1 (compile error)
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?
#1 Updated by Wilson Snyder about 1 year 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:
gcc 7 has this bug:
While we might be able to find a workaround, this suggests trouble ahead, perhaps you could either not use threading or a different GCC?
#4 Updated by Danilo Ramos about 1 year 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 about 1 year 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.
Also available in: Atom