-
Notifications
You must be signed in to change notification settings - Fork 30
Enable static builds with pkg-config integration. #288
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
Conversation
vt-tv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks for your contribution!
|
You are mising the SPDX headers/comments in these files : lib/tests/test_pkgconfig_c_link.cpp |
vt-tv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments about SPDX
jonasohland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, the same changes need to be applied to targets in lib/fabrics/ofi
KimonHoffmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for this contribution and filling in the missing bits for the static library build. That has been long on my TODO list and I very much appreciate being able to tick this off now.
Regarding the pkg-config compile check I'm a bit conflicted. I think it's a good idea, but having it as part of the tests on the side feels wrong to me. Could you please transform this into a post-build step that is independent of the other tests?
Also regarding the C++ parts of this PR please try to match the style present in other tests with regards to pointer types, right hand types and explicit qualification of entities in the global namespace.
0be1757 to
2d0aa94
Compare
Resolved |
vt-tv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy issues introcued by the spdx changes.
I moved the pkg-config consumer test out of Catch2, removed the cpp wrapper, and added a standalone CTest test (via add_test()) that executes the test shell script directly. It is cleaner this way. Does that address your "independent of other tests" concern? |
I removed the cpp wrapper that would have produced that. So it's now a non-issue I believe. |
jonasohland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if we could have the test script also test linking the fabrics API. But fabrics is not in scope for v1.0.0, so I will just add that later.
I can do it. I looked at the fabric code and noticed that it was not documented yet and not enabled so I was uncertain. It's not a problem for me to add it to the test script so I'll do that. Standby for that update. |
Or if this goes in first then I'll do it a followup PR. |
pedro-alves-ferreira
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Thank you for making the changes regarding position independent code. Could you please have a look at my suggestion regarding the linker invocation above? |
KimonHoffmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dummy comment to set the status of my review to to "request changes".
11dd246 to
33fe8f0
Compare
c488e19 to
7d71eb0
Compare
- Respect BUILD_SHARED_LIBS for mxl, mxl-common, and mxl-fabrics - Add MXL_ENABLE_PIC option (default ON) for static builds - Fix CMake export set dependencies involving mxl-internal-headers - Update libmxl.pc to correctly express static linking requirements - Add test to validate pkg-config C consumer linking (static and shared) - Add "CMAKE_LINKER_TYPE": "LLD" to the clang preset to resolve LTO linking in the test. Signed-off-by: jpt <jim.trainor@jptrainor.com>
|
@jptrainor Is the request for changes from Kimon adressed? |
Yes |
Ready to merge (with rebase)? if so I'll do it now. |
This PR fixes static build correctness across CMake and
pkg-config.Static build issues surfaced while implementing static linking using
pkg-configfor an ffmpeg/MXL integration. MXL supported shared-library builds only, ignoredBUILD_SHARED_LIBS, and provided incompletepkg-configmetadata for static linkage.Key build-related changes:
BUILD_SHARED_LIBS=ON|OFFacross mxl targetsMXL_ENABLE_PIC(default ON) to support static builds used in shared contextsThis change adds a C consumer link test to prevent regressions.
Tested with:
BUILD_SHARED_LIBS=ON|OFF)The ffmpeg integration lives in a downstream fork and is still being
finalized, but is included here for reference:
https://github.com/cbcrc/FFmpeg/tree/dmf-mxl/master