1 Introduction
A collection of software installation guides.
1.1 Linux
1.1.1 BAMscale
- Install HTSlib
mkdir /data/softwares/BAMscale
wget https://github.com/samtools/htslib/releases/download/1.21/htslib-1.21.tar.bz2
tar -xjvf htslib-1.21.tar.bz2
cd htslib-1.21
./configure --prefix=/data/softwares/BAMscale/htslib-1.21-for_BAMscale
make
make install
- Install libBigWig
git clone https://github.com/dpryan79/libBigWig.git
cd libBigWig
make
- Install BAMscale
export CPPFLAGS="-I /data/softwares/BAMscale/htslib-1.21-for_BAMscale/include -I /data/softwares/BAMscale/libBigWig"
export LDFLAGS="-L /data/softwares/BAMscale/htslib-1.21-for_BAMscale/lib -Wl,-rpath,/data/softwares/BAMscale/htslib-1.21-for_BAMscale/lib -L /data/softwares/BAMscale/libBigWig -Wl,-rpath,/data/softwares/BAMscale/libBigWig"
git clone https://github.com/ncbi/BAMscale.git
cd BAMscale
make
sudo ln -s /data/softwares/BAMscale/BAMscale/bin/BAMscale /usr/local/bin/BAMscale
注:利用gcc/g++编译程序时与编译和链接相关的环境变量和选项:
CPATH:冒号分隔的目录列表,全局配置编译时头文件(.h)搜索路径。LIBRARY_PATH:冒号分隔的目录列表,全局配置编译时静态库(.a)和动态库(.so/.dylib)搜索路径。LD_LIBRARY_PATH:冒号分隔的目录列表,全局配置运行时动态库文件搜索路径。CPPFLAGS:传递 C preprocessor flags,如头文件路径(-I)和宏定义,只在“预处理”阶段生效。CPPFLAGS显式传递给编译器,优先级高于CPATH。CFLAGS:传递 C compiler flags。控制编译器如何编译程序。LDFLAGS:传递 linker flags,如添加编译时库文件路径(-L)、添加链接库(-l)、添加运行时库文件路径(-Wl,-rpath)。-L应放在-l之前。-lhts代表链接名为libhts.so或libhts.a的库。-Wl,-rpath将路径硬编码到可执行文件,避免运行时依赖LD_LIBRARY_PATH。
如果头文件/库文件存在于标准搜索路径则可不必指定,如/usr/include、/usr/lib、/usr/local/include、/usr/local/lib等。