Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: jackg on August 03, 2018, 02:00:30 PM



Title: Compiling bitcoin core on raspberry pi failed
Post by: jackg on August 03, 2018, 02:00:30 PM
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 <file:///usr/share/doc/gcc-4.9/README.Bugs> 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). :)


Title: Re: Compiling bitcoin core on raspberry pi failed
Post by: DaCryptoRaccoon on August 03, 2018, 02:07:04 PM
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


Title: Re: Compiling bitcoin core on raspberry pi failed
Post by: jackg on August 03, 2018, 02:18:07 PM
Thanks,

I get this:

https://i.imgur.com/RXXsP6v.png.



Title: Re: Compiling bitcoin core on raspberry pi failed
Post by: DaCryptoRaccoon on August 03, 2018, 03:12:23 PM
Try add more swap space this should fix the issue.

Code above in previous post


Title: Re: Compiling bitcoin core on raspberry pi failed
Post by: jackg on August 03, 2018, 04:01:26 PM
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 <file:///usr/share/doc/gcc-4.9/README.Bugs> 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...


Title: Re: Compiling bitcoin core on raspberry pi failed
Post by: DaCryptoRaccoon on August 04, 2018, 12:42:59 AM
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.


Title: Re: Compiling bitcoin core on raspberry pi failed
Post by: jackg on August 06, 2018, 12:36:35 PM
Same error :(

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 <file:///usr/share/doc/gcc-4.9/README.Bugs> 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).


Title: Re: Compiling bitcoin core on raspberry pi failed
Post by: king nothin on August 06, 2018, 07:01:34 PM
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://bitcointalk.org/index.php?topic=304389.0
try monitoring your ram while compiling on a second ssh session


Title: Re: Compiling bitcoin core on raspberry pi failed
Post by: jackg on August 06, 2018, 07:05:31 PM
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://bitcointalk.org/index.php?topic=304389.0
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 :( (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.


Title: Re: Compiling bitcoin core on raspberry pi failed
Post by: DaCryptoRaccoon on August 23, 2018, 12:27:20 PM
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


Title: Re: Compiling bitcoin core on raspberry pi failed
Post by: jackg on August 23, 2018, 12:57:11 PM
I think I've done most of these but I'll try it again at some point... Thanks!