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

compile for Raspberry Pi 4 #81

Open
michelvankessel opened this issue Dec 19, 2019 · 4 comments
Open

compile for Raspberry Pi 4 #81

michelvankessel opened this issue Dec 19, 2019 · 4 comments

Comments

@michelvankessel
Copy link

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

@hoffmang9
Copy link

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.)

@michelvankessel
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

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

2 participants