Then, every application in wolf (every gtest and every test) requires at runtime that the *.so (linux) or *.dylib (OSX) be available in the machine, otherwise it's a runtime error.
This only happens when I run in eclipse, but nevertheless we should only link every executable against its required libraries, not all.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
For example, this file test/gtest_rotation.cpp, which only requires Eigen.
I can use ldd [exec_file] in linux, or otool -L [exec_file] in OSX, to find out which libraries has it been linked to.
Surprisingly, you find it has been linked against apriltag, raw_gps_utils, laser_scan_utils, vision_utils, and a looot of other unused stuff including ceres and the whole opencv!
vermicelle:bin jsola$ otool -L ./gtest_rotation ./gtest_rotation: libapriltag.so (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1) @rpath/libwolf.dylib (compatibility version 0.0.0, current version 0.0.0) /usr/local/opt/ceres-solver/lib/libceres.1.dylib (compatibility version 1.0.0, current version 1.13.0) /usr/local/opt/gflags/lib/libgflags.2.2.dylib (compatibility version 2.2.0, current version 2.2.1) liblaser_scan_utils.dylib (compatibility version 0.0.0, current version 0.0.0) libraw_gps_utils.dylib (compatibility version 0.0.0, current version 0.0.0) libvision_utils.dylib (compatibility version 0.0.0, current version 0.0.0) /usr/local/opt/opencv/lib/libopencv_stitching.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_superres.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_videostab.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_photo.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_aruco.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_bgsegm.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_bioinspired.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_ccalib.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_dpm.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_face.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_fuzzy.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_img_hash.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_line_descriptor.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_optflow.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_reg.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_rgbd.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_saliency.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_stereo.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_structured_light.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_phase_unwrapping.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_surface_matching.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_tracking.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_dnn.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_datasets.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_plot.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_text.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_ml.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_xfeatures2d.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_shape.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_video.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_ximgproc.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_calib3d.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_features2d.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_flann.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_highgui.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_videoio.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_xobjdetect.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_imgcodecs.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_objdetect.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_xphoto.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_imgproc.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) /usr/local/opt/opencv/lib/libopencv_core.3.3.dylib (compatibility version 3.3.0, current version 3.3.0) libyaml-cpp.0.5.dylib (compatibility version 0.5.0, current version 0.5.3) /usr/local/opt/glog/lib/libglog.0.3.5.dylib (compatibility version 0.3.5, current version 0.0.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
So the thing is: if an executable execAB only uses libA and libB, but not libC, then I should not be linking it against libC, but only libA and libB and their dependencies.
This is important, because at any moment I want to uninstall, or upgrade, libC and the executable MUST continue to work.
I believe this would create smaller executables, and perhaps also would make linking faster.
In my case, the hot problem for me is that I cannot use the debugger in my Mac because of some libraries not found.
So it seems that the libs that we prepared (the 3 on top) are badly placed; and that the last external lib that we included (apriltag) is also wrong. Other external libs (ceres, opencv, glog, etc) seem all fine.
Then I understand that there are actually two issues:
The binaries get linked against everything, although they might not be needed:
This is a consequence of linking against libwolf.so since libwolf.so has been compiled with support for all these libraries I'd assume that whenever you link anything against Wolf it will be linked against all this libraries.
Some libs paths are seemingly missing:
@jsola Although your debugger complaints, you can run this binaries, right? Have you ran any binary that actually uses some of this "missplaced" libraries? Does it work?
@jcasals yes, two issues. the first one would be unimportant without the second, so let us discuss the second.
All execs work. It's just at debug time, and only from my Mac.
I believe it's possibly the wrong path which is causing this.
Maybe this is something that can be fixed from the CMakeLists.txt files in wolf, I don't know.
Maybe also, it is a linker problem in my mac, which does not take the correct path. To check this, can you run the ldd util in your linux system and see if the paths are OK?
@jsola It looks like the paths are correct on my side, but I only have the bare minimum installed to compile Wolf. I will install vision & scan utils and check again, since those two are missing for you.
@jsola I have installed vision_utils and laser_scan_utils. I've checked out the master branch and built Wolf. If I check which libraries is gtest_rotation linked against, this is the result:
At least for me, it looks like it is linked just against what is needed. Just to be sure I have checked a test that actually uses more things and this is the result (it also looks like all paths are correct):