Determining if the pthread_create exist failed with the following output:
Change Dir: /home/mjj/CLionProjects/caffe_cmake/build/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/make "cmTryCompileExec4062037407/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec4062037407.dir/build.make CMakeFiles/cmTryCompileExec4062037407.dir/build
make[1]: 正在进入目录 `/home/mjj/CLionProjects/caffe_cmake/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/mjj/CLionProjects/caffe_cmake/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec4062037407.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTryCompileExec4062037407.dir/CheckSymbolExists.c.o -c /home/mjj/CLionProjects/caffe_cmake/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec4062037407
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec4062037407.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTryCompileExec4062037407.dir/CheckSymbolExists.c.o -o cmTryCompileExec4062037407 -rdynamic
CMakeFiles/cmTryCompileExec4062037407.dir/CheckSymbolExists.c.o:在函数‘main’中:
CheckSymbolExists.c:(.text+0x16):对‘pthread_create’未定义的引用
collect2: error: ld returned 1 exit status
make[1]: *** [cmTryCompileExec4062037407] 错误 1
make[1]:正在离开目录 `/home/mjj/CLionProjects/caffe_cmake/build/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec4062037407/fast] 错误 2
File /home/mjj/CLionProjects/caffe_cmake/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/mjj/CLionProjects/caffe_cmake/build/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/make "cmTryCompileExec298938062/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec298938062.dir/build.make CMakeFiles/cmTryCompileExec298938062.dir/build
make[1]: 正在进入目录 `/home/mjj/CLionProjects/caffe_cmake/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/mjj/CLionProjects/caffe_cmake/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec298938062.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTryCompileExec298938062.dir/CheckFunctionExists.c.o -c /usr/share/cmake-2.8/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec298938062
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec298938062.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTryCompileExec298938062.dir/CheckFunctionExists.c.o -o cmTryCompileExec298938062 -rdynamic -lpthreads
/usr/bin/ld: 找不到 -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [cmTryCompileExec298938062] 错误 1
make[1]:正在离开目录 `/home/mjj/CLionProjects/caffe_cmake/build/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec298938062/fast] 错误 2