4 ms·
This happens a lot, especially with dynamic linking. I have a project that uses Qt, OpenCV, CUDA, PCL and VTK - fairly standard stack for 3D imaging and visuali
by joshvm 9y ago
This happens a lot, especially with dynamic linking. I have a project that uses Qt, OpenCV, CUDA, PCL and VTK - fairly standard stack for 3D imaging and visualisation.
Since you normally need to bundle dependencies to account for different versions, this adds up quite fast. Qt adds 20MB for OpenGL, 15MB for the VC++ redist, about 30MB for other core libraries. Some stuff in OpenCV requires Nvidia's performance primitives (NPP), so in goes nppi64_80.dll - that's 100MB alone. opencv_cudaarithm310.dll is 70MB and even opencv_imgproc310.dll weighs in at 30MB. And on and on.
So yes, one little call to cv::cuda::remap adds in a boatload of dependencies when all the algorithm is doing is using a lookup table to sample an image.
https://github.com/opencv/opencv/blob/master/modules/cudawarping/src/cuda/remap.cu https://github.com/opencv/opencv/blob/master/modules/cudawar...
- maxxxxx 9y agoIt's pretty ironic that dynamic linking's main motivation was to eliminate duplicate code and reduce code size. Deploy a DLL once, every software uses it and doesn't have to include it. Now it has turned out exactly the opposite way. If we went back to linking object code together we would get smaller sizes. Instead we have to include huge DLLs.
- dfox 9y agoIIRC Windows has pretty involved infrastructure for deduplicating same executable images both in memory and on disk.
- verytrivial 9y ago> dynamic linking's main motivation was to eliminate duplicate code and reduce code size I'm pretty sure the main motivation is/was to allow patching of dependencies independently from applications. Very popular shared libraries might save space overall, but that is a secondary effect.
- maxxxxx 9y agoWhen I started out the main motivation was to get install sizes down. At least on Windows patching never really worked and ended in "DLL hell".
- boondaburrah 9y agoI had a fun time with this once. The Jetbrains Toolbox app is written using Qt and is 150mb. I opend the .app package on mac, deleted the frameworks directory, and symlinked it to my system's Qt install. It's now 6mb.
- AstralStorm 9y agoAnd it will break at random due to API or ABI incompatibility. Have fun gluing the pieces back together.
- boondaburrah 9y agoThey seem to build it against a reasonable version of Qt, I haven't updated it in a while (because it's just a launcher), and when I do I'll just re-symlink against whatever Qt is currently installed (which I do keep updated) I understand your argument, but in this particular case things aren't volatile enough that it causes any problems, and if it does it's just as easy to solve.