opencv-rust icon indicating copy to clipboard operation
opencv-rust copied to clipboard

add docs for static build on macOS(static=libtegra_hal,tbb,static=ittnotify,framework=OpenCL,z is required)

Open frederik-uni opened this issue 5 months ago • 2 comments

I tried to link opencv statically & it decided to link against dylibs, anyway. to get the errors I deleted the dylibs from my system & figured out by the missing symbols whats actually required which are these libs/framekworks static=libtegra_hal,tbb,static=ittnotify,framework=OpenCL,z

export OPENCV_LINK_LIBS=+static=opencv_core,static=opencv_imgproc,static=opencv_calib3d,static=libtegra_hal,tbb,static=ittnotify,framework=OpenCL,z

frederik-uni avatar Sep 21 '25 09:09 frederik-uni

These kind of things are extremely system-dependent (OS, system capabilities like CUDA, how OpenCV was installed, what features was OpenCV built with, what features does your crate use), so they have little value as a general advice. Usually they are resolved automatically when you use an OpenCV detection tool like cmake, pkg-config or vcpkg, but when you need to set up the detection manually via environment vars you'll need to go through the process of finding out what your situation exactly needs. With static linking the order of the link libs also matters, leaf libs go first, root libs go last.

twistedfall avatar Sep 22 '25 06:09 twistedfall

@twistedfall im so sorry I didn’t mean windows, but macOS. A hint for the prebuilt binaries would’ve been nice. Maybe as a hint what features require which libs

frederik-uni avatar Sep 22 '25 10:09 frederik-uni