|
1 | 1 | --- |
2 | | -title: "Installing the Arrow Package on Linux" |
| 2 | +title: "Installing the Arrow Package" |
3 | 3 | output: rmarkdown::html_vignette |
4 | 4 | vignette: > |
5 | | - %\VignetteIndexEntry{Installing the Arrow Package on Linux} |
| 5 | + %\VignetteIndexEntry{Installing the Arrow Package} |
6 | 6 | %\VignetteEngine{knitr::rmarkdown} |
7 | 7 | %\VignetteEncoding{UTF-8} |
8 | 8 | --- |
@@ -100,8 +100,6 @@ satisfy C++ dependencies. |
100 | 100 |
|
101 | 101 | > Note that, unlike packages like `tensorflow`, `blogdown`, and others that require external dependencies, you do not need to run `install_arrow()` after a successful `arrow` installation. |
102 | 102 |
|
103 | | -<!-- TODO: does remotes::install_github("apache/arrow/r") work now? --> |
104 | | - |
105 | 103 | ## S3 support |
106 | 104 |
|
107 | 105 | The `arrow` package allows you to work with data in AWS S3 or in other cloud |
@@ -166,10 +164,35 @@ run `install.packages("arrow")` or `R CMD INSTALL` but not when running `R CMD c |
166 | 164 | unless you've set the `NOT_CRAN=true` environment variable. |
167 | 165 |
|
168 | 166 | For the mechanics of how all this works, see the R package `configure` script, |
169 | | -which calls `tools/linuxlibs.R`. |
| 167 | +which calls `tools/nixlibs.R`. |
170 | 168 | If the C++ library is built from source, `inst/build_arrow_static.sh` is executed. |
171 | 169 | This build script is also what is used to generate the prebuilt binaries. |
172 | 170 |
|
| 171 | + |
| 172 | +# Using `remotes::install_github(...)` |
| 173 | + |
| 174 | +If you need an Arrow installation from a specific repository or at a specific ref, |
| 175 | +`remotes::install_github("apache/arrow/r", build = FALSE)` |
| 176 | +should work on most platforms (with the notable exception of Windows). |
| 177 | +The `build = FALSE` argument is important so that the installation can access the |
| 178 | +C++ source in the `cpp/` directory in `apache/arrow`. |
| 179 | + |
| 180 | +As with other installation methods, setting the environment variables `LIBARROW_MINIMAL=false` and `ARROW_R_DEV=true` will provide a more full-featured version of Arrow and provide more verbose output, respectively. |
| 181 | + |
| 182 | +For example, to install from the (fictional) branch `bugfix` from `apache/arrow` one could: |
| 183 | + |
| 184 | +```r |
| 185 | +Sys.setenv(LIBARROW_MINIMAL="false") |
| 186 | +remotes::install_github("apache/arrow/r@bugfix", build = FALSE) |
| 187 | +``` |
| 188 | + |
| 189 | +Developers may wish to use this method of installing a specific commit |
| 190 | +separate from another Arrow development environment or system installation |
| 191 | +(e.g. we use this in [arrowbench](https://github.com/ursacomputing/arrowbench) to install development versions of arrow isolated from the system install). If you already have Arrow C++ libraries installed system-wide, you may need to set some additional variables in order to isolate this build from your system libraries: |
| 192 | + |
| 193 | +* Setting the environment variable `FORCE_BUNDLED_BUILD` to `true` will skip the `pkg-config` search for Arrow libraries and attempt to build from the same source at the repository+ref given. |
| 194 | +* You may also need to set the Makevars `CPPFLAGS` and `LDFLAGS` to `""` in order to prevent the installation process from attempting to link to already installed system versions of Arrow. One way to do this temporarily is wrapping your `remotes::install_github()` call like so: `withr::with_makevars(list(CPPFLAGS = "", LDFLAGS = ""), remotes::install_github(...))`. |
| 195 | + |
173 | 196 | # Troubleshooting |
174 | 197 |
|
175 | 198 | The intent is that `install.packages("arrow")` will just work and handle all C++ |
@@ -334,7 +357,7 @@ By default, these are all unset. All boolean variables are case-insensitive. |
334 | 357 | Use this if you want to avoid compiling the C++ library, which may be slow |
335 | 358 | and resource-intensive, and ensure that you only use a prebuilt binary. |
336 | 359 | * `LIBARROW_MINIMAL`: If set to `false`, the build script |
337 | | - will enable some optional features, including compression libraries, S3 |
| 360 | + will enable some optional features, including compression libraries, S3 |
338 | 361 | support, and additional alternative memory allocators. This will increase the |
339 | 362 | source build time but results in a more fully functional library. |
340 | 363 | * `NOT_CRAN`: If this variable is set to `true`, as the `devtools` package does, |
|
0 commit comments