Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion r/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ URL: https://github.com/apache/arrow/, https://arrow.apache.org/docs/r/
BugReports: https://github.com/apache/arrow/issues
Encoding: UTF-8
Language: en-US
SystemRequirements: C++17; for AWS S3 support on Linux, libcurl and openssl (optional);
SystemRequirements: C++20; for AWS S3 support on Linux, libcurl and openssl (optional);
cmake >= 3.26 (build-time only, and only for full source build)
Biarch: true
Imports:
Expand Down
2 changes: 1 addition & 1 deletion r/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ There are some special cases to note:

- On Linux the installation process can sometimes be more involved because CRAN does not host binaries for Linux. For more information please see the [installation guide](https://arrow.apache.org/docs/r/articles/install.html).

- If you are compiling arrow from source, please note that as of version 10.0.0, arrow requires C++17 to build. This has implications on Windows and CentOS 7. For Windows users it means you need to be running an R version of 4.0 or later. On CentOS 7, it means you need to install a newer compiler than the default system compiler gcc. See the [installation details article](https://arrow.apache.org/docs/r/articles/developers/install_details.html) for guidance.
- If you are compiling arrow from source, please note that as of version 22.0.0, arrow requires C++20 to build. This has implications on Windows and CentOS 7. For Windows users it means you need to be running an R version of 4.1 or later. See the [installation details article](https://arrow.apache.org/docs/r/articles/developers/install_details.html) for guidance.

- Development versions of arrow are released nightly. For information on how to install nightly builds please see the [installing nightly builds](https://arrow.apache.org/docs/r/articles/install_nightly.html) article.

Expand Down
16 changes: 8 additions & 8 deletions r/configure
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ if [ "$ARROW_R_DEV" = "true" ] && [ -f "data-raw/codegen.R" ]; then
${R_HOME}/bin/Rscript data-raw/codegen.R
fi

# Arrow requires C++17, so check for it
if [ ! "`${R_HOME}/bin/R CMD config CXX17`" ]; then
# Arrow requires C++20, so check for it
if [ ! "`${R_HOME}/bin/R CMD config CXX20`" ]; then
echo "------------------------- NOTE ---------------------------"
echo "Cannot install arrow: a C++17 compiler is required."
echo "Cannot install arrow: a C++20 compiler is required."
echo "See https://arrow.apache.org/docs/r/articles/install.html"
echo "---------------------------------------------------------"
exit 1
Expand Down Expand Up @@ -265,7 +265,7 @@ set_pkg_vars () {
# match the substring. However, expr always outputs the number of matched characters
# to stdout, to avoid noise in the log we redirect the output to /dev/null
if [ "$UNAME" = "Darwin" ] && expr $(sw_vers -productVersion) : '10\.13' >/dev/null 2>&1; then
# avoid C++17 availability warnings on macOS < 11
# avoid C++20 availability warnings on macOS < 11
PKG_CFLAGS="$PKG_CFLAGS -D_LIBCPP_DISABLE_AVAILABILITY"
fi
}
Expand Down Expand Up @@ -408,11 +408,11 @@ else
fi

# Test that we can compile something with those flags
CXX17="`${R_HOME}/bin/R CMD config CXX17` -E"
CXX17FLAGS=`"${R_HOME}"/bin/R CMD config CXX17FLAGS`
CXX17STD=`"${R_HOME}"/bin/R CMD config CXX17STD`
CXX20="`${R_HOME}/bin/R CMD config CXX20` -E"
CXX20FLAGS=`"${R_HOME}"/bin/R CMD config CXX20FLAGS`
CXX20STD=`"${R_HOME}"/bin/R CMD config CXX20STD`
CPPFLAGS=`"${R_HOME}"/bin/R CMD config CPPFLAGS`
TEST_CMD="${CXX17} ${CPPFLAGS} ${PKG_CFLAGS} ${CXX17FLAGS} ${CXX17STD} -xc++ -"
TEST_CMD="${CXX20} ${CPPFLAGS} ${PKG_CFLAGS} ${CXX20FLAGS} ${CXX20STD} -xc++ -"
TEST_ERROR=$(echo "#include $PKG_TEST_HEADER" | ${TEST_CMD} -o /dev/null 2>&1)

if [ $? -eq 0 ]; then
Expand Down
2 changes: 1 addition & 1 deletion r/configure.win
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ set_pkg_vars () {
# match the substring. However, expr always outputs the number of matched characters
# to stdout, to avoid noise in the log we redirect the output to /dev/null
if [ "$UNAME" = "Darwin" ] && expr $(sw_vers -productVersion) : '10\.13' >/dev/null 2>&1; then
# avoid C++17 availability warnings on macOS < 11
# avoid C++20 availability warnings on macOS < 11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does R still support macOS < 11? It's end-of-life since 2022.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, I need to dig to see what the actual number is and update this comment / remove this code path if we don't need it.

PKG_CFLAGS="$PKG_CFLAGS -D_LIBCPP_DISABLE_AVAILABILITY"
fi
}
Expand Down
2 changes: 1 addition & 1 deletion r/src/Makevars.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ PKG_CPPFLAGS=@cflags@
# https://bugs.llvm.org/show_bug.cgi?id=39191
# https://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg534862.html
# PKG_CXXFLAGS=$(CXX_VISIBILITY)
CXX_STD=CXX17
CXX_STD=CXX20
PKG_LIBS=@libs@

all: $(SHLIB) purify
Expand Down
2 changes: 1 addition & 1 deletion r/src/Makevars.ucrt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ CRT=-ucrt
include Makevars.win

# XXX for some reason, this variable doesn't seem propagated from Makevars.win
CXX_STD=CXX17
CXX_STD=CXX20
13 changes: 8 additions & 5 deletions r/tools/nixlibs.R
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,11 @@ compile_test_program <- function(code) {
openssl_dir <- paste0("-I", openssl_root_dir, "/include")
}
runner <- paste(
R_CMD_config("CXX17"),
R_CMD_config("CXX20"),
openssl_dir,
R_CMD_config("CPPFLAGS"),
R_CMD_config("CXX17FLAGS"),
R_CMD_config("CXX17STD"),
R_CMD_config("CXX20FLAGS"),
R_CMD_config("CXX20STD"),
"-E",
"-xc++"
)
Expand Down Expand Up @@ -565,8 +565,11 @@ build_libarrow <- function(src_dir, dst_dir) {
# is found, it will be used by the libarrow build, and this does
# not affect how R compiles the arrow bindings.
CC = sub("^.*ccache", "", R_CMD_config("CC")),
CXX = paste(sub("^.*ccache", "", R_CMD_config("CXX17")), R_CMD_config("CXX17STD")),
# CXXFLAGS = R_CMD_config("CXX17FLAGS"), # We don't want the same debug symbols
CXX = paste(
sub("^.*ccache", "", R_CMD_config("CXX20")),
R_CMD_config("CXX20STD")
),
# CXXFLAGS = R_CMD_config("CXX20FLAGS"), # We don't want the same debug symbols
LDFLAGS = R_CMD_config("LDFLAGS"),
N_JOBS = ncores
)
Expand Down
4 changes: 2 additions & 2 deletions r/vignettes/install.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ but there are a few things to note.

### Compilers

As of version 10.0.0, arrow requires a C++17 compiler to build.
For `gcc`, this generally means version 7 or newer. Most contemporary Linux
As of version 22.0.0, arrow requires a C++20 compiler to build.
For `gcc`, this generally means version 10 or newer. Most contemporary Linux
distributions have a new enough compiler; however, CentOS 7 is a notable
exception, as it ships with gcc 4.8.

Expand Down
Loading