从github安装R包时出现问题,得到“ld:警告:找不到选项'-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0'的目录”[重复]

问题描述 投票:0回答:1

我是 Rcpp 新手。我正在尝试从 github 安装一个包。根据README.md的指示,

# Install release version from CRAN
install.packages("devtools")
# Install development version from GitHub
devtools::install_github("shuangj00/IntegrativeBayes")

运行这些代码时我收到警告:

ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
ld: library not found for -lquadmath
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [IntegrativeBayes.so] Error 1
ERROR: compilation failed for package ‘IntegrativeBayes’

整个下午我都被困在最开始(安装包)。有人知道如何解决这个问题吗?

c++ r gcc rcpp gfortran
1个回答
1
投票

正如我在评论中提到的,您首先需要在Mac上启用从源代码编译此处的教程通常是最新的,如果不是,一些 macOS 专家可能会提供其他教程。

存储库本身很好,并且在我的 Linux 机器上非常干净地安装了我使用的

remotes::install_github()
的小包装:

edd@rob:~$ installGithub.r shuangj00/IntegrativeBayes
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo shuangj00/IntegrativeBayes@HEAD

Skipping 1 packages ahead of CRAN: Rcpp
✔  checking for file ‘/tmp/remotes3c654e4cdc73ce/shuangj00-IntegrativeBayes-c76cfd4/DESCRIPTION’
─  preparing ‘IntegrativeBayes’:
✔  checking DESCRIPTION meta-information
─  cleaning src
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
   Omitted ‘LazyData’ from DESCRIPTION
─  building ‘IntegrativeBayes_1.0.tar.gz’
   
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
* installing *source* package ‘IntegrativeBayes’ ...
** using staged installation
** libs
ccache g++-11  -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG  -I'/usr/local/lib/R/site-library/Rcpp/include' -I'/usr/local/lib/R/site-library/RcppArmadillo/include'   -fopenmp  -fpic  -g -O3 -Wall -pipe -pedantic -Wno-ignored-attributes  -c RcppExports.cpp -o RcppExports.o
ccache g++-11  -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG  -I'/usr/local/lib/R/site-library/Rcpp/include' -I'/usr/local/lib/R/site-library/RcppArmadillo/include'   -fopenmp  -fpic  -g -O3 -Wall -pipe -pedantic -Wno-ignored-attributes  -c ZINBwCOV.cpp -o ZINBwCOV.o
ccache g++-11 -std=gnu++11 -Wl,-S -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -o IntegrativeBayes.so RcppExports.o ZINBwCOV.o -fopenmp -llapack -lblas -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/00LOCK-IntegrativeBayes/00new/IntegrativeBayes/libs
** R
** demo
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (IntegrativeBayes)
edd@rob:~$ 
© www.soinside.com 2019 - 2024. All rights reserved.