You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[R-package] Add support for R 4.0 (fixes#3064, fixes#3024) (#3065)
* [R-package] replaced gendef.exe with R code to create R.def (fixes#3064)
* fix broken things
* trying to add R4.0 docs
* changed make
* fixing make paths
* update notes on environment variables
* fix linting
* fixes to CI
* fixing build_cmd and other stuff
* fix bad substitution
* fix Azure Linux builds
* I am bad at bash
* simplifying
* only testing R
* getting better logs
* mingw32
* docs
* toolchain
* using msys
* fix visual studio condition
* toolchain test
* full CI
* fix if-elses
* bump allowed NOTEs
* search for Rscript
* updates to docs
* use processx
* fix mismatched arguments
* move CI to GitHub Actions
* minor changes
* fix workflow file
* fix templating
* fix Azure DevOps
* debugging windows builds
* dont shQuote file name
* all GitHub Actions jobs
* Apply suggestions from code review
Co-authored-by: Nikita Titov <nekit94-08@mail.ru>
* minor cleanup
* remove objdump printing
* make file.remove() invisible
* Apply suggestions from code review
Co-authored-by: Nikita Titov <nekit94-08@mail.ru>
* reduce duplicated paths in docs
Co-authored-by: Nikita Titov <nekit94-08@mail.ru>
Copy file name to clipboardExpand all lines: R-package/README.md
+42-3Lines changed: 42 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,14 +20,53 @@ Note: 32-bit (i386) R/Rtools is currently not supported.
20
20
21
21
#### Windows Preparation
22
22
23
-
Installing [Rtools](https://cran.r-project.org/bin/windows/Rtools/) is mandatory, and only support the 64-bit version. It requires to add to PATH the Rtools MinGW64 folder, if it was not done automatically during installation.
23
+
Installing a 64-bit version of [Rtools](https://cran.r-project.org/bin/windows/Rtools/) is mandatory.
24
24
25
-
The default compiler is Visual Studio (or [VS Build Tools](https://visualstudio.microsoft.com/downloads/)) in Windows, with an automatic fallback to Rtools or any [MinGW64](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/) (x86_64-posix-seh) available (this means if you have only Rtools and CMake, it will compile fine).
25
+
After installing `Rtools` and `CMake`, be sure the following paths are added to the environment variable `PATH`. These may have been automatically added when installing other software.
26
26
27
-
To force the usage of Rtools / MinGW, you can set `use_mingw` to `TRUE` in `R-package/src/install.libs.R`.
27
+
*`Rtools`
28
+
- If you have `Rtools` 3.x, example:
29
+
- `C:\Rtools\mingw_64\bin`
30
+
- If you have `Rtools` 4.0, example:
31
+
-`C:\rtools40\mingw64\bin`
32
+
-`C:\rtools40\usr\bin`
33
+
*`CMake`
34
+
- example: `C:\Program Files\CMake\bin`
35
+
*`R`
36
+
- example: `C:\Program Files\R\R-3.6.1\bin`
37
+
38
+
NOTE: Two `Rtools` paths are required from `Rtools` 4.0 onwards because paths and the list of included software was changed in `Rtools` 4.0.
39
+
40
+
#### Windows Toolchain Options
41
+
42
+
A "toolchain" refers to the collection of software used to build the library. The R package can be built with three different toolchains.
28
43
29
44
**Warning for Windows users**: it is recommended to use *Visual Studio* for its better multi-threading efficiency in Windows for many core systems. For very simple systems (dual core computers or worse), MinGW64 is recommended for maximum performance. If you do not know what to choose, it is recommended to use [Visual Studio](https://visualstudio.microsoft.com/downloads/), the default compiler. **Do not try using MinGW in Windows on many core systems. It may result in 10x slower results than Visual Studio.**
30
45
46
+
**Visual Studio (default)**
47
+
48
+
By default, the package will be built with [Visual Studio Build Tools](https://visualstudio.microsoft.com/downloads/).
49
+
50
+
**MinGW (R 3.x)**
51
+
52
+
If you are using R 3.x and installation fails with Visual Studio, `LightGBM` will fall back to using [MinGW](http://mingw-w64.org/doku.php) bundled with `Rtools`.
53
+
54
+
If you want to force `LightGBM` to use MinGW (for any R version), open `R-package/src/install.libs.R` and change `use_mingw`:
55
+
56
+
```r
57
+
use_mingw<-TRUE
58
+
```
59
+
60
+
**MSYS2 (R 4.x)**
61
+
62
+
If you are using R 4.x and installation fails with Visual Studio, `LightGBM` will fall back to using [MSYS2](https://www.msys2.org/). This should work with the tools already bundled in `Rtools` 4.0.
63
+
64
+
If you want to force `LightGBM` to use MSYS2 (for any R version), open `R-package/src/install.libs.R` and change `use_msys2`:
65
+
66
+
```r
67
+
use_msys2<-TRUE
68
+
```
69
+
31
70
#### Mac OS Preparation
32
71
33
72
You can perform installation either with **Apple Clang** or **gcc**. In case you prefer **Apple Clang**, you should install **OpenMP** (details for installation can be found in [Installation Guide](https://github.com/microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#apple-clang)) first and **CMake** version 3.16 or higher is required. In case you prefer **gcc**, you need to install it (details for installation can be found in [Installation Guide](https://github.com/microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#gcc)) and set some environment variables to tell R to use `gcc` and `g++`. If you install these from Homebrew, your versions of `g++` and `gcc` are most likely in `/usr/local/bin`, as shown below.
0 commit comments