-
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
[R-package] Introduce R-specific control of lib_lightgbm #2837
Conversation
thanks @jameslamb ! |
Just want to say that I'm really excited to see we have some progress on #629! Thank you James! |
Can't we achieve the same goal via CMake options to not play around with LightGBM/R-package/src/install.libs.R Lines 43 to 45 in 53137e2
|
BUT you're right, passing the argument to |
Can you point me to the code where we build the dll / so files that we include with each release? I'd be happy to update that code / documentation to show how to build a version of the library specifically for R (with this flag). But I don't think we need to do anything in |
I think we will publish a separate artifacts in our |
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.
Confirm that one item from a note is eliminated! 🎉
I mean, sometimes user will build the dll first, then install python /R packages. After this PR, I think python/R will not share the same dll. So we need the build options to build R dll, maybe including msvc project file. |
yep, makes sense! I agree, from this point we should have a different Another option we could give is an R package @StrikerRUS to answer your question...yes CRAN allows for precompiled packages, but you cannot publish them yourself. That is done for security reasons, so that CRAN tightly controls what software people can get into your environment via CRAN. We have to have a working source distribution (one that gets compiled when users download and install it) first, which means yes we have to close #629 first. From the CRAN policies:
|
4b0d382
to
34d19a9
Compare
@jameslamb According to my lgbdl package, the precompiled library should be at the root of the LightGBM folder. The file is then checked by install.libs.R if use_precompile is |
perfect, thanks |
I'm going to rebase to |
…ib_lightgbm for the R package
34d19a9
to
ac4599d
Compare
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. |
I've been working on #1440 / #1909 (as part of #629 ), and am still struggling with it. But I think that a small part of what I've done can be introduced right now, and that it actually might be easier to discuss it as its own thing.
I'm currently working on this NOTE from
R CMD CHECK
:Similar to the way XGBoost solved this, I'd like to introduce a new define that tells the compiler "hey
lib_lightgbm
is being compiled for use with the R package".I first tried to do this to introduce
Rprintf()
, the R equivalent toprintf()
, inlog.h
. I've been running into some complications there that will take some more time to address, so for this PR I'd like to focus on one isolated case not related to logging.This comes from
src/io/json11.cpp
. This PR uses-DLGB_R_BUILD
to say "excludecassert
if you're building the R package"...and I can confirm it works! After running the code below:I get the following output (notice that
assert
is no longer mentioned!):That command also runs all the R tests, so this should pass CI and doesn't seem to be affecting the R package's functionality.
If this PR is approved and merged, then the next thing I'll work on is
log.h
, where for example I'll try to make something like this work:Thanks for your time!