-
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] Installation with R4.0.0 on Windows is broken #3064
Comments
I manually copied gendef.exe from the old RTools bundle and *magic, magic, installation worked! Do we need to contact Rtools maintainers? Or is it just me? |
Hi mayer79, exactly the same problem. I have tried different ways of solving it, but with no luck. |
SummaryFor people arriving from a search engine, if you have R 4.0.x, are trying to build the R package on Windows, and get this error:
First, please put a 👍 on this comment so we can get a sense of how many people are facingt the problem. You have two options for now
UPDATE: try the fix in #3064 (comment) until #3065 is merged The rest of the information below is for those who want to discuss why this is broken and how it will get permanently fixed. If you just want to get |
DetailsThank you for using
Thanks for trying this! It definitely makes sense that if I will look into this in the next day or two and contact CRAN about it if necessary. If you have time, I would appreciate if you could try my first suggestion in #3064 (comment) ( |
noting here that @RaminZi has reported the same issue with R4.0 on #2714 (comment) |
James, I tested with |
😱 ok thanks! I am going to be looking into this later today. I thought from https://github.com/r-windows/docs/blob/master/faq.md that all the mingw stuff that was in RTools 3.5 would be in 4.0, but maybe I made too many assumptions. I've been on R3.6.x in my personal dev environment (waiting for R 4.0 and RTools 4.0 to be out a bit longer), so I haven't hit this. Really appreciate your report and the information you gave to help us reproduce it. Worst-case, we can host By the way we are working hard in parallel on getting the package to CRAN to alleviate some of this pain. |
No worries, rtools40 is probably just slightly reorganized. Compiling the R packages itself work, so a compiler is still part of rtools ;-). lgb on CRAN would be the ultimate thing! |
I have a pull request coming in the next few days that I think will get us close. If you want to follow the progress you can subscribe to #629 . The CRAN package would be mingw-only for Windows, since Visual Studio isn't part of the CRAN toolchain for Windows, but for people who are ok with that I think it would make life easier. We'll get there! |
Thank you @jameslamb , I am sure many R users will appreciate this! |
I just created #3065 , which introduces a possible fix! It will take some time to get it ready to be merged (especially since I want to wait for #2965 to be merged so we can test with Visual Studio in CI), but if you want to try it you can run the following: git clone https://github.com/jameslamb/LightGBM.git
cd LightGBM
git fetch origin fix/r-4.0
git checkout fix/r-4.0
# install LightGBM
Rscript build_r.R
# test that it worked
cd R-package/tests
Rscript testthat.R ^ if anyone arriving at this issue tries that, please let me know how it goes! I updated to R 4.0 and Rtools 4.0 on my machine tonight and this is working for me. |
It worked (with VS compiler) - awesome! |
Worked for me as well. |
@jameslamb . Worked for me also; great. Thank you! Just a few remarks: I am attaching some screenshots that seem to be minor bugs, but better to pay attention. While performing, Test MM_PREFETCH and Test MM_MALLOC - Failed. Also, there is a warning (in Spanish) that says "The intermediate or the output directory cannot be in the temporary directory as it could lead to problems with incremental compilation_" Here is a screenshot of the PATH for Rtools, etc.. Also, with CreatePredictionEarlyStopInstance, "not all control paths return a value" Thanks a lot and feel free to ask for tests if they are needed. |
Thanks so much for trying it out, and especially to @gmobaz for the thorough report! Those warnings you noted are all current things that I've seen building our project even with R 3.6.x so I don't think we need to worry about them for now. |
To install
|
Thanks @jeroen for your help here and your amazing work on the R toolchain for Windows! I think we will move ahead with my proposal in #3065 , using I really want to preserve the user experience of our installation "just working" if you have CMake and Rtools. |
This worked for me also, you are great life saver, I am struggling this for last 2 days |
Thanks for the report @srinadhan , and for using The changes in #3065 will be merged in the next few days. |
This issue 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. |
Is it possible to install LightGBM with R 4.0.0? So far, I failed with different configs. This is my latest try. On my other Windows machine, I had no troubles today to build under R 3.6.3.
With a hack, it is possible, see my response
R 4.0.0 has been released with a new RTools version with different install paths etc.
Config
PATH
Error
PS C:\Users\Michael\LightGBM> 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
WARNING: directory 'lightgbm/src/compute/test' is empty
looking to see if a 'data/datalist' file should be added
building 'lightgbm_2.3.2.tar.gz'
installing to library 'C:/Users/Michael/Documents/R/win-library/4.0'
installing source package 'lightgbm' ...
** using staged installation
** libs
installing via 'install.libs.R' to C:/Users/Michael/Documents/R/win-library/4.0/00LOCK-lightgbm/00new/lightgbm
[1] "Trying to build with: 'Visual Studio 16 2019'"
-- Selecting Windows SDK version 10.0.15063.0 to target Windows 10.0.18362.
-- The C compiler identification is MSVC 19.25.28614.0
-- The CXX compiler identification is MSVC 19.25.28614.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
R version passed into FindLibR.cmake: 4.0.0
Creating R.lib and R.def
CMake Error at cmake/modules/FindLibR.cmake:48 (message):
Either gendef.exe or dlltool.exe not found!
Do you have Rtools installed with its MinGW's bin/ in PATH?
Call Stack (most recent call first):
cmake/modules/FindLibR.cmake:204 (create_rlib_for_msvc)
CMakeLists.txt:76 (find_package)
Comments
dlltool.exe is here:
In that folder,
gendef.exe
is not available though. On my other machine with old R and old RTools, "gendef.exe" is present. Hmm.The text was updated successfully, but these errors were encountered: