R包arules在macos上安装错误
R package arules installation error on macos
我正在尝试使用以下命令从 R 控制台中安装 'arules' 包
* 设置:
macOS Sierra v 10.12.6,R 版本 3.4.2,RStudio 1.1.383,Anaconda 5.0; anaconda 客户端版本 1.6.5,python 3.6.3
在 R 控制台中使用命令:
install.packages("arules")
错误输出:
install.packages("arules")
trying URL 'https://cran.revolutionanalytics.com/src/contrib/arules_1.5-4.tar.gz'
Content type 'application/octet-stream' length 1359205 bytes (1.3 MB)
==================================================
downloaded 1.3 MB
* installing *source* package ‘arules’ ...
** package ‘arules’ successfully unpacked and MD5 sums checked
** libs
x86_64-apple-darwin13.4.0-clang -I/Users/alsabay/anaconda3/lib/R/include -DNDEBUG -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -I/Users/alsabay/anaconda3/include -DNDEBUG -DNIMAPFN -fPIC -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -I/Users/alsabay/anaconda3/include -c arrayIndex.c -o arrayIndex.o
make: x86_64-apple-darwin13.4.0-clang: No such file or directory
make: *** [arrayIndex.o] Error 1
ERROR: compilation failed for package ‘arules’
* removing ‘/Users/alsabay/anaconda3/lib/R/library/arules’
The downloaded source packages are in ‘/private/var/folders/lc/_068llz1667dp1m75b_js4hr09p31n/T/RtmpObrwiG/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("arules") :
installation of package ‘arules’ had non-zero exit status
我已经将 xcode 命令行工具更新到 9.1 版,但我仍然遇到同样的错误。我也尝试过从 RStudio 安装它并检查依赖项,并且在依赖项包上添加编译错误时我得到了同样的错误。我在这里 运行 没有线索,虽然我知道这是某种 clang 编译错误,但不确定接下来的步骤。请帮忙
以下是我使用上述建议解决此问题的方法
按照说明下载macos的clang4
cran.r-project.org/bin/macosx/tools。
复制 clang4 到 /usr/local/clang4.
在目录 ~/.R 中创建 Makevars 文件
以下环境变量。
CC=/usr/local/clang4/bin/clang
CXX=/usr/local/clang4/bin/clang++
LDFLAGS=-L/usr/local/clang4/lib
FC=/usr/local/bin/gfortran
F77=/usr/local/bin/gfortran
从 cran.r-project.org/bin/macosx/tools 下载并安装 gfortran-4.2。3.pkg(这有一个安装程序)。
启动 R 控制台并输入
install.packages('arules')
install.packages('arulesViz')
我正在尝试使用以下命令从 R 控制台中安装 'arules' 包 * 设置: macOS Sierra v 10.12.6,R 版本 3.4.2,RStudio 1.1.383,Anaconda 5.0; anaconda 客户端版本 1.6.5,python 3.6.3
在 R 控制台中使用命令:
install.packages("arules")
错误输出:
install.packages("arules") trying URL 'https://cran.revolutionanalytics.com/src/contrib/arules_1.5-4.tar.gz' Content type 'application/octet-stream' length 1359205 bytes (1.3 MB) ================================================== downloaded 1.3 MB * installing *source* package ‘arules’ ... ** package ‘arules’ successfully unpacked and MD5 sums checked ** libs x86_64-apple-darwin13.4.0-clang -I/Users/alsabay/anaconda3/lib/R/include -DNDEBUG -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -I/Users/alsabay/anaconda3/include -DNDEBUG -DNIMAPFN -fPIC -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -I/Users/alsabay/anaconda3/include -c arrayIndex.c -o arrayIndex.o make: x86_64-apple-darwin13.4.0-clang: No such file or directory make: *** [arrayIndex.o] Error 1 ERROR: compilation failed for package ‘arules’ * removing ‘/Users/alsabay/anaconda3/lib/R/library/arules’ The downloaded source packages are in ‘/private/var/folders/lc/_068llz1667dp1m75b_js4hr09p31n/T/RtmpObrwiG/downloaded_packages’ Updating HTML index of packages in '.Library' Making 'packages.html' ... done Warning message: In install.packages("arules") : installation of package ‘arules’ had non-zero exit status
我已经将 xcode 命令行工具更新到 9.1 版,但我仍然遇到同样的错误。我也尝试过从 RStudio 安装它并检查依赖项,并且在依赖项包上添加编译错误时我得到了同样的错误。我在这里 运行 没有线索,虽然我知道这是某种 clang 编译错误,但不确定接下来的步骤。请帮忙
以下是我使用上述建议解决此问题的方法
按照说明下载macos的clang4 cran.r-project.org/bin/macosx/tools。
复制 clang4 到 /usr/local/clang4.
在目录 ~/.R 中创建 Makevars 文件 以下环境变量。
CC=/usr/local/clang4/bin/clang CXX=/usr/local/clang4/bin/clang++ LDFLAGS=-L/usr/local/clang4/lib FC=/usr/local/bin/gfortran F77=/usr/local/bin/gfortran
从 cran.r-project.org/bin/macosx/tools 下载并安装 gfortran-4.2。3.pkg(这有一个安装程序)。
启动 R 控制台并输入
install.packages('arules') install.packages('arulesViz')