I am trying to install LightGBM on my windows laptop. I have it installed on an AWS Ubuntu/Lunix instance but I keep getting errors on my windows laptop...
In the terminal using my RStudio windows version I run:
git clone --recursive https://github.com/microsoft/LightGBM
cd LightGBM
Rscript build_r.R
Which gives the following output:
Microsoft Windows [Versión 10.0.17763.1039]
(c) 2018 Microsoft Corporation. Todos los derechos reservados. # Spanish but all rights reserved.
C:\Users\USER\Documents>git clone --recursive https://github.com/microsoft/LightGBM
Cloning into 'LightGBM'...
remote: Enumerating objects: 207, done.
remote: Counting objects: 100% (207/207), done.
remote: Compressing objects: 100% (172/172), done.
Receiving objects: 100% (16659/16659), 11.36 MiB | 1.86 MiB/s, done.
Resolving deltas: 100% (12071/12071), done.
Submodule 'include/boost/compute' (https://github.com/boostorg/compute) registered for path 'compu
te'
Cloning into 'C:/Users/USER/Documents/LightGBM/compute'...
remote: Enumerating objects: 21728, done.
remote: Total 21728 (delta 0), reused 0 (delta 0), pack-reused 21728
Receiving objects: 100% (21728/21728), 8.51 MiB | 1.79 MiB/s, done.
Resolving deltas: 100% (17565/17565), done.
Submodule path 'compute': checked out '36c89134d4013b2e5e45bc55656a18bd6141995a'
C:\Users\USER\Documents>cd LightGBM
C:\Users\USER\Documents\LightGBM>Rscript build_r.R
* checking for file 'lightgbm_r/DESCRIPTION' ... OK
* preparing 'lightgbm':
* checking DESCRIPTION meta-information ... OK
* cleaning src
Warning in cleanup_pkg(pkgdir, Log) :
unable to run 'make clean' in 'src'
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* looking to see if a 'data/datalist' file should be added
* building 'lightgbm_2.3.2.tar.gz'
* installing to library 'C:/Users/USER/Documents/R/win-library/3.6'
* installing *source* package 'lightgbm' ...
** using staged installation
** libs
Warning in system(cmd) : 'make' not found
ERROR: compilation failed for package 'lightgbm'
* removing 'C:/Users/USER/Documents/R/win-library/3.6/lightgbm'
Error in .run_shell_command(cmd) : Command failed with exit code: 1
Ejecución interrumpida
Error: Warning in system(cmd) : 'make' not found
I have tried many times to install make
. I have updated Rtools also.
Edit 1:
Session Info:
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)
Matrix products: default
locale:
[1] LC_COLLATE=Spanish_Spain.1252 LC_CTYPE=Spanish_Spain.1252 LC_MONETARY=Spanish_Spain.1252
[4] LC_NUMERIC=C LC_TIME=Spanish_Spain.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] Rcpp_1.0.2 rstudioapi_0.10 magrittr_1.5 usethis_1.5.1 devtools_2.1.0
[6] pkgload_1.0.2 R6_2.4.0 rlang_0.4.0 tools_3.6.1 pkgbuild_1.0.4
[11] sessioninfo_1.1.1 cli_1.1.0 withr_2.1.2 remotes_2.1.0 assertthat_0.2.1
[16] digest_0.6.21 rprojroot_1.3-2 crayon_1.3.4 processx_3.4.1 callr_3.3.1
[21] fs_1.3.1 ps_1.3.0 curl_4.0 testthat_2.2.1 memoise_1.1.0
[26] glue_1.3.1 compiler_3.6.1 desc_1.2.0 backports_1.1.4 prettyunits_1.0.2
EDIT 2:
I managed to pass the `make not found` argument, when I run the code now I get.
$ Rscript build_r.R
* checking for file 'lightgbm_r/DESCRIPTION' ... OK
* preparing 'lightgbm':
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* looking to see if a 'data/datalist' file should be added
* building 'lightgbm_2.3.2.tar.gz'
* installing to library 'C:/Users/USER/Documents/R/win-library/3.6'
* installing *source* package 'lightgbm' ...
** using staged installation
** libs
installing via 'install.libs.R' to C:/Users/USER/Documents/R/win-library/3.6/00LOCK-lightgbm/00new
/lightgbm
Warning in system(paste0(tmp_cmake_cmd, " ..")) : 'cmake' not found
Warning in system(paste0(tmp_cmake_cmd, " ..")) : 'cmake' not found
Warning in system(paste0(tmp_cmake_cmd, " ..")) : 'cmake' not found
Warning in system(paste0(cmake_cmd, " ..")) : 'cmake' not found
Warning in system(build_cmd) : 'cmake' not found
Error in eval(ei, envir) : Cannot find lib_lightgbm.dll
* removing 'C:/Users/USER/Documents/R/win-library/3.6/lightgbm'
Error in .run_shell_command(cmd) : Command failed with exit code: 1
Ejecución interrumpida
I downloaded cmake
but I still get the same error.
Based on your comments from chat, it seems you've installed Rtools
into a non-standard folder (something other than C:/Rtools
), which may have resulted in C:/Rtools/bin
not being part of your PATH
.
Try the following
Sys.setenv(PATH = paste("C:/Rtools/bin", Sys.getenv("PATH"), sep=";"))
Make sure you change "C:/Rtools/bin"
to reflect the folder in which you installed Rtools
.
If the folder is C:\rtools40
, change it do
Sys.setenv(PATH = paste("C:/rtools40/bin", Sys.getenv("PATH"), sep=";"))
Then try re-installing lightgbm
as per the official instructions.