-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit Tests Are Dynamically Linking Against Installed Libraries Rather Than The Newest Libraries #4556
Comments
Aside: We are almost at a stage where an install should not be required. That would be punting on this issue, of course. |
@liangfok The instructions do not guarantee correctness for any build other than the superbuild, so I'm going to downgrade this to medium priority. That said, I agree it's annoying and I don't totally understand why it's happening.
I'm absolutely on board with removing the install step, and considering that a good-enough resolution. What are the remaining obstacles? |
Removing pods.cmake and SWIG, I think. The removing pods.cmake is mostly done (I have a POD-free branch locally). The SWIG part, I have not thought about yet. I doubt it would be difficult. |
Right, I believe SWIG belongs to @mwoehlke-kitware on #4486. |
Yes, though I think MATLAB would probably have to stay with SWIG and the logic changed not to require an install. |
The only caveat, is that for now Director may need an install of Drake. That can be fixed. |
Actually, I can't reproduce the original problem. My That said, we've had all sorts of non-hermetic |
After a F2F meeting with @david-german-tri, using Here is @david-german-tri's command:
Here is my command:
Using Basically, the problem is on my computer, |
^ Which is some kind of super weird CMake behavior, I guess? |
CMake is ultimately responsible, but the RPATH is apparently being "abused" by PODs. |
With #2482 closed, I wonder if this issue has an updated disposition? |
I will retest |
I retested this on my Ubuntu 14.04 workstation using cf497e8 and was able to replicate the issue. This issue shall thus remain open. 😭 |
@jamiesnape, I've reassigned this to you, and downgraded the priority to "low" since it's CMake-specific. |
@liangfok Now that we use Bazel to build Drake, is this still an issue? |
Closing, as this no longer seems relevant per Jamie's comment. |
Problem Definition
When running a unit test, we often want it to dynamically linked against the latest version of Drake's libraries (located in
drake-distro/build/drake/...
) as opposed to the installed version (located indrake-distro/build/install/...
) since the installed versions are typically older. A common use case is we want to instrument the Device Under Test (DUT) with temporary debug print statements. By linking against the installed library rather than the most recent library, these print statements will not show up, resulting in confusion.How to Replicate the Problem
The following was tested on an Ubuntu 14.04 system.
Starting from a clean build environment, execute the following:
You should see that the unit test
package_map_test
successfully ran.Next, open
drake-distro/drake/multibody/parsers/package_map.cc
and modify methodContains()
to be:Note the newly added log statement, which results in a message being printed to the console.
Save and exit your text editor, then execute the following commands:
You should see that the modification did not apply (nothing new is printed to the screen). This is presumably because the executable linked against the old (installed) version of the library containing
PackageMap
(drake-distro/build/install/lib/libdrakeMultibodyParsers.so
) instead of the newest non-installed version (drake-distro/build/drake/multibody/parsers/libdrakeMultibodyParsers.so
).To resolve the problem, we need to build at the super-build level:
You should now see that the newly added print statement results in a bunch of text being printed to the console.
The text was updated successfully, but these errors were encountered: