How can I check if the OpenCV libraries installed on my Linux machine are compiled against TBB libraries or not?
Asked
Active
Viewed 6,657 times
1 Answers
16
Print the shared library dependencies of *libopencv_core* using ldd:
ldd /usr/local/lib/libopencv_core.so
And you should see TBB on the list.
If you were on Mac OS X the equivalent is otool -L, and on my system it outputs:
/Users/karlphillip/installers/OpenCV-2.4.2/build/lib/libopencv_core.2.4.dylib (compatibility version 2.4.0, current version 2.4.2)
libtbb.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
So according to the output above, my OpenCV installation was built to support TBB. ;D

karlphillip
- 92,053
- 36
- 243
- 426
-
Would it be possible to perform this check with CMake without relying on ldd ? – remi Oct 10 '12 at 12:47
-
Yes. After you execute cmake it prints a list of the features that it supports and that will be compiled. – karlphillip Oct 10 '12 at 12:57
-
So, when in your own project you use FindPackage(OpenCV), you are able to search like OpenCV_HAS_TBB ? – remi Oct 10 '12 at 13:04
-
Something like that. Download OpenCV sources and check the file `OpenCVDetectTBB.cmake`. – karlphillip Oct 10 '12 at 13:15
-
1On Mac the command is `otool -L /usr/local/lib/libopencv_core.2.4.dylib` – Robert May 26 '14 at 14:43
-
I'd personally like to find out how to do this within CMake. Running ldd or whatever is not directly supported by build systems and is not portable. – AcidTonic Dec 21 '21 at 15:51