bitcoin-seeder icon indicating copy to clipboard operation
bitcoin-seeder copied to clipboard

compile for Raspberry Pi 4

Open michelvankessel opened this issue 5 years ago • 4 comments

Is it possible to compile the code on a Raspberry Pi 4? I get the following build errors

g++ -pthread -O2 -o dnsseed dns.o bitcoin.o netbase.o protocol.o db.o main.o util.o -lcrypto /usr/bin/ld: main.o: in function ThreadStats': main.cpp:(.text+0x584): undefined reference to __atomic_load_8' /usr/bin/ld: main.o: in function GetIPList': main.cpp:(.text+0xe7c): undefined reference to __atomic_fetch_add_8' /usr/bin/ld: main.o: in function main': main.cpp:(.text.startup+0x47c): undefined reference to __atomic_store_8' collect2: error: ld returned 1 exit status make: *** [Makefile:5: dnsseed] Error 1

thank you Michel

michelvankessel avatar Dec 19 '19 09:12 michelvankessel

I just tried this on a Pi 4 and it compiled for me. It may be because my Ubuntu install also had libffi-dev installed as a pre-req (which is oddly excluded only on Pi Ubuntu.)

hoffmang9 avatar Jan 01 '20 02:01 hoffmang9

I installed the libffi-dev package, but still no luck

g++ -pthread -O2 -o dnsseed dns.o bitcoin.o netbase.o protocol.o db.o main.o util.o -lcrypto /usr/bin/ld: main.o: in function ThreadStats': main.cpp:(.text+0x540): undefined reference to __atomic_load_8' /usr/bin/ld: main.o: in function GetIPList': main.cpp:(.text+0xe38): undefined reference to __atomic_fetch_add_8' /usr/bin/ld: main.o: in function main': main.cpp:(.text.startup+0x47c): undefined reference to __atomic_store_8' collect2: error: ld returned 1 exit status make: *** [Makefile:5: dnsseed] Error 1

michelvankessel avatar Apr 18 '20 07:04 michelvankessel

it must be something related to raspbian 10 or just my installation, because I was able to compile it on another Pi4 with ubuntu 18.04

~/data/development/blackcoin-seeder$ make g++ -std=c++11 -pthread -O2 -Wall -Wno-unused -Wno-sign-compare -Wno-reorder -Wno-comment -c -o dns.o dns.cpp g++ -std=c++11 -pthread -O2 -Wall -Wno-unused -Wno-sign-compare -Wno-reorder -Wno-comment -c -o bitcoin.o bitcoin.cpp g++ -std=c++11 -pthread -O2 -Wall -Wno-unused -Wno-sign-compare -Wno-reorder -Wno-comment -c -o netbase.o netbase.cpp g++ -std=c++11 -pthread -O2 -Wall -Wno-unused -Wno-sign-compare -Wno-reorder -Wno-comment -c -o protocol.o protocol.cpp g++ -std=c++11 -pthread -O2 -Wall -Wno-unused -Wno-sign-compare -Wno-reorder -Wno-comment -c -o db.o db.cpp g++ -std=c++11 -pthread -O2 -Wall -Wno-unused -Wno-sign-compare -Wno-reorder -Wno-comment -c -o main.o main.cpp g++ -std=c++11 -pthread -O2 -Wall -Wno-unused -Wno-sign-compare -Wno-reorder -Wno-comment -c -o util.o util.cpp g++ -pthread -O2 -o dnsseed dns.o bitcoin.o netbase.o protocol.o db.o main.o util.o -lcrypto

michelvankessel avatar Apr 18 '20 07:04 michelvankessel

did some more research and I was able to solve the issue by adding a LDFLAG

make LDFLAGS="-latomic"

inspired by this post > https://www.raspberrypi.org/forums/viewtopic.php?t=245878

michelvankessel avatar Apr 18 '20 09:04 michelvankessel