Skip to content

Instantly share code, notes, and snippets.

@ethanfu
Last active December 20, 2015 11:03
Show Gist options
  • Save ethanfu/e77ddacd2278687dceaf to your computer and use it in GitHub Desktop.
Save ethanfu/e77ddacd2278687dceaf to your computer and use it in GitHub Desktop.
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/ethan/factor/ggnfs/tpie/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTryCompileExec2208474023/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec2208474023.dir/build.make CMakeFiles/cmTryCompileExec2208474023.dir/build
make[1]: Entering directory '/home/ethan/factor/ggnfs/tpie/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/ethan/factor/ggnfs/tpie/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec2208474023.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTryCompileExec2208474023.dir/CheckSymbolExists.c.o -c /home/ethan/factor/ggnfs/tpie/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec2208474023
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2208474023.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTryCompileExec2208474023.dir/CheckSymbolExists.c.o -o cmTryCompileExec2208474023 -rdynamic
CMakeFiles/cmTryCompileExec2208474023.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTryCompileExec2208474023.dir/build.make:88: recipe for target 'cmTryCompileExec2208474023' failed
make[1]: Leaving directory '/home/ethan/factor/ggnfs/tpie/build/CMakeFiles/CMakeTmp'
make[1]: *** [cmTryCompileExec2208474023] Error 1
Makefile:118: recipe for target 'cmTryCompileExec2208474023/fast' failed
make: *** [cmTryCompileExec2208474023/fast] Error 2
File /home/ethan/factor/ggnfs/tpie/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>
int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/ethan/factor/ggnfs/tpie/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTryCompileExec3682562555/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec3682562555.dir/build.make CMakeFiles/cmTryCompileExec3682562555.dir/build
make[1]: Entering directory '/home/ethan/factor/ggnfs/tpie/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/ethan/factor/ggnfs/tpie/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec3682562555.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTryCompileExec3682562555.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.0/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec3682562555
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3682562555.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTryCompileExec3682562555.dir/CheckFunctionExists.c.o -o cmTryCompileExec3682562555 -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTryCompileExec3682562555.dir/build.make:88: recipe for target 'cmTryCompileExec3682562555' failed
make[1]: Leaving directory '/home/ethan/factor/ggnfs/tpie/build/CMakeFiles/CMakeTmp'
make[1]: *** [cmTryCompileExec3682562555] Error 1
Makefile:118: recipe for target 'cmTryCompileExec3682562555/fast' failed
make: *** [cmTryCompileExec3682562555/fast] Error 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment