Open ynqjwsm opened 3 years ago
what is the output of: ldconfig -p | grep pthread ?
can you try now? latest master
what is the output of: ldconfig -p | grep pthread ?
libpthread.so.0 (libc6,x86-64, OS ABI: Linux 3.2.0) => /lib64/libpthread.so.0 libpthread.so (libc6,x86-64, OS ABI: Linux 3.2.0) => /lib64/libpthread.so libevent_pthreads-2.1.so.6 (libc6,x86-64) => /lib64/libevent_pthreads-2.1.so.6 libOpenIPMIpthread.so.0 (libc6,x86-64) => /lib64/libOpenIPMIpthread.so.0
can you try now? latest master
[ 97%] Building CXX object lib/bls-signatures/src/CMakeFiles/runtest.dir/test.cpp.o /usr/bin/ar: /usr/lib64/libgmp.so: File format not recognized make[2]: [lib/bls-signatures/src/CMakeFiles/combined_custom.dir/build.make:79: lib/bls-signatures/src/CMakeFiles/combined_custom] Error 1 make[1]: [CMakeFiles/Makefile2:537: lib/bls-signatures/src/CMakeFiles/combined_custom.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... [ 97%] Linking CXX executable runbench [ 97%] Built target runbench [ 98%] Linking CXX executable test_phase_3 [ 98%] Built target test_phase_3 [ 98%] Linking CXX executable test_phase_1 [ 98%] Built target test_phase_1 [ 98%] Linking CXX executable runtest [ 98%] Built target runtest make: [Makefile:149: all] Error 2
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /root/chia-plotter/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_05cb4/fast && /usr/bin/gmake -f CMakeFiles/cmTC_05cb4.dir/build.make CMakeFiles/cmTC_05cb4.dir/build
gmake[1]: Entering directory '/root/chia-plotter/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_05cb4.dir/src.c.o
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -fPIE -o CMakeFiles/cmTC_05cb4.dir/src.c.o -c /root/chia-plotter/build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_05cb4
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_05cb4.dir/link.txt --verbose=1
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -rdynamic CMakeFiles/cmTC_05cb4.dir/src.c.o -o cmTC_05cb4
CMakeFiles/cmTC_05cb4.dir/src.c.o: In function `main':
src.c:(.text+0x2f): undefined reference to `pthread_create'
src.c:(.text+0x3b): undefined reference to `pthread_detach'
src.c:(.text+0x47): undefined reference to `pthread_cancel'
src.c:(.text+0x58): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_05cb4.dir/build.make:106: cmTC_05cb4] Error 1
gmake[1]: Leaving directory '/root/chia-plotter/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:140: cmTC_05cb4/fast] Error 2
Source file was:
#include <pthread.h>
void* test_func(void* data)
{
return data;
}
int main(void)
{
pthread_t thread;
pthread_create(&thread, NULL, test_func, NULL);
pthread_detach(thread);
pthread_cancel(thread);
pthread_join(thread, NULL);
pthread_atfork(NULL, NULL, NULL);
pthread_exit(NULL);
return 0;
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /root/chia-plotter/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_30eff/fast && /usr/bin/gmake -f CMakeFiles/cmTC_30eff.dir/build.make CMakeFiles/cmTC_30eff.dir/build
gmake[1]: Entering directory '/root/chia-plotter/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_30eff.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -fPIE -o CMakeFiles/cmTC_30eff.dir/CheckFunctionExists.c.o -c /usr/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTC_30eff
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_30eff.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_30eff.dir/CheckFunctionExists.c.o -o cmTC_30eff -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_30eff.dir/build.make:106: cmTC_30eff] Error 1
gmake[1]: Leaving directory '/root/chia-plotter/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:140: cmTC_30eff/fast] Error 2
still not working
/usr/bin/ar: /usr/lib64/libgmp.so: File format not recognized
I think there is something wrong with your system...
/usr/bin/ar: /usr/lib64/libgmp.so: File format not recognized
I think there is something wrong with your system...
Freshly installed centos8
It's an issue with this submodule: https://github.com/Chia-Network/bls-signatures They need to fix it... it's trying to use an *.so file as a static library.
Maybe try now, I disabled building BLS tests, seems like that's where it was failing.
Maybe try now, I disabled building BLS tests, seems like that's where it was failing.
failed
[ 94%] Building C object _deps/relic-build/src/CMakeFiles/relic_s.dir/low/easy/relic_fb_mul_low.c.o
[ 94%] Building C object _deps/relic-build/src/CMakeFiles/relic_s.dir/low/easy/relic_fb_rdc_low.c.o
[ 94%] Building C object _deps/relic-build/src/CMakeFiles/relic_s.dir/low/gmp/relic_fb_shift_low.c.o
[ 95%] Building C object _deps/relic-build/src/CMakeFiles/relic_s.dir/low/easy/relic_fb_slv_low.c.o
[ 95%] Building C object _deps/relic-build/src/CMakeFiles/relic_s.dir/low/easy/relic_fb_sqr_low.c.o
[ 95%] Building C object _deps/relic-build/src/CMakeFiles/relic_s.dir/low/easy/relic_fb_srt_low.c.o
[ 96%] Building C object _deps/relic-build/src/CMakeFiles/relic_s.dir/low/easy/relic_fb_trc_low.c.o
[ 96%] Linking C static library ../lib/librelic_s.a
[ 96%] Built target relic_s
Scanning dependencies of target combined_custom
Scanning dependencies of target runbench
[ 96%] Linking CXX executable test_phase_2
[ 97%] Building CXX object lib/bls-signatures/src/CMakeFiles/runbench.dir/test-bench.cpp.o
/usr/bin/ar: /usr/lib64/libgmp.so: File format not recognized
make[2]: *** [lib/bls-signatures/src/CMakeFiles/combined_custom.dir/build.make:79: lib/bls-signatures/src/CMakeFiles/combined_custom] Error 1
make[1]: *** [CMakeFiles/Makefile2:537: lib/bls-signatures/src/CMakeFiles/combined_custom.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 97%] Built target test_phase_2
[ 97%] Linking CXX executable runbench
[ 97%] Built target runbench
[ 98%] Linking CXX executable test_phase_3
[ 98%] Built target test_phase_3
[ 98%] Linking CXX executable test_phase_1
[ 98%] Built target test_phase_1
make: *** [Makefile:149: all] Error 2
(venv) [root@bdp-core chia-plotter]# cat build/CMakeFiles/CMakeError.log
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /root/chia-plotter/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_a9fb8/fast && /usr/bin/gmake -f CMakeFiles/cmTC_a9fb8.dir/build.make CMakeFiles/cmTC_a9fb8.dir/build
gmake[1]: Entering directory '/root/chia-plotter/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_a9fb8.dir/src.c.o
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -fPIE -o CMakeFiles/cmTC_a9fb8.dir/src.c.o -c /root/chia-plotter/build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_a9fb8
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a9fb8.dir/link.txt --verbose=1
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -rdynamic CMakeFiles/cmTC_a9fb8.dir/src.c.o -o cmTC_a9fb8
CMakeFiles/cmTC_a9fb8.dir/src.c.o: In function `main':
src.c:(.text+0x2f): undefined reference to `pthread_create'
src.c:(.text+0x3b): undefined reference to `pthread_detach'
src.c:(.text+0x47): undefined reference to `pthread_cancel'
src.c:(.text+0x58): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_a9fb8.dir/build.make:106: cmTC_a9fb8] Error 1
gmake[1]: Leaving directory '/root/chia-plotter/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:140: cmTC_a9fb8/fast] Error 2
Source file was:
#include <pthread.h>
void* test_func(void* data)
{
return data;
}
int main(void)
{
pthread_t thread;
pthread_create(&thread, NULL, test_func, NULL);
pthread_detach(thread);
pthread_cancel(thread);
pthread_join(thread, NULL);
pthread_atfork(NULL, NULL, NULL);
pthread_exit(NULL);
return 0;
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /root/chia-plotter/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_8c458/fast && /usr/bin/gmake -f CMakeFiles/cmTC_8c458.dir/build.make CMakeFiles/cmTC_8c458.dir/build
gmake[1]: Entering directory '/root/chia-plotter/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_8c458.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -fPIE -o CMakeFiles/cmTC_8c458.dir/CheckFunctionExists.c.o -c /usr/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTC_8c458
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8c458.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_8c458.dir/CheckFunctionExists.c.o -o cmTC_8c458 -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_8c458.dir/build.make:106: cmTC_8c458] Error 1
gmake[1]: Leaving directory '/root/chia-plotter/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:140: cmTC_8c458/fast] Error 2
it seems some different between libpthreads and libpthread ?
Centos Stream fails: [ 96%] Linking C static library ../lib/librelic_s.a [ 96%] Built target relic_s Scanning dependencies of target combined_custom Scanning dependencies of target runbench /bin/ar: /usr/lib64/libgmp.so: File format not recognized make[2]: [lib/bls-signatures/src/CMakeFiles/combined_custom.dir/build.make:79: lib/bls-signatures/src/CMakeFiles/combined_custom] Error 1 make[1]: [CMakeFiles/Makefile2:537: lib/bls-signatures/src/CMakeFiles/combined_custom.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... [ 97%] Building CXX object lib/bls-signatures/src/CMakeFiles/runbench.dir/test-bench.cpp.o [ 97%] Linking CXX executable runbench [ 97%] Built target runbench [ 98%] Linking CXX executable test_phase_3 [ 98%] Built target test_phase_3 [ 98%] Linking CXX executable test_phase_1 [ 98%] Built target test_phase_1 make: [Makefile:149: all] Error 2
UBUNTU 20.04 fails here: [ 94%] Building C object _deps/relic-build/src/CMakeFiles/relic_s.dir/low/easy/relic_fb_trc_low.c.o [ 94%] Linking C static library ../lib/librelic_s.a [ 94%] Built target relic_s make: *** [Makefile:130: all] Error 2
UBUNTU 16.04 w/updated CMAKE 3.20.3 fails: [ 94%] Building C object _deps/relic-build/src/CMakeFiles/relic_s.dir/low/easy/relic_fb_trc_low.c.o [ 94%] Linking CXX executable check_phase_1 [ 94%] Linking C static library ../lib/librelic_s.a [ 94%] Built target relic_s [ 94%] Built target check_phase_1 Makefile:135: recipe for target 'all' failed make: *** [all] Error 2
Hmmm....
Centos Stream fails: [ 96%] Linking C static library ../lib/librelic_s.a [ 96%] Built target relic_s Scanning dependencies of target combined_custom Scanning dependencies of target runbench /bin/ar: /usr/lib64/libgmp.so: File format not recognized make[2]: [lib/bls-signatures/src/CMakeFiles/combined_custom.dir/build.make:79: lib/bls-signatures/src/CMakeFiles/combined_custom] Error 1 make[1]: [CMakeFiles/Makefile2:537: lib/bls-signatures/src/CMakeFiles/combined_custom.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... [ 97%] Building CXX object lib/bls-signatures/src/CMakeFiles/runbench.dir/test-bench.cpp.o [ 97%] Linking CXX executable runbench [ 97%] Built target runbench [ 98%] Linking CXX executable test_phase_3 [ 98%] Built target test_phase_3 [ 98%] Linking CXX executable test_phase_1 [ 98%] Built target test_phase_1 make: [Makefile:149: all] Error 2
UBUNTU 20.04 fails here: [ 94%] Building C object _deps/relic-build/src/CMakeFiles/relic_s.dir/low/easy/relic_fb_trc_low.c.o [ 94%] Linking C static library ../lib/librelic_s.a [ 94%] Built target relic_s make: *** [Makefile:130: all] Error 2
UBUNTU 16.04 w/updated CMAKE 3.20.3 fails: [ 94%] Building C object _deps/relic-build/src/CMakeFiles/relic_s.dir/low/easy/relic_fb_trc_low.c.o [ 94%] Linking CXX executable check_phase_1 [ 94%] Linking C static library ../lib/librelic_s.a [ 94%] Built target relic_s [ 94%] Built target check_phase_1 Makefile:135: recipe for target 'all' failed make: *** [all] Error 2
Hmmm....
cat your errlogs at build/CMakeFiles/CMakeError.log
UBUNTU 20.02: [anna-i3] (jade): ldconfig -p | grep pthread libpthread.so.0 (libc6,x86-64, OS ABI: Linux 3.2.0) => /lib/x86_64-linux-gnu/libpthread.so.0 libpthread.so.0 (libc6, OS ABI: Linux 3.2.0) => /lib/i386-linux-gnu/libpthread.so.0 libpthread.so.0 (libc6, OS ABI: Linux 3.2.0) => /lib32/libpthread.so.0 libpthread.so (libc6,x86-64, OS ABI: Linux 3.2.0) => /lib/x86_64-linux-gnu/libpthread.so libevent_pthreads-2.1.so.7 (libc6,x86-64) => /lib/x86_64-linux-gnu/libevent_pthreads-2.1.so.7 libOpenIPMIpthread.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libOpenIPMIpthread.so.0 (/home/jade/chia-plotter)
[anna-i3] (jade): cat build/CMakeFiles/CMakeError.log Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output: Change Dir: /home/jade/chia-plotter/build/CMakeFiles/CMakeTmp
Run Build Command(s):/bin/make cmTC_e108e/fast && /bin/make -f CMakeFiles/cmTC_e108e.dir/build.make CMakeFiles/cmTC_e108e.dir/build
make[1]: Entering directory '/home/jade/chia-plotter/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_e108e.dir/src.c.o
/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -fPIE -o CMakeFiles/cmTC_e108e.dir/src.c.o -c /home/jade/chia-plotter/build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_e108e
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e108e.dir/link.txt --verbose=1
/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -rdynamic CMakeFiles/cmTC_e108e.dir/src.c.o -o cmTC_e108e
/bin/ld: CMakeFiles/cmTC_e108e.dir/src.c.o: in function main': src.c:(.text+0x3e): undefined reference to
pthread_create'
/bin/ld: src.c:(.text+0x4a): undefined reference to pthread_detach' /bin/ld: src.c:(.text+0x5b): undefined reference to
pthread_join'
collect2: error: ld returned 1 exit status
make[1]: [CMakeFiles/cmTC_e108e.dir/build.make:87: cmTC_e108e] Error 1
make[1]: Leaving directory '/home/jade/chia-plotter/build/CMakeFiles/CMakeTmp'
make: [Makefile:121: cmTC_e108e/fast] Error 2
Source file was:
void test_func(void data) { return data; }
int main(void) { pthread_t thread; pthread_create(&thread, NULL, test_func, NULL); pthread_detach(thread); pthread_join(thread, NULL); pthread_atfork(NULL, NULL, NULL); pthread_exit(NULL);
return 0; }
Determining if the function pthread_create exists in the pthreads failed with the following output: Change Dir: /home/jade/chia-plotter/build/CMakeFiles/CMakeTmp
Run Build Command(s):/bin/make cmTC_b3005/fast && /bin/make -f CMakeFiles/cmTC_b3005.dir/build.make CMakeFiles/cmTC_b3005.dir/build make[1]: Entering directory '/home/jade/chia-plotter/build/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_b3005.dir/CheckFunctionExists.c.o /bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -fPIE -o CMakeFiles/cmTC_b3005.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.16/Modules/CheckFunctionExists.c Linking C executable cmTC_b3005 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b3005.dir/link.txt --verbose=1 /bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_b3005.dir/CheckFunctionExists.c.o -o cmTC_b3005 -lpthreads /bin/ld: cannot find -lpthreads collect2: error: ld returned 1 exit status make[1]: [CMakeFiles/cmTC_b3005.dir/build.make:87: cmTC_b3005] Error 1 make[1]: Leaving directory '/home/jade/chia-plotter/build/CMakeFiles/CMakeTmp' make: [Makefile:121: cmTC_b3005/fast] Error 2
it seems some different between libpthreads and libpthread ?
It should be libpthread, without the 's'.
But that's a different issue, see: https://stackoverflow.com/questions/64514666/what-does-performing-test-cmake-have-libc-pthread-failed-actually-mean
This output is common for Unix-like systems. Despite "Failed" and "not found" words, this is perfectly good output.
Maybe now? I disabled building BLS benchmarks too.
Failing to understand how to correct the "undefined reference to pthread_create' and pthread_detach'" errors, I just built it on ubuntu 18.04.
Trying on other systems now... Cheers madmax, looks brilliant :-)
Maybe now? I disabled building BLS benchmarks too.
not work
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /root/chia-plotter/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_6829b/fast && /usr/bin/gmake -f CMakeFiles/cmTC_6829b.dir/build.make CMakeFiles/cmTC_6829b.dir/build
gmake[1]: Entering directory '/root/chia-plotter/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_6829b.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -fPIE -o CMakeFiles/cmTC_6829b.dir/CheckFunctionExists.c.o -c /usr/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTC_6829b
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_6829b.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_6829b.dir/CheckFunctionExists.c.o -o cmTC_6829b -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_6829b.dir/build.make:106: cmTC_6829b] Error 1
gmake[1]: Leaving directory '/root/chia-plotter/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:140: cmTC_6829b/fast] Error 2
/usr/bin/ld: cannot find -lpthreads
why use -lpthreads , maybe -lpthread is correct?
Ignore the pthreads errors in CMakeError.log, those are normal.
The issue is with libgmp.so
being used as a static library, which of course won't work.
The cultprint is in: https://github.com/Chia-Network/bls-signatures/blob/4e21aa6742d67562920ac67507e90b722116b14b/src/CMakeLists.txt#L56
Failing to understand how to correct the "undefined reference to pthread_create' and pthread_detach'" errors, I just built it on ubuntu 18.04.
Trying on other systems now... Cheers madmax, looks brilliant :-)
try upgrade your libc6 , and apt install libgmp3-dev libsodium-dev
Yeah I already saw sodium missing, and upgrading 20.04 to current didn't help. Centos is stuck on the linking, ubuntu 20.04 still doesn't build...
I submitted a bug report: https://github.com/Chia-Network/bls-signatures/issues/225
Ubuntu 20.04 should work, using it myself. x86_64?
Yes, 20.04 x86_64, it's not fully current, upgrading and will report back :-)
Fortunately the 18.04 build is portable. Perhaps a "releases" section with binary and checksum?
After dist-upgrade on 20.04, it still fails:
[anna-i3] (root): cat build/CMakeFiles/CMakeError.log Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output: Change Dir: /home/chia/chia-plotter/build/CMakeFiles/CMakeTmp
Run Build Command(s):/bin/make cmTC_5cbe6/fast && /bin/make -f CMakeFiles/cmTC_5cbe6.dir/build.make CMakeFiles/cmTC_5cbe6.dir/build
make[1]: Entering directory '/home/chia/chia-plotter/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_5cbe6.dir/src.c.o
/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -fPIE -o CMakeFiles/cmTC_5cbe6.dir/src.c.o -c /home/chia/chia-plotter/build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_5cbe6
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_5cbe6.dir/link.txt --verbose=1
/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -rdynamic CMakeFiles/cmTC_5cbe6.dir/src.c.o -o cmTC_5cbe6
/bin/ld: CMakeFiles/cmTC_5cbe6.dir/src.c.o: in function main': src.c:(.text+0x3e): undefined reference to
pthread_create'
/bin/ld: src.c:(.text+0x4a): undefined reference to pthread_detach' /bin/ld: src.c:(.text+0x5b): undefined reference to
pthread_join'
collect2: error: ld returned 1 exit status
make[1]: [CMakeFiles/cmTC_5cbe6.dir/build.make:87: cmTC_5cbe6] Error 1
make[1]: Leaving directory '/home/chia/chia-plotter/build/CMakeFiles/CMakeTmp'
make: [Makefile:121: cmTC_5cbe6/fast] Error 2
Clearly something is different on my system Vs. your build system. I'm not super familiar with Ubuntu or how to dump the overall config, but it's pretty standard, with /etc/apt/sources.list.d having these:
4 -rw-r--r-- 1 root root 132 Mar 16 21:17 bitcoin-ubuntu-bitcoin-focal.list.save 4 -rw-r--r-- 1 root root 136 Mar 16 21:17 ethereum-ubuntu-ethereum-focal.list 4 -rw-r--r-- 1 root root 142 Mar 16 21:17 graphics-drivers-ubuntu-ppa-focal.list 4 -rw-r--r-- 1 root root 146 Mar 16 21:17 oibaf-ubuntu-graphics-drivers-focal.list
apt-cache madison cmake says: cmake | 3.16.3-1ubuntu1 | http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages
Sorry I'm not much more help, but willing to test across Centos systems (7 and stream) and 16/18/20 Ubuntu...
Can you show terminal output? cmake error log is not very helpful here.
Here ya go, this is Ubuntu 20.04
Wow, that's a strict compiler. Should be fixed now.
Yeah! Thanks!
Works on ubuntu 16.04 with updated cmake v 3.20.3, for posterity's sake:
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main' sudo apt-get update; sudo apt-get -y install cmake
Same for 18.04 just change "xenial" to "bionic"
Works on 20.04. Trying CentOS Stream.... ...ah, right, fails at the same error you noted about shared libraries: /bin/ar: /usr/lib64/libgmp.so: File format not recognized
https://github.com/madMAx43v3r/chia-plotter/issues/52#issuecomment-857239757
In arch you just need to install libgmp-static and libsodium-static.
For the record, libgmp-static
and libsodium-static
are not provided by the default Arch package manager (pacman
), so, you need to use a package manager to interact with AUR packages (such as yay
, yaourt
, and others)
In my case that was easy as running yay -S libgmp-static libsodium-static
If you don't have yay
installed, you can install it with sudo pacman -S yay
Because all the cool chicks run Gentoo ;-)
Fails on libsodium: [ 96%] Building C object _deps/relic-build/src/CMakeFiles/relic_s.dir/low/easy/relic_fb_trc_low.c.o [ 97%] Linking C static library ../lib/librelic_s.a [ 97%] Built target relic_s Scanning dependencies of target combined_custom /usr/bin/ar: /usr/lib64/libsodium.so: file format not recognized make[2]: [lib/bls-signatures/src/CMakeFiles/combined_custom.dir/build.make:79: lib/bls-signatures/src/CMakeFiles/combined_custom] Error 1 make[1]: [CMakeFiles/Makefile2:481: lib/bls-signatures/src/CMakeFiles/combined_custom.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... [ 97%] Linking CXX executable test_phase_2 [ 97%] Built target test_phase_2 [ 98%] Linking CXX executable test_phase_3 [ 98%] Built target test_phase_3 [ 98%] Linking CXX executable test_phase_1 [ 98%] Built target test_phase_1 make: [Makefile:149: all] Error 2 (/home/chia/chia-plotter) [gentoo] (root): equery b /usr/lib64/libsodium.so
UPDATE: Most likely my error, as I'm 344 builds behind current: Emerging (1 of 344) sys-libs/glibc-2.33::gentoo
On Fedora 33 Server I installed static versions of the libs sodium and gmp:
sudo yum install libsodium-static gmp-static
After that the project compiled without errors. I think this might work for any RHEL derivate
On Fedora 33 Server I installed static versions of the libs sodium and gmp:
sudo yum install libsodium-static gmp-static
After that the project compiled without errors. I think this might work for any RHEL derivate
gmp-static <- centos do not have such package
gcc-8.4.1-1.el8.x86_64 libgcc-8.4.1-1.el8.x86_64 gcc-c++-8.4.1-1.el8.x86_64 cmake-filesystem-3.18.2-9.el8.x86_64 cmake-3.18.2-9.el8.x86_64 cmake-data-3.18.2-9.el8.noarch make-4.2.1-10.el8.x86_64 cmake-rpm-macros-3.18.2-9.el8.noarch glibc-2.28-151.el8.x86_64 glibc-all-langpacks-2.28-151.el8.x86_64 glibc-devel-2.28-151.el8.x86_64 glibc-headers-2.28-151.el8.x86_64 glibc-common-2.28-151.el8.x86_64
[ 96%] Built target test_disk_sort [ 96%] Linking CXX executable runbench [ 96%] Built target runbench [ 97%] Linking CXX executable test_phase_4 [ 97%] Built target test_phase_4 [ 97%] Linking CXX executable test_phase_2 [ 97%] Built target test_phase_2 [ 98%] Linking CXX executable test_phase_3 [ 98%] Built target test_phase_3 [ 98%] Linking CXX executable test_phase_1 [ 98%] Built target test_phase_1 [ 98%] Linking CXX executable runtest [ 98%] Built target runtest make: *** [Makefile:149: all] Error 2
Run Build Command(s):/usr/bin/gmake cmTC_d89bc/fast && /usr/bin/gmake -f CMakeFiles/cmTC_d89bc.dir/build.make CMakeFiles/cmTC_d89bc.dir/build gmake[1]: Entering directory '/root/chia-plotter/build/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_d89bc.dir/CheckFunctionExists.c.o /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -fPIE -o CMakeFiles/cmTC_d89bc.dir/CheckFunctionExists.c.o -c /usr/share/cmake/Modules/CheckFunctionExists.c Linking C executable cmTC_d89bc /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d89bc.dir/link.txt --verbose=1 /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_d89bc.dir/CheckFunctionExists.c.o -o cmTC_d89bc -lpthreads /usr/bin/ld: cannot find -lpthreads collect2: error: ld returned 1 exit status gmake[1]: [CMakeFiles/cmTC_d89bc.dir/build.make:106: cmTC_d89bc] Error 1 gmake[1]: Leaving directory '/root/chia-plotter/build/CMakeFiles/CMakeTmp' gmake: [Makefile:140: cmTC_d89bc/fast] Error 2