解决方案参考下面的教程
https://arrow.apache.org/docs/r/articles/install.html
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 distributions have a new enough compiler; however, CentOS 7 is a notable exception, as it ships with gcc 4.8.
If you are on CentOS 7, to build arrow you will need to install a newer devtoolset, and you’ll need to update R’s Makevars to define the CXX17 variables. This script installs devtoolset-8 and configures R to be able to use C++17:
#!/usr/bin/env bash
yum install -y centos-release-scl
yum install -y devtoolset-8
# Optional: also install cloud storage dependencies, as described below
yum install -y libcurl-devel openssl-devel
source /opt/rh/devtoolset-8/enable
if [ ! `R CMD config CXX17` ]; then
mkdir -p ~/.R
echo "CC = $(which gcc) -fPIC" >> ~/.R/Makevars
echo "CXX17 = $(which g++) -fPIC" >> ~/.R/Makevars
echo "CXX17STD = -std=c++17" >> ~/.R/Makevars
echo "CXX17FLAGS = ${CXX11FLAGS}" >> ~/.R/Makevars
fi
Note
修改 R CMD config 里面的设置主要的方式有两种:
一种方法是修改用户目录下的 ~/.R/Makevars 文件,不需要root权限。
第二种方法是修改R安装目录下的 $R_HOME/etc/Makeconf 文件。
网友评论