-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
[doc] Cleanup document for building from source. #11145
Conversation
- Use `ninja` uniformly and refer to CMake doc for other options. The latest CMake is cross platform, no need to add special instructions for each OS. - Drop support for MSVC with the R package. - Stop documenting methods that we don't test, like mingw with the Python package.
In the future, we might merge the Python script for building jvm packages into CMake scripts and eliminate the Python dependency. |
doc/build.rst
Outdated
|
||
mvn -Duse.cuda=ON install | ||
- OpenMP on MacOS: See :ref:`running_cmake_and_build` for installing ``openmp``. The flag | ||
-``mvn Duse.openmp=OFF`` can be used to disable OpenMP support. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-``mvn Duse.openmp=OFF`` can be used to disable OpenMP support. | |
-``mvn -Duse.openmp=OFF`` can be used to disable OpenMP support. |
from the same subfolder ``R-package`` in the repository's root, and by extension, can | ||
be installed through RStudio's build panel if one adds that folder ``R-package`` as an | ||
R package project in the RStudio IDE. | ||
Use the environment variable ``MAKEFLAGS=-j$(nproc)`` if you want to speedup the build. As |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work for R packages. MAKEFLAGS
needs to be in the user file ~/.R/Makevars
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm running this command at the moment with Ubuntu 22.04, and R 4.4.2, it's effective.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MAKEFLAGS=-j$(nproc) R CMD INSTALL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's curious (doesn't work for me with install.packages
). But would that work if you use devtools to install?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it works.
devtools::load_all(path = "/home/jiamingy/workspace/xgboost_dev/xgboost/R-package")
MAKEFLAGS=-j$(nproc) Rscript ./basic.R
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have verified that there's no ~/.R
in my system.
|
||
- ``C:\Rtools\bin`` | ||
- ``C:\Rtools\mingw_64\bin`` | ||
cmake -B build -S . -DR_LIB=ON -GNinja |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this make it use the MSVC compiler by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a warning at the end of this section, MSVC with R is not supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if you install windows build tools (e.g. cmake and clang) from microsoft's packages, the default compiler will be msvc if you don't change it in cmake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it could be helpful to provide instructions for a clang install with a tool like conda to build the package with GPU support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me add a note that cmake on windows with R is not supported either. I tried to make it work with Windows and the latest rtools, it's quite a hack. I don't expect users to do something similar.
The mingw is hidden deep in the rtools43 package.
@trivialfis Doesn't the CMake build for R require setting up other variables like the R version and similar? |
On Linux, it's quite simple, only the |
First error that I run into on windows:
But then how is
Perhaps suggesting installs of cmake, clang, and so on from conda could result in easier instructions? |
That's gpu_linux... not windows. As for Windows, it was a pain #11148 (comment) . |
I use conda on Linux for installing gcc indeed, but have no experience with conda on Windows. Even on Linux, it takes some experience with the underlying runtime like locking:
I don't expect Windows to be easier. In addition, I actually use |
- Use `ninja` uniformly and refer to CMake doc for other options. The latest CMake is cross platform, no need to add special instructions for each OS. - Drop support for MSVC with the R package. - Stop documenting methods we don't test, like mingw with the Python package. - Fix broken links.
ninja
uniformly and refer to CMake doc for other options. The latest CMake is cross platform, no need to add special instructions for each OS.Close #11143 .