参考:https://www.jianshu.com/p/6d5b5763c409
作者是因为安装中遇到了下面的问题:
creating vignettes (8s)
--- re-building ‘FACETS.Rnw’ using Sweave
Loading required package: pctGCdata
Error: processing vignette 'FACETS.Rnw' failed with diagnostics:
Running 'texi2dvi' on 'FACETS.tex' failed.
--- failed re-building ‘FACETS.Rnw’
SUMMARY: processing the following file failed:
‘FACETS.Rnw’
Error: Vignette re-building failed.
Execution halted
Error: Failed to install 'facets' from GitHub:
System command error, exit status: 1, stdout + stderr (last 10 lines):
E> Loading required package: pctGCdata
E> Error: processing vignette 'FACETS.Rnw' failed with diagnostics:
E> Running 'texi2dvi' on 'FACETS.tex' failed.
E> --- failed re-building ‘FACETS.Rnw’
E>
E> SUMMARY: processing the following file failed:
E> ‘FACETS.Rnw’
E>
E> Error: Vignette re-building failed.
E> Execution halted
而我则是彻底的卡死在了等待下载的路上:
Downloading GitHub repo mskcc/facets@HEAD
Downloading GitHub repo veseshan/pctGCdata@HEAD
Error in utils::download.file(url, path, method = method, quiet = quiet, :
download from 'https://api.github.com/repos/veseshan/pctGCdata/tarball/HEAD' failed
Downloading GitHub repo veseshan/pctGCdata@HEAD
这里git clone 下载一下:
git clone https://github.com/mskcc/facets
git clone https://github.com/mskcc/pctGCdata
放在工作目录下,进行编译。
看到有两个版本的编译方法,第一个:https://blog.csdn.net/renyongzhe/article/details/101352683 采用了软件源码安装的configure-make-install 三部曲,比较麻烦:
比如要配置下面这么多参数。
./configure --prefix=/path/to/install/R_3.6.0 --enable-R-shlib CPPFLAGS="-I/path_to/zlib_1.2.11/include -I/path_to/bzip2-1.0.6/include -I/path_to/xz-5.2.4/include -I/path_to/pcre-8.43/include -I/path_to/curl-7.65.3/include -I/usr/include -fPIC" LDFLAGS="-L/path_to/zlib_1.2.11/lib -L/path_to/bzip2-1.0.6/lib -L/path_to/xz-5.2.4/lib -L/path_to/pcre-8.43/lib -Wl,-rpath=/path_to/xz-5.2.4/lib -Wl,-rpath=/path_to/pcre-8.43/lib -L/path_to/curl-7.65.3/lib -L/path_to/icu/source/lib/ -L/usr/lib -L/usr/lib64 -fPIC"
还有一个就是:https://blog.csdn.net/huangfei711/article/details/51100155
在R 中进行安装,使用本地的源码文件。
我们尝试在R 中操作一下。
进入R,并将工作目录设置为源码文件所在目录:
~/archive
R
> getwd()
[1] "/home/yzpen/archive"
> list.files(recursive = TRUE)
[1] "facets-master.zip"
[2] "pctGCdata-master.zip"
R中安装本地包:
install.packages("pctGCdata-master", repos=NULL, type="source")
发生报错了:
Error in rawToChar(block[seq_len(ns)]) :
字符串里嵌入了nul:'PK\003\004\n\0\0\0\0\0Ne^O\0\0\0\0\0\0\0\0\0\0\0\0\016\0\t\0facets-master/UT\005\0\001\xa5\xe7\xb9]PK\003\004\n\0\0\0\b\0Ne^O\xbc\024\x81\xabI\0\0\0W\0\0\0\033\0\t\0facets-master/.Rb'
Warning message:
In install.packages("facets-master.zip", repos = NULL, type = "source") :
安装程序包‘facets-master.zip’时退出狀態的值不是0
接着尝试把文件解压缩,还是报错:
> install.packages("facets-master", repos=NULL, type="source")
* installing *source* package ‘facets’ ...
** using staged installation
** libs
gfortran -fPIC -Wall -g -O2 -c cbs2rank.f -o cbs2rank.o
make: gfortran: No such file or directory
make: *** [cbs2rank.o] Error 1
ERROR: compilation failed for package ‘facets’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/facets’
Warning message:
In install.packages("facets-master", repos = NULL, type = "source") :
安装程序包‘facets-master’时退出狀態的值不是0
这也太可怕了吧!
换一个安装:
> install.packages("pctGCdata-master", repos=NULL, type="source")
* installing *source* package ‘pctGCdata’ ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (pctGCdata)
竟然就成功了。
再来研究第一个安装失败的报错:
make: gfortran: No such file or directory
make: *** [cbs2rank.o] Error 1
ERROR: compilation failed for package ‘facets’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/facets’
这里参考:https://www.jianshu.com/p/c63450e91a8c
发现是没有文件gfortran,简单查了一下这是一个非常古老的1956 年就开始使用的编程语言。
那就下载一个,镜像:https://mirrors.tuna.tsinghua.edu.cn/CRAN/bin/macosx/tools/gfortran-6.1.pkg
我这里选择直接用brew 下载:
$ brew install gcc
终于也成功安装了:
** R
** 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 (facets)
看来源码安装,还是麻烦啊!