Building a completely statically compiled OpenCV for Linux

asked 2018-04-23 15:48:11 -0500

I'm working on building a static version of OpenCV with CUDA enabled. I have -D SHARED_LIBS=OFF -D CUDA_USE_STATIC_CUDA_RUNTIME=ON which seems to be the flags I need to pass, but if I take the statically compiled OpenCV built binaries (and libraries) and run opencv_version I get error while loading shared libraries: libcudart.so.9.1.

Is there a way to _truly_ statically compile OpenCV or will I have to ship CUDA with the build as well? Additionally, when I try and load the "static" python library, I'm getting a message about ImportError: libharfbuzz.so.0: cannot open shared object file

So it really seems like I'm missing _something_ to build OpenCV statically to slim down Docker containers...

edit retag flag offensive close merge delete