Closed jermp closed 2 months ago
Did you also notice this @hmusta under gcc-12?
My environment is gcc-12 with Ubuntu 20.04 and this doesn't seem to be an issue, target_compile_options(PTHASH INTERFACE -pthread)
works fine
Thanks for confirming @hmusta! Perhaps it is an issue of cmake 3.25.
Did you try a new, fresh build directory and used cmake from the command line? Maybe the old build directory or the IDE caches something. Using CMAKE_CXX_FLAGS
is the old way to use cmake and causes problems because it applies the flag even to compilation units that don't use PTHash. (it even breaks the build when some target in the project uses a different compiler that doesn't understand the flag)
Actually yes, I did. I created some new build directories and executed cmake from there. But I could also try to re-clone the entire project from scratch...maybe maybe!
No, still getting the same errors: undefined pthread_create
and pthread_join
.
Just for some of the targets (build
, example
, etc) or for all?
For all of them :/
Closing this as it seems a problem related to that specific server machine.
Under Ubuntu 18.04.6 and gcc 7.5/11/13, I got an error
undefined reference to pthread_create
which is caused bytarget_compile_options(PTHASH INTERFACE -pthread)
which does not seem to work. Re-adding the originalset(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
works.Why is that?
CC. @ByteHamster any ideas?