Skip to content
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] Expand docs for building R package from source #11122

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions doc/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -317,15 +317,23 @@ simplest way to install the R package after obtaining the source code is:
cd R-package
R CMD INSTALL .

But if you want to use CMake build for better performance (which has the logic for
detecting available CPU instructions) or greater flexibility around compile flags, the
above snippet can be replaced by:
As an alternative, the package can also be loaded through ``devtools::load_all()``
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.

If you want to use the CMake build for better performance or greater flexibility around
compile flags, the earlier snippet can be replaced by:

.. code-block:: bash

cmake -B build -S . -DR_LIB=ON
cmake --build build --target install -j$(nproc)

Note in this case that ``cmake`` will not take configurations from your regular ``Makevars``
file (if you have such a file under ``~/.R/Makevars``) - instead, custom configurations such
as compilers to use and flags need to be set through environment variables like ``${CC}``,
``${CFLAGS}``, etc.

Installing the development version with Visual Studio (Windows)
===============================================================
Expand Down
Loading