跳转至

ARM软件编译

参考

ARM平台NEON指令的编译和优化

鲲鹏软件性能调优基础知识

x86移植到鲲鹏常见编译脚本、编译选项移植、builtin函数、内联汇编函数替换汇总

鲲鹏论坛-鲲鹏HPC

鲲鹏开源应用软件移植指南-生命科学

SSE2NEON安装与配置完全指南

在GCC 9.1.0版本,支持了鲲鹏处理器所兼容的ARM v8指令集、TaiShan v110流水线。

使用方法:

在GCC for openEuler编译器、毕昇编译器、GCC编译器高于9.1.0版本上,并在CFLAGS、CPPFLAGS里增加编译选项:

-mtune=tsv110 -march=armv8-a

https://hpc.ilri.cgiar.org/list-of-software

http://ftp.genek.cn:8888/Share/linux_software/

常见报错

  • c++: error: unrecognized command-line option ‘-mbmi2’

    `-mbmi2` 是一个 GCC 编译器的命令行选项,用于启用针对支持 BMI2(Bit Manipulation Instruction Set 2)的处理器架构的优化。BMI2 是 Intel 和 AMD 处理器的一组指令集扩展,旨在提高位操作的性能。
    
    解决:移除该编译选项
    
  • c++: error: unrecognized command-line option ‘-mpopcnt’

    -mpopcnt 是 GCC 编译器的一个选项,用于启用对 POPCNT 指令的支持。POPCNT 是一种位操作指令,用于快速计算一个二进制数中“1”的个数,通常可用于优化与位操作相关的算法。
    
    解决:移除该编译选项
    

公共软件安装规范

  • 慎用 root 安装各类依赖库、python 包、perl 模块等,以免导致各节点环境不一致、环境混乱,也没法做版本管理。root 非必要不使用。

  • zlibgslzstdxzhdf5 等各类依赖均使可使用普通账号源码编译,然后写好 modulefile,使用时 module 载入即可。

  • 公共环境禁止使用 conda 安装任何软件,如果无法避免,则在 singularity 镜像中使用 conda 安装所需的软件,用户调用该镜像即可。

  • perl 所需的模块可以安装在 module 的 perl 中,基准版本为 arm/perl/5.34.0

  • R 包可以安装在 module 的 R 中,基本版本为 arm/r/4.4.1

  • 由于 python 包更新频繁、各个软件依赖的 python 版本区别较大,因此每个应用软件依赖的 python 包均应该安装在该软件目录内(使用 --prefix 指定安装目录),而不是在系统或公共 python 目录内,modulefile 文件中使用 PYTHONPATH 环境变量指定路径来引用安装的包。

  • modulefile 文件命名均采用小写字母,所有依赖 python 的软件,其 modulefile 文件名中均应指定 python 版本,如 arm/rnaframework/2.9.2-py3.11 arm/ntsynt/1.0.2-py3.9 arm/snpbinner/1.0.0-py2.7;使用了 MPI 的软件,modulefile 文件命名中指定使用了哪个MPI,如 arm/gflow/0.1.7-openmpi arm/gromacs/2019.5-hmpi等。

  • 每个软件的 modulefile 文件中均应包含软件的项目地址,github地址优先,方便跟踪。

  • 所有软件源码在 package 目录内均应单独建目录,然后在该目录内下载该软件的各种版本、进行编译等,所有软件源码的 tar.gz 源码包尽量保留。

  • 软件中若有头文件(xxx.h),应使用 CPATH 指定路径。

  • 软件中若有静态链接库(xxx.a),应使用 LIBRARY_PATH 指定路径。

  • 软件中若有动态链接库(xxx.so),应使用 LD_LIBRARY_PATH 指定路径。

  • 软件中若有 pkgconfig 文件(xxx.pc),应使用 PKG_CONFIG_PATH 指定路径。

  • 软件中若有 cmake 模块文件(xxx.cmake),应使用 CMAKE_PREFIX_PATH 指定路径。

anchorwave

项目地址 https://github.com/baoxingsong/anchorwave

git clone https://github.com/baoxingsong/anchorwave.git
cd anchorwave
mv CMakeLists_arm.txt CMakeLists.txt
cmake ./
make

Amber

项目地址 https://ambermd.org/GetAmber.php

参考文档 https://ambermd.org/doc12/Amber24.pdf

module load gcc/compiler/gccmodule gcc/hmpi/hmpi 
tar xf Amber24.tar.bz2
tar xf AmberTools24.tar.bz2
pip install --prefix=/path/to/amber/ numpy scipy matplotlib
cd amber24_src
$ ./update_amber --update
cd build
根据需要修改 run_cmake 文件中 cmake 的参数,然后再运行 run_cmake

修改后如下,指定安装目录、启用 MPI、禁用 conda

  cmake $AMBER_PREFIX/amber24_src \
    -DCMAKE_INSTALL_PREFIX=/share/software/app/arm/amber/24/ \
    -DCOMPILER=GNU  \
    -DMPI=TRUE -DCUDA=FALSE -DINSTALL_TESTS=TRUE \
    -DDOWNLOAD_MINICONDA=FALSE \
    2>&1 | tee  cmake.log
run_cmake 运行完成后,再运行 make install 安装。

source /share/software/app/arm/amber/24/amber.sh 后即可使用。

AnnoPRO

https://github.com/idrblab/AnnoPRO

依赖库 profeatpy 在 github 上的源码包被删了,无法编译安装这个包。

apbs

项目地址

github.com/Electrostatics/apbs

https://apbs.readthedocs.io/en/latest/index.html

$ tar xf apbs-3.4.1.tar.gz
$ cd apbs-3.4.1
$ mkdir build && cd build
$ export APBS_BUILD_DIR=${PWD}
$ export SuiteSparse_DIR="/path/to/suitesparse/"
$ export CMAKE_PREFIX_PATH="/path/to/suitesparse/:$CMAKE_PREFIX_PATH"
$ cmake .. -DUMFPACK_INCLUDES=/path/to/suitesparse/include/suitesparse/umfpack.h -DUMFPACK_LIBRARIES=/path/to/suitesparse/lib64/libumfpack.a -DAMD_INCLUDE_DIR=/path/to/suitesparse/include/suitesparse/ -DAMD_STATIC=/path/to/suitesparse/lib64/libamd.a -DPython3_EXECUTABLE=/usr/bin/python3 -DCMAKE_C_COMPILER=`which gcc` -DCMAKE_CXX_COMPILER=`which g++` -DCMAKE_C_FLAGS="-fopenmp" -DCMAKE_CXX_FLAGS="-fopenmp"
$ make -j
$ make install

Augustus

项目地址:https://github.com/Gaius-Augustus/Augustus/

参考 https://github.com/Gaius-Augustus/Augustus/blob/master/docs/INSTALL.md

$ wget http://bioinf.uni-greifswald.de/augustus/binaries/augustus.current.tar.gz
$ tar -xzf augustus.current.tar.gz
$ cd augustus
修改 common.mk 文件,将 COMPGENEPRED = true 更改为 COMPGENEPRED = false,添加 MYSQL = false

编译 make augustus

如果需要编译 augustus 及其它相关工具。

$ module load arm/bamtools/2.5.2    arm/htslib/1.21
$ tar -xzf augustus.current.tar.gz
$ cd augustus
$ make

ATLAS

$ mkdir build && cd build
$ ../configure --prefix=/path/to/atlas/ -Si archdef 0 -b 64 -D c -DATL_ARM_HARDFP=1   --cripple-atlas-performance 
# make -j 20 会报错
$ make && make install
# 查看安装的库
$ $ ls -1 /path/to/atlas/
libatlas.a
libcblas.a
libf77blas.a
liblapack.a
libptcblas.a
libptf77blas.a

BatMeth2

项目地址:https://github.com/GuoliangLi-HZAU/BatMeth2

$ git clone https://github.com/GuoliangLi-HZAU/BatMeth2.git

$ cp  ~/package/sse2neon.h src/mealign/
$ sed -i.bak 's/<emmintrin.h>/"sse2neon.h"/g' ./src/mealign/ksw.c 
$ sed -i.bak 's/-m64/ /g' ./src/Makefile 

$ ./configure --prefix=/path/to/batmeth2/
$ make -j20 && make install

BLAT

最新版 https://hgdownload.soe.ucsc.edu/admin/,下载 jksrc.xxx.zip,BLAT 位于 kent/src/blat,不容易编译成功。

编译好的 x86 版本 https://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/blat/

可编译版本

$ wget https://codeload.github.com/djhshih/blat/tar.gz/v35.1
$ mv v35.1 blat_35.1.tar.gz
$ tar xf blat_35.1.tar.gz
$ cd blat-35.1/
$ make
# 或编译静态库版本
$ CFLAGS="-static -static-libgcc -D_STATIC" make

BerkeleyDB

项目地址 https://github.com/berkeleydb/libdb/

$ wget https://github.com/berkeleydb/libdb/releases/download/v5.3.28/db-5.3.28.tar.gz
$ tar xf db-5.3.28.tar.gz
$ cd db-5.3.28/build_unix
$ ../dist/configure --build=aarch64-unknown-linux-gnu --prefix=/path/to/berkeley-db/
$ make -j20 && make install

bmtagger

https://ftp.ncbi.nlm.nih.gov/pub/agarwala/bmtagger/

$ wget https://ftp.ncbi.nlm.nih.gov/pub/agarwala/bmtagger/bmtagger.sh
$ wget https://anaconda.org/bioconda/bmfilter/3.101/download/linux-aarch64/bmfilter-3.101-h78569d1_5.tar.bz2
$ wget https://anaconda.org/bioconda/srprism/2.4.24/download/linux-aarch64/srprism-2.4.24-h76f4f2e_5.tar.bz2
$ wget https://conda.anaconda.org/bioconda/linux-aarch64/extract_fullseq-3.101-h78569d1_5.tar.bz2

$ tar xf *bz2
$ ls -1 bin/
bmfilter
extract_fullseq
srprism

$ module load arm/blast/2.16.0
创建文件 bmtagger.conf
#!/bin/sh

echo "bmtagger.sh: You may want to edit bmtagger.conf" >&2
SRPRISM=./bin/srprism 
BMFILTER="./bin/bmfilter"
EXTRACT_FA="./bin/extract_fullseq"
#bmfiles="hs/quick_mask/indexes/washu_mask18" 
#blastdb="hs/quick_mask/indexes/HUMAN_SCREENING"
#srindex="hs/quick_mask/indexes/HUMAN_SCREENING.srprism"
#TMPDIR="/tmp"

https://ftp.ncbi.nlm.nih.gov/pub/agarwala/bmtagger/bmtools.tar.gz 这个源码包可以独立编译 srprism bmfilter extract_fullseq 但有编译报错。

blast+

可以在 https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/ 中下载编译好的版本。

$ wget https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/ncbi-blast-2.16.0+-aarch64-linux.tar.gz

bwa-mem2

项目地址 https://github.com/bwa-mem2/bwa-mem2

# 下载二进制版本
wget https://anaconda.org/bioconda/bwa-mem2/2.2.1/download/linux-aarch64/bwa-mem2-2.2.1-h0010869_6.tar.bz2

cactus

项目地址 https://github.com/ComparativeGenomicsToolkit/cactus

git clone https://github.com/ComparativeGenomicsToolkit/cactus.git --recursive
cd cactus
setup.py 文件中22行的 subprocess.run([sys.executable, "-m", "pip", "install", "submodules/sonLib"], check=True) 注释掉,以免将 sonLib 安装到了 python 的默认目录。
make -j20
pip install --prefix=/path/to/cactus/  submodules/sonLib
pip install --prefix=/path/to/cactus/  .
pip install --prefix=/path/to/cactus/ -r toil-requirement.txt

cereal

https://github.com/USCiLab/cereal

unittests/CMakeLists.txt unittests/boost/CMakeLists.txt unittests/cpp17/CMakeLists.txt 中所有 -m32 删除

删除 CMakeLists.txt 中部分编译选项

add_compile_options(-Wall -Wextra -pedantic -Wshadow -Wold-style-cast) 更改为 add_compile_options(-Wall -Wextra -pedantic )

add_compile_options(-Werror) 更改为 add_compile_options()

$ mkdir build
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=/path/to/cereal/ -DBoost_INCLUDE_DIR=/path/to/boost/include/   ..
$ make -j12
$ make install

clustalw

项目地址 http://www.clustal.org/download/current/

wget http://www.clustal.org/download/current/clustalw-2.1.tar.gz
tar xf clustalw-2.1.tar.gz
cd clustalw-2.1/
./configure --build=arm  --prefix=/path/to/clustalw/
make -j20 && make install

cmake

https://cmake.org/download/

直接下载编译好的 aarch64 版本 cmake-3.30.5-linux-aarch64.sh

cppunit

https://freedesktop.org/wiki/Software/cppunit/

$ tar xf cppunit-1.13.2.tar.gz 
$ cd cppunit-1.13.2
$ ./configure --prefix=/path/to/cppunit/ --build=aarch64-unknown-linux-gnu
$ make -j20 && make install

bowtie2

直接下载编译好的二进制文件

https://github.com/BenLangmead/bowtie2/releases

EDTA (todo)

https://github.com/liaoherui/AnnoSINE_v2

mamba create -n EDTA2.2 -c conda-forge -c bioconda annosine2 biopython cd-hit coreutils genericrepeatfinder genometools-genometools glob2 tir-learner ltr_finder_parallel ltr_retriever mdust multiprocess muscle openjdk perl perl-text-soundex r-base r-dplyr regex repeatmodeler r-ggplot2 r-here r-tidyr tesorter samtools bedtools LTR_HARVEST_parallel HelitronScanner
glob2 
https://github.com/lutianyu2001/TIR-Learner

elai

项目地址 https://github.com/haplotype/ELAI

$ git clone https://github.com/haplotype/ELAI
$ cd src

修改 Makefile 文件

CFLAGS += -Wall -fno-math-errno -ffast-math 修改为 CFLAGS += -Wall -fno-math-errno -ffast-math -fsigned-char,即添加 -fsigned-char 编译选项

STATICLIBS += /usr/local/lib/libgsl.a /usr/local/lib/libgslcblas.a 修改为 STATICLIBS += /share/software/app/arm/gsl/2.7/lib/libgsl.a /share/software/app/arm/gsl/2.7/lib/libgslcblas.a

最后编译 make

Warning

编译时不添加 -fsigned-char 编译选项也能编译成功,但运行不出结果。

测试

cd ../example
$ ../src/elai -g hap.ceu.chr22.inp -p 10 -g hap.yri.chr22.inp -p 11 -g admix-1cm.inp -p 1 -pos hgdp.chr22.pos -o test -s 20 --exclude-nopos --exclude-maf 0.01 --exclude-miss1 -mg 20

emboss

https://emboss.sourceforge.net/

$ wget https://anaconda.org/bioconda/emboss/6.6.0/download/linux-aarch64/emboss-6.6.0-h70f19aa_11.tar.bz2

EVM

项目地址 https://github.com/EVidenceModeler/EVidenceModeler/

$ tar xf EVidenceModeler-v2.1.0.tar.gz
$ cd EVidenceModeler-v2.1.0
plugins/ParaFly/configure 中第 3123 行的 AM_CXXFLAGS=-m64 注释掉。
$ make

exonerate

下载二进制版本

$ wget https://anaconda.org/bioconda/exonerate/2.4.0/download/linux-aarch64/exonerate-2.4.0-he4d9ad3_8.tar.bz2

fastlmm

需要替换 Cpp/Inc/BlasLapack.h 中数学库,源码中使用的 intel MKL 数学库。

intel MKLopenblasKML
sscalcblas_sscalcblas_sscal
dscalcblas_dscalcblas_dscal
scopycblas_scopycblas_scopy
dcopycblas_dcopycblas_dcopy
sgemvcblas_sgemvcblas_sgemv
dgemvcblas_dgemvcblas_dgemv
sgemmcblas_sgemmcblas_sgemm
dgemmcblas_dgemmcblas_dgemm
ssyrkcblas_ssyrkcblas_ssyrk
dsyrkcblas_dsyrkcblas_dsyrk
spotrfLAPACKE_spotrfspotrf_
dpotrfLAPACKE_dpotrfdpotrf_
spotrsLAPACKE_spotrsspotrs_
dpotrsLAPACKE_dpotrsdpotrs_
sgesddLAPACKE_sgesddsgesdd_
dgesddLAPACKE_dgesdddgesdd_
ssyevrLAPACKE_ssyevrssyevd_
dsyevrLAPACKE_dsyevrdsyevd_
sgelsyLAPACKE_sgelsysgelsy_
dgelsyLAPACKE_dgelsydgelsy_
vsLnfor (BLAS_INT i = 0; i < n; ++i)vslog2
vdLnvdlog2
vsSqrtfor (BLAS_INT i = 0; i < n; ++i)vssqrt
vsSqrtvdsqrt

fastqc

https://anaconda.org/bioconda/fastqc

直接下载编译好的二进制文件

$ wget https://anaconda.org/bioconda/fastqc/0.12.1/download/noarch/fastqc-0.12.1-hdfd78af_0.tar.bz2

fastp

安装依赖库 isa-l,libdeflate,如果没有 libstdc++.a,也需要安装 gcc。最后使用静态库编译fastp,使用时不用另外载入依赖库。

# 设置静态库地址
$ export LIBRARY_PATH=/path/to/isa-l/lib/:/path/to/libdeflate/lib/:/path/to/gcc/lib64/
$ git clone https://github.com/OpenGene/fastp.git
$ cd fastp
$ make -j12 static

fastStructure

python3

项目地址 https://github.com/rajanil/fastStructure/issues/63

原项目基于python2,安装 scipy 出现报错。

因此实际编译安装使用python3的版本 https://github.com/jashapiro/fastStructure

git clone https://github.com/jashapiro/fastStructure.git
cd fastStructure
git checkout py3

部分代码需要更改

parse_bed.pyx

25 行的Nbytes = Nindiv/4+(Nindiv%4>0)*1 更改为 Nbytes = Nindiv//4+(Nindiv%4>0)*1

48 行的 print "This is not a valid bed file" 更改为 print("This is not a valid bed file")

fastStructure.pyx

305 行的 print "Failed" 更改为 print("Failed")

$ module load arm/gsl/2.4
$ pip install --prefix=/path/to/faststructure/ numpy scipy cython
$ cd var
$ PYTHONPATH=/path/to/faststructure/1.0/lib64/python3.9/site-packages/:/path/to/faststructure/1.0/lib/python3.9/site-packages/ python setup.py build_ext -f --inplace
$ cd ..
$ PYTHONPATH=/path/to/faststructure/1.0/lib64/python3.9/site-packages/:/path/to/faststructure/1.0/lib/python3.9/site-packages/ python setup.py build_ext -f --inplace

# 测试,将 ./var/ 加入 PYTHONPATH,否则出现 allelefreq 相关报错
$ PYTHONPATH=/path/to/faststructure/1.0/lib64/python3.9/site-packages/:/path/to/faststructure/1.0/lib/python3.9/site-packages/:$PWD python structure.py -h

运行测试算例

PYTHONPATH=//path/to/faststructure/faststructure/1.0/lib64/python3.9/site-packages/://path/to/faststructure/faststructure/1.0/lib/python3.9/site-packages/ python structure.py -K 3 --input=test/testdata --output=testoutput_simple --full --seed=100

出现报错,暂时未能解决。

