编译支持128线程的aria2

February 26, 2019 · 分享 · 16次阅读

参考自:https://wijtb.nctu.me/archives/46/

摘要如下:
首先根据官方GitHub的指导,提前安装以下包:

libxml2-dev
libcppunit-dev
autoconf
automake
autotools-dev
autopoint
libtool

然后是编译三步骤(这里我选择了静态编译ARIA2_STATIC=yes,以便于在其他时候使用):

cd aria2-master
autoreconf -i
./configure ARIA2_STATIC=yes
make

但要改成128线程还需要做些改动,在执行autoreconf -i
通过以下命令修改相关内容:

sed -i 's/"1", 1, 16/"128", 1, -1/g' ./src/OptionHandlerFactory.cc
sed -i 's/"20M", 1_m, 1_g/"4K", 1_k, 1_g/g' ./src/OptionHandlerFactory.cc
sed -i 's/PREF_CONNECT_TIMEOUT, TEXT_CONNECT_TIMEOUT, "60", 1, 600/PREF_CONNECT_TIMEOUT, TEXT_CONNECT_TIMEOUT, "30", 1, 600/g' ./src/OptionHandlerFactory.cc
sed -i 's/PREF_PIECE_LENGTH, TEXT_PIECE_LENGTH, "1M", 1_m, 1_g/PREF_PIECE_LENGTH, TEXT_PIECE_LENGTH, "4k", 1_k, 1_g/g' ./src/OptionHandlerFactory.cc
sed -i 's/new NumberOptionHandler(PREF_RETRY_WAIT, TEXT_RETRY_WAIT, "0", 0, 600/new NumberOptionHandler(PREF_RETRY_WAIT, TEXT_RETRY_WAIT, "2", 0, 600/g' ./src/OptionHandlerFactory.cc
sed -i 's/new NumberOptionHandler(PREF_SPLIT, TEXT_SPLIT, "5", 1, -1,/new NumberOptionHandler(PREF_SPLIT, TEXT_SPLIT, "8", 1, -1,/g' ./src/OptionHandlerFactory.cc

然后再configure即可,编译好的二进制文件在src文件夹下面,没有后缀。

标签:aria2

最后编辑于:2019/02/26 09:34

添加新评论