You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

M1 Mac安装R包maftools时遭遇编译错误求助

M1 Mac 安装R包maftools时的编译错误问题

我在M1 Mac上安装R包maftools,和其他M1 Mac用户一样,之前安装依赖包DNAcopy或Rhtslib时遇到编译问题,通过在/opt/R/arm64/中直接安装xz解决了该问题。在/opt/R/arm64/include/中添加lzma和lzma.h后,上述两个依赖包已成功安装,但安装maftools时仍提示编译错误。

执行的安装命令

BiocManager::install("maftools", type="source")

错误日志

* installing *source* package ‘maftools’ ...
** using staged installation
** libs
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG     File /Users/cswc/.Renviron contains invalid line(s)       GITHUB_PAT    They were ignored  -D_FILE_OFFSET_BITS=64 -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rhtslib/include' -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/zlibbioc/include' -I/opt/R/arm64/include   -fPIC  -falign-functions=64 -Wall -g -O2  -c ntcounts.c -o ntcounts.o
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG     File /Users/cswc/.Renviron contains invalid line(s)       GITHUB_PAT    They were ignored  -D_FILE_OFFSET_BITS=64 -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rhtslib/include' -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/zlibbioc/include' -I/opt/R/arm64/include   -fPIC  -falign-functions=64 -Wall -g -O2  -c ntcounts.c -o ntcounts.o'
make: *** [ntcounts.o] Error 2
ERROR: compilation failed for package ‘maftools’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/maftools’

The downloaded source packages are in
    ‘/private/var/folders/p8/f28qvb_j7p70b67bzygm666m0000gn/T/RtmpI9NPdm/downloaded_packages’
Warning message:
In install.packages(...) :
  installation of package ‘maftools’ had non-zero exit status

已检查的环境状态

  • xcode-select路径:/usr/bin/xcode-select
  • gfortran路径:/opt/homebrew/bin/gfortran

Session信息

R version 4.2.0 (2022-04-22)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.4

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib

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] fansi_1.0.4         utf8_1.2.3          dplyr_1.1.3         grid_4.2.0          R6_2.5.1            gtable_0.3.4        lifecycle_1.0.3     magrittr_2.0.3     
 [9] scales_1.2.1        ggplot2_3.4.3       pillar_1.9.0        rlang_1.1.1         cli_3.6.1           data.table_1.14.8   rstudioapi_0.15.0   vctrs_0.6.3        
[17] generics_0.1.3      cowplot_1.1.1       tools_4.2.0         glue_1.6.2          munsell_0.5.0       compiler_4.2.0      colorspace_2.1-0    pkgconfig_2.0.3    
[25] BiocManager_1.30.22 tidyselect_1.2.0    tibble_3.2.1 

我不清楚编译错误出在哪部分,是否有用户遇到过类似问题?


内容的提问来源于stack exchange,提问作者agnes-csw

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.10 21:30:16