Skip to content

Commit

Permalink
ARROW-10733: [R] Improvements to Linux installation troubleshooting
Browse files Browse the repository at this point in the history
Closes apache#9034 from nealrichardson/linux-troubleshooting

Authored-by: Neal Richardson <[email protected]>
Signed-off-by: Neal Richardson <[email protected]>
  • Loading branch information
nealrichardson committed Dec 30, 2020
1 parent 1ddf721 commit 4e57002
Show file tree
Hide file tree
Showing 7 changed files with 461 additions and 453 deletions.
15 changes: 12 additions & 3 deletions r/R/install-arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
#' from a nightly development version, or on Linux to try reinstalling with
#' all necessary C++ dependencies.
#'
#' 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.
#'
#' @param nightly logical: Should we install a development version of the
#' package, or should we install from CRAN (the default).
#' @param binary On Linux, value to set for the environment variable
Expand All @@ -33,10 +37,13 @@
#' See `vignette("install", package = "arrow")` for further details.
#' @param use_system logical: Should we use `pkg-config` to look for Arrow
#' system packages? Default is `FALSE`. If `TRUE`, source installation may be
#' faster, but there is a risk of version mismatch.
#' faster, but there is a risk of version mismatch. This sets the
#' `ARROW_USE_PKG_CONFIG` environment variable.
#' @param minimal logical: If building from source, should we build without
#' optional dependencies (compression libraries, for example)? Default is
#' `FALSE`.
#' `FALSE`. This sets the `LIBARROW_MINIMAL` environment variable.
#' @param verbose logical: Print more debugging output when installing? Default
#' is `FALSE`. This sets the `ARROW_R_DEV` environment variable.
#' @param repos character vector of base URLs of the repositories to install
#' from (passed to `install.packages()`)
#' @param ... Additional arguments passed to `install.packages()`
Expand All @@ -49,6 +56,7 @@ install_arrow <- function(nightly = FALSE,
binary = Sys.getenv("LIBARROW_BINARY", TRUE),
use_system = Sys.getenv("ARROW_USE_PKG_CONFIG", FALSE),
minimal = Sys.getenv("LIBARROW_MINIMAL", FALSE),
verbose = Sys.getenv("ARROW_R_DEV", FALSE),
repos = getOption("repos"),
...) {
sysname <- tolower(Sys.info()[["sysname"]])
Expand All @@ -65,7 +73,8 @@ install_arrow <- function(nightly = FALSE,
Sys.setenv(
LIBARROW_DOWNLOAD = "true",
LIBARROW_BINARY = binary,
LIBARRWOW_MINIMAL = minimal,
LIBARROW_MINIMAL = minimal,
ARROW_R_DEV = verbose,
ARROW_USE_PKG_CONFIG = use_system
)
if (isTRUE(binary)) {
Expand Down
20 changes: 1 addition & 19 deletions r/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,6 @@ installation will also build necessary C++ dependencies. For a faster,
more complete installation, set the environment variable `NOT_CRAN=true`.
See `vignette("install", package = "arrow")` for details.

If you install the `arrow` package from source and the C++ library is
not found, the R package functions will notify you that Arrow is not
available. Call

```r
arrow::install_arrow()
```

to retry installation with dependencies.

Note that `install_arrow()` is available as a standalone script, so you can
access it for convenience without first installing the package:

```r
source("https://raw.githubusercontent.com/apache/arrow/master/r/R/install-arrow.R")
install_arrow()
```

## Installing a development version

Development versions of the package (binary and source) are built daily and hosted at
Expand All @@ -69,7 +51,7 @@ install.packages("arrow", repos = "https://arrow-r-nightly.s3.amazonaws.com")
Or

```r
install_arrow(nightly = TRUE)
arrow::install_arrow(nightly = TRUE)
```

Conda users can install `arrow` nightlies from our nightlies channel using:
Expand Down
4 changes: 2 additions & 2 deletions r/configure
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ else
echo "$TEST_CMD"
fi
echo "------------------------- NOTE ---------------------------"
echo "After installation, please run arrow::install_arrow()"
echo "for help installing required runtime libraries"
echo "See https://arrow.apache.org/docs/r/articles/install.html"
echo "for help installing Arrow C++ libraries"
echo "---------------------------------------------------------"
PKG_LIBS=""
PKG_CFLAGS=""
Expand Down
4 changes: 2 additions & 2 deletions r/data-raw/codegen.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ cpp_functions_definitions <- arrow_exports %>%
}}
#else
extern "C" SEXP _arrow_{name}({sexp_params}){{
\tRf_error("Cannot call {name}(). Please use arrow::install_arrow() to install required runtime libraries. ");
\tRf_error("Cannot call {name}(). See https://arrow.apache.org/docs/r/articles/install.html for help installing Arrow C++ libraries. ");
}}
#endif
Expand Down Expand Up @@ -122,7 +122,7 @@ cpp_classes_finalizers <- map2(names(arrow_classes), arrow_classes, function(nam
}}
# else
extern "C" SEXP _arrow_{name}__Reset(SEXP r6) {{
Rf_error("Cannot call _arrow_{name}__Reset(). Please use arrow::install_arrow() to install required runtime libraries. ");
Rf_error("Cannot call _arrow_{name}__Reset(). See https://arrow.apache.org/docs/r/articles/install.html for help installing Arrow C++ libraries. ");
}}
# endif
')
Expand Down
14 changes: 12 additions & 2 deletions r/man/install_arrow.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4e57002

Please sign in to comment.