开发者
基于鲲鹏环境移植生科应用smoothxg
基于鲲鹏环境移植生科应用smoothxg
发表于2024/09/14
390

一、获取源码

官方推荐使用git clone --recursive https://github.com/pangenome/smoothxg.git

但使用了--recursive参数默认是把子模块也同时下载,由于github是国外网站,子模块下载时经常超时,导致下载不完整,最终编译时会缺失各种文件。因此,整理了以下步骤,完整git clone smoothxg和它的所有子模块。(原理:每git clone一次,查看当前目录下的.gitmodules文件,把里面的模块都重新git clone一次,以此类推,直到最后一层没有.gitmodules文件)

注意:下述部分子模块有重复套娃,可以复制粘贴,减少git clone等待时间,但务必注意复制粘贴的路径,千万别弄错

1.1. 下载软件本体smoothxg

cd /path/to

git clone https://github.com/pangenome/smoothxg.git

1.2. 下载子模块BBHash

cd /path/to/smoothxg/deps

git clone https://github.com/vgteam/BBHash.git

1.3. 下载子模块sdsl-lite

cd /path/to/smoothxg/deps

git clone https://github.com/simongog/sdsl-lite.git

1.3.1. 下载子模块googletest

cd /path/to/smoothxg/deps/sdsl-lite/external

git clone https://github.com/google/googletest.git

1.3.2. 下载子模块libdivsufsort

cd /path/to/smoothxg/deps/sdsl-lite/external

git clone https://github.com/simongog/libdivsufsort.git

1.4. 下载子模块libhandlegraph

cd /path/to/smoothxg/deps

git clone https://github.com/vgteam/libhandlegraph.git

1.5. 下载子模块ips4o

cd /path/to/smoothxg/deps

git clone https://github.com/SaschaWitt/ips4o.git

1.6. 下载子模块args

cd /path/to/smoothxg/deps

git clone https://github.com/Taywee/args.git

1.7. 下载子模块gfakluge

cd /path/to/smoothxg/deps

git clone https://github.com/vgteam/gfakluge.git

1.7.1. 下载子模块GFA-spec

cd /path/to/smoothxg/deps/gfakluge

git clone https://github.com/GFA-spec/GFA-spec

1.7.2. 下载子模块pliib

cd /path/to/smoothxg/deps/gfakluge

git clone https://github.com/edawson/pliib

1.7.3. 下载子模块bash-tap

cd /path/to/smoothxg/deps/gfakluge

git clone https://github.com/illusori/bash-tap.git

1.7.4. 下载子模块tinyFA

cd /path/to/smoothxg/deps/gfakluge/src

rm -rf tinyFA

git clone https://github.com/edawson/tinyFA

1.7.4.1. 下载子模块pliib

cd /path/to/smoothxg/deps/gfakluge/src/tinyFA

git clone https://github.com/edawson/pliib

1.8. 下载子模块mmmulti

cd /path/to/smoothxg/deps

git clone https://github.com/ekg/mmmulti

1.8.1. 下载子模块mio

cd /path/to/smoothxg/deps/mmmulti/deps

git clone https://github.com/mandreyel/mio.git

1.8.2. 下载子模块args

cd /path/to/smoothxg/deps/mmmulti/deps

git clone https://github.com/Taywee/args.git

1.8.3. 下载子模块DYNAMIC

cd /path/to/smoothxg/deps/mmmulti/deps

git clone https://github.com/vgteam/DYNAMIC.git

1.8.3.1. 下载子模块hopscotch_map

cd /path/to/smoothxg/deps/mmmulti/deps/DYNAMIC/deps

git clone https://github.com/Tessil/hopscotch-map.git

1.8.4. 下载子模块sdsl-lite

cd /path/to/smoothxg/deps/mmmulti/deps

git clone https://github.com/vgteam/sdsl-lite.git

1.8.4.1. 下载子模块googletest

cd /path/to/smoothxg/deps/mmmulti/deps/sdsl-lite/external

git clone https://github.com/google/googletest.git

1.8.4.2. 下载子模块libdivsufsort

cd /path/to/smoothxg/deps/mmmulti/deps/sdsl-lite/external

git clone https://github.com/simongog/libdivsufsort.git

1.8.5. 下载子模块ips4o

cd /path/to/smoothxg/deps/mmmulti/deps

git clone https://github.com/SaschaWitt/ips4o.git

1.8.6. 下载子模块atomic_queue

cd /path/to/smoothxg/deps/mmmulti/deps

git clone https://github.com/max0x7ba/atomic_queue.git

1.8.7. 下载子模块paryfor

cd /path/to/smoothxg/deps/mmmulti/deps

git clone https://github.com/ekg/paryfor.git

1.8.8. 下载子模块hopscotch-map

cd /path/to/smoothxg/deps/mmmulti/deps

git clone https://github.com/Tessil/hopscotch-map.git

1.9. 下载子模块atomic_queue

cd /path/to/smoothxg/deps

git clone https://github.com/max0x7ba/atomic_queue.git

1.10. 下载子模块cgranges

cd /path/to/smoothxg/deps

git clone https://github.com/lh3/cgranges.git

1.11. 下载子模块atomicbitvector

cd /path/to/smoothxg/deps

git clone https://github.com/ekg/atomicbitvector.git

1.12. 下载子模块odgi

cd /path/to/smoothxg/deps

git clone https://github.com/pangenome/odgi.git

1.12.1. 下载子模块pybind11

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/pybind/pybind11.git

1.12.2. 下载子模块sdsl-lite

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/simongog/sdsl-lite.git

1.12.2.1. 下载子模块googletest

cd /path/to/smoothxg/deps/odgi/deps/sdsl-lite/external

git clone https://github.com/google/googletest.git

1.12.2.2. 下载子模块libdivsufsort

cd /path/to/smoothxg/deps/odgi/deps/sdsl-lite/external

git clone https://github.com/simongog/libdivsufsort.git

1.12.3. 下载子模块DYNAMIC

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/vgteam/DYNAMIC.git

1.12.3.1. 下载子模块hopscotch_map

cd /path/to/smoothxg/deps/odgi/deps/DYNAMIC/deps

git clone https://github.com/Tessil/hopscotch-map.git

1.12.4. 下载子模块hopscotch_map

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/Tessil/hopscotch-map.git

1.12.5. 下载子模块gfakluge

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/vgteam/gfakluge.git

1.12.5.1. 下载子模块GFA-spec

cd /path/to/smoothxg/deps/odgi/deps/gfakluge

git clone https://github.com/GFA-spec/GFA-spec

1.12.5.2. 下载子模块pliib

cd /path/to/smoothxg/deps/odgi/deps/gfakluge

git clone https://github.com/edawson/pliib

1.12.5.3. 下载子模块bash-tap

cd /path/to/smoothxg/deps/odgi/deps/gfakluge

git clone https://github.com/illusori/bash-tap.git

1.12.5.4. 下载子模块tinyFA

cd /path/to/smoothxg/deps/odgi/deps/gfakluge/src

rm -rf tinyFA

git clone https://github.com/edawson/tinyFA

下载子模块pliib

cd /path/to/smoothxg/deps/odgi/deps/gfakluge/src/tinyFA

git clone https://github.com/edawson/pliib

1.12.6. 下载子模块libhandlegraph

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/vgteam/libhandlegraph.git

1.12.7. 下载子模块args

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/Taywee/args.git

1.12.8. 下载子模块BBHash

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/vgteam/BBHash.git

1.12.9. 下载子模块sparsepp

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/edawson/sparsepp.git

1.12.10. 下载子模块flat_hash_map

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/skarupke/flat_hash_map.git

1.12.11. 下载子模块intervaltree

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/ekg/intervaltree.git

1.12.12. 下载子模块lodepng

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/ekg/lodepng.git

1.12.13. 下载子模块PicoSHA2

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/okdshin/PicoSHA2.git

1.12.14. 下载子模块sgd2

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/ekg/sgd2.git

1.12.15. 下载子模块structures

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/jeizenga/structures.git

1.12.16. 下载子模块libbf

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/subwaystation/libbf.git

1.12.17. 下载子模块cpp-httplib

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/yhirose/cpp-httplib.git

1.12.18. 下载子模块cpp_random_distributions

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/llersch/cpp_random_distributions.git

1.12.19. 下载子模块cgranges

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/lh3/cgranges.git

