Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create' #15

Open
SomeO opened this issue Sep 6, 2018 · 2 comments
Open

Comments

@SomeO
Copy link

SomeO commented Sep 6, 2018

Determining if the pthread_create exist failed with the following output:
Change Dir: /home/lijie/ECO-efficient-video-understanding/caffe_3d/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_35b4f/fast"
/usr/bin/make -f CMakeFiles/cmTC_35b4f.dir/build.make CMakeFiles/cmTC_35b4f.dir/build
make[1]: Entering directory '/mnt/raid3/home/lijie/ECO-efficient-video-understanding/caffe_3d/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_35b4f.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTC_35b4f.dir/CheckSymbolExists.c.o -c /home/lijie/ECO-efficient-video-understanding/caffe_3d/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_35b4f
/usr/local/lib/python3.5/dist-packages/cmake/data/bin/cmake -E cmake_link_script CMakeFiles/cmTC_35b4f.dir/link.txt --verbose=1
/usr/bin/cc -rdynamic CMakeFiles/cmTC_35b4f.dir/CheckSymbolExists.c.o -o cmTC_35b4f
CMakeFiles/cmTC_35b4f.dir/CheckSymbolExists.c.o: In function main': CheckSymbolExists.c:(.text+0x16): undefined reference to pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_35b4f.dir/build.make:86: recipe for target 'cmTC_35b4f' failed
make[1]: *** [cmTC_35b4f] Error 1
make[1]: Leaving directory '/mnt/raid3/home/lijie/ECO-efficient-video-understanding/caffe_3d/build/CMakeFiles/CMakeTmp'
Makefile:121: recipe for target 'cmTC_35b4f/fast' failed
make: *** [cmTC_35b4f/fast] Error 2

File /home/lijie/ECO-efficient-video-understanding/caffe_3d/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/lijie/ECO-efficient-video-understanding/caffe_3d/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_403cc/fast"
/usr/bin/make -f CMakeFiles/cmTC_403cc.dir/build.make CMakeFiles/cmTC_403cc.dir/build
make[1]: Entering directory '/mnt/raid3/home/lijie/ECO-efficient-video-understanding/caffe_3d/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_403cc.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_403cc.dir/CheckFunctionExists.c.o -c /usr/local/lib/python3.5/dist-packages/cmake/data/share/cmake-3.12/Modules/Chec
kFunctionExists.c
Linking C executable cmTC_403cc
/usr/local/lib/python3.5/dist-packages/cmake/data/bin/cmake -E cmake_link_script CMakeFiles/cmTC_403cc.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_403cc.dir/CheckFunctionExists.c.o -o cmTC_403cc -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_403cc.dir/build.make:86: recipe for target 'cmTC_403cc' failed
make[1]: *** [cmTC_403cc] Error 1
make[1]: Leaving directory '/mnt/raid3/home/lijie/ECO-efficient-video-understanding/caffe_3d/build/CMakeFiles/CMakeTmp'
Makefile:121: recipe for target 'cmTC_403cc/fast' failed
make: *** [cmTC_403cc/fast] Error 2

@mzolfaghari when I run cmake .. ,I met this problem above,please help,thanks!

@arleyzhang
Copy link

arleyzhang commented Jan 3, 2019

I met the same mistake as you.

If you check the cmake output carefully, you will find there is an error:

CMake Error at docs/CMakeLists.txt:82 (file):
  file STRINGS file
  "/home/host/ECO-efficient-video-understanding/caffe_3d/.Doxyfile"
  cannot be read.

and when you check the ~/ECO-efficient-video-understanding/caffe_3d/build/CMakeFiles/CMakeError.log file, the content was the same as you wrote above.
Then you can copy a ".Doxyfile" file from caffe to "ECO-efficient-video-understanding/caffe_3d"
or
you can also modify the "CMakeList.txt" file:
line 24:
caffe_option(BUILD_docs "Build documentation" ON IF UNIX OR APPLE)
replace this line to:
caffe_option(BUILD_docs "Build documentation" OFF)

And then all errors will disappear and you can cmake and make.

@TwinkleYR
Copy link

models_ECO_Lite/kinetics/run.sh: 7: models_ECO_Lite/kinetics/run.sh: train: not found
when I use run.sh to realize the caffe_model on kinetics,I met this problem above. I think this error is related to the path,but the path is true, please help me thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants