Compiling CMake project using ROOT with Multithreading

Dear ROOT users,

I am encountering compilation errors when trying to use ROOT libraries in another program with multithreading. CMake stops with an undefined reference to pthread_create(). If I explicitly tell CMake to link against pthread or threads the build is successful but executing the program then results in a segmentation fault.
My first question would be: is it required to install ROOT with specific multithreading option(s) in order to correctly use pthread?

Thank you in advance!

_ROOT_Version: 6.09.02
Platform: Fedora 27
Compiler: GCC 7.3.1


I think I need a clarification. What are you concretely trying to do? What exactly fails with what error message?


Thank you for the response.
I solved the issue in the meantime by specifying the compiler flags using $ROOTSYS/bin/root-config --cflags and use these within CMake in set(CMAKE_CXX_FLAGS)

Thanks again!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.