It looks like compile may run out of memory.
You could try 'free -m' option to check your free memory then if you need to you can add some swap space with the code below.
You many need to use sudo command for the swap space.
To add a 1gb swap file, in /swapfile:
sudo dd if=/dev/zero of=/swapfile bs=1024M count=1000
sudo mkswap /swapfile
sudo swapon /swapfile
After compiling turn OFF swap
Code:
sudo swapoff /swapfile
sudo rm /swapfile
I'd be inclined to make the swapfile persistent, I usually do ...
sudo dd if=/dev/zero of=/swapfile bs=64M count=16
where count=4 = 256 MB , count=8 = 512 MB , count=16 = 1G , count=32 = 2G etc.
sudo mkswap /swapfile
sudo swapon /swapfile
make swapfile persistent ...
add at base of file ...
/swapfile none swap sw 0 0
...
also for server ...
sudo nano /etc/sysctl.conf
add at base of file ...
vm.swappiness = 60
vm.vfs_cache_pressure = 50
desktop !
vm.swappiness = 10
check with ...
cat /proc/sys/vm/vfs_cache_pressure
cat /proc/sys/vm/swappiness
other useful commands ...
check for existing swapfile ...
filesystem (diskspace) ...
...
running ...
in a new terminal window (or Screen) is always useful for monitoring %CPU and %MEM to gain a better indication of what is actually happening.
I've not run an RPi in a while, although as Carlton has said an SSD is the safer bet.