参考:https://www.jianshu.com/p/6d5b5763c409

    作者是因为安装中遇到了下面的问题:

    1. creating vignettes (8s)
    2. --- re-building FACETS.Rnw using Sweave
    3. Loading required package: pctGCdata
    4. Error: processing vignette 'FACETS.Rnw' failed with diagnostics:
    5. Running 'texi2dvi' on 'FACETS.tex' failed.
    6. --- failed re-building FACETS.Rnw
    7. SUMMARY: processing the following file failed:
    8. FACETS.Rnw
    9. Error: Vignette re-building failed.
    10. Execution halted
    11. Error: Failed to install 'facets' from GitHub:
    12. System command error, exit status: 1, stdout + stderr (last 10 lines):
    13. E> Loading required package: pctGCdata
    14. E> Error: processing vignette 'FACETS.Rnw' failed with diagnostics:
    15. E> Running 'texi2dvi' on 'FACETS.tex' failed.
    16. E> --- failed re-building FACETS.Rnw
    17. E>
    18. E> SUMMARY: processing the following file failed:
    19. E> FACETS.Rnw
    20. E>
    21. E> Error: Vignette re-building failed.
    22. E> Execution halted

    而我则是彻底的卡死在了等待下载的路上:

    1. Downloading GitHub repo mskcc/facets@HEAD
    2. Downloading GitHub repo veseshan/pctGCdata@HEAD
    3. Error in utils::download.file(url, path, method = method, quiet = quiet, :
    4. download from 'https://api.github.com/repos/veseshan/pctGCdata/tarball/HEAD' failed
    5. Downloading GitHub repo veseshan/pctGCdata@HEAD

    这里git clone 下载一下:

    1. git clone https://github.com/mskcc/facets
    2. git clone https://github.com/mskcc/pctGCdata

    放在工作目录下,进行编译。

    看到有两个版本的编译方法,第一个:https://blog.csdn.net/renyongzhe/article/details/101352683 采用了软件源码安装的configure-make-install 三部曲,比较麻烦:

    比如要配置下面这么多参数。

    1. ./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,并将工作目录设置为源码文件所在目录:

    1. ~/archive
    2. R
    3. > getwd()
    4. [1] "/home/yzpen/archive"
    5. > list.files(recursive = TRUE)
    6. [1] "facets-master.zip"
    7. [2] "pctGCdata-master.zip"

    R中安装本地包:

    1. install.packages("pctGCdata-master", repos=NULL, type="source")

    发生报错了:

    1. Error in rawToChar(block[seq_len(ns)]) :
    2. 字符串里嵌入了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'
    3. Warning message:
    4. In install.packages("facets-master.zip", repos = NULL, type = "source") :
    5. 安装程序包‘facets-master.zip’时退出狀態的值不是0

    接着尝试把文件解压缩,还是报错:

    1. > install.packages("facets-master", repos=NULL, type="source")
    2. * installing *source* package facets ...
    3. ** using staged installation
    4. ** libs
    5. gfortran -fPIC -Wall -g -O2 -c cbs2rank.f -o cbs2rank.o
    6. make: gfortran: No such file or directory
    7. make: *** [cbs2rank.o] Error 1
    8. ERROR: compilation failed for package facets
    9. * removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/facets
    10. Warning message:
    11. In install.packages("facets-master", repos = NULL, type = "source") :
    12. 安装程序包‘facets-master’时退出狀態的值不是0

    这也太可怕了吧!

    换一个安装:

    1. > install.packages("pctGCdata-master", repos=NULL, type="source")
    2. * installing *source* package pctGCdata ...
    3. ** using staged installation
    4. ** R
    5. ** data
    6. *** moving datasets to lazyload DB
    7. ** byte-compile and prepare package for lazy loading
    8. ** help
    9. *** installing help indices
    10. ** building package indices
    11. ** testing if installed package can be loaded from temporary location
    12. ** testing if installed package can be loaded from final location
    13. ** testing if installed package keeps a record of temporary installation path
    14. * DONE (pctGCdata)

    竟然就成功了。

    再来研究第一个安装失败的报错:

    1. make: gfortran: No such file or directory
    2. make: *** [cbs2rank.o] Error 1
    3. ERROR: compilation failed for package facets
    4. * 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 下载:

    1. $ brew install gcc

    终于也成功安装了:

    1. ** R
    2. ** inst
    3. ** byte-compile and prepare package for lazy loading
    4. ** help
    5. *** installing help indices
    6. ** building package indices
    7. ** installing vignettes
    8. ** testing if installed package can be loaded from temporary location
    9. ** checking absolute paths in shared objects and dynamic libraries
    10. ** testing if installed package can be loaded from final location
    11. ** testing if installed package keeps a record of temporary installation path
    12. * DONE (facets)

    看来源码安装,还是麻烦啊!