R:无法在 OSX El Capitan 上安装 R 3.3.1 的 Rcpp 包
R: Unable to install Rcpp package for R 3.3.1 on OSX El Capitan
我正在尝试在 Mac OS X El Capitan 上安装 R Rcpp 包,并在 R 控制台中安装 R 的自制程序
> install.packages("Rcpp")
Installing package into ‘/usr/local/lib/R/3.3/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r- project.org/src/contrib/Rcpp_0.12.5.tar.gz'
Content type 'application/x-gzip' length 2397088 bytes (2.3 MB)
==================================================
downloaded 2.3 MB
* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** libs
clang++ -I/usr/local/Cellar/r/3.3.1/R.framework/Resources/include - DNDEBUG -I/usr/local/include -I/usr/local/opt/ - I/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/../include - I/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/../i nclude/darwin -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -I/usr/local/include -fPIC -g -O2 -c Date.cpp -o Date.o
Date.cpp:31:10: fatal error: 'Rcpp.h' file not found
#include <Rcpp.h>
^
1 error generated.
make: *** [Date.o] Error 1
ERROR: compilation failed for package ‘Rcpp’
* removing ‘/usr/local/lib/R/3.3/site-library/Rcpp’
The downloaded source packages are in
‘/private/var/folders/g8/rqv40nhs3zqcntnz_9t9l60w0000gr/T/Rtmpq2VPG3/ downloaded_packages’
Warning message:
In install.packages("Rcpp") :
installation of package ‘Rcpp’ had non-zero exit status
尝试使用以下方式搜索 Rcpp.h
:
$locate Rcpp.h
/usr/local/lib/R/3.2/site-library/Rcpp/include/Rcpp.h
我可以符号链接到 R/3.2
目录,但这似乎有风险?
尝试过:
brew update; brew install Rcpp
收到:
Error: No available formula with the name "rcpp"
==> Searching for similarly named formulae... Error: No similarly named formulae found.
==> Searching taps... Error: No formulae found in taps.
会话信息:
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin15.5.0 (64-bit)
Running under: OS X 10.11.5 (El Capitan)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_3.3.1
首先,通过以下方式卸载所有以前的依赖项:
brew uninstall r
接下来,尝试在以下 brew
语句下安装 R:
# Grab xquartz
brew install cask
brew cask install xquartz
# Install R w/ GCC (compiled under)
brew tap homebrew/science
brew install gcc
brew install r
然后尝试:
install.packages("Rcpp")
已将 tar 文件从 CRAN 下载到单独的目录(例如 /tmp)。 tar-x Rcpp<*>.tar.gz。在我的 R Makevars 文件中将 -I/tmp/Rcpp/inst/include 添加到 PKG_CPPFLAGS。在 R 控制台中 install.packages("Rcpp")。仍然不知道为什么 "normal" / "standard" 进程不起作用
关闭 McAfee 等任何防病毒软件,然后您应该能够毫无问题地安装软件包。它解决了我的问题。
我正在尝试在 Mac OS X El Capitan 上安装 R Rcpp 包,并在 R 控制台中安装 R 的自制程序
> install.packages("Rcpp")
Installing package into ‘/usr/local/lib/R/3.3/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r- project.org/src/contrib/Rcpp_0.12.5.tar.gz'
Content type 'application/x-gzip' length 2397088 bytes (2.3 MB)
==================================================
downloaded 2.3 MB
* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** libs
clang++ -I/usr/local/Cellar/r/3.3.1/R.framework/Resources/include - DNDEBUG -I/usr/local/include -I/usr/local/opt/ - I/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/../include - I/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre/../i nclude/darwin -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -I/usr/local/include -fPIC -g -O2 -c Date.cpp -o Date.o
Date.cpp:31:10: fatal error: 'Rcpp.h' file not found
#include <Rcpp.h>
^
1 error generated.
make: *** [Date.o] Error 1
ERROR: compilation failed for package ‘Rcpp’
* removing ‘/usr/local/lib/R/3.3/site-library/Rcpp’
The downloaded source packages are in
‘/private/var/folders/g8/rqv40nhs3zqcntnz_9t9l60w0000gr/T/Rtmpq2VPG3/ downloaded_packages’
Warning message:
In install.packages("Rcpp") :
installation of package ‘Rcpp’ had non-zero exit status
尝试使用以下方式搜索 Rcpp.h
:
$locate Rcpp.h
/usr/local/lib/R/3.2/site-library/Rcpp/include/Rcpp.h
我可以符号链接到 R/3.2
目录,但这似乎有风险?
尝试过:
brew update; brew install Rcpp
收到:
Error: No available formula with the name "rcpp" ==> Searching for similarly named formulae... Error: No similarly named formulae found. ==> Searching taps... Error: No formulae found in taps.
会话信息:
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin15.5.0 (64-bit)
Running under: OS X 10.11.5 (El Capitan)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_3.3.1
首先,通过以下方式卸载所有以前的依赖项:
brew uninstall r
接下来,尝试在以下 brew
语句下安装 R:
# Grab xquartz
brew install cask
brew cask install xquartz
# Install R w/ GCC (compiled under)
brew tap homebrew/science
brew install gcc
brew install r
然后尝试:
install.packages("Rcpp")
已将 tar 文件从 CRAN 下载到单独的目录(例如 /tmp)。 tar-x Rcpp<*>.tar.gz。在我的 R Makevars 文件中将 -I/tmp/Rcpp/inst/include 添加到 PKG_CPPFLAGS。在 R 控制台中 install.packages("Rcpp")。仍然不知道为什么 "normal" / "standard" 进程不起作用
关闭 McAfee 等任何防病毒软件,然后您应该能够毫无问题地安装软件包。它解决了我的问题。