LightGBM: Install R package error ( Windows10 )
Environment info
Windows 10 x64 R version 3.5.1(Path) Rtools34 (Path) VS 2017 Cmake(Path)
Running following command in RStudio
devtools::install_github("Laurae2/lgbdl", force = TRUE)
library(lgbdl)
lgb.dl(commit = "master",
compiler = "vs",
repo = "https://github.com/Microsoft/LightGBM",
cores =6,
r35 = true)
Error message
* installing *source* package 'lightgbm' ...
** libs
c:/Rtools/mingw_64/bin/gcc -I"C:/R/R-35~1.1/include" -DNDEBUG -O2 -Wall -std=gnu99 -mtune=generic -c R_init.c -o R_init.o
c:/Rtools/mingw_64/bin/gcc -shared -s -static-libgcc -o lightgbm.dll tmp.def R_init.o -LC:/R/R-35~1.1/bin/x64 -lR
installing via 'install.libs.R' to C:/R/R-3.5.1/library/lightgbm
eval(ei, envir) error : Copying CMakeLists failed
* removing 'C:/R/R-3.5.1/library/lightgbm'
In R CMD INSTALL
[1] FALSE
Warning message:
In install.packages(file.path(lgb_git_dir, "LightGBM", "R-package", :
installation of package ‘C:/Users/Kline/AppData/Local/Temp/Rtmpwb0XlY/LightGBM/R-package’ had non-zero exit status
I found the error message “Copying CMakeLists failed” in the following URL (line 20), but I don’t know how to fix it. Please help me. https://github.com/Microsoft/LightGBM/blob/master/R-package/src/install.libs.R
# Move in CMakeLists.txt
if (!file.copy("../inst/bin/CMakeLists.txt", "CMakeLists.txt", overwrite = TRUE)){
stop("Copying CMakeLists failed")
}
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19 (3 by maintainers)
When I attempt to install the R package on Windows with the precompiled dll, even after following the install instructions and copying the .dll, I get
This is unusual. Followed all the install instructions and the instructions in this comment, and even tried putting the .dll all over the place. But it still couldn’t be found.
It is the same as spedygiorgio’s issue.
hey guys i just installed lightgbm package these are the steps to reproduce :
1 - git clone --recursive https://github.com/Microsoft/LightGBM 2 - cd LightGBM 3 - open R-package/src/install.lib and change use_precompile from FALSE to TRUE 4 - go to root directory of lightgbm and copy cmakelists and paste it to R-package/inst/bin 5 - cd lightGBM 6 - Rscript build_r.R 7 - cd r_lightgbm 8 - R CMD INSTALL --build . --no-multiarch
@Kallikrates
make sure you have mingw32-make.exe in your PATH.
C:\Rtools\bin;to your system PATH, close terminal and reopen try again;C:\ProgramFiles\CMake(without space in the path) and add it to the PATH variable, close and reopen , try again;@teru111 pleage see : https://github.com/Laurae2/lgbdl/issues/4
you’d better use Rtools35, if you use gcc compiler
create a
temp.batwith the following codes if you usevscompiler :run the
temp.batgcccompiler :C:\LightGBM\R-package\src\install.libs.Ruse_precompile <- TRUEif (!file.copy("../../CMakeLists.txt", "../CMakeLists.txt", overwrite = TRUE)){ stop("Copying CMakeLists failed") }install.packages(file.path("C:", "LightGBM", "R-package", fsep = "\\"), repos = NULL, type = "source")the gcc compiler can be reproducible and tested in my Windows computer