Author

Topic: Compiling bitcoin core on raspberry pi failed (Read 306 times)

copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
August 23, 2018, 08:57:11 AM
#11
I think I've done most of these but I'll try it again at some point... Thanks!
hero member
Activity: 1220
Merit: 612
OGRaccoon
What was the end result did you get this to work.
Been having  issues on a RPI 2 B board with my own daemon I am working on.

My guess is its a dependency issue that's caused this.  

I would be warey of pre-installed on imaged could be asking for trouble if its been modified.

You could try add all of the list below to allow for building I got it to work on mine with the following.

Code:
sudo apt-get install git
sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils
sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev
sudo apt-get install libboost-all-dev
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev
sudo apt-get install libminiupnpc-dev
sudo apt-get install libzmq3-dev
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler
sudo apt-get install libqt4-dev libprotobuf-dev protobuf-compiler
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
what RPI are you using? compiling on my tinker board went pretty straight, but it has 2GB RAM
you might be running into same issue as that guy https://bitcointalksearch.org/topic/solved-g-internal-compiler-error-killed-program-cc1plus-304389
try monitoring your ram while compiling on a second ssh session

Yeah I'll try that. I ran into another error with producing the daemon after I fixed the first error Sad (I'll post the log tomorrow).

I'm not sure what Pi I'm running it from, I have a Pi 2 and a B+ I assume the second (latter) was the 2 that I used which got further along the installation.

I found an OS that comes preinstalled with bitcoin core for a raspberry pi so I'm going to try that.
newbie
Activity: 11
Merit: 1
what RPI are you using? compiling on my tinker board went pretty straight, but it has 2GB RAM
you might be running into same issue as that guy https://bitcointalksearch.org/topic/solved-g-internal-compiler-error-killed-program-cc1plus-304389
try monitoring your ram while compiling on a second ssh session
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
Same error Sad

Code:
  CXX      libbitcoin_server_a-init.o
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
Makefile:5882: recipe for target 'libbitcoin_server_a-init.o' failed
make[2]: *** [libbitcoin_server_a-init.o] Error 4
make[2]: Leaving directory '/home/pi/bitexperiment/bitcoin/src'
Makefile:9948: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/pi/bitexperiment/bitcoin/src'
Makefile:764: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Increased swap to 1GiB and didn't work.
I'm trying 2GiB now...
2GiB didn't work, so I switched Pis and it's working now (normally, without the swap stuff).
hero member
Activity: 1220
Merit: 612
OGRaccoon
Try this. You many need to use sudo command for the swap space.

Type "dmesg",

Code:
[ 1377.575785] Out of memory: Kill process 12305 (cc1plus) score 905 or sacrifice child
[ 1377.575800] Killed process 12305 (cc1plus) total-vm:579928kB, anon-rss:546144kB, file-rss:0kB

If you see output like this, your machine does not have enough memory to compile. 
You can fix this by adding more swap.

To add a 1gb swap file, in /swapfile:

Code:
sudo dd if=/dev/zero of=/swapfile bs=1024M count=1000
sudo mkswap /swapfile
sudo swapon /swapfile


After compiling

Code:
sudo swapoff /swapfile
sudo rm /swapfile

Please post any further issues.
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
Same error happens again.

Code:
:~/bitexperiment/bitcoin $ sudo make
Making all in src
make[1]: Entering directory '/home/pi/bitexperiment/bitcoin/src'
make[2]: Entering directory '/home/pi/bitexperiment/bitcoin/src'
make[3]: Entering directory '/home/pi/bitexperiment/bitcoin'
make[3]: Leaving directory '/home/pi/bitexperiment/bitcoin'
  CXX      libbitcoin_server_a-init.o
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
Makefile:5882: recipe for target 'libbitcoin_server_a-init.o' failed
make[2]: *** [libbitcoin_server_a-init.o] Error 4
make[2]: Leaving directory '/home/pi/bitexperiment/bitcoin/src'
Makefile:9948: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/pi/bitexperiment/bitcoin/src'
Makefile:764: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

I ran it previously and it worked beyond that stage, do I have to undo what I previously did? It failed at a point later though...
hero member
Activity: 1220
Merit: 612
OGRaccoon
Try add more swap space this should fix the issue.

Code above in previous post
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
Thanks,

I get this:

.

hero member
Activity: 1220
Merit: 612
OGRaccoon
Code:
free
dd if=/dev/zero of=/var/swap.img bs=1024k count=1000
mkswap /var/swap.img
swapon /var/swap.img
free
make -f makefile.unix


It looks like compile may run out of memory.
Running make runs lots of process which use more memory. The problem above occurs when your system runs out of memory

You can try 'free -m' option to check
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
When running sudo make I get this printed (I thought I'd show it in its entirety as it's quite small).
I ran ./autogen.sh and ./configure --with-incompatible-bdb (or whatever the syntax is) previously on another session.
Code:
Making all in src
^[ xmake[1]: Entering directory '/home/pi/bitexperiment/bitcoin/src'          ma                                                      ke[2]: Entering directory '/home/pi/bitexperiment/bitcoin/src'
make[3]: Entering directory '/home/pi/bitexperiment/bitcoin'
make[3]: Leaving directory '/home/pi/bitexperiment/bitcoin'
  CXX      libbitcoin_server_a-init.o
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
Makefile:5882: recipe for target 'libbitcoin_server_a-init.o' failed
make[2]: *** [libbitcoin_server_a-init.o] Error 4
make[2]: Leaving directory '/home/pi/bitexperiment/bitcoin/src'
Makefile:9948: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/pi/bitexperiment/bitcoin/src'
Makefile:764: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Please don't question why I'm using a raspberry pi (it's for educational purposes only). Smiley
Jump to: