48

The cmake partial output looks like this:

-- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed 
3
  • 1
    What is the exit code of cmake? Sometimes libraries search for functionality in multiple possible places. I saw similar output when building either cmake, xerces-c or qt5. Not sure which one it was, but unless cmake exits with a non-zero code, you're fine. Usually in case the exit code is non-0 the last 3 or so lines in the output contain a message that an error occured. If this is a open source lib, mentioning it could be helpful. I'm not sure this kind of output is predetermined by cmake. Commented Oct 24, 2020 at 15:04
  • There is no exit code since the cmake execution was complete and the makefile was created. Just trying to figure out if the make file missed out something because of the above failed operation Commented Oct 24, 2020 at 16:17
  • 1
    Even if cmake completes there is a exit code. Every program produces and exit code, non-zero exit code means there is an error. It's just not printed by default. You need to check for the type of console/script you're using, how to access that exit code. e.g. echo $LastExitCode for powershell, echo $? in bash... (both need to be run immediately after you run cmake, since they can only access the exit code of the last command) Commented Oct 25, 2020 at 5:57

1 Answer 1

62

The lines

-- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- 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 

are output of a call like

find_package(Threads) 

This call is used in a script CMakeLists.txt by many CMake projects which want to use threads-related functionality (like pthread_create).

When process this call, CMake (by means of FindThreads.cmake script) tries to determine kind of thread support for the current platform.

The check Looking for pthread.h is self-explanatory: CMake checks whether header pthread.h exists and available.

The check Performing Test CMAKE_HAVE_LIBC_PTHREAD is about whether thread support functions are compiled into libc library directly, or one need to link additional libraries (like -lpthread).

The check Looking for pthread_create in pthreads tries to find pthreads library and function pthread_create in it.

The check Looking for pthread_create in pthread tries to find pthread library and function pthread_create in it.


That particular output could be interpreted as:

The platform supports threads by providing the header pthread.h and the library pthread.

This output is common for Unix-like systems. Despite "Failed" and "not found" words, this is perfectly good output.

Sign up to request clarification or add additional context in comments.

7 Comments

So if I want to compile a windows Win32 would it be a problem or I should ignore this error?
@Hamed_gibago: What "error" are you talking about? There is no word "error" in the output.
This error: Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
This is not the "error". And yes, you may ignore it.
Well, I'm build oneTbb for windows 10 and want to build it to use pagmo2 and pygmo2 in python 32 bit. After configuring building tbb, during build I get error: LINK : fatal error LNK1104: cannot open file 'c:\hwloc-win32-build-2.5.0\lib.obj' [C:\oneTBB-master\build\src\tbbbind\t bbbind_2_5.vcxproj] despite I downloaded and passed path of hwloc. Would you help me?
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.