I have tried to compile OpenCV 3.2 onto my pi Zero W Board running Stretch and i'm using a 16GB SD Card (running SSH on Mac and Python 2.7).
Running make to compile openCV takes over 9 hours to get to 83% at which point it just freezes (gets stuck) with no further progress. I am sure of this as I have left it for a good half hour and still no progress. I left it over night the first time and got the error: connection to host 192. ...: broken pipe". But that takes a good hour or so to even spit that out. It just seems to hang at 83% with no error or indication and it's happened both times I have tried all the installation processes from the beginning (By deleting the openCV folder completely in VNC) and starting again. Even when I try to continue build by changing to the build directory on the pi it continues from where it left off (i.e. 83%) but gets stuck at the same point. Based on a lot of deep googling I have tried the following: - Deleted wolfram and Libre Office from the pi to open up a further 1GB of space on the pi. (so its not a memory issue, currently has 6GB free). I have run the free command and get the following:
total Mem: 493252 Swap: 102396 used Mem: 76112 Swap: 476
- Adjusted the GPU_mem to 16 so I could maximise ram usage. Doing this I noticed my swap memory usage went up from 0 to 476 (above) when trying to run make from 83% again..not sure if thats a good thing..is this the best setting?
- I noticed that I had the camera plugged into the pi during the whole process which seemed to be the issue for some people and tried again without the camera plugged in but no luck. I further checked config.txt to ensure x=0 not x=1 to ensure camera is definitely not enabled and GPU is set at 16.
Anyody have any ideas what could be causing this and why its not completing the build? and how I could fix this?? There's not much on the internet its just from what I've been able to gather from online forums and comments and I have been stuck on this for a few days now and I need to get it working for my uni project and its so frustrating :( I am a beginner with using the raspberry pi so any help would be greatly appreciated!
The build gets stuck at the following line: [ 83%] Building CXX object modules/python2/CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o
Thanks in advance Amir