MacOS下编译RSEM失败,运行提示rsem-parse-alignments不存在
RSEM在MacOS下编译失败及运行报错的解决办法
问题详情
编译阶段错误
下载用于RNA-Seq基因/转录本表达量估算的RSEM软件包后,在MacOS终端进入软件目录执行make命令编译,出现大量boost库相关编译错误,核心错误片段如下:
In file included from simulation.cpp:22: In file included from ./SingleModel.h:16: In file included from ./Orientation.h:8: In file included from ./simul.h:6: In file included from ./boost/random.hpp:52: In file included from ./boost/random/generate_canonical.hpp:22: In file included from ./boost/math/special_functions.hpp:15: In file included from ./boost/math/special_functions/airy.hpp:10: In file included from ./boost/math/special_functions/bessel.hpp:21: In file included from ./boost/math/special_functions/detail/bessel_jy_zero.hpp:25: ./boost/math/special_functions/detail/airy_ai_bi_zero.hpp:91:24: error: no template named 'tuple' in namespace 'boost::math' boost::math::tuple<T, T> operator()(const T& x) const ~~~~~~~~~~~~~^ ./boost/math/special_functions/detail/airy_ai_bi_zero.hpp:94:33: error: no member named 'make_tuple' in namespace 'boost::math' return boost::math::make_tuple( ~~~~~~~~~~~~~^ // 其余错误省略 fatal error: too many errors emitted, stopping now [-ferror-limit=] 6 warnings and 20 errors generated. make: *** [simulation.o] Error 1
运行阶段错误
编译失败后尝试执行以下RSEM命令:
./rsem-calculate-expression --bowtie2 --bowtie2-path /Users/Documents/Bioinformatics_tools/Bowtie2/bowtie2-2.5.0-macos-x86_64 -p 8 --output-genome-bam --paired-end /Users/Documents/Bioinformatics_tools/SRA/fastq_dir/SRR1039508_1.fastq /Users/Documents/Bioinformatics_tools/SRA/fastq_dir/SRR1039508_2.fastq /Users/Documents/Bioinformatics_tools/Bowtie2/index/GRCh38_noalt_as/GRCh38_noalt_as hg_paired_end_quals
收到错误提示:
rsem-parse-alignments : No such file or directory!
推测是编译未生成该可执行文件,已排查相关issue但未解决。
可行解决方案
- 优先使用预编译版本:直接下载官方提供的MacOS预编译RSEM包,解压后即可直接使用所有命令,彻底规避编译阶段的boost兼容问题。
- 修改boost头文件修复编译:若坚持源码编译,修改RSEM自带的两个boost头文件:
- 打开
./boost/math/special_functions/detail/airy_ai_bi_zero.hpp和./boost/math/special_functions/detail/bessel_jy_zero.hpp - 将文件中所有
boost::math::tuple替换为std::tuple,boost::math::make_tuple替换为std::make_tuple - 在每个文件开头添加
#include <tuple> - 执行
make clean && make重新编译
- 打开
- 指定低版本编译器:MacOS自带clang版本过高可能引发兼容问题,安装低版本llvm并指定编译:
brew install llvm@11 export CC=/usr/local/opt/llvm@11/bin/clang export CXX=/usr/local/opt/llvm@11/bin/clang++ make clean && make
内容的提问来源于stack exchange,提问作者MOHAMMED TOUFIQ
相关产品推荐
相关产品推荐

