Made compile script work on MacOS, added OpenCV dependency.