Traceback (most recent call last):
  File "//path/to/faststructure/fastStructure/structure.py", line 176, in <module>
    Q, P, other = fastStructure.infer_variational_parameters(G, params['K'], \
  File "fastStructure.pyx", line 99, in fastStructure.infer_variational_parameters
    psi.update(G, pi)
TypeError: Cannot convert allelefreq.AlleleFreq to allelefreq.AlleleFreq

参考

https://github.com/rajanil/fastStructure/issues/63

https://github.com/rajanil/fastStructure/issues/81

python2

$ module load arm/python/2.7.18
$ git clone https://github.com/rajanil/fastStructure/
$ cd fastStructure
安装依赖
$ pip install --prefix=/path/to/fastStructure/ numpy
# 设置编译参数 -fallow-argument-mismatch,否则 scipy 编译过程中出现报错 Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
$ export FCFLAGS="-fallow-argument-mismatch"
$ export FFLAGS="-fallow-argument-mismatch"
$ PYTHONPATH=/path/to/lib/python2.7/site-packages/ pip install --prefix=/path/to/fastStructure/ scipy  Cython matplotlib
parse_bed.pyxfastStructure.pyx 顶部添加 # cython: language_level=2 表示使用 python2 编译 cpython
$ cd vars
$ PYTHONPATH=/path/to/lib/python2.7/site-packages/ python setup.py build_ext -f --inplace
$ cd ..
$ PYTHONPATH=/path/to/lib/python2.7/site-packages/ python setup.py build_ext -f --inplace
# 测试
$ PYTHONPATH=/path/to/lib/python2.7/site-packages/:$PWD/vars/ python structure.py -h
测试算例可正常运行

PYTHONPATH=//path/to/faststructure/faststructure/1.0/lib/python2.7/site-packages/ python structure.py -K 3 --input=test/testdata --output=testoutput_simple --full --seed=100

FastTree

$ wget http://meta.microbesonline.org/fasttree/FastTree.c
$ gcc -DOPENMP -DUSE_DOUBLE -fopenmp -O3 -march=armv8.2-a -mtune=tsv110 -finline-functions -funroll-loops -Wall -o FastTreePar-2.1.11 FastTree.c -lm
$ export OMP_NUM_THREADS=128

fftw

参考

https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpcindapp/prtg-osc/kunpenggromacs_02_0027.html

$ module load arm/openmpi/5.0.5
$ wget wget https://fftw.org/pub/fftw/fftw-3.3.8.tar.gz
$ tar xf fftw-3.3.8.tar.gz
$ cd fftw-3.3.8/
$ ./configure --prefix=/path/to/fftw/ --enable-single --enable-float --enable-neon --enable-shared --enable-threads --enable-openmp --enable-mpi CFLAGS="-O3 -fomit-frame-pointer -fstrict-aliasing"
$ make -j20
$ make install

flye

项目地址 https://github.com/mikolmogorov/Flye/

wget wget https://anaconda.org/bioconda/flye/2.9.5/download/linux-aarch64/flye-2.9.5-py39h989d1c4_2.tar.bz2
tar xf flye-2.9.5-py39h989d1c4_2.tar.bz2

GATK

intel GKL

# 下载这个 arm64 分支
git clone -b devel https://github.com/syalavarthi/GKL.git
cd GKL
下载 gradle-5.6-bin.zip,将其再放在 /share/home/software/.gradle/wrapper/dists/gradle-5.6-bin/gradle-5.6-bin.zip,将 gradle/wrapper/gradle-wrapper.properties 中的 distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-all.zip 替换为 distributionUrl=file:/share/home/software/.gradle/wrapper/dists/gradle-5.6-bin/gradle-5.6-bin.zip

运行 ./gradlew build

git clone https://github.com/IntelLabs/GKL.git

gcta

项目地址 https://github.com/jianyangqt/gcta

注意 openblas 的版本,较高的版本中部分 API 有变化(函数 dpotri_)会导致编译报错,测试 0.3.13 可正常编译。

git submodule update --init
git clone https://github.com/jianyangqt/gcta.git
cd gcta
mdir build; cd build
module load arm/gcc/12.2.0
export EIGEN3_INCLUDE_DIR=/path/to/eigen/3.4.0/include/eigen3
export SPECTRA_LIB=/path/to/spectra/1.1.0/include/
export BOOST_LIB=/path/to/boost/1.72.0/include/
export OPENBLAS=/path/to/openblas/0.3.13/
cmake ..
make -j20

gcc

$ wget https://ftp.gnu.org/gnu/gcc/gcc-10.3.0/gcc-10.3.0.tar.xz
$ tar xf gcc-10.3.0.tar.xz
$ cd gcc-10.3.0
$ contrib/download_prerequisites 
$ mkdir build
$ cd build
../configure \
    --prefix=/path/to/gcc \
    --enable-languages=all \
    --enable-threads=posix \
    --enable-shared \
    --enable-static \
    --disable-multilib \
    --enable-libatomic \
    --enable-libgomp \
    --enable-libstdcxx \
$ make -j20 && make install
各选项的作用
  • --enable-languages=all 启用 GCC 支持的所有语言

  • -enable-threads=posix 指定线程模型

  • --enable-shared 启用共享库的生成

  • --enable-static 启用静态库的生成,否则部分软件编译时报错 /usr/bin/ld: cannot find -lstdc++

  • --diskable-multilib 禁止多库支持,只编译 64 位库

  • --enable-libatomic 启用 libatomic 库,否则部分软件编译时报错 /usr/bin/ld: cannot find -latomic

  • --enable-libgomp 启用 libgomp 库(OpenMP 支持)

  • --enable-libstdcxx 启用 C++ 标准库

GEMMA

项目地址 https://github.com/genetics-statistics/GEMMA/

安装依赖库 gsl,openblas,如果没有 libstdc++.a,也需要安装 gcc。最后使用静态库编译 GEMMA,使用时不用另外载入依赖库。

# 使用静态链接库编译,设置环境变量
$ export LIBRARY_PATH=/path/to/gsl/lib/:/path/to/openblas/lib/:/path/to/gcc/lib64/

$ wget https://github.com/genetics-statistics/GEMMA/archive/refs/tags/v0.98.5.tar.gz
$ mv v0.98.5.tar.gz gemma-0.98.5.tar.gz
$ tar xf gemma-0.98.5.tar.gz
$ cd GEMMA-0.98.5/
$ make -j12 static

GenABEL

项目地址 https://github.com/GenABEL-Project/GenABEL

$ module load arm/r/4.4.1 
$ wget https://cran.r-project.org/src/contrib/Archive/GenABEL.data/GenABEL.data_1.0.0.tar.gz
$ wget https://cran.r-project.org/src/contrib/Archive/GenABEL/GenABEL_1.8-0.tar.gz
$ tar xf GenABEL_1.8-0.tar.gz
$ R CMD INSTALL GenABEL.data_1.0.0.tar.gz
从 R 4.3 开始 Sint 类型被废弃,根据之前 R 版本中的定义 typedef int Sint;,将 GenABEL/src/ctest.h 中的 Sint 替换为 intsed -i 's/Sint/int/g' GenABEL/src/ctest.h

修改 GenABEL/src/fexact.c 文件,添加头文件 #include <Rinternals.h>

PROBLEM "Bug in FEXACT: gave negative key" RECOVER(NULL_ENTRY); 替换为 Rf_error("Bug in FEXACT: gave negative key");

ROBLEM "FEXACT error %d.\n%s", icode, mes RECOVER(NULL_ENTRY); 替换为 Rf_error("FEXACT error %d.\n%s", icode, mes);

安装 R CMD INSTALL GenABEL

gffread

项目地址 https://github.com/gpertea/gffread

$ git clone https://github.com/gpertea/gffread
$ cd gffread/
$ make release

GFlow

项目地址:https://github.com/gflow/GFlow

$ git clone https://github.com/gflow/GFlow.git
$ cd GFlow
# 加载 petsc
$ module load arm/petsc/3.22.2-openmpi
# 下载测试算例
$ wget https://github.com/gflow/GFlow/releases/download/v0.1.7-alpha/inputs.tar.gz

output.h 中添加一行代码,否则编译时会出现 undefined reference to 'MAX' 的报错。

#define MAX(a, b) ((a) > (b) ? (a) : (b))
编译 make,生成可执行文件 gflow.x

运行测试算例

$ tar xf inputs.tar.gz
$ cp input/* .
# 修改 execute_example.sh 中 PETSC_DIR 的位置为 petsc 的安装目录
$ sh execute_example.sh

GLnexus

项目地址 https://github.com/dnanexus-rnd/GLnexus

bioconda 中有一个 aarch64 的预编译版本,下载使用报错,看报错应该是在 x86 上编译的。https://anaconda.org/bioconda/glnexus/1.4.1/download/linux-64/glnexus-1.4.1-h17e8430_5.tar.bz2

以下为源码编译。

下载源码

git clone https://github.com/dnanexus-rnd/GLnexus
cd GLnexus

删除 CMakeLists.txt 中所有的 -march=ivybridge -msse4.2 -DHAVE_SSE42 -mpclmul

src/genotyper.cc 中的 __asm__(".symver logf,logf@GLIBC_2.2.5");注释。

运行 cmake .

下载所有依赖软件至当前路径下,然后 cp *gz *bz2 *zip external/src/

https://github.com/giacomodrago/fcmm/archive/v1.0.1.zip 404 了,换成 https://github.com/sigiesec/fcmm/archive/v1.0.1.zip

https://github.com/samtools/htslib/releases/download/1.9/htslib-1.9.tar.bz2
https://github.com/facebook/rocksdb/archive/v6.29.3.tar.gz
https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.6.3.zip
https://github.com/vit-vit/CTPL/archive/v.0.0.2.zip
https://github.com/giacomodrago/fcmm/archive/v1.0.1.zip
https://github.com/gabime/spdlog/archive/v1.8.2.tar.gz
https://capnproto.org/capnproto-c++-0.7.0.tar.gz
https://github.com/philsquared/Catch/archive/v1.12.2.zip
注意依赖软件的命名和版本,与下面的保持一致,否则编译时会找不到软件包。
$ ls -1 external/src/{*gz,*zip,*bz2}
external/src/capnproto-c++-0.7.0.tar.gz
external/src/htslib-1.9.tar.bz2
external/src/v.0.0.2.zip
external/src/v1.0.1.zip
external/src/v1.8.2.tar.gz
external/src/v6.29.3.tar.gz
external/src/yaml-cpp-0.6.3.zip

然后将所有cmake中下载相关的动作注释掉

find external/src/ -name "*-impl.cmake" |xargs -i sed -i '1,10s/^/# /' {}

src/BCFKeyValueData.cc 中第 467 至 471 行注释,如下所示。

//#ifndef __x86_64__
//if (uint64_t(data.data) % sizeof(::capnp::word)) {
 //    return Status::Failure("BCFBucketReader: input buffer isn't word-aligned");
//}
//#endif
运行 make 编译,中间会有一次 capnp 相关的报错,继续 make 编译。然后报错
/usr/bin/ld: cannot find -lsnappy
/usr/bin/ld: cannot find -lzstd
/usr/bin/ld: cannot find -lstdc++

加载相关依赖 module load arm/zstd/1.5.6 arm/gcc/12.2.0 arm/snappy/1.2.1,继续 make。这几个依赖不可一开始就是加载,否则依赖 yaml-cpp 编译不通过。

出现如下信息表明 glnexus 编译成功,后面测试部分报错不用管。

[ 76%] Linking CXX executable glnexus_cli
[ 77%] Built target glnexus_cli
[ 78%] Creating directories for 'catch'
[ 79%] Performing download step (download, verify and extract) for 'catch'

测试

$ ./glnexus_cli -h
[2871613] [2025-03-09 19:12:19.710] [GLnexus] [info] glnexus_cli release v1.4.5-0-gfae491b-dirty Mar  9 2025
[2871613] [2025-03-09 19:12:19.710] [GLnexus] [warning] jemalloc absent, which will impede performance with high thread counts. See https://github.com/dnanexus-rnd/GLnexus/wiki/Performance
Usage: ./glnexus_cli [options] /vcf/file/1 .. /vcf/file/N
Merge and joint-call input gVCF files, emitting multi-sample BCF on standard output.

Options:
  --dir DIR, -d DIR              scratch directory path (mustn't already exist; default: ./GLnexus.DB)
  --config X, -c X               configuration preset name or .yml filename (default: gatk)
  --bed FILE, -b FILE            three-column BED file with ranges to analyze (if neither --range nor --bed: use full length of all contigs)
  --list, -l                     expect given files to contain lists of gVCF filenames, one per line

  --more-PL, -P                  include PL from reference bands and other cases omitted by default
  --squeeze, -S                  reduce pVCF size by suppressing detail in cells derived from reference bands
  --trim-uncalled-alleles, -a    remove alleles with no output GT calls in postprocessing

  --mem-gbytes X, -m X           memory budget, in gbytes (default: most of system memory)
  --threads X, -t X              thread budget (default: all hardware threads)

  --help, -h                     print this help message

Configuration presets:
            Name          CRC32C    Description
            gatk      1926883223    Joint-call GATK-style gVCFs
 gatk_unfiltered      4039280095    Merge GATK-style gVCFs with no QC filters or genotype revision
          xAtlas      1991666133    Joint-call xAtlas gVCFs
xAtlas_unfiltered       221875257   Merge xAtlas gVCFs with no QC filters or genotype revision
          weCall      2898360729    Joint-call weCall gVCFs
weCall_unfiltered      4254257210   Merge weCall gVCFs with no filtering or genotype revision
     DeepVariant      2932316105    Joint call DeepVariant whole genome sequencing gVCFs
  DeepVariantWGS      2932316105    Joint call DeepVariant whole genome sequencing gVCFs
  DeepVariantWES      1063427682    Joint call DeepVariant whole exome sequencing gVCFs
DeepVariantWES_MED_DP      2412618877   Joint call DeepVariant whole exome sequencing gVCFs, populating 0/0 DP from MED_DP instead of MIN_DP
DeepVariant_unfiltered      3285998180  Merge DeepVariant gVCFs with no QC filters or genotype revision
        Strelka2       395868656    [EXPERIMENTAL] Merge Strelka2 gVCFs with no QC filters or genotype revision
             GxS      3929547104    [EXPERIMENTAL] merging for GxS

GMAP

项目地址 http://research-pub.gene.com/gmap/src/

$ wget http://research-pub.gene.com/gmap/src/gmap-gsnap-2023-12-01.tar.gz
$ tar xf gmap-gsnap-2023-12-01.tar.gz
$ cd gmap-2023-12-01/
$ ./configure --prefix=/path/to/gmap/ --with-simd-level=arm

gnuplot

项目地址 http://www.gnuplot.info/

$ wget http://nchc.dl.sourceforge.net/project/gnuplot/gnuplot/5.4.9/gnuplot-5.4.9.tar.gz
$ tar xf gnuplot-5.4.9.tar.gz
$ cd gnuplot-5.4.9
$ module load arm/lua/5.4.7
$ ./configure --prefix=/path/gnuplot/ --with-qt=no
$ make -j20 && make install

gromacs

参考

https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpcindapp/prtg-osc/kunpenggromacs_02_0027.html

$ module load arm/openmpi/5.0.5 arm/openblas/0.3.28
$ wget http://ftp.gromacs.org/pub/gromacs/gromacs-2019.5.tar.gz
$ tar xf gromacs-2019.5.tar.gz
$ cd gromacs-2019.5/
$ mkdir build && cd build/
$ cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/gromacs/ -DGMX_SIMD=ARM_NEON_ASIMD -DGMX_OPENMP=on -DGMX_MPI=on -DGMX_X11=off -DGMX_GPU=off -DFFTWF_LIBRARY=/path/to/lib//libfftw3f.so -DFFTWF_INCLUDE_DIR=/path/to/include
$ make -j20
$ make install
GPU 版
$ cmake .. -DGMX_GPU=CUDA -DGMX_BUILD_OWN_FFTW=ON -DCMAKE_INSTALL_PREFIX=/path/to/gromacs/
$ make -j20
$ make install
gromacs with plumd2

https://github.com/amd/amd-fftw/issues/3

$ module load arm/plumed/2.9.2-bisheng arm/hyper-mpi/24.6.30_bisheng
$ wget http://ftp.gromacs.org/pub/gromacs/gromacs-2021.7.tar.gz
$ tar xf gromacs-2021.7.tar.gz
$ cd gromacs-2021.7/
# 为 plumed 打 patch
$ plumed-patch -p -e gromacs-2021.7
$ mkdir build && cd build/
$ cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/2021.7-plumed -DGMX_SIMD=ARM_NEON_ASIMD -DGMX_THREAD_MPI=OFF -DGMX_OPENMP=on -DGMX_MPI=on -DGMX_X11=off -DGMX_GPU=off -DBUILD_SHARED_LIBS=OFF -DGMX_PREFER_STATIC_LIBS=ON -DGMXAPI=OFF -DCMAKE_C_COMPILER=`which mpicc` -DCMAKE_CXX_COMPILER=`which mpic++` -DGMX_FFT_LIBRARY=fftw3 -DCMAKE_PREFIX_PATH=/path/to/fftw3/
$ make -j96 && make install

hal2vg

项目地址 https://github.com/glennhickey/hal2vg

git clone https://github.com/glennhickey/hal2vg.git --recursive
cd hal2vg

sed -i '1,$s/std=c++11/std=c++17/` deps/libbdsg-easy/deps/DYNAMIC/CMakeLists.txt 
# 需要运行 3 次 make
make -j
make -j
make -j

./hal2vg 

HiCPlotter

项目地址 https://github.com/akdemirlab/HiCPlotter

$ module load arm/python/2.7.18

$ pip install --prefix=/path/to/hicplotter/ bx-python==1.16.6

# 设置这2个环境变量,否则 scipy 安装编译报错,Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
$ export FCFLAGS="-fallow-argument-mismatch"
$ export FFLAGS="-fallow-argument-mismatch"
$ pip install --prefix=/path/to/hicplotter/ scipy==1.2.3

$ pip install --prefix=/path/to/hicplotter/ matplotlib==1.4.3
# 在 mpl_toolkits 目录下添加 __init__.py,否则会出现报错 ImportError: No module named mpl_toolkits.axes_grid1
$ touch /path/to/hicplotter/lib/python2.7/site-packages/mpl_toolkits/__init__.py

$ tar xf HiCPlotter-0.6.6.tar.gz
$ cd HiCPlotter-0.6.6/
# 编辑 HiCPlotter.py,在首行添加 #!/bin/env python
$ chmod +x HiCPlotter.py
$ cp HiCPlotter.py /path/to/hicplotter/bin/
$ /path/to/hicplotter/bin/HiCPlotter.py -h

HiC-Pro

HiC-Pro-2.11.4

module load arm/python/2.7.18 arm/lzo/2.10
pip install --prefix=/path/to/hic-pro/ bx-python==0.8.1 numpy==1.8.2  pysam==0.8.3

# 设置这2个环境变量,否则 scipy 安装编译报错,Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
export FCFLAGS="-fallow-argument-mismatch"
export FFLAGS="-fallow-argument-mismatch"
pip install --prefix=/path/to/hic-pro/ scipy==1.2.3

tar xf HiC-Pro-2.11.4.tar.gz
cd HiC-Pro-2.11.4/

# 载入相关依赖软件,需要安装这3个R包,ggplot2 (>2.2.1) RColorBrewer grid
module load arm/r/4.4.1 arm/bowtie2/2.5.4 arm/samtools/1.21
# 编辑 config-install.txt,PREFIX = /path/to/hic-pro/
make configure
make CONFIG_SYS=config-install.txt
1.x 版的numpy可以使用这个命令安装 pip install --prefix=/path/to/hic-pro/ "numpy<2" HiC-Pro-3.1.0
wget https://files.pythonhosted.org/packages/e2/3f/c2747248931fc997d2fe303c4e18827cc0c94114fba3e2c709e530db7226/iced-0.5.13.tar.gz
pip install --prefix=/path/to/hic-pro/ numpy==1.19.5 scipy==1.9.3 pysam==0.17.0 bx-python==0.9.0 cython
tar xf iced-0.5.13.tar.gz
cd iced-0.5.13
cython iced/normalization/_normalization_.pyx
python setup.py install --prefix=/path/to/hic-pro/

tar xf hic-pro-3.1.0.tar.gz
HiC-Pro-3.1.0

# 载入相关依赖软件,需要安装这3个R包,ggplot2 (>2.2.1) RColorBrewer grid
module load arm/r/4.4.1 arm/bowtie2/2.5.4 arm/samtools/1.21
# 编辑 config-install.txt,PREFIX = /path/to/hic-pro/
make configure
make CONFIG_SYS=config-install.txt

hisat2

项目地址 https://github.com/DaehwanKimLab/hisat2

下载源码及依赖库

$ git clone https://github.com/DaehwanKimLab/hisat2.git
cd hisat2
$ wget https://raw.githubusercontent.com/lh3/ksw2/refs/heads/master/ksw2.h
$ wget https://raw.githubusercontent.com/DLTcollab/sse2neon/refs/heads/master/sse2neon.h
更改 alphabet.cpp 文件的 404 行,将 -1 , 更改为 char(-1) , 更改后为
char mask2iupac[16] = { 
        char(-1),
        'A', // 0001
        'C', // 0010
        'M', // 0011
        'G', // 0100
        'R', // 0101
        'S', // 0110
        'V', // 0111
        'T', // 1000
        'W', // 1001
        'Y', // 1010
        'H', // 1011
        'K', // 1100
        'D', // 1101
        'B', // 1110
        'N', // 1111
};
sse_util.haligner_sw.h 文件中的 #include <emmintrin.h> 替换为 #include "sse2neon.h"

Makefile 文件中的 EXTRA_FLAGS += -DPOPCNT_CAPABILITY 注释掉

Makefile 166-175 行的如下内容

BITS_FLAG =

ifeq (32,$(BITS))
    BITS_FLAG = -m32
endif

ifeq (64,$(BITS))
    BITS_FLAG = -m64
endif
SSE_FLAG=-msse2
更改为如下内容
BITS_FLAG =

BITS=64
ifeq (32,$(BITS))
        BITS_FLAG = -m32
endif

ifeq (64,$(BITS))
         ifeq (0, $(AARCH64))
        BITS_FLAG = -m64
  endif
endif
SSE_FLAG =
ifeq (0, $(AARCH64))
  SSE_FLAG=-msse2
        BITS_FLAG = -m64
endif
#SSE_FLAG=-msse2
最后 make -j12

hifiasm

项目地址 https://github.com/chhylp123/hifiasm

下载二进制文件

$ wget https://anaconda.org/bioconda/hifiasm/0.19.9/download/linux-aarch64/hifiasm-0.19.9-hf1d9491_0.tar.bz2

手动编译

下载源码及依赖库

$ git https://github.com/chhylp123/hifiasm.git
$ cd hifiasm
$ wget https://raw.githubusercontent.com/DLTcollab/sse2neon/refs/heads/master/sse2neon.h
Levenshtein_distance.h 中的 以下头文件都注释,添加 #include "sse2neon.h"
#include "emmintrin.h"
#include "nmmintrin.h"
#include "smmintrin.h"
#include <immintrin.h>
更改后的内容为
//#include "emmintrin.h"
//#include "nmmintrin.h"
//#include "smmintrin.h"
//#include <immintrin.h>
#include "sse2neon.h"
Makefile 中的

#CXXFLAGS= -g -O3 -msse4.2 -mpopcnt -fomit-frame-pointer -Wall

替换为

CXXFLAGS= -g -O3 -fomit-frame-pointer -Wall

最后 make -j12

IBSpy

项目地址 https://github.com/Uauy-Lab/IBSpy

module load arm/python/3.11.10
pip install --prefix=/path/to/ibspy/ numpy pandas cython biopython pyfaidx pandas psutil matplotlib pyranges multiprocess pysam scikit-learn
wget https://github.com/Uauy-Lab/IBSpy/archive/refs/tags/0.4.6.tar.gz
tar 0.4.6.tar.gz
cd IBSpy-0.4.6
pip install --prefix=/path/to/ibspy/
# /path/to/ibspy/lib/python3.11/site-packages/IBSpy/window_affinity_propagation.py 中 `from numpy import NaN, ndarray` 改为 `from numpy import nan, ndarray`

# KMC api 安装
cd ..
wget https://github.com/refresh-bio/KMC/archive/refs/tags/v3.1.1.tar.gz
tar xf v3.1.1.tar.gz
cd KMC-3.1.1
# 将 makefile 中的 -I $(PY_KMC_API_DIR)/libs/pybind11/include 替换为 -I /share/software/app/arm/python/3.11.10/lib/python3.11/site-packages/pybind11/include/ 
make py_kmc_api
cp  bin/*so /path/to/ibspy/lib/python3.11/site-packages/

# 测试
IBSpy -h
sh  tests/integration_python.sh 

k8

项目地址 https://github.com/attractivechaos/k8

直接使用 bioconda 中编译好的版本

$ wget https://anaconda.org/bioconda/k8/1.2/download/linux-aarch64/k8-1.2-h7f4e536_0.tar.bz2
$ tar xf k8-1.2-h7f4e536_0.tar.bz2
$ module load arm/gcc/12.2.0
$ ./bin/k8
Usage: k8 [options] <script.js> [arguments]
Options:
  -e STR      execute STR
  -E STR      execute STR and print results
  -m INT      v8 max size of the old space (in Mbytes) [16384]
  -v          print version number
  --help      show v8 command-line options

lammps

$ module load  arm/openmpi/5.0.5
$ wget https://download.lammps.org/tars/lammps.tar.gz
$ #tar xf lammps.tar.gz 
$ cd lammps-29Aug2024
$ cd src
$ mkdir build
# 添加所需的包
$ make yes-manybody yes-meam yes-extra-fix yes-mc
$ make -j80 g++_openmpi

lapack

编译静态库

librefblas.alibcblas.aliblapack.aliblapacke.a 都编译出来。

$ wget http://www.netlib.org/lapack/lapack.tgz
$ tar lapack
$ cd lapack-3.10.1
$ cp make.inc.example make.inc
$ make blaslib
$ make cblaslib
$ make lapacklib
$ make lapackelib

1、 静态库路径

检查下 lapack-3.10.1 下是否有 librefblas.alibcblas.aliblapack.aliblapacke.a 这几个文件,没有的话重新编译一次。

  1. 头文件路径

cblas头文件路径: lapack-3.10.1/CBLAS/include

lapacke头文件路径: lapack-3.10.0/LAPACKE/include

cblasblas 的 c 接口,lapackelapack 的 c 接口,由于 blaslapack 是 fortran 代码所以这两个没有头文件,只有 .a 文件。

参考

https://www.cnblogs.com/babyclass/p/16358589.html

编译动态库

动态库编译需要使用 cmake 编译

$ wget http://www.netlib.org/lapack/lapack.tgz
$ tar lapack
$ cd lapack-3.10.1
$ mkdir build && cd build
$ cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=ON  -DCBLAS=ON -DLAPACKE=ON
$ make -j

$ ls -1 lib/
libblas.so -> libblas.so.3
libblas.so.3 -> libblas.so.3.10.0
libblas.so.3.10.0
libcblas.so -> libcblas.so.3
libcblas.so.3 -> libcblas.so.3.10.0
libcblas.so.3.10.0
liblapacke.so -> liblapacke.so.3
liblapacke.so.3 -> liblapacke.so.3.10.0
liblapacke.so.3.10.0
liblapack.so -> liblapack.so.3
liblapack.so.3 -> liblapack.so.3.10.0
liblapack.so.3.10.0
其它选项
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
option(BUILD_INDEX64 "Build Index-64 API libraries" OFF)
option(BUILD_TESTING "Build tests" ${_is_coverage_build})
option(BUILD_DEPRECATED "Build deprecated routines" OFF)
option(BUILD_SINGLE "Build single precision real" ON)
option(BUILD_DOUBLE "Build double precision real" ON)
option(BUILD_COMPLEX "Build single precision complex" ON)
option(BUILD_COMPLEX16 "Build double precision complex" ON)
option(USE_OPTIMIZED_BLAS "Whether or not to use an optimized BLAS library instead of included netlib BLAS" OFF)
option(CBLAS "Build CBLAS" OFF)
option(USE_XBLAS "Build extended precision (needs XBLAS)" OFF)
option(USE_OPTIMIZED_LAPACK "Whether or not to use an optimized LAPACK library instead of included netlib LAPACK" OFF)
option(LAPACKE "Build LAPACKE" OFF)
option(LAPACKE_WITH_TMG "Build LAPACKE with tmglib routines" OFF)
option(BLAS++ "Build BLAS++" OFF)
option(LAPACK++ "Build LAPACK++" OFF)
option(BUILD_HTML_DOCUMENTATION "Create and install the HTML based API
option(BUILD_MAN_DOCUMENTATION "Create and install the MAN based documentation (requires Doxygen) - command: make man" OFF)

libdb

https://github.com/berkeleydb/libdb

$ git clone https://github.com/berkeleydb/libdb.git
$ cd libdb/build_unix
$ ../dist/configure --prefix=/path/to/libdb/ --build=arm-linux-gnueabi
$ make -j20
$ make install

Liftoff

项目地址 https://github.com/agshumate/Liftoff

git clone https://github.com/agshumate/Liftoff
cd Liftoff
pip install --prefix=/path/to/liftoff/ numpy pysam
PYTHONPATH=//path/to/liftoff/lib/python3.9/site-packages/://path/to/liftoff/lib64/python3.9/site-packages/ python setup.py install --prefix=/path/to/liftoff/

llvm

项目地址 https://github.com/llvm/llvm-project

git clone https://github.com/llvm/llvm-project.git
cd llvm-project
cmake -S llvm -B build -DCMAKE_INSTALL_PREFIX=/path/to/llvm/ -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;lld"
cmake --build build -j 80

mafft

参考 https://mafft.cbrc.jp/alignment/software/installation_without_root.html

mash

项目地址 github.com/marbl/Mash/

源码编译

$ module load capnproto/1.1.0 gsl/2.8 gcc/10.3.0 
$ tar xf Mash-2.3.tar.gz
$ cd Mash-2.3
$ sed -i  '8,10s/^/#/' Makefile.in
$ autoreconf -i
$ ./configure --prefix=/path/to/mash/ --with-capnp=/path/to/capnproto/ --with-gsl=/path/to/gsl/ --enable-static-gsl
$ make -j
$ make install 
$ /path/to/mash/bin/mash -h

Mash version 2.3

Type 'mash --license' for license and copyright information.

Usage:

  mash <command> [options] [arguments ...]

Commands:

  bounds     Print a table of Mash error bounds.

  dist       Estimate the distance of query sequences to references.

  info       Display information about sketch files.

  paste      Create a single sketch file from multiple sketch files.

  screen     Determine whether query sequences are within a larger mixture of
             sequences.

  sketch     Create sketches (reduced representations for fast operations).

  taxscreen  Create Kraken-style taxonomic report based on mash screen.

  triangle   Estimate a lower-triangular distance matrix.

使用 bioconda 中编译好的版本。

先编译 cblas 动态库

tar xf lapack-3.10.0.tgz
cd lapack-3.10.0
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/mash/ -DCMAKE_BUILD_TYPE=RELEASE -DCBLAS=ON
make -j
make install
$ wget https://anaconda.org/bioconda/mash/2.3/download/linux-aarch64/mash-2.3-heca2785_9.tar.bz2
$ tar xf mash-2.3-heca2785_9.tar.bz2
$ module load arm/gsl/2.7   arm/gcc/14.2.0
$ cp -r bin/ /path/to/mash/
$ export LD_LIBRARY_PATH=/path/to/mash/lib64/:$LD_LIBRARY_PATH
$ /path/to/mash/bin/mash -h

Mash version 2.3

Type 'mash --license' for license and copyright information.

Usage:

  mash <command> [options] [arguments ...]

Commands:

  bounds     Print a table of Mash error bounds.

  dist       Estimate the distance of query sequences to references.

  info       Display information about sketch files.

  paste      Create a single sketch file from multiple sketch files.

  screen     Determine whether query sequences are within a larger mixture of
             sequences.

  sketch     Create sketches (reduced representations for fast operations).

  taxscreen  Create Kraken-style taxonomic report based on mash screen.

  triangle   Estimate a lower-triangular distance matrix.

megahit

项目地址 https://github.com/voutcn/megahit

下载二进制文件

https://anaconda.org/bioconda/megahit/1.2.9/download/linux-aarch64/megahit-1.2.9-hf1d9491_5.tar.bz2

手动编译

$ git clone https://github.com/voutcn/megahit.git
$ cd megahit 
$ wget https://raw.githubusercontent.com/DLTcollab/sse2neon/refs/heads/master/sse2neon.h
$ cp sse2neon.h src

src/parallel_hashmap/phmap_config.h 中 618 行的 #include <emmintrin.h> 和 623 行的 #include <tmmintrin.h> 分别替换为 #include "../sse2neon.h",如下所示。

#if PHMAP_HAVE_SSE2
    //#include <emmintrin.h>
    #include "../sse2neon.h"
#endif

#if PHMAP_HAVE_SSSE3
    //#include <tmmintrin.h>
    #include "../sse2neon.h"
#endif
src/xxhash/xxh3.h 中 618 行的 #include <emmintrin.h> 和 623 行的 #include <tmmintrin.h> 分别替换为 #include "../sse2neon.h",如下所示。
#if defined(__GNUC__)
#  if defined(__AVX2__)
//#    include <immintrin.h>
#include "../sse2neon.h"
#  elif defined(__SSE2__)
//#    include <emmintrin.h>
#include "../sse2neon.h"
src/main.cpp 中 包含 HasPopcnt()HasBmi2() 的行注释掉,如下所示。
 } else if (strcmp(argv[1], "checkcpu") == 0) {
//    pprintf("{}\n", HasPopcnt() && HasBmi2());
  } else if (strcmp(argv[1], "checkpopcnt") == 0) {
 //   pprintf("{}\n", HasPopcnt());
  } else if (strcmp(argv[1], "checkbmi2") == 0) {
  //  pprintf("{}\n", HasBmi2());
  } else if (strcmp(argv[1], "dumpversion") == 0) {

src/kmlib/kmrns.h 中 11 行的 #include <x86intrin.h> 注释掉,如下所示。

// #include <x86intrin.h>
CMakeLists.txt 中 76-77 两行注释掉,即禁用 -mbmi2 -DUSE_BMI2-mpopcnt 相关的编译选项,如下所示。
set_target_properties(megahit_core PROPERTIES COMPILE_FLAGS "-mbmi2 -DUSE_BMI2 -mpopcnt")
set_target_properties(megahit_core_popcnt PROPERTIES COMPILE_FLAGS "-mpopcnt")

编译

$ mkdir build
$ cd build
$ cmake ../ .. -DCMAKE_BUILD_TYPE=Release
$ make -j12
$ make install

metabat

下载二进制文件

$ module load arm/libdeflate/1.8 arm/boost/1.85.0  arm/gcc/12.2.0 
$ wget https://anaconda.org/bioconda/metabat2/2.17/download/linux-aarch64/metabat2-2.17-hb490ba1_0.tar.bz2
$ tar xf metabat2-2.17-hb490ba1_0.tar.bz2
$ ./bin/metabat1
源码编译
$ git clone https://bitbucket.org/berkeleylab/metabat.git
$ cd metabat
$ mkdir build && cd build
$ cmake -DCMAKE_INSTALL_PREFIX=/path/to/metabat ..
# make 时会从 github 下载依赖,需保持 github 网络通畅
$ make -j20
$ make install

MCScanX

项目地址 https://github.com/wyp1125/MCScanX

$ tar xf MCScanX-1.0.0.tar.gz 
$ cd MCScanX-1.0.0/
$ make
# 测试
$ ./MCScanX -h

# 使用下游分析脚本
$ cd downstream_analyses/
$ java bar_plotter -h
Usage: java bar_plotter -g gff_file -s collinearity_file -c control_file -o output_PNG_file

minigraph

项目地址 https://github.com/lh3/minigraph

$ git clone https://github.com/lh3/minigraph
$ cd minigraph
# 去掉 -msse4 编译选项
$ sed -i 's/-msse4//g' Makefile
$ make

minimap2

项目地址 https://github.com/lh3/minimap2

$ git clone https://github.com/lh3/minimap2
$ cd minimap2
$ make arm_neon=1 aarch64=1

miniprot

项目地址 https://github.com/lh3/miniprot

$ git clone https://github.com/lh3/miniprot
$ cd miniprot && make

msmc2

项目地址 https://github.com/stschiff/msmc2

使用 ldmd2 代替 dmd

$ module load arm/ldc2/1.41.0
$ cd /path/to/ldc2/1.41.0/bin/
$ ln -s ldmd2 dmd
$ tar xf msmc2-2.1.4.tar.gz
$ cd msmc2-2.1.4
# 将 Makefile 中的 GSLDIR=/usr/local/lib 替换为 GSLDIR=/path/to/gsl/2.4/lib/
$ make -j
$ build/release/msmc2

muscle

项目地址:https://www.drive5.com/muscle/

github上编译好的aarch64版本,运行会报错 myutils.cpp(106) assert failed: sizeof(void *) == 4,查看源码,其原因为代码未能正确识别 64 位CPU,因此需要下载源码重新编译。

muscle-5.3.tar.gz
tar xf muscle-5.3.tar.gz
cd muscle-5.3/src/
myutils.h 第 13 行代码 13 #if defined(__x86_64__) || defined(_M_X64) || defined(__arm64__)

修改为

13 #if defined(__x86_64__) || defined(_M_X64) || defined(__arm64__) || defined(__aarch64__)

然后 sh build_linux.bash 编译,编译后生成可执行文件 ../bin/muscle

也可以直接在 bioconda 中下载编译的 aarch64 版本

https://anaconda.org/bioconda/muscle/files

$ wget https://anaconda.org/bioconda/muscle/5.3/download/linux-aarch64/muscle-5.3-h78569d1_0.tar.bz2
$ tar xf muscle-5.3-h78569d1_0.tar.bz2
$ ls bin/muscle

nanom6A

项目地址:https://github.com/gaoyubang/nanom6A

打开链接 https://drive.google.com/drive/folders/1Dodt6uJC7lBihSNgT3Mexzpl_uqBagu0

下载 nanom6A_2022_12_22.tar.gz 并解压

安装 python 依赖库

# 注意固定 numpy 和 xgboost 的版本,否则可能会安装或运行出错
$ pip install --prefix=/path/to/nanom6a/ joblib numpy==1.21 pysam scikit-learn scipy tqdm xgboost==0.80 h5py statsmodels

安装 jvarkit-sam2tsv

$ wget https://anaconda.org/HCC/jvarkit-sam2tsv/1.0/download/linux-64/jvarkit-sam2tsv-1.0-0.tar.bz2
tar xf jvarkit-sam2tsv-1.0-0.tar.bz2
mkdir /path/to/nanom6a/jar/
cp dist/sam2tsv.jar /path/to/nanom6a/jar/
cp lib/com/beust/jcommander/1.64/jcommander-1.64.jar /path/to/nanom6a/jar/
cp lib/com/github/samtools/htsjdk/2.9.1/htsjdk-2.9.1.jar /path/to/nanom6a/jar/

# 创建sam2tsv脚本
$ cat /path/to/nanom6a/bin/sam2tsv
#!/bin/bash

java -Djvarkit.log.name=sam2tsv -Dfile.encoding=UTF8 -Xmx500m     -cp "/path/to/nanom6a/jar/htsjdk-2.9.1.jar:/path/to/nanom6a/jar/jcommander-1.64.jar:/path/to/nanom6a/jar/sam2tsv.jar" com.github.lindenb.jvarkit.tools.sam2tsv.Sam2Tsv $*

测试

cd nanom6A_2022_12_22
$ export PYTHONPATH=/path/to/nanom6a/lib/python3.9/site-packages/:/path/to/nanom6a/lib64/python3.9/site-packages/
$ export PATH="/path/to/nanom6a/bin/:$PATH"
$ module load arm/samtools/1.21 arm/minimap2/2.28 arm/bedtools/2.31.1 
$ sh run_source_code.sh

如果 run_source_code.sh 运行正常没有报错,则表示相关依赖安装完成。

openblas

项目地址 https://github.com/OpenMathLib/OpenBLAS

$ wget https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.28/OpenBLAS-0.3.28.tar.gz
$ tar xf OpenBLAS-0.3.28.tar.gz
$ cd OpenBLAS
$ make -j20
$ make install PREFIX=/path/to/openblas/
线程控制
export OPENBLAS_NUM_THREADS=4
export GOTO_NUM_THREADS=4
export OMP_NUM_THREADS=4

odgi

项目地址 https://github.com/pangenome/odgi

$ git clone --recursive https://github.com/pangenome/odgi.git
$ cd odgi

# 去掉 -msse4.2 编译选项
$ sed -i 's/-msse4.2//g' ./CMakeLists.txt
$ sed -i 's/-msse4.2//g' ./deps/sdsl-lite/CMakeLists.txt
$ sed -i 's/-msse4.2//g' ./deps/mmmulti/deps/sdsl-lite/CMakeLists.txt

$ sed -i 's/arch=x86-64/arch=armv8-a/g' src/main.cpp

$ module load arm/jemalloc/5.2.1
# 使用自己编译好的 gcc,否则会出现报错 /usr/bin/ld: cannot find -latomic 
$ module load arm/gcc/10.3.0 
$ cmake -H. -Bbuild
$ cmake --build build -- -j 20
$ bin/odgi -h

ORCA

项目地址 https://orcaforum.kofo.mpg.de/app.php/dlext/?cat=25

ORCA 官方只有编译好的二进制版本,其依赖的 glibc 和 gcc 版本较高,这里手动处理这 2 个依赖。

$ cd /path/to/orca/
$ tar xf orca_6_0_1_linux_arm64_shared_openmpi418.tar.xz
$ mv orca_6_0_1_linux_arm64_shared_openmpi418 orca
$ git clone https://github.com/matrix1001/glibc-all-in-one
$ cd glibc-all-in-one

# 下载适合版本的 libc6,此处的 glibc 版本为 2.41
$ wget https://ftp.debian.org/debian/pool/main/g/glibc/libc6_2.41-6_arm64.deb
$ mkdir glibc

# 解压 deb 
$ ./extract libc6_2.41-6_arm64.deb glibc
$ mv glibc ../orca

# 使用 patchelf 更改可执行文件的 interpreter
module load arm/patchelf/0.18.0
$ ls -1 /path/to/orca/orca/orca* |xargs -i patchelf --set-interpreter /path/to/orca/orca/glibc/ld-linux-aarch64.so.1 --add-rpath /path/to/orca/orca/glibc/ {}
$ ls -1 /path/to/orca/orca/autoci_* |xargs -i patchelf --set-interpreter /path/to/orca/orca/glibc/ld-linux-aarch64.so.1 --add-rpath /path/to/orca/orca/glibc/ {}

# 更改 orca 动态库的 rpath
$ patchelf --add-rpath /path/to/orca/orca/glibc/ /path/to/orca/orca/lib/liborca_tools_6_0_1.so.6
$ patchelf --add-rpath /path/to/orca/orca/glibc/ /path/to/orca/orca/lib/liborca_tools_6_0_1_mpi.so.6

# 加载 gcc 和 openmpi 依赖
$ module load arm/gcc/14.2.0 arm/openmpi/5.0.5

# 测试
$ orca
This program requires the name of a parameterfile as argument
For example ORCA TEST.INP 
# 可用
$ #singularity build --sandbox orca_openmpi2 docker://dockerpull.org/fenicsproject/test-env:current-openmpi
# 不可用
$ #singularity build --sandbox orca_openmpi3 docker://dockerpull.org/mfisherman/openmpi:4.1.6

OrthoFinder

项目地址 https://github.com/davidemms/OrthoFinder

$ wget https://github.com/davidemms/OrthoFinder/archive/refs/tags/3.0.1b1.tar.gz
$ tar xf 3.0.1b1.tar.gz
$ cd OrthoFinder-3.0.1b1
$ pip install numpy scipy --prefix=/path/to/orthofinder/
$ pip install . --prefix=/path/dir/orthofinder/
# 载入依赖
$ module load arm/diamond/2.1.10 arm/mcl/22-282 arm/fastme/2.1.6.4 arm/mafft/7.525 arm/fasttree/2.1.11
# 测试
$ orthofinder -f ExampleData/

nextdenovo

$ module load arm/curl/8.10.1 arm/openssl/3.3.2
$ git clone git@github.com:Nextomics/NextDenovo.git
$ cd NextDenovo && make arm_neon=1 aarch64=1

PanDepth

项目地址https://github.com/HuiyangYu/PanDepth

软件编译时使用了在x86平台上预编译好的静态库,使用自己编译的静态库时报错较多,故这里使用依赖的动态库编译。

$ module load arm/libdeflate/1.8 arm/htslib/1.21 
$ git clone https://github.com/HuiyangYu/PanDepth.git
$ cd PanDepth
$ mkdir include2
$ cp include/{comm.h,DataClass.h,gzstream.*} include2/
$ g++  --std=c++11 -g -O3 src/PanDepth.cpp -lhts -ldeflate -lz -pthread -Iinclude2 -o  bin/pandepth
$ cd bin
./pandepth -h

PanGenie

编译安装 jellyfish,设置环境变量 PKG_CONFIG_PATH

$ export PKG_CONFIG_PATH=/path/to/jellyfish/lib/pkgconfig

下载 cereal,设置环境变量 CPATH

$ git clone https://github.com/USCiLab/cereal
$ export CPATH=/path/to/cereal/include/
下载 pangenie
$ git clone https://github.com/eblerjana/pangenie.git  
$ cd pangenie
tests/catch.hpp 中 所有的 SIGSTKSZ 更改为 32768 (6631行、6599行)。

编译安装

$ mkdir build
$ cd build
$ cmake ..
$ make -j12
$ ls src/
libPanGenieLib.so
PanGenie-index
PanGenie

paragraph

项目地址 https://github.com/Illumina/paragraph/

编译boost,因为需要用特殊的编译选项,故不使用已安装好的。

cd ~
wget http://downloads.sourceforge.net/project/boost/boost/1.65.0/boost_1_65_0.tar.bz2
tar xf boost_1_65_0.tar.bz2
cd boost_1_65_0
./bootstrap.sh
./b2 --prefix=/path/to/boost/ link=static install
tar xf paragraph-2.4a.tar.gz
cd paragraph-2.4a

# 注释x86编译选项 -msse4.1
sed -i.bak 's/set_source_files_properties/#set_source_files_properties/g'  ./external/CMakeLists.txt

# 将 x86的 sse2 替换为 arm 的相关指令
cp  ~/package/sse2neon.h  ./external/gssw/ 
cp  ~/package/sse2neon.h  ./external/klib/
sed -i.bak 's/<emmintrin.h>/"sse2neon.h"/g' ./external/gssw/gssw.c
sed -i.bak 's/<smmintrin.h>/"sse2neon.h"/g' ./external/gssw/gssw.h
sed -i.bak 's/<emmintrin.h>/"sse2neon.h"/g' ./external/klib/ksw.c 

# 编译 warning 报错
sed -i.bak 's/-Werror/ /g' src/cmake/cxx.cmake

mkdir build && cd build
BOOST_ROOT=/path/to/boost/ ../configure --prefix=//path/to/paragrpah
然后再修改部分代码(当前目录为 paragraph-2.4a/build

external/graphtools-src/src/graphcore/GraphCoordinates.cpp 中 31 行添加 #include <limits>

external/graphtools-src/src/graphIO/GraphJson.cpp 中 71 行的for (const string& label : *labels) 改为 for (const auto& label : *labels)

external/graphtools-src/src/graphIO/../../external/include/nlohmann/json.hpp 中 2997 行的 if ('\x00' <= c and c <= '\x1F') 改为 if (static_cast<unsigned char>(c) <= 0x1F)

最后 make,以下报错不用管。

[ 97%] Linking CXX executable ../../../bin/test_blackbox
/usr/bin/ld: CMakeFiles/test_blackbox.dir/test_paragraph.cpp.o:/share/home/software/package/paragrpah/tmp/paragraph-2.4a/src/c++/test-blackbox/test_paragraph.cpp:47: multiple definition of `compare_values'; CMakeFiles/test_blackbox.dir/test_multithreading.cpp.o:/share/home/software/package/paragrpah/tmp/paragraph-2.4a/src/c++/test-blackbox/test_multithreading.cpp:39: first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [src/c++/test-blackbox/CMakeFiles/test_blackbox.dir/build.make:174: bin/test_blackbox] Error 1
make[1]: *** [CMakeFiles/Makefile2:784: src/c++/test-blackbox/CMakeFiles/test_blackbox.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
查看编译好的软件
$ ls -1 bin/
addVariants.py
compare-alignments.py
findgrm.py
graph-to-fasta
grmpy
grmpy-vcf-merge.py
idxdepth
__init__.py
kmerstats
msa2vcf.py
multigrmpy.py
multiparagraph.py
pam
paragraph
paragraph2dot.py
test_grm
vcf2paragraph.py

$ ./bin/paragraph -h

安装python依赖

pip install --prefix=/path/to/paragrpah/ -r requirements.txt 

perl

DB_File

需要先编译安装 berkeley-db,否则使用报错 DB_File/DB_File.so: undefined symbol: db_create at ...

$ cpanm --reinstall --configure-args='INC="-I/path/to/berkeley-db/5.3.21/include" LIBS="-L/path//berkeley-db/5.3.21/lib -ldb"' -l /path/to/perl/5.34.0/ DB_File

petsc

项目地址 https://gitlab.com/petsc/petsc

$ wget https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-3.22.2.tar.gz
$ tar xf petsc-3.22.2.tar.gz
$ cd petsc-3.22.2
$ module load arm/openmpi/5.0.5 arm/openblas/0.3.28
$ ./configure --prefix=//path/to/petsc/  --with-hypre=1  --download-hypre=yes
$ make all check
$ make install

项目地址 https://github.com/chrchang/plink-ng https://www.cog-genomics.org/plink/2.0/

2.0 版本

tar xf plink-ng-2.0.0-a.6.5.tar.gz
cd plink-ng-2.0.0-a.6.5/2.0
将 Makefile 文件的

#BLASFLAGS64 ?= -llapack

改为

BLASFLAGS64 ?= -O2 -L/share/software/app/arm/lapack/3.12.0/ -I/share/software/app/arm/lapack/3.12.0/include/ -llapack -lblas -lgfortran

然后编译 make -j20,生成目标文件 bin/plink2

1.9 版本

tar xf plink-ng-2.0.0-a.6.5.tar.gz
cd plink-ng-2.0.0-a.6.5/1.9
module load arm/zlib/1.3
将 Makefile 文件的

CFLAGS ?= -Wall -O2 -g -I../2.0/simde

改为

CFLAGS ?= -Wall -O2 -g -I../2.0/simde -D DYNAMIC_ZLIB

BLASFLAGS ?= -L/usr/lib64/atlas -llapack -lblas -lcblas -latlas

改为

BLASFLAGS ?= -L/share/software/app/arm/lapack/3.12.0/lib -I/share/software/app/arm/lapack/3.12.0/include/ -llapack -lblas -lcblas -lgfortran

#ZLIB ?= -L. ../zlib-1.3.1/libz.so.1.3.1

改为

ZLIB ?= -L. /share/software/app/arm/zlib/1.3/lib/libz.a

然后编译 make -j20,生成目标文件 plink

plotsr

项目地址 https://github.com/schneebergerlab/plotsr

$ git clone https://github.com/schneebergerlab/plotsr.git
$ pip install --prefix=/path/to/plotsr/ numpy==1.21.2 pandas==1.2.4 matplotlib setuptools
$ PYTHONPATH=/path/to/plotsr/lib/python3.9/site-packages/:/path/to/plotsr/lib64/python3.9/site-packages/ python setup.py install --prefix=/path/to/plotsr/
$ cd dist/
$ unzip plotsr-0.0.0-py3.9.egg
$ cp -r plotsr /path/to/plotsr/lib64/python3.9/
$ export PYTHONPATH=/path/to/plotsr/lib/python3.9/site-packages/:/path/to/plotsr/lib64/python3.9/site-packages/
$ export PATH="/path/to/plotsr/bin/:$PATH"
$ plotsr -h

plumed

项目地址 https://github.com/plumed/plumed2

# 使用hmpi编译
# 使用 FFTW_ROOT 设置使用 fftw3,否则默认可能使用fftw,导致后面编译gromacs使用fftw3时报错
$ module load arm/hyper-mpi/24.6.30_bisheng arm/jq/1.7.1
$ FFTW_ROOT=/path/to/fftw3/ ./configure --prefix=/path/to/plumed2 --enable-fftw --enable-zlib --enable-mpi  CXX=`which mpicxx` CC=`which mpicc`
$ make -j96 && install

R

项目地址 https://cran.r-project.org/

install=/path/to/r/

export LDFLAGS="-L${install}/lib"
export CFLAGS="-I${install}/include"
export LD_LIBRARY_PATH="${install}/lib/"

# 编译安装 readline
$ wget https://ftp.gnu.org/gnu/readline/readline-8.2.tar.gz
$ tar xf readline-8.2.tar.gz 
$ cd readline-8.2/
$ ./configure --prefix=$install
$ make -j20 && make install

# 编译安装 libpsl
$ wget https://github.com/rockdaboot/libpsl/releases/download/0.21.5/libpsl-0.21.5.tar.gz
$ tar xf libpsl-0.21.5.tar.gz 
$ cd libpsl-0.21.5/
$ ./configure --prefix=$install
$ make -j20 && make install

# 编译安装 curl
$ wget https://curl.se/download/curl-8.13.0.tar.gz
$ tar xf curl-8.13.0.tar.gz 
$ cd curl-8.13.0/
$ ./configure --prefix=$install --with-ssl
$ make -j20 && make install

# 编译 R
$ wget https://cran.r-project.org/src/base/R-4/R-4.5.0.tar.xz
$ tar xf R-4.5.0.tar.xz
$ cd R-4.5.0/
# 如果系统没有安装图形界面,添加选项 --with-x=no 
$ ./configure --enable-R-shlib --with-x=no --with-pcre1 --prefix=$install CPPFLAGS="-I$install/include" LDFLAGS="-L$install/lib"
$ make -j20 && make install

rmats

项目地址 https://github.com/Xinglab/rmats-turbo

$ tar xf rmats_turbo_v4_3_0.tar.gz
$ cd rmats_turbo_v4_3_0/
$ export FC=gfortran
$ sed -i 's/-msse2//g' rMATS_C/lbfgs_scipy/Makefile
$ sed -i 's/-msse2//g' rMATS_C/Makefile
$ pip install --prefix=/path/to/rmats-turbo/ cython
$ module load arm/r/4.4.1
$ ./build_rmats

# 使用
run_rmats --b1 Y_Adipose_file.txt --b2 E_Adipose_file.txt  --gtf Mus_musculus.GRCm39.114.gtf --od rmats/rMATs_Y_E/ --tmp rmats/tmp_WT_CRC/ -t paired --readLength 150 --variable-read-length --cstat 0.0001 --nthread 20

也可以参考 conda 中 rmats 的编译脚本

info/recipe/build.sh
#!/bin/bash

set -xe

mkdir $PREFIX/rMATS

GSL_LDFLAGS="$(gsl-config --libs)"
GSL_CFLAGS="$(gsl-config --cflags)"
export GSL_LDFLAGS
export GSL_CFLAGS
export LD_LIBRARY_PATH=${PREFIX}/lib

case $(uname -m) in
    aarch64)
        sed -i.bak -e "s/-msse2//" rMATS_C/Makefile
        ;;
    *)
        ;;
esac

make -j ${CPU_COUNT}

cp rmats.py $PREFIX/rMATS
cp cp_with_prefix.py $PREFIX/rMATS
mkdir $PREFIX/rMATS/rMATS_C
cp rMATS_C/rMATSexe $PREFIX/rMATS/rMATS_C
cp -R rMATS_P $PREFIX/rMATS
cp -R rMATS_R $PREFIX/rMATS
cp *.so $PREFIX/rMATS

chmod +x $PREFIX/rMATS/rmats.py
ln -s $PREFIX/rMATS/rmats.py $PREFIX/bin/rmats.py
ln -s $PREFIX/rMATS/rMATS_P/FDR.py $PREFIX/bin/FDR.py
ln -s $PREFIX/rMATS/rMATS_P/inclusion_level.py $PREFIX/bin/inclusion_level.py
ln -s $PREFIX/rMATS/rMATS_P/joinFiles.py $PREFIX/bin/joinFiles.py
ln -s $PREFIX/rMATS/rMATS_P/paste.py $PREFIX/bin/paste.py

# for backwards compatibility with the previous recipe, create a symlink named
# for the previously-used executable
ln -s $PREFIX/rMATS/rmats.py $PREFIX/bin/RNASeq-MATS.py

rmblast

项目地址:https://www.repeatmasker.org/rmblast/

$ wget https://www.repeatmasker.org/rmblast/rmblast-2.14.0+-x64-linux.tar.gz
$ wget https://www.repeatmasker.org/rmblast/isb-2.14.1+-rmblast.patch.gz
$ tar xf rmblast-2.14.0+-x64-linux.tar.gz
$ gzip -d isb-2.14.1+-rmblast.patch.gz
$ cd ncbi-blast-2.14.1+-src/
$ patch -p1 < ../isb-2.14.1+-rmblast.patch
$ cd c++/
$ ./configure --with-mt --without-debug --without-krb5 --without-openssl --with-projects=scripts/projects/rmblastn/project.lst --prefix=/path/to/rmblast
$ make -j20
$ make install

RNAstructure

项目地址 https://rna.urmc.rochester.edu/RNAstructureDownload.html

$ wget https://rna.urmc.rochester.edu/Releases/current/RNAstructureSource.tgz
$ tar xf RNAstructureSource.tgz 
$ cd RNAstructure/
$ make all -j20

sambamba

项目地址 https://github.com/biod/sambamba

$ wget https://anaconda.org/bioconda/sambamba/1.0.1/download/linux-aarch64/sambamba-1.0.1-hc099486_2.tar.bz2
$ tar xf sambamba-1.0.1-hc099486_2.tar.bz2
$ bin/sambamba

smcpp

项目地址 https://github.com/popgenmethods/smcpp

smcpp 1.15.4 需要使用低版本 numpy ,pip 安装低版本 numpy 时出现下面的报错,使用 --ignore-installed 选项。

Permission denied: '/usr/lib/python3.9/site-packages/__pycache__/six.cpython-39.pyc'
Consider using the `--user` option or check the permissions.
smcpp 1.15.4 只能使用低于 3.10 的 python。
$ module load arm/mpfr/4.1.0
$ pip install   --prefix=/path/to/smcpp/1.15.4/   --ignore-installed   --no-cache-dir   --no-build-isolation   "numpy<1.20"   appdirs matplotlib pandas pysam scipy setuptools tqdm scikit-learn
$ module load arm/smcpp/1.15.4-py3.9
$ tar xf smcpp-1.15.4.tar.gz
$ cd smcpp-1.15.4
$ python setup.py install --prefix=/path/to/smcpp/1.15.4/ 
# 去掉告警
$ export PYTHONWARNINGS="ignore::UserWarning:smcpp.version"
$ /path/to/smcpp/1.15.4/bin/smc++ -h
usage: smc++ [-h] {chunk,cite,cv,estimate,plot,posterior,simulate,split,vcf2smc,version} ...

positional arguments:
  {chunk,cite,cv,estimate,plot,posterior,simulate,split,vcf2smc,version}
    chunk               Sample randomly with replacement chunks from data file(s)
    cite                Print citation information for SMC++
    cv                  Perform cross-validated estimation procedure.
    estimate            Estimate size history for one population
    plot                Plot size history from fitted model
    posterior           Store/visualize posterior decoding of TMRCA
    simulate            Simulate from a fitted model
    split               Estimate split time in two population model
    vcf2smc             Convert VCF to SMC++ format
    version             Print version string

optional arguments:
  -h, --help            show this help message and exit

smoothxg

项目地址 https://github.com/pangenome/smoothxg

$ git clone --recursive https://github.com/pangenome/smoothxg.git

# 提前编译 abPOA 静态库,否则后面使用cmake编译会出错
$ cd smoothxg/deps/abPOA/
# 更改代码,否则后面编译 smoothxg 会报错
$ sed -i 's/static const char/static const signed char/' src/abpoa_output.c 
$ make
$ ls lib/libabpoa.a

# 更改 odgi 相关代码,否则编译 odgi 时会报错
$ cd ../odgi
# 去掉 -msse4.2 编译选项
$ sed -i 's/-msse4.2//g' ./CMakeLists.txt
$ sed -i 's/-msse4.2//g' ./deps/sdsl-lite/CMakeLists.txt
$ sed -i 's/-msse4.2//g' ./deps/mmmulti/deps/sdsl-lite/CMakeLists.txt

$ sed -i 's/arch=x86-64/arch=armv8-a/g' src/main.cpp
更改 smoothxg 的 CMakeLists.txt,禁止编译 abPOA,使用上面编译好的 abPOA。

将 280 至 291 abPOA 相关的行注释掉,然后在下面添加这 3 行。

set(abpoa_SOURCE_DIR "${CMAKE_SOURCE_DIR}/deps/abPOA")
set(abpoa "${CMAKE_SOURCE_DIR}/deps/abPOA/lib/libabpoa.a")
include_directories("${CMAKE_SOURCE_DIR}/deps/abPOA/include")

将 268 行的 add_dependencies(smoothxg_objs abpoa) 注释掉。

module load arm/jemalloc/5.2.1 arm/gcc/10.3.0
mkdir build && cd build
$ cmake -DCMAKE_C_COMPILER=`which gcc` -DCMAKE_CXX_COMPILER=`which g++` ..
$ make -j20
$ ../bin/smoothxg -h

snoscan

wget http://eddylab.org/software/snoscan/snoscan.tar.gz
tar xf snoscan.tar.gz
cd snoscan-0.9.1
cd squid-1.5.11
make clean
make
cd ..
make clean
make

SPAdes

项目地址 https://github.com/ablab/spades

tar xf SPAdes-4.1.0.tar.gz
cd SPAdes-4.1.0
PREFIX=/path/to/spades/ ./spades_compile.sh -j 10

sratools

sratools编译需要 libstdc++.a 静态链接库,否则编译过程中会出现报错。

/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
可以使用下面的命令查看系统中是否安装。
$ find /usr/ -name "*libstdc++.a*"
如果系统中没有 libstdc++.a,可自行编译安装 gcc。

sratools 安装依赖 ncbi-vdb。

$ git clone https://github.com/ncbi/ncbi-vdb
$ cd ncbi-vdb
$ ./configure --prefix=/path/to/ncbi-vdb/
$ make -j12 && make install
编译安装 sratools。
$ git clone https://github.com/ncbi/sra-tools
$ cd sra-tools
$ ./configure --with-ncbi-vdb-prefix=/path/to/ndcbi-vdb/ --prefix=/path/to/sra-tools/
$ make -j12 && make install

STAR

项目地址 https://github.com/alexdobin/STAR

$ git clone https://github.com/alexdobin/STAR
$ cd STAR/source
Makefile 文件中 CXXFLAGS_SIMD ?= -mavx2 整行注释,如下所示。
#CXXFLAGS_SIMD ?= -mavx2

然后 make

stringtie

项目地址 https://github.com/gpertea/stringtie

wget https://anaconda.org/bioconda/stringtie/3.0.0/download/linux-aarch64/stringtie-3.0.0-hac7b671_0.tar.bz2
$ tar xf stringtie-3.0.0-hac7b671_0.tar.bz2 
$ ./bin/stringtie -h

suiteparse

项目地址 https://github.com/DrTimothyAldenDavis/SuiteSparse

tar xf c-7.10.2.tar.gz
cd SuiteSparse-7.10.2/
module load arm/gcc/12.2.0
cmake ../ -DCMAKE_INSTALL_PREFIX=/path/to/suitesparse/ -DCMAKE_C_COMPILER=`which gcc` -DCMAKE_CXX_COMPILER=`which g++` -DMPFR_INCLUDE_DIR=/path/to/mpfr/include/ -DMPFR_LIBRARY=/path/to/mpfr/lib/
make -j20
make install

syri

项目地址 https://github.com/schneebergerlab/syri

$ tar xf v1.7.0.tar.gz 
$ cd syri-1.7.0
$ pip install --prefix=/path/to/syri/ numpy==1.21 cython==0.29.24 scipy pandas python-igraph psutil pysam matplotlib
$ PYTHONPATH=/path/to/syri/lib/python3.9/site-packages/:/path/to/syri/lib64/python3.9/site-packages/ python setup.py install --prefix=/path/to/syri/
$ export PYTHONPATH=/path/to/syri/lib/python3.9/site-packages/:/path/to/syri/lib64/python3.9/site-packages/:/path/to/syri/lib64/python3.9/site-packages/syri-0.0.0-py3.9-linux-aarch64.egg/
$ export PATH="/path/to/syri/bin/:$PATH"
$ syri -h

TE_finder

https://github.com/urgi-anagen/TE_finder

$ tar xf TE_finder-release-2.31.1.tar.gz 
$ cd TE_finder-release-2.31.1/
$ mkdir build; cd build
$ cmake -DCPPUNIT_INCLUDE_DIR=/path/to/cppunit/include  -DCPPUNIT_LIBRARY=/path/to/cppunit/lib/libcppunit.so ..
$ make -j20
$ make install

TIR-Learner

项目地址 https://github.com/lutianyu2001/TIR-Learner

$ tar xf TIR-Learner-3.0.7.tar.gz
$ cd TIR-Learner-3.0.7
$ cp -r TIR-Learner3/ /path/to/tir-learner/
$ pip install --prefix=/path/to/tir-learner/ biopython keras multiprocess pandas regex scikit-learn swifter torch torchvision torchaudio psutil
$ module load arm/blast/2.16.0 arm/genericrepeatfinder/1.0.2 arm/genometools/1.6.5
$ PYTHONPATH=//path/to//tir-learner/lib/python3.9/site-packages/://path/to//tir-learner/lib64/python3.9/site-packages/ /path/to/tir-learner/TIR-Learner3/TIR-Learner.py -h

trinity

$ vim  ./Inchworm/CMakeLists.txt
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -W -Wall -Wpedantic -fopenmp ")

$ vim  ./Chrysalis/CMakeLists.txt
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -W -Wall -Wpedantic -fopenmp -pthread -m64")

$ vim   trinity-plugins/ParaFly/configure
AM_CXXFLAGS=-m64 $OPENMP_CXXFLAGS

cd trinity-plugins/bamsifter/
rm -rf htslib/
wget https://github.com/samtools/htslib/releases/download/1.21/htslib-1.21.tar.bz2
tar xf htslib-1.21.tar.bz2
mv htslib-1.21 htslib
cd -

make

ucsc kent utils

$ module load arm/libpng/1.6.44 arm/mariadb/11.6.2
# 不使用 mysql 的 so 动态库
$ cd /dir/to/mariadb/lib
$ mkdir bak; mv *so* bak
# 下载编译 ucsc kent 
$ wget https://hgdownload.cse.ucsc.edu/admin/exe/userApps.src.tgz
$ tar xf userApps.src.tgz
$ cd userApps
$ make -j20
$ ls /bin

# 恢复 mysql 的 so 动态库
$ cd /dir/to/mariadb/lib
$ mv bak/* .
不加载任何环境,测试这些命令是否正常运行
$ module purge
ls -1 bin/* >> app_test.sh

# 测试命令,然后在日志中用error关键字搜索,查看是否有执行失败的命令
sh app_test.sh > app_test_log

vasp

使用 openblas、scalapack、fftw、gcc、华为MPI(hmpi) 编译 vasp。

openblas编译安装

# 载入 hmpi、gcc
module load gcc/hmpi/hmpi gcc/compiler/gccmodule
mkdir /path/to/vasp/dep/openblas/
tar xf OpenBLAS-0.3.28.tar.gz
cd OpenBLAS-0.3.28
export CC=`which gcc`
export CXX=`which g++`
export FC=`which gfortran`
make
make PREFIX=/path/to/vasp/dep/openblas/ install

使用常规方式安装 scalapack 会有类似 Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(8)/REAL(4)) 的报错,因此这里使用专门的安装工具安装 scalapack。

# 安装工具使用python2编写的
module load arm/python/2.7.18

# 载入 hmpi、gcc
module load gcc/hmpi/hmpi gcc/compiler/gccmodule

mkdir /path/to/vasp/dep/scalapack/
wget http://www.netlib.org/scalapack/scalapack_installer.tgz
tar xf scalapack_installer.tgz 
cd scalapack_installer/
python ./setup.py --prefix=/path/to/vasp/dep/scalapack/  --mpiincdir=/path/to/hmpi/gcc/hmpi/include/ --downall --notesting
fftw 编译安装
# 载入 hmpi、gcc
module load gcc/hmpi/hmpi gcc/compiler/gccmodule

mkdir /path/to/vasp/dep/fftw/
tar xf fftw-3.3.8.tar.gz
cd fftw-3.3.8/
./configure --prefix=/path/to/vasp/dep/fftw/ --enable-shared --enable-static --enable-fma --enable-neon
make
make install

vasp编译安装

# 载入 hmpi、gcc
module load gcc/hmpi/hmpi gcc/compiler/gccmodule

tar xf vasp.5.4.4.tar.gz
cd vasp.5.4.4
创建 makefile.include 文件,文件内容如下。

这里面加了一个 -fallow-argument-mismatch 编译选项,否则会出现类似 Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(8)/REAL(4)) 的报错,导致编译失败。

重点关注高亮的行。

最后 make,编译时间较长。编译成功后可执行文件在 ./bin/ 目录内。

makefile.include
# Precompiler options
CPP_OPTIONS= -DHOST=\"LinuxGNU\" \
             -DMPI -DMPI_BLOCK=8000 \
             -Duse_collective \
             -DscaLAPACK \
             -DCACHE_SIZE=4000 \
             -Davoidalloc \
             -Duse_bse_te \
             -Dtbdyn \
             -Duse_shmem

CPP        = gcc -E -P -C -w $*$(FUFFIX) >$*$(SUFFIX) $(CPP_OPTIONS)

FC         = mpif90
FCL        = mpif90

FREE       = -ffree-form -ffree-line-length-none

FFLAGS     = -w -fallow-argument-mismatch
OFLAG      = -O3 -ffp-contract=fast -fdec-math -ffpe-trap=invalid,zero,overflow -ffpe-summary=none
OFLAG_IN   = $(OFLAG)
DEBUG      = -O0

BLAS       = -L$(LIBDIR) -lrefblas
LAPACK     = -L$(LIBDIR) -ltmglib -llapack
BLACS      = 
SCALAPACK  = -L$(LIBDIR) -lscalapack $(BLACS)

LLIBS      = -L//path/to/vasp/dep/scalapack/lib/ -lscalapack -L/path/to/vasp/dep/openblas/lib/ -lopenblas

FFTW       ?= /path/to/vasp/dep/fftw/
LLIBS      += -L$(FFTW)/lib -lfftw3
INCS       = -I$(FFTW)/include

OBJECTS    = fftmpiw.o fftmpi_map.o  fftw3d.o  fft3dlib.o

OBJECTS_O1 += fftw3d.o fftmpi.o fftmpiw.o
OBJECTS_O2 += fft3dlib.o

# For what used to be vasp.5.lib
CPP_LIB    = $(CPP)
FC_LIB     = $(FC)
CC_LIB     = gcc
CFLAGS_LIB = -O
FFLAGS_LIB = -O1
FREE_LIB   = $(FREE)

OBJECTS_LIB= linpack_double.o getshmem.o

# For the parser library
CXX_PARS   = g++

LIBS       += parser
LLIBS      += -Lparser -lparser -lstdc++

# Normally no need to change this
SRCDIR     = ../../src
BINDIR     = ../../bin

参考

https://www.vasp.at/wiki/index.php/Installing_VASP.5.X.X

VCF2Dis

项目地址 https://github.com/hewm2008/VCF2Dis

$ tar xf VCF2Dis-1.53.tar.gz
$ cd VCF2Dis-1.53/
$ sh make.sh
$  bin/VCF2Dis -help

vcflib

项目地址 https://github.com/vcflib/vcflib

git clone --recursive https://github.com/vcflib/vcflib
cd vcflib
mkdir build
cd build
$ export CMAKE_PREFIX_PATH=/path/to/pybind11/lib/python3.9/site-packages/pybind11/share/cmake/pybind11/:$CMAKE_PREFIX_PATH
# 这里载入之前安装的 htslib,否则 cmake 会自动下载编译 htslib,然后会出现 libcurl 相关的报错
$ module load arm/htslib/1.21 arm/pybind11/2.13.6-py3.9
$ cmake -DCMAKE_BUILD_TYPE=Debug -DZIG=OFF -DWFA_GITMODULE=ON -DCMAKE_INSTALL_PREFIX=/path/to/vcflib/ ..
$ cmake --build . -- -j 20
$ cmake --install .

vcfhub

项目地址 https://github.com/pangenome/vcfbub

module load arm/llvm/18.1.8 arm/rust/1.85.1
git clone https://github.com/pangenome/vcfbub.git
cd vcfhub
cargo install --path .
./target/release/vcfbub -h
本文阅读量  次
本站总访问量  次