Troubleshooting

Solutions to common issues when building and testing Hybrid Compute.

Missing cv2 Module

Error: ModuleNotFoundError: No module named 'cv2'

Solution:

pip install --break-system-packages opencv-python numpy
python3 -c "import cv2; print('cv2 works:', cv2.__version__)"

OpenCV Version Warnings

Warning: Building for macOS-11.0 but linking with newer dylib

Solution: Add to CMakeLists.txt:

set(CMAKE_OSX_DEPLOYMENT_TARGET "14.0")

Missing Dependencies

OpenMP Support:

brew install libomp

CUDA Support:

export CUDAToolkit_ROOT=/usr/local/cuda

Build Fails

Clean Build:

rm -rf build
mkdir build && cd build
cmake ..
make -j$(sysctl -n hw.logicalcpu)

Python Environment Conflicts

Use a virtual environment:

python3 -m venv venv
source venv/bin/activate
pip install opencv-python numpy

Quick Fix

pip install --break-system-packages opencv-python numpy && ctest --test-dir build --output-on-failure

Verification

python3 -c "import cv2; print('cv2 works:', cv2.__version__)"
ctest --test-dir build --output-on-failure

Expected Results

Platform Notes

macOS: Use Homebrew, Xcode Command Line Tools required, Metal shaders compile automatically.

Linux: Use apt/yum, CUDA toolkit available, OpenMP typically available by default.

Windows: Use Chocolatey, Visual Studio Build Tools required, Google Benchmark disabled.