Cannot install OpenCV on jetson nano

I m following this tutorial:

https://www.learnopencv.com/install-opencv3-on-ubuntu/

to install OpenCV on jetson nano. When I run the command

make -j4

the system stucks on this point for hours:

https://ibb.co/gPk1wD5

Why does this happen? Is there any other way to install OpenCV on jetson nano??

This picture does not indicate any errors, but indeed not normal to stuck here for hours.

Do you have extra space to install opencv?

I use 128 GB microSD…

hi, i guess you are using the provided installer (by Nvidia).

Your problem is due to lack of memory.

increase your available swap memory (i wish i’d remember how i done this but it solved the problem for me)

Be aware that flashing a 32 GB disk image into a 128 GB card would only use 32 GB, until you resize partition(s).

For reference, the easiest way to add swap would be a swapfile. First check your rootfs partition has enough free space:

df -H -T /

If you have more than 5GB free, you may try to create a 4GB swapfile with:

sudo fallocate -l 4.0G /swapfile 
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile