R version: 4.2.1
Seurat
install.packages("Seurat")
- rgeos包依赖geos-config:
- 下载geos: http://download.osgeo.org/geos/geos-3.9.3.tar.bz2
- 安装geos:
1
2
3
4
5
6
7
8
9tar jxf geos-3.9.3.tar.bz2
cd geos-3.9.3
./configure --prefix=/opt/software/geos
make
make install
vim ~/.bashrc
export PATH=$PATH:/opt/software/geos/bin
source ~/.bashrc
cp /opt/software/geos/lib/libgeos_c.so.1.14.3 /opt/software/R/lib64/R/lib/libgeos_c.so.1
SingleR
BiocManager::install("SingleR")
- BiocManager版本3.16安装SingleR要求C++17:
- 下载C++11编译的SingleR包: http://bioconductor.org/packages/3.15/bioc/html/SingleR.html
- 安装SingleR:
install.packages("SingleR_1.10.0.tar.gz", repos = NULL)
hdf5r
install.packages("hdf5r")
- 依赖hdf5:
- 下载hdf5: https://portal.hdfgroup.org/display/support/HDF5+1.14.1#files
- 安装hdf5:
1
2
3
4
5
6
7
8
9
10
11
12tar xzf hdf5-1.14.1-2.tar.gz
cd hdf5-1.14.1-2
./configure --prefix=/opt/software/hdf5
make
make install
vim ~/.bashrc
export PATH=$PATH:/opt/software/hdf5/bin
source ~/.bashrc
# 找不到共享库的问题
vim /etc/ld.so.conf
/opt/software/hdf5/lib
ldconfig
infercnv
BiocManager::install("infercnv")
- rjags包依赖jags:
- 下载jags: https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/
- 安装lapack:
yum install lapack lapack-devel
- 安装jags:
1
2
3
4
5
6
7
8
9
10tar xzf JAGS-4.3.2.tar.gz
cd JAGS-4.3.2
./configure --prefix=/opt/software/jags
make
make install
vim ~/.bashrc
export PATH=$PATH:/opt/software/jags/bin
source ~/.bashrc
# 找不到/opt/software/jags/lib64/JAGS/modules-4/basemod.so
cp -R lib lib64
- RcppParallel包安装出错: 下载低版本的包安装:
install.packages("RcppParallel_4.4.3.tar.gz", repos = NULL)
SPATA2
1 | yum install fftw-devel |
1 | install.packages("devtools") |
*安装参考资料: https://themilolab.github.io/SPATA2/articles/spata-v2-installation.html
- 依赖gdal-config:
- 下载gdal: https://gdal.org/download.html
- 安装gdal:
1
2
3
4
5
6
7
8
9tar xzf gdal-2.4.4.tar.gz
cd gdal-2.4.4
./configure --prefix=/opt/software/gdal
make
make install
vim ~/.bashrc
export PATH=$PATH:/opt/software/gdal/bin
source ~/.bashrc
ln -s /opt/software/gdal/lib/libgdal.so.20.5.4 /usr/local/lib64/libgdal.so.20
- gdal 3.5.0版本依赖proj6:
- 下载: https://proj.org/en/9.2/download.html
- proj6依赖sqlite3: 下载sqlite3 (https://sqlite.org/download.html)
- 安装:
./configure --prefix=/home/software/gdal --with-proj=/home/software/proj6
a. 编译出现undefined reference to sqlite3_column_origin_name和undefined reference to sqlite3_column_table_name:
vim sqlite3.c
添加 #define SQLITE_ENABLE_COLUMN_METADATA 1
重新编译sqlite3
Monocle3
1 | BiocManager::install(c('BiocGenerics', 'DelayedArray', 'DelayedMatrixStats', |
- 安装依赖包terra出现proj_api.h not found in standard or given locations:
将proj的include和lib中的文件复制到/usr/local/include和lib下
R安装包问题及解决方案总结
- 缺乏依赖: 报错信息中会给出类似找不到某个依赖 -> 根据缺少的东西通过yum/apt安装或下载包编译安装
- 找不到库: 报错信息中会给出相关库找不到的信息 -> 主要是提供寻找库的路径 (一般将编译好的包的bin和lib目录都添加到环境变量)
- GLIBC版本的问题: 查看版本:
strings /lib64/libc.so.6 |grep GLIBC_
; 下载地址: https://ftp.gnu.org/gnu/glibc/
- GLIBC版本的问题: 查看版本:
- 编译过程中的代码错误: 一般是版本问题 -> 更换低版本安装
添加动态库.so文件到环境变量
- 当前用户当前终端:
export LD_LIBRARY_PATH=
(删除变量:unset LD_LIBRARY_PATH
) - 当前用户环境变量:
1
2
3vim ~/.bashrc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:
source ~/.bashrc - 所有用户环境变量:
1
2
3vim /etc/profile
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:
source /etc/profile - 复制so文件到lib目录:
sudo cp .so /usr/lib
- ldconfig寻找路径:
1
2
3vim /etc/ld.so.conf
/opt/software/hdf5/lib
sudo ldconfig