-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[ci] use lowercase library names in linker flags #5870
Conversation
Changed casing of link libraries: Ws2_32 -> ws2_32 IPHLPAPI -> iphlpapi
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.
Thanks for taking the time to contribute to LightGBM!
Can you give some specific examples of "potential issues arising from the inconsistent capitalization of the library names" to help us understand this proposed change?
I was trying to create libraries for Julia using BinaryBuilder.jl, during compilation I found the following errors for windows: /opt/x86_64-w64-mingw32/bin/../lib/gcc/x86_64-w64-mingw32/7.1.0/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lWs2_32
/opt/x86_64-w64-mingw32/bin/../lib/gcc/x86_64-w64-mingw32/7.1.0/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lIPHLPAPI when refering to the documentation of the builders, I found that the libraries were in lowercase for linux, and since windows is case insensitive, I think this change would allow more projects to build LightGBM without making downstream patches. |
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.
Works for me! We don't use MinGW to cross-compile Windows artifacts on Linux (we just directly compile on Windows), so haven't run into the issues you've described.
But we've been using all-lowercase library names in the same linker flags for CMake-driven builds of the R package on Windows for a few years now, without issue:
LightGBM/R-package/src/Makevars.win.in
Lines 18 to 22 in 7c71db0
PKG_LIBS = \ | |
${SHLIB_OPENMP_CXXFLAGS} \ | |
${SHLIB_PTHREAD_FLAGS} \ | |
-lws2_32 \ | |
-lIphlpapi |
So given that + all the passing CI jobs, I'm confident this change won't cause issues.
Thanks for the contribution!
Oh wait actually I just realized there's a capital LightGBM/R-package/src/Makevars.win.in Line 22 in 7c71db0
|
@microsoft-github-policy-service agree |
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 great, thanks so much!
It's great to start contributing to the libraries I use |
of course! We'd love to have more of your help here in LightGBM if you have time and interest 😁 |
This pull request has been automatically locked since there has not been any recent activity since it was closed. |
This change should improve compatibility and consistency with other projects and build tools, and prevent any potential issues arising from the inconsistent capitalization of the library names.