Hi,I just tried to build the package but it fails with a cmake error trying to determine if pthread_create exists. Has anyone had or even solved this problem? Here's my CMakeErr.log:
Determining if the pthread_create exist failed with the following output:
Change Dir: /build/freecad-git/src/freecad-git/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_d9d4f/fast"
/usr/bin/make -f CMakeFiles/cmTC_d9d4f.dir/build.make CMakeFiles/cmTC_d9d4f.dir/build
make[1]: Entering directory '/build/freecad-git/src/freecad-git/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_d9d4f.dir/CheckSymbolExists.c.o
/usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -o CMakeFiles/cmTC_d9d4f.dir/CheckSymbolExists.c.o -c /build/freecad-git/src/freecad-git/CMakeFile
s/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_d9d4f
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d9d4f.dir/link.txt --verbose=1
/usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -rdynamic CMakeFiles/cmTC_d9d4f.dir/CheckSymbolExist
s.c.o -o cmTC_d9d4f
/usr/bin/ld: CMakeFiles/cmTC_d9d4f.dir/CheckSymbolExists.c.o: in function `main':
CheckSymbolExists.c:(.text.startup+0x3): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_d9d4f.dir/build.make:87: cmTC_d9d4f] Error 1
make[1]: Leaving directory '/build/freecad-git/src/freecad-git/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_d9d4f/fast] Error 2
File /build/freecad-git/src/freecad-git/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: /build/freecad-git/src/freecad-git/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_b3bbb/fast"
/usr/bin/make -f CMakeFiles/cmTC_b3bbb.dir/build.make CMakeFiles/cmTC_b3bbb.dir/build
make[1]: Entering directory '/build/freecad-git/src/freecad-git/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_b3bbb.dir/CheckFunctionExists.c.o
/usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_b3bbb.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.13/Modules/CheckFunctionExists.c
Linking C executable cmTC_b3bbb
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b3bbb.dir/link.txt --verbose=1
/usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -DCHECK_FUNCTION_EXISTS=pthread_create -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -rdynamic CMakeFiles/cmTC_b3bbb.dir/CheckFunctionExists.c.o -o cmTC_b3bbb -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_b3bbb.dir/build.make:87: cmTC_b3bbb] Error 1
make[1]: Leaving directory '/build/freecad-git/src/freecad-git/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_b3bbb/fast] Error 2
I think it might be caused by the "-lpthreads" ld-flag. As far as I know, it is a singular "-lpthread", or am I wrong here?
Pinned Comments
adrianinsaval commented on 2023-03-12 14:50 (UTC)
If the check fails there is little I can do about it as it most likely needs to be fixed upstream, in such cases report those upstream (maybe wait a day or two as sometimes it's quickly solved upstream) or skip the check with
makepkg --nocheck
if you don't care about the functionality that is being reported as failing in the check.