在安装SOAPdenovo2的时候,按照教程进入文件目录下,make的时候出现报错,错误代码如下。
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(bam.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(bam_import.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(sam.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(bam_pileup.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(faidx.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(knetfile.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(sam_header.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(bgzf.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(kstring.o): relocation R_X86_64_32 against `.text' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(bam_aux.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(razf.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
collect2: error: ld returned 1 exit status
make: *** [Makefile:58:SOAPdenovo-63mer] 错误 1
网上找了很多的方法,都没解决。最后找到了github的issue(https://github.com/aquaskyline/SOAPdenovo2/issues/60),解决方法竟然是尝试用bioconda安装,优秀。
接下来就使用conda安装,关于conda的安装和使用可以看我之前的文章(https://blog.csdn.net/weixin_45963508/article/details/114628358?spm=1001.2014.3001.5501)。
先去查寻SOAPdenovo2的安装命令(https://anaconda.org/bioconda/soapdenovo2)。
在终端输入conda install -c bioconda soapdenovo2
,等待安装完成。进入安装目录,找到可执行程序,尝试能否使用。
2022-8-22更新
终于找到了有人给出的解决方案,原文链接:https://blog.csdn.net/Maiya19724/article/details/124127768。
出现上述报错,需要更改makefile中第58行以及62行中的内容,添加 -no-pie,具体可以参考链接中的内容。
添加完成后再次使用make进行编译,就可以看到不会再报错,等待安装完成。