-
Notifications
You must be signed in to change notification settings - Fork 443
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
cmake error (can't resolve pthread_create?) #1916
Comments
This is not an error. See #1534 (comment) |
It's not a fragment; it's an entire CMakeError.log. I can see why there's an issue: it looks for 'libpthreads' -- and there's no such library; it's 'libpthread'. |
There should be some errors before the output you shared:
|
I do not know why this message is appearing, but if you are willing to start from a freshly installed Ubuntu 16.04 or 18.04 Linux system, the script [1] can install p4c and its needed dependencies, and the script [2] installs those plus BMv2 plus open source P4Runtime API software. They do not do anything more than the README instructions say to do, but they can help the process be more reproducible across installs. [1] https://github.com/jafingerhut/p4-guide/blob/master/bin/install-p4c-without-bmv2.sh |
Yes, starting from fresh again is plan c :). This is a brand new install of Ubuntu 16.04. And, seemingly, everything was working fine -- got all the dependencies, built protobuf, etc. CMake Warning at backends/bmv2/CMakeLists.txt:195 (MESSAGE): CMake Warning at backends/ebpf/CMakeLists.txt:102 (MESSAGE): CMake Error at /usr/share/llvm-3.8/cmake/LLVMConfig.cmake:178 (include):
Call Stack (most recent call first): CMake Error at /usr/share/llvm-3.8/cmake/LLVMConfig.cmake:181 (include):
Call Stack (most recent call first): -- Found LLVM 3.8.0 |
It looks like you have hit this issue: #1376 |
Yep, that's it looks like! Thanks for the link. I will plod along. |
And thanks to antoninbas -- -DENABLE_EBPF=OFF seems to have done the trick. |
Hopefully the LLVM issue has been solved, so I am closing this one. |
-- Found LLVM 3.8.0
-- Added 14 tests to 'ebpf-bcc' (0 xfails)
-- Added 14 tests to 'ebpf' (0 xfails)
-- Added 5 tests to 'p4' (0 xfails)
-- Added 533 tests to 'p4' (5 xfails)
-- Added 5 tests to 'err' (0 xfails)
-- Added 160 tests to 'err' (0 xfails)
-- Added 207 tests to 'p14_to_16' (0 xfails)
-- CTest parallel: -j 4
-- Configuring incomplete, errors occurred!
See also "/home/ilya/p4/p4c/build/CMakeFiles/CMakeOutput.log".
See also "/home/ilya/p4/p4c/build/CMakeFiles/CMakeError.log".
...Below is the dump of the CMakeError.log; it appears that it can't resolve pthread_create, even though I can link with it just fine, if I use '-lpthread'
cat /home/ilya/p4/p4c/build/CMakeFiles/CMakeError.log
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/ilya/p4/p4c/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_30d9b/fast"
/usr/bin/make -f CMakeFiles/cmTC_30d9b.dir/build.make CMakeFiles/cmTC_30d9b.dir/build
make[1]: Entering directory '/home/ilya/p4/p4c/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_30d9b.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTC_30d9b.dir/CheckSymbolExists.c.o -c /home/ilya/p4/p4c/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_30d9b
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_30d9b.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_30d9b.dir/CheckSymbolExists.c.o -o cmTC_30d9b -rdynamic
CMakeFiles/cmTC_30d9b.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_30d9b.dir/build.make:97: recipe for target 'cmTC_30d9b' failed
make[1]: *** [cmTC_30d9b] Error 1
make[1]: Leaving directory '/home/ilya/p4/p4c/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_30d9b/fast' failed
make: *** [cmTC_30d9b/fast] Error 2
File /home/ilya/p4/p4c/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/ilya/p4/p4c/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_15b4a/fast"
/usr/bin/make -f CMakeFiles/cmTC_15b4a.dir/build.make CMakeFiles/cmTC_15b4a.dir/build
make[1]: Entering directory '/home/ilya/p4/p4c/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_15b4a.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_15b4a.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c
Linking C executable cmTC_15b4a
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_15b4a.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_15b4a.dir/CheckFunctionExists.c.o -o cmTC_15b4a -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_15b4a.dir/build.make:97: recipe for target 'cmTC_15b4a' failed
make[1]: *** [cmTC_15b4a] Error 1
make[1]: Leaving directory '/home/ilya/p4/p4c/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_15b4a/fast' failed
make: *** [cmTC_15b4a/fast] Error 2
The text was updated successfully, but these errors were encountered: