PC freezing when building Pytorch from source

OS: Manjaro Linux 17.1.5 64bit
CPU: Intel Pentium P6000, 1.87Ghz x 2
RAM: 3.66 (4 Gb)
GPU: None
GCC: gcc (GCC) 7.3.0

When installing Pytorch from source I’ve ran out of RAM and computer freezes and therefore it won’t install. I need to install Pytorch from source because I can’t run any pytorch script because it raises the “Illegal instruction (core dumped)” error.
I can’t tell you more than this because everytime I’ve ran the commands to install Pytorch, my PC froze and I had to restart the computer by pressing the button.

This is what I did to install Pytorch from source:

How can I install Pytorch?

did you try installing through conda? conda install pytorch-cpu torchvision -c pytorch

Yes, but it raises the “Illegal instruction (core dumped)” error.
That’s why I’m trying to install from source.

may be you can dump the output of terminal to a file and post the message from the file after you restart.
like python setup.py install > out.log

For now I have this journalctl log journal_ctl, I’ll had that log after I try to install it again.