Ask Your Question

Revision history [back]

Build Python bindings separately

Hi,

Is it possible to build the Python bindings for OpenCV separately to the main build - something like a standard distutils setup.py?

On our supercomputer cluster we maintain quite a few versions of Python. As with all packages, each new version gets built and installed into it's own directory. Each of these versions needs their own Python bindings, linked against that particular version of Python, so what we usually do is install the main C/C++ libraries as usual and then build Python packages for each version as needed, linking against the already-installed C/C++ libraries. However, I can't work out how to separate the Python binding build for OpenCV from the main C/C++ build.

Our base application tree looks like this at the moment:

  • /apps/opencv/x.x.x (OpenCV x.x.x. installation - already have)
  • /apps/python/y.y.y (Python y.y.y installation - already have)

and we want to build and install the bindings at

  • /apps/opencv-python/x.x.x-y.y.y

The we can easily allow users to mix and match Python and OpenCV versions using the standard environment modules (e.g. doing module load opencv/1.2.3, module load python/4.5.6, module load opencv-python would add /apps/opencv-python/x.x.x-y.y.y to PYTHONPATH.

Could you let me know how we can do this?

Thanks, Ben