How to use lightgbm in a R package


I’m using lightgbm in my package.

Below, the specifics of lightgbm installation:

cd Downloads
git clone --recursive
cd LightGBM/R-package
export CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++
R CMD INSTALL --build . --no-multiarch

How do I set the automatic install in the DESCRIPTION field?
Using Remotes with:

obviously doesn’t work…



lightgbm does not use a standard installation procedure, so you cannot use it in Remotes. In particular it uses submodules (which are not supported by devtools), does not work on 32 bit R, and requires the R package to be built from within the LightGBM tree. FWIW the correct Remotes syntax if this were to work would be Remotes: Microsoft/LightGBM/R-package.

There is not a way to have it automatically installed for your package solely based on the DESCRIPTION file.

You could potentially install it in your packages’ configure script, but this would be non-trivial to do correctly.


Thanks Jim
I’ll notify the developers, I know it’s in their todo list to submit to CRAN…