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

Adding static library option #3171

Merged
merged 2 commits into from Jun 26, 2020
Merged

Adding static library option #3171

merged 2 commits into from Jun 26, 2020

Conversation

ghost
Copy link

@ghost ghost commented Jun 16, 2020

This adds a cmake option to build the library statically which is useful when linking into a static executable. The option is disabled by default.

@jameslamb jameslamb removed their request for review June 17, 2020 14:26
@StrikerRUS
Copy link
Collaborator

I guess this piece of code should be updated as well:

LightGBM/CMakeLists.txt

Lines 216 to 220 in e83042f

if(APPLE_OUTPUT_DYLIB)
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
else()
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
endif()

@ghost
Copy link
Author

ghost commented Jun 18, 2020

I believe the shared library suffix code should be fine as is since I don't think CMAKE_SHARED_LIBRARY_SUFFIX is used explicitly anywhere.

@StrikerRUS
Copy link
Collaborator

@dpayne I mean, APPLE_OUTPUT_DYLIB should affect suffix for static library, shouldn't it?

@ghost
Copy link
Author

ghost commented Jun 18, 2020

Apple should only be using DYLIB when building the shared library. I know this isn't definitive but at least on my local mac book I get
[100%] Linking CXX static library ../lib_lightgbm.a
The suffix there is that static lib suffix.

@jameslamb
Copy link
Collaborator

@dpayne I apologize for the inconvenience, but could you please merge the most recent changes from master into this branch?

We have had some recent changes to our continuous integration setup that you'll need for this PR to pass checks.

Thanks for using and contributing to LightGBM!

@yiwiz-sai
Copy link

very cool, static library is necessary !

@StrikerRUS StrikerRUS merged commit 2e2757f into microsoft:master Jun 26, 2020
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants