rtorrent是一个Bittorrent软件,基于终端的BT客户端,高性能、低资源,另外有很多人给rtorrent开发了Web GUI来更好的让用户控制管理rtorrent,总而言之在Linux平台下,rtorrent是一个不错的BT下载解决方案。
rtorrent是一个Bittorrent软件,基于终端的BT客户端,高性能、低资源,另外有很多人给rtorrent开发了Web GUI来更好的让用户控制管理rtorrent,总而言之在Linux平台下,rtorrent是一个不错的BT下载解决方案。
rtorrent已被添加进Ubuntu源中,在Ubuntu下安装rtorrent很是容易,一句话便可安装:
$sudo apt-get install rtorrent
可是这里要写的是编译安装rtorrent的笔记记录,在这个编译安装过程当中能够学习到一些关于编译安装源码的简单经验。在这里所用到的是全新安装的Ubuntu 8.10,以此为例来进行编译安装的学习。
首先在rtorrent官方Wiki中的Install条目中给出了安装步骤:
cd /home/rtorrent
svn co svn://rakshasa.no/libtorrent/trunk
cd /home/rtorrent/trunk
svn up
cd libtorrent
./autogen.sh
./configure
make
make install
cd ../rtorrent
./autogen.sh
./configure
make
make install
在一个全新安装的Ubuntu下还未安装subversion,没法使用svn获取最新源码,因此咱们须要安装subversion:
$sudo apt-get install subversion
在/home下建立一个文件夹须要提权:
$cd /home
$sudo mkdir rtorrent
而后根据rtorrent wiki的Install条目进行下一步:
$cd /home/rtorrent
因为svn获取源码写入/home/rtorrent也须要提权:
$sudo svn co svn://rakshasa.no/libtorrent/trunk
接下来就会下载一堆源码,下载完成后接着进行下一步:
$cd /home/rtorrent/trunk
想要查看经过svn得到的源码版本使用命令:
$sudo svn up
这条命令会返回版本号,因为编译软件须要编译器,因此咱们在这一步就须要安装编译器先:
$sudo apt-get install build-essential
安装完编译器以后进行接下来的步骤:
$sudo ./autogen.sh
应该会返回信息:aclocal not found,这是由于须要安装automake:
$sudo apt-get install automake
安装完automake以后再重复上一步:
$sudo ./autogen.sh
应该会返回信息:
aclocal...
configure.ac:22: warning: macro `AM_DISABLE_STATIC' not found in library
configure.ac:23: warning: macro `AM_PROG_LIBTOOL' not found in library
autoheader...
libtoolize... libtoolize nor glibtoolize not found
这是由于未安装libtool软件包,一句话安装:
$sudo apt-get install libtool
安装完libtool以后再重复上一步:
$sudo ./autogen.sh
应该会返回信息:
aclocal...
autoheader...
libtoolize... using libtoolize
automake...
configure.ac:23: installing `./config.guess'
configure.ac:23: installing `./config.sub'
configure.ac:18: installing `./install-sh'
configure.ac:18: installing `./missing'
src/Makefile.am: installing `./depcomp'
autoconf...
ready to configure
接下来进行下一步:
$sudo ./configure
将会开始检查环境、配置,应该会返回信息:
checking for OPENSSL... configure: error: Package requirements (openssl) were not met:
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables OPENSSL_CFLAGS
and OPENSSL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
经过Google搜索结果中,都说的是在这里须要告诉pkg-config这个openssl的相关配置文件(.pc)的位置,一般已安装的软件和包的.pc文件都会出如今/usr/lib/pkg-config下,但我在这里没有找到openssl的.pc文件,而且经过使用命令$sudo apt-get install openssl发现openssl是已安装了的,到这一步就停滞不前了。最后在Ubuntu的package网站里搜索到一个相关的包是libssl- dev,安装这个包:
$sudo apt-get install libssl-dev
安装完libssl-dev以后再接着重复上一步$sudo ./configure又会收到和以前相似的信息,只是这回返回的是:
checking for STUFF... configure: error: Package requirements (sigc++-2.0) were not met:
No package 'sigc++-2.0' found
再次经过Ubuntu的Package网站里搜索到相关软件包是libsigc++-2.0,因此须要安装这个包:
$sudo apt-get install libsigc++-2.0-dev html
若是仍是不行的话安装这个包libcurl4-openssl-dev c++
$sudo apt-get install libsigc++-2.0-dev
安装完这个包以后再重复执行$sudo /.configure,能够顺利完成了,接下来的步骤:
$sudo make
$sudo make install ubuntu
sudo ldconfig
$cd ../rtorrent
$sudo ./autogen.sh
$sudo ./configure
返回*** The ncurses library is required!,安装ncurses开发包:
$sudo apt-get install ncurses-dev libncursesw5-dev
重复$sudo ./configure,再返回信息checking for libcurl... configure: error: Package requirements (libcurl >= 7.15.4),安装libcurl开发包(libcurl-dev是由libcurl4-openssl-dev提供的虚拟软件包):
$sudo apt-get install libcurl4-openssl-dev
重复$sudo ./configure,能够顺利完成而且进行下一步了:
$sudo make
$sudo make install
至此rtorrent编译安装就完成了,在此次编译安装rtorrent能够学习到如下基础经验:
编译所需的东西是首先要安装好的:
$sudo apt-get install build-essential automake libcurl4-openssl-dev
在进行./configure步骤出现找不到的包的状况下先将Package requirement后括号中的关键字词记下来,在Ubuntu Package(http://packages.ubuntu.com/) 搜索一下,就能够知道如何经过apt-get来安装哪一个包了。一般状况下所须要安装的是相关包的开发包,因此一般安装的是***-dev这样子的包,好比以前的openssl就是一个典型,编译须要用到openssl的开发包libssl-dev。另外编译安装软件以前应该有个好习惯,是此次编译安装所得到的经验,那就是至少应该先读一读svn下载下来的源码中的README文本文件,在libtorrent目录下的README(用nano README命令打开文本文件)中已说明了库依赖(LIBRARY DEPENDENCIES)libsigc++ 2.0(deb:libsigc++-2.0-dev),g++ >=3.3,而rtorrent目录下的README文本文件里说明了所需库依赖文件是libcurl >=7.12.0,ncurses。因此若是编译以前先阅读了这些说明文件,至少能够事先安装好所需库文件包。 curl
安装rtorrent过程当中使用 ./configure --with-ncursesw 选项好像也没法改变 生成Makefile文件中仍然为LIBS = -lncurses -lsigc-2.0 -lcurl -L/usr/local/lib -ltorrent,这时须要将全部的Makefile文件都手工改成LIBS = -lncursesw -lsigc-2.0 -lcurl -L/usr/local/lib -ltorrent,尤为是src目录及其子目录下面的Makefile修改完毕后make一下,若是出现can't find lncursesw ,sudo apt-get install libncursesw5-dev,须要检查一下/usr/lib/libncursesw.so文件,若是没有须要 ide
ln -sfv /lib/libncursesw.so.5 /usr/lib/libncursesw.so 前提是已经存在libncursesw.so.5 或 libncursesw.so.5.7 svn
make 性能
makinstall 学习
OK 这样rtorrent就不会有乱码 网站
InstallingBuilding./configure; make; make install ui
Building from latest development version (trunk)(note: you need to have SVN installed)
Before the first use, you have to get the latest trunk version. This needs to be done only once. In this example, the directory in which you store the sources is /home/rtorrent/trunk
cd /home/rtorrentsvn co svn://rakshasa.no/libtorrent/trunkThen, everytime you want to update your copy and recompile libTorrent and rTorrent:
cd /home/rtorrent/trunksvn upcd libtorrent./autogen.sh./configuremakemake installcd ../rtorrent./autogen.sh./configuremakemake install(hint: you can put that in a file and run it everytime you want to recompile from trunk)
If it doesn't work, make sure you have a recent version of autotools. See also CompilationHelp.
libtorrent.so.5: cannot open shared object file: No such file or directoryMake sure you have $prefix/lib in either your /etc/ld.so.conf or LD_LIBRARY_PATH, where $prefix is where you installed libtorrent. To update the ld cache, run "ldconfig".
Non-blocking hostname lookup in curlRTorrent will block on hostname lookup during tracker requests and http downloads. You can avoid this by compiling libcurl with 'cares' support, though this will be fixed later by using seperate threads within rTorrent.
后来又安装rTorrentWeb时配置~/.rtorrent.rc文件,添加scgi_port = localhost:5000参数后,重启rtorrent报错,rtorrent:XMLRPC not supported ,究其缘由原来编译安装rtorrent时没有把xmlrpl的功能编译进来后来根据这篇文件的提示 安装xmlrpc后 编译rtorrent时加上了./configure --with-xmlrpc-c编译选项终于成功
2010-12-23 今天安装rtorrent-0.8.7.tar.gz , libtorrent-0.12.7.tar.gz的时候
/rtorrent/trunk/libtorrent# ./autogen.sh
aclocal...configure.ac:20: warning: macro `AM_PATH_CPPUNIT' not found in library
./autogen.sh 提示 warning: macro `AM_PATH_CPPUNIT' not found in library,查阅资料发现缺乏cppunit
apt-get install libcppunit-dev 安装完毕再次执行autogen.sh搞定
make rtorrent 时最后编译main.o出现错误 /usr/bin/ld: note: 'pthread_create@@GLIBC_2.1' is defined in DSO /lib/libpthread.so.0 so try adding it to the linker command line
手工添加/lib/libpthread.so.0执行成功
libtool --tag=CXX --mode=link g++ -g -O2 -g -DDEBUG -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/local/include -I/usr/local/include -o rtorrent main.o libsub_root.a ui/libsub_ui.a core/libsub_core.a display/libsub_display.a input/libsub_input.a rpc/libsub_rpc.a utils/libsub_utils.a -lncursesw -lsigc-2.0 -lcurl -L/usr/local/lib -ltorrent -L/usr/local/lib -lxmlrpc_server -lxmlrpc -lxmlrpc_util -lxmlrpc_xmlparse -lxmlrpc_xmltok -L/lib lib/libpthread.so.0