MantisBT - CMake
View Issue Details
0015447CMakeCMakepublic2015-03-14 12:132015-11-02 09:13
azrdev 
 
normalmajoralways
closedno change required 
LinuxArchlinuxrolling
CMake 3.1 
 
0015447: libpthreads not found on cmake >= 3.1
Originally this popped up when trying to update the AUR tulip packet to 4.6.1 (<https://aur.archlinux.org/packages/tulip/> [^])

The CMakeLists.txt for that software contains the line:
FIND_PACKAGE(Threads)
Which started to break after installing cmake 3.1 (or higher): Running cmake yields

-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
CMake Error at CMakeLists.txt:111 (SET_TARGET_PROPERTIES):
  INTERFACE_LIBRARY targets may only have whitelisted properties. The
  property "INSTALL_RPATH" is not allowed.
Call Stack (most recent call first):
  /usr/share/cmake-3.1/Modules/FindThreads.cmake:207 (add_library)
  CMakeLists.txt:234 (FIND_PACKAGE)

CMakeError.txt contains the log for "Determining if the pthread_create exist"
especially the line
/usr/bin/ld: cannot find -lpthreads

According to manual tests, that argument should read -lpthread (without the s).

Please tell if you need any other information. The CMakeError.log is attached.
No tags attached.
log CMakeError.log (3,940) 2015-03-14 12:13
https://public.kitware.com/Bug/file/5403/CMakeError.log
Issue History
2015-03-14 12:13azrdevNew Issue
2015-03-14 12:13azrdevFile Added: CMakeError.log
2015-03-16 17:00Brad KingNote Added: 0038226
2015-03-16 17:00Brad KingStatusnew => resolved
2015-03-16 17:00Brad KingResolutionopen => no change required
2015-11-02 09:13Robert MaynardNote Added: 0039732
2015-11-02 09:13Robert MaynardStatusresolved => closed

Notes
(0038226)
Brad King   
2015-03-16 17:00   
That project CMakeLists.txt file contains:

 FUNCTION(ADD_LIBRARY name)
   _ADD_LIBRARY(${name} ${ARGN})
   ...
 ENDFUNCTION()

which replaces the add_library command. This is an undocumented and unsupported feature meant only for local use in debugging.

The tulip project should be updated to rename the function to "tulip_add_library" and update its call sites accordingly.
(0039732)
Robert Maynard   
2015-11-02 09:13   
Closing resolved issues that have not been updated in more than 4 months.