1.12.20. 下载子模块mmmulti

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/ekg/mmmulti

1.12.20.1. 下载子模块mio

cd /path/to/smoothxg/deps/odgi/deps/mmmulti/deps

git clone https://github.com/mandreyel/mio.git

1.12.20.2. 下载子模块args

cd /path/to/smoothxg/deps/odgi/deps/mmmulti/deps

git clone https://github.com/Taywee/args.git

1.12.20.3. 下载子模块DYNAMIC

cd /path/to/smoothxg/deps/odgi/deps/mmmulti/deps

git clone https://github.com/vgteam/DYNAMIC.git

下载子模块hopscotch_map

cd /path/to/smoothxg/deps/odgi/deps/mmmulti/deps/DYNAMIC/deps

git clone https://github.com/Tessil/hopscotch-map.git

1.12.20.4. 下载子模块sdsl-lite

cd /path/to/smoothxg/deps/odgi/deps/mmmulti/deps

git clone https://github.com/vgteam/sdsl-lite.git

下载子模块googletest

cd /path/to/smoothxg/deps/odgi/deps/mmmulti/deps/sdsl-lite/external

git clone https://github.com/google/googletest.git

下载子模块libdivsufsort

cd /path/to/smoothxg/deps/odgi/deps/mmmulti/deps/sdsl-lite/external

git clone https://github.com/simongog/libdivsufsort.git

1.12.20.5. 下载子模块ips4o

cd /path/to/smoothxg/deps/odgi/deps/mmmulti/deps

git clone https://github.com/SaschaWitt/ips4o.git

1.12.20.6. 下载子模块atomic_queue

cd /path/to/smoothxg/deps/odgi/deps/mmmulti/deps

git clone https://github.com/max0x7ba/atomic_queue.git

1.12.20.7. 下载子模块paryfor

cd /path/to/smoothxg/deps/odgi/deps/mmmulti/deps

git clone https://github.com/ekg/paryfor.git

1.12.20.8. 下载子模块hopscotch-map

cd /path/to/smoothxg/deps/odgi/deps/mmmulti/deps

git clone https://github.com/Tessil/hopscotch-map.git

1.12.21. 下载子模块ips4o

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/SaschaWitt/ips4o.git

1.12.22. 下载子模块atomic_queue

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/max0x7ba/atomic_queue.git

1.12.23. 下载子模块Xoshiro-cpp

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/Reputeless/Xoshiro-cpp.git

1.12.24. 下载子模块dirtyzipf

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/ekg/dirtyzipf.git

1.12.25. 下载子模块atomicbitvector

cd /path/to/smoothxg/deps/odgi/deps

git clone https://github.com/ekg/atomicbitvector.git

1.13. 下载子模块libbf

cd /path/to/smoothxg/deps

git clone https://github.com/subwaystation/libbf.git

1.14. 下载子模块sautocorr

cd /path/to/smoothxg/deps

git clone https://github.com/ekg/sautocorr.git

1.15. 下载子模块abPOA

cd /path/to/smoothxg/deps

git clone https://github.com/yangao07/abPOA.git

1.15.1. 下载子模块simde

cd /path/to/smoothxg/deps/abPOA/include

git clone https://github.com/simd-everywhere/simde.git

1.15.1.1. 下载子模块munit

cd /path/to/smoothxg/deps/abPOA/include/simde/test

git clone https://github.com/nemequ/munit.git

1.16. 下载子模块edlib

cd /path/to/smoothxg/deps

git clone https://github.com/Martinsos/edlib.git

1.17. 下载子模块mkmh

cd /path/to/smoothxg/deps

git clone https://github.com/AndreaGuarracino/mkmh.git

1.17.1. 下载子模块murmur3

cd /path/to/smoothxg/deps/mkmh

git clone https://github.com/edawson/murmur3.git

1.17.2. 下载子模块Catch2

cd /path/to/smoothxg/deps/mkmh

git clone https://github.com/catchorg/Catch2.git

1.17.3. 下载子模块xxHash

cd /path/to/smoothxg/deps/mkmh

git clone https://github.com/Cyan4973/xxHash.git

1.18. 下载子模块patchmap

cd /path/to/smoothxg/deps

git clone https://github.com/1ykos/patchmap.git

1.19. 下载子模块WFA

