Skip to content
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

Add -lm to library list for plugins #380

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

bwbarrett
Copy link
Contributor

The tuner uses the log2 function that is defined in libm, but we were relying on someone else to pull in libm, which is technically wrong. Checking for what library provides libm fixes this issue, with the side effect of adding a -lm to the link line for the libnccl-net plugin. This is not strictly needed, but linkers also will do the right thing most of the time and not actually include that dependency in the list of libraries that must be loaded for the plugin. So this is a lot less configure code compared to each plugin having its own LIBS list, for the same outcome.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The tuner uses the log2 function that is defined in libm, but we
were relying on someone else to pull in libm, which is technically
wrong.  Checking for what library provides libm fixes this issue,
with the side effect of adding a -lm to the link line for the
libnccl-net plugin.  This is not strictly needed, but linkers also
will do the right thing most of the time and not actually include
that dependency in the list of libraries that must be loaded for
the plugin.  So this is a lot less configure code compared to
each plugin having its own LIBS list, for the same outcome.

Signed-off-by: Brian Barrett <bbarrett@amazon.com>
@bwbarrett bwbarrett requested a review from a team April 9, 2024 17:40
@bwbarrett
Copy link
Contributor Author

Thanks to @aws-nslick for pointing this out.

@ghost
Copy link

ghost commented Apr 9, 2024

Thanks Brian, LGTM.

@rajachan rajachan merged commit 5a27309 into aws:master Apr 9, 2024
13 checks passed
@bwbarrett bwbarrett deleted the bugfix/missing-lm branch April 12, 2024 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants