探序基因肿瘤研究院 整理
本作者系统为centos
1. 安装JAGS
下载JAGS-4.3.0.tar.gz,
./configure
出现报错:
checking if sgemm_ is being linked in already... no
checking for ATL_xerbla in -latlas... no
checking for sgemm_ in -lblas... no
checking for sgemm_ in -lmkl... no
checking for sgemm_ in -framework vecLib... no
checking for sgemm_ in -lcxml... no
checking for sgemm_ in -ldxml... no
checking for sgemm_ in -lscs... no
checking for sgemm_ in -lcomplib.sgimath... no
checking for sgemm_ in -lblas... (cached) no
checking for sgemm_ in -lblas... (cached) no
configure: error: "You need to install the LAPACK library"
于是下载:https://www.netlib.org/lapack
安装lapack,BLAS库等方法参照:https://blog.csdn.net/weixin_41277663/article/details/131379753
将libxxx.a文件等都复制到自己的文件夹下。把这个目录配置到环境变量中,./configure仍就configure: error: "You need to install the LAPACK library",./configure --with-blas=/xxx --with-lapack=/xxx 指定了目录,仍旧报错。将librefblas.a修改成:libblas.a才可以。
如果遇到报错:relocation R_X86_64_32 against `.rodata' can not be used when making a shared object,那么要以./configure --with-blas=/xxx --with-lapack=/xxx这种形式指定LAPACK库地址,编译时会增加-fPIC参数。
或者简单的解决方案:
在系统/usr/lib64目录中,发现:libblas.so.3.8.0,liblapack.so.3.8.0等。于是增加一个软连接,ln -s libblas.so.3.8.0 libblas.a,ln -s liblapack.so.3.8.0 liblapack.a
再./configure --with-blas=/usr/lib64 --with-lapack=/usr/lib64,make,make install,成功
2. 安装R包,rjags
Sys.setenv(LD_LIBRARY_PATH="/usr/local/lib64/JAGS/modules-4/")
Sys.setenv(LD_RUN_PATH="/usr/local/lib64/JAGS/modules-4/")
Sys.setenv(PKG_CONFIG_PATH="/usr/local/lib64/pkgconfig")install.packages("rjags",configure.args="--enable-rpath")
参考:简书-CentOS7和Rstudio server安装LAPACK library、JAGS、rjags 和 inferCNV
rjags包的源代码:
https://cran.ms.unimelb.edu.au/web/packages/rjags/index.html
3. 安装R包infercnv
if(!require("BiocManager",quietly=TRUE))
install.packages("BiocManager")
BiocManager::install("infercnv")