-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fix oom() compile time linker error #2238
Comments
@robdarvell this is a temporary fix that should technically work, but is not the real longterm solution:
For Makefile.in:
|
The solution will be 1) removing the circular dependencies and 2) adjusting link order.
Goal: Recommend adding README.md file to top-level library file to define these dependencies and update the Contributor's Guide to point to that README.md.
|
@hsoh-u have you figured out a way to run the linker to actually fail when these circular dependencies exist? If we're able to figure that out, I'd recommend we add those options to our GHA compilation of MET so that we force the compilation to fail when we introduce unresolved dependencies. |
I tried to move where "usage" and "process_command_line" were called (from met_main at various MET applications to main at main.cc). The link errors happened at seneca and was not simple to resolve it. |
Describe the Problem
@robdarvell reports via Slack that MET-11.0.0-beta2 fails to compile due to a linker error.
This was added in beta2 but introduced a new dependency. The vx_log library now depends on the vx_util library. But I'm sure that vx_util already depends on vx_log. To avoid a circular dependency, recommend main.cc from vx_log into the vx_util library. Listed below is a
The first step here is trying to replicate this linker error. Check for
ld
options to enforce strict dependency checking. It would be nice for this to be flagged during development rather than leaving it to users to find.Once we can replicate the error, confirm that moving main.cc into vx_util actually fixes it. Of course, this may impact the linking for other applications.
Here's a more detailed description of the problem:
The oom() (i.e. out-of-memory) handler is defined in vx_util/memory.cc. But it is called by vx_log/main.cc. That means that vx_log has a dependency on vx_util. And that means that we need "-lvx_log" to be followed by "-lvx_util" somewhere in the link in src/tools/core/ensemble_stat/Makefile.am. But this is NOT the case. "-lvx_log" is basically last and "-lvx_util" does not appear after it.
Only need to fix this for MET-11.0.0-beta3. We do not provide bugfixes for beta releases.
Expected Behavior
MET-11.0.0-beta3 should compile/link even when strict library dependencies are enforced.
Environment
Describe your runtime environment:
1. Machine: (e.g. HPC name, Linux Workstation, Mac Laptop)
2. OS: (e.g. RedHat Linux, MacOS)
3. Software version number(s)
To Reproduce
Describe the steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
Post relevant sample data following these instructions:
https://dtcenter.org/community-code/model-evaluation-tools-met/met-help-desk#ftp
Relevant Deadlines
List relevant project deadlines here or state NONE.
Funding Source
2799991
Define the Metadata
Assignee
Labels
Projects and Milestone
Define Related Issue(s)
Consider the impact to the other METplus components.
No impacts.
Bugfix Checklist
See the METplus Workflow for details.
Branch name:
bugfix_<Issue Number>_main_<Version>_<Description>
Pull request:
bugfix <Issue Number> main_<Version> <Description>
Select: Reviewer(s) and Linked issues
Select: Organization level software support Project for the current coordinated release
Select: Milestone as the next bugfix version
Branch name:
bugfix_<Issue Number>_develop_<Description>
Pull request:
bugfix <Issue Number> develop <Description>
Select: Reviewer(s) and Linked issues
Select: Repository level development cycle Project for the next official release
Select: Milestone as the next official version
The text was updated successfully, but these errors were encountered: