![](https://img.haomeiwen.com/i14607083/766f1d40c8a472fa.png)
这期开始会不断更新一些软件安装使用过程中的一些问题,帮着各位老师快速的实现软件的使用,在安装过程中总是出现这样那样的问题,我们就将基于此类问题,总结一些解决办法,帮助大家快速成长!今天我们要说的是 velocyto.R 怎么安装以及debug?
devtools::install_github("velocyto-team/velocyto.R")
![](https://img.haomeiwen.com/i14607083/98bc94d8c5c77994.png)
报错信息如下:
g++ -shared -s -static-libgcc -o velocyto.R.dll tmp.def RcppExports.o points_within.o routines.o -lboost_filesystem -lboost_system -lstdc++ -LD:/R-4.2.1/bin/x64 -lRlapack -LD:/R-4.2.1/bin/x64 -lRblas -fopenmp -lgfortran -lm -lquadmath -LD:/rtools42/x86_64-w64-mingw32.static.posix/lib/x64 -LD:/rtools42/x86_64-w64-mingw32.static.posix/lib -LD:/R-4.2.1/bin/x64 -lR
D:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: cannot find -lboost_filesystem
D:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: cannot find -lboost_system
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'velocyto.R'
* removing 'D:/R-4.2.1/library/velocyto.R'
Warning message:
In i.p(...) :
安装程序包‘C:/Users/zhaoh/AppData/Local/Temp/RtmpGuvyjs/file425c4675b5e/velocyto.R_0.6.tar.gz’时退出狀態的值不是0
解决方案:
1. 首先下载安装好Boost, 这个可以参考以往 软件安装系列:Boost 的安装与初试
2. 下载软件包 velocyto.R ,下载地址:https://github.com/velocyto-team/velocyto.R
![](https://img.haomeiwen.com/i14607083/4e6818b096746c5c.png)
下载后自动生成的名称为:
![](https://img.haomeiwen.com/i14607083/a62364e86b3a0a40.png)
将压缩包解压,并且修改文件名称为:
![](https://img.haomeiwen.com/i14607083/fe9ad35475e7c531.png)
3. 进入velocyto.R目录,创建目录 inst:
![](https://img.haomeiwen.com/i14607083/d70bf2b271919aa2.png)
进入inst再次创建目录 include:
![](https://img.haomeiwen.com/i14607083/48244b89e46a720d.png)
找到Boost安装目录,将整个目录进行复制,黏贴到刚刚创建的目录 include中:
![](https://img.haomeiwen.com/i14607083/94bf12b0b9364547.png)
4. 进入src目录,找到Makevars,对其内容进行修改
![](https://img.haomeiwen.com/i14607083/b5fb47cf1e14fcd3.png)
![](https://img.haomeiwen.com/i14607083/c01bfd8e500b27d4.png)
使用文本的方式打开文件Makevars,原始内容如下:
![](https://img.haomeiwen.com/i14607083/35e4510ee5089bc5.png)
修改为以下内容:
CXX_STD = CXX11
PKG_CXXFLAGS= $(SHLIB_OPENMP_CXXFLAGS)
PKG_CPPFLAGS = -I../inst/include
PKG_LIBS= -lstdc++ $(LAPACK_LIBS) $(BLAS_LIBS) $(SHLIB_OPENMP_CFLAGS) $(FLIBS)
最后看下修改后的样子,千万别搞错了,否则还报错哦!
![](https://img.haomeiwen.com/i14607083/208b572e4206cf90.png)
5. 最后再次进行安装,路径就填写到velocyto.R文件夹即可,运行下面的代码:
install.package('F:\demo script\velocyto.R', repos = NULL, type = 'source')
安装成功,最后测试一下:
library(velocyto.R)
载入需要的程辑包:Matrix
Warning message:
程辑包‘Matrix’是用R版本4.2.2 来建造的
总结一下,其实这个软件包还是挺麻烦的,需要在安装之前依赖几款软件,安装顺序为:Microsoft Visual Studio ———> Boost ———> velocyto.R
下期将分享 velocyto.R 具体数据分析,敬请期待哦!
本文使用 文章同步助手 同步
网友评论