cd /path/to/smoothxg/deps

git clone https://github.com/pangenome/WFA.git

1.20. 下载子模块spoa

cd /path/to/smoothxg/deps

git clone https://github.com/rvaser/spoa.git

1.21. 下载子模块xxHash

cd /path/to/smoothxg/deps

git clone https://github.com/Cyan4973/xxHash.git

二、下载系统依赖

处理器:鲲鹏920系列

操作系统:openEuler 22.03 SP2

yum源:openEuler官方网络源

编译器:系统自带gcc10.3.1编译器

安装所需系统依赖:

yum install libatomic-static jemalloc-devel zstd-devel zlib-devel gsl-devel gcc gcc-c++ cmake git

三、编译步骤

3.1. 进入软件目录smoothxg,生成编译文件makefile

cd /path/to/smoothxg

mkdir build

cd build

export CC=gcc CXX=g++

cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/smoothxg_install

3.2. 第一次编译,解决报错“set_target_properties called with incorrect number of arguments.

make

出现报错:

111.jpg

解决方法:

修改/path/to/smoothxg/deps/sdsl-lite/external/googletest/googletest/CMakeLists.txt的第124行和142行,在${GOOGLETEST_VERSION}前后加上双引号,

同理修改/path/to/smoothxg/deps/mmmulti/deps/sdsl-lite/external/googletest/googletest/CMakeLists.txt/path/to/smoothxg/deps/odgi/deps/sdsl-lite/external/googletest/googletest/CMakeLists.txt/path/to/smoothxg/deps/odgi/deps/mmmulti/deps/sdsl-lite/external/googletest/googletest/CMakeLists.txt

111.jpg

3.3. 第二次编译,解决报错“error: #error C++ versions less than C++14 are not supported.

make

出现报错:

111.jpg

解决方法:全局搜到-std=c++11的地方,删除规避

sed -i "s/-std=c++11//g" `grep -rnl "\-std=c++11"`

3.4. 第三次编译,解决报错“g++: error: unrecognized command-line option ‘-msse4.2’

make

出现报错:

111.jpg

解决方法:全局搜到-msse4.2的地方,删除规避

sed -i "s/-msse4.2//g" `grep -rnl "\-msse4.2"`

3.5. 第四次编译,解决报错“error: #error C++ versions less than C++14 are not supported.

make

出现报错:

111.jpg

解决方法:全局搜到-std=c++11的地方,删除规避

sed -i "s/-std=c++11//g" `grep -rnl "\-std=c++11"`

(说明:此处的错误与第二次编译的错误一样,这次出现的报错,是出现在odgi的目录下的sdsl-lite目录的报错)

3.6. 第五次编译,解决报错“fatal error: dynamic.hpp: No such file or directory

make

出现报错:

111.jpg

解决方法:将dynamic.hpp拷贝到正确目录下

cp /path/to/smoothxg/deps/odgi/deps/DYNAMIC/include/dynamic/dynamic.hpp /path/to/smoothxg/deps/odgi/src

3.7. 第六次编译,解决报错“fatal error: tinyfa.hpp: No such file or directory

make

出现报错:

111.jpg

解决方法:将tinyFA.hpp重命名成tinyfa.hpp

mv /path/to/smoothxg/deps/gfakluge/src/tinyFA/tinyFA.hpp /path/to/smoothxg/deps/gfakluge/src/tinyFA/tinyfa.hpp

mv /path/to/smoothxg/deps/odgi/deps/gfakluge/src/tinyFA/tinyFA.hpp /path/to/smoothxg/deps/odgi/deps/gfakluge/src/tinyFA/tinyfa.hpp

3.8. 第七次编译,解决报错“fatal error: pliib.hpp: No such file or directory

make

出现报错:

111.jpg

解决方法:将pliib.hpp拷贝到正确目录下

cp /path/to/smoothxg/deps/gfakluge/src/tinyFA/pliib/pliib.hpp /path/to/smoothxg/deps/gfakluge/src/tinyFA

cp /path/to/smoothxg/deps/odgi/deps/gfakluge/src/tinyFA/pliib/pliib.hpp /path/to/smoothxg/deps/odgi/deps/gfakluge/src/tinyFA

3.8. 第八次编译,解决报错“error: ‘string’ does not name a type; did you mean ‘stdin’?

make

出现报错:

111.jpg

解决方法:全局搜到-std=gnu++17的地方,替换成-std=c++17,同时在gfakluge.hpp3行引入using namespace std;

sed -i "s/-std=gnu++17/-std=c++17/g" `grep -rnl "\-std=gnu++17"`
vim /path/to/smoothxg/deps/gfakluge/src/gfakluge.hpp

在第3行加入using namespace std;

vim /path/to/smoothxg/deps/odgi/deps/gfakluge/src/gfakluge.hpp

在第3行加入using namespace std;

111.jpg

3.10. 第九次编译,解决报错“error: invalid name ("x86-64") in ‘target("arch=")’ pragma or attribute

make

出现报错:

cke_283502.png

解决方法:将文件main.cpp中第32行的x86-64改成armv8-a

vim /path/to/smoothxg/deps/odgi/src/main.cpp

将第32行的x86-64改成armv8-a

111.jpg

3.11. 第十次编译,解决报错“fatal error: immintrin.h: No such file or directory

make

出现报错:

111.jpg

解决方法:替换头文件,将文件simd_instruction.h中的<immintrin.h>改成"sse2neon.h",同时下载sse2neon.himmintrin.h的同级目录下

vim /path/to/smoothxg/deps/abPOA/src/simd_instruction.h

vim /path/to/smoothxg/deps/abPOA/include/simd_instruction.h

将第21<immintrin.h>修改成"sse2neon.h"

111.jpg

wget https://raw.githubusercontent.com/DLTcollab/sse2neon/master/sse2neon.h -O /path/to/smoothxg/deps/abPOA/src/sse2neon.h

wget https://raw.githubusercontent.com/DLTcollab/sse2neon/master/sse2neon.h -O /path/to/smoothxg/deps/abPOA/include/sse2neon.h

3.12. 第十一次编译,解决报错“error: lane -4 out of range 0 - 15

make

出现报错:

111.jpg

解决方法:修改sse2neon.h5361行,取消限制lane

vim /path/to/smoothxg/deps/abPOA/src/sse2neon.h

5361行改成((imm <= 0 || imm > 0) ));     \

vim /path/to/smoothxg/deps/abPOA/include/sse2neon.h

5364行改成((imm <= 0 || imm > 0) ));     \

111.jpg

3.13. 第十二次编译,解决报错“fatal error: dynamic.hpp: No such file or directory

make

出现报错:

111.jpg

解决方法:将dynamic.hpp拷贝到正确目录下

cp /path/to/smoothxg/deps/odgi/deps/DYNAMIC/include/dynamic/dynamic.hpp /path/to/smoothxg/build/odgi-prefix/include/odgi

(说明:此处的错误与第五次编译的错误一样,这次出现的报错,是出现在build的目录下的odgi-prefix目录的报错)

3.14. 第十三次编译,解决报错“error: narrowing conversion of ‘-1’ from ‘int’ to ‘char’ [-Wnarrowing]

make

出现报错:

111.jpg

解决方法:修改abpoa_output.c

vim /path/to/smoothxg/deps/abPOA/src/abpoa_output.c

将第15行的char改成signed char

111.jpg

3.15. 最后一次编译,编译成功

make

make install

111.jpg

四、验证与测试

cd /path/to/smoothxg

time -p bin/smoothxg -t 8 -g test/data/DRB1-3123.fa.gz.pggb-s3000-p70-n10-a70-K16-k8-w10000-j5000-e5000.seqwish.gfa -j 5k -e 5k -l 700,900,1100 -m test/data/DRB1-3123.fa.gz.pggb-s3000-p70-n10-a70-K16-k8-w10000-j5000-e5000.smooth.maf -C consensus,10,100:test/data/gi_568815592_32578768-32589835.txt:y,1000:test/data/gi_568815592_32578768-32589835.txt:n,10000 -o test/data/DRB1-3123.fa.gz.pggb-s3000-p70-n10-a70-K16-k8-w10000-j5000-e5000.smooth.gfa -r 12

命令中的“-t 8”指的是8线程,可根据机器情况修改,本文举例以8线程运行时间最短,性能最优

收藏举报
Level 1
0
帖子
0
粉丝
0
获赞