Skip to content

Commit 247f0ea

Browse files
authored
Enable r-universe build. (dmlc#11365)
1 parent 24f683e commit 247f0ea

File tree

4 files changed

+78
-24
lines changed

4 files changed

+78
-24
lines changed

R-package/LICENSE

Lines changed: 0 additions & 13 deletions
This file was deleted.

R-package/bootstrap.R

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## Script used to bootstrap R-universe build.
2+
3+
## Execute git commands to initialize git submodules
4+
system("git submodule init")
5+
system("git submodule update")
6+
7+
## core
8+
file.copy("../src", "./src/", recursive = TRUE)
9+
file.copy("../include", "./src/", recursive = TRUE)
10+
file.copy("../amalgamation", "./src/", recursive = TRUE)
11+
12+
## dmlc-core
13+
dir.create("./src/dmlc-core")
14+
file.copy("../dmlc-core/include", "./src/dmlc-core/", recursive = TRUE)
15+
file.copy("../dmlc-core/src", "./src/dmlc-core/", recursive = TRUE)
16+
17+
pkgroot <- function(path) {
18+
## read the file from path, replace the PKGROOT=../../ with PKGROOT=.
19+
lines <- readLines(path)
20+
lines <- gsub("PKGROOT=../../", "PKGROOT=.", lines, fixed = TRUE)
21+
writeLines(lines, path)
22+
}
23+
24+
## makefile and license
25+
file.copy("../LICENSE", "./LICENSE")
26+
pkgroot("./src/Makevars.in")
27+
pkgroot("./src/Makevars.win.in")
28+
29+
## misc
30+
path <- file.path("remove_warning_suppression_pragma.sh")
31+
file.remove(path)
32+
path <- file.path("CMakeLists.txt")
33+
file.remove(path)
34+
35+
## remove the directory recursively ./tests/helper_scripts
36+
unlink("tests/helper_scripts", recursive = TRUE)

doc/R-package/index.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,16 @@ You have found the XGBoost R Package!
1717
Get Started
1818
***********
1919

20-
* Checkout the :doc:`Installation Guide </install>` contains instructions to install xgboost, and :doc:`Tutorials </tutorials/index>` for examples on how to use XGBoost for various tasks.
21-
* Read the latest `API documentation <../r_docs/R-package/docs/reference/index.html>`__ . This might refer to a newer version than the one on CRAN.
22-
* Read the `CRAN documentation <https://cran.r-project.org/web/packages/xgboost/xgboost.pdf>`_.
20+
Since XGBoost 3.0.0, the latest R package is available on
21+
`https://dmlc.r-universe.dev/builds <R-universe>`__ while the one on CRAN is kept at an
22+
older version. We will work on helping the CRAN version to catch up in the future. In the
23+
meantime, please use R-universe packages.
24+
25+
* Check out the :doc:`Installation Guide </install>` for instructions on how to install
26+
xgboost, and :doc:`Tutorials </tutorials/index>` for examples on how to use XGBoost for
27+
various tasks.
28+
* Read the latest `API documentation <../r_docs/R-package/docs/reference/index.html>`__.
29+
* Read the `CRAN documentation <https://cran.r-project.org/web/packages/xgboost/xgboost.pdf>`_. (outdated)
2330

2431
*********
2532
Vignettes

doc/install.rst

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,22 +127,22 @@ Visit the `Miniconda website <https://docs.conda.io/en/latest/miniconda.html>`_
127127
R
128128
-
129129

130-
* From CRAN:
130+
* From R Universe
131131

132-
.. code-block:: R
132+
.. code-block:: R
133133
134-
install.packages("xgboost")
134+
install.packages('xgboost', repos = c('https://dmlc.r-universe.dev', 'https://cloud.r-project.org'))
135135
136-
.. note:: Using all CPU cores (threads) on Mac OSX
136+
.. note:: Using all CPU cores (threads) on Mac OSX
137137

138-
If you are using Mac OSX, you should first install OpenMP library (``libomp``) by running
138+
If you are using Mac OSX, you should first install OpenMP library (``libomp``) by running
139139

140-
.. code-block:: bash
140+
.. code-block:: bash
141141
142142
brew install libomp
143143
144-
and then run ``install.packages("xgboost")``. Without OpenMP, XGBoost will only use a
145-
single CPU core, leading to suboptimal training speed.
144+
and then run ``install.packages("xgboost")``. Without OpenMP, XGBoost will only use a
145+
single CPU core, leading to suboptimal training speed.
146146

147147
* We also provide **experimental** pre-built binary with GPU support. With this binary,
148148
you will be able to use the GPU algorithm without building XGBoost from the source.
@@ -158,6 +158,30 @@ R
158158
# Install XGBoost
159159
R CMD INSTALL ./xgboost_r_gpu_linux.tar.gz
160160
161+
162+
* From CRAN (outdated):
163+
164+
.. warning::
165+
166+
We are working on bringing the CRAN version of XGBoost up-to-date, in the meantime,
167+
please use packages from the R-universe.
168+
169+
170+
.. code-block:: R
171+
172+
install.packages("xgboost")
173+
174+
.. note:: Using all CPU cores (threads) on Mac OSX
175+
176+
If you are using Mac OSX, you should first install OpenMP library (``libomp``) by running
177+
178+
.. code-block:: bash
179+
180+
brew install libomp
181+
182+
and then run ``install.packages("xgboost")``. Without OpenMP, XGBoost will only use a
183+
single CPU core, leading to suboptimal training speed.
184+
161185
JVM
162186
---
163187

0 commit comments

Comments
 (0)