2006-10-12 23:24:24 +02:00
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" xml:lang = "en" lang = "en" >
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" / >
2006-11-28 19:18:37 +01:00
< meta name = "generator" content = "Docutils 0.5: http://docutils.sourceforge.net/" / >
2006-10-12 23:24:24 +02:00
< title > Building libtorrent on Ubuntu 6.06< / title >
2006-11-08 01:38:30 +01:00
< meta name = "date" content = "Nov 6, 2006" / >
2006-11-28 19:18:37 +01:00
< meta name = "authors" content = "Xi Stan Francois Dermu" / >
2006-10-12 23:24:24 +02:00
< link rel = "stylesheet" href = "style.css" type = "text/css" / >
< / head >
< body >
< div class = "document" id = "building-libtorrent-on-ubuntu-6-06" >
< h1 class = "title" > Building libtorrent on Ubuntu 6.06< / h1 >
< table class = "docinfo" frame = "void" rules = "none" >
< col class = "docinfo-name" / >
< col class = "docinfo-content" / >
< tbody valign = "top" >
< tr > < th class = "docinfo-name" > Date:< / th >
2006-11-08 01:38:30 +01:00
< td > Nov 6, 2006< / td > < / tr >
2006-11-28 19:18:37 +01:00
< tr > < th class = "docinfo-name" > Authors:< / th >
< td > Xi Stan
< br / > Francois Dermu< / td > < / tr >
2006-10-12 23:24:24 +02:00
< tr > < th class = "docinfo-name" > Contact:< / th >
< td > < a class = "first last reference" href = "mailto:stan8688@gmail.com" > stan8688@ gmail.com< / a > < / td > < / tr >
< / tbody >
< / table >
2006-11-28 19:18:37 +01:00
< div class = "section" >
< h1 > < a id = "prerequisites" name = "prerequisites" > Prerequisites< / a > < / h1 >
2006-10-12 23:24:24 +02:00
< p > To build libtorrent, you need the following libraries:< / p >
< ul class = "simple" >
< li > < a class = "reference" href = "http://www.rasterbar.com/products/libtorrent/index.html" > http://www.rasterbar.com/products/libtorrent/index.html< / a > < / li >
< li > < a class = "reference" href = "http://www.boost.org" > http://www.boost.org< / a > < / li >
< li > < a class = "reference" href = "http://asio.sourceforge.net/" > http://asio.sourceforge.net/< / a > < / li >
< / ul >
< / div >
2006-11-28 19:18:37 +01:00
< div class = "section" >
< h1 > < a id = "step-1-acquire-the-source-code-from-cvs" name = "step-1-acquire-the-source-code-from-cvs" > Step 1: Acquire the source code from cvs< / a > < / h1 >
2006-10-12 23:37:16 +02:00
< p > Create a directory for the project:< / p >
2006-10-12 23:24:24 +02:00
< pre class = "literal-block" >
2006-11-08 01:34:02 +01:00
mkdir ${HOME}/work
cd ${HOME}/work
2006-10-12 23:24:24 +02:00
< / pre >
2006-10-12 23:37:16 +02:00
< p > Check out < tt class = "docutils literal" > < span class = "pre" > boost< / span > < / tt > , < tt class = "docutils literal" > < span class = "pre" > libtorrent< / span > < / tt > , < tt class = "docutils literal" > < span class = "pre" > asio< / span > < / tt > source code from cvs
2006-10-12 23:24:24 +02:00
by executing the following commands:< / p >
2006-11-08 01:34:02 +01:00
< p > < em > No password needed (just hit enter when prompted)< / em > < / p >
2006-10-12 23:24:24 +02:00
< pre class = "literal-block" >
cvs -d:pserver:anonymous@ boost.cvs.sourceforge.net:/cvsroot/boost login
cvs -z3 -d:pserver:anonymous@ boost.cvs.sourceforge.net:/cvsroot/boost checkout boost
cvs -d:pserver:anonymous@ boost.cvs.sourceforge.net:/cvsroot/boost logout
2006-10-13 01:51:10 +02:00
cvs -d:pserver:anonymous@ libtorrent.cvs.sourceforge.net:/cvsroot/libtorrent login
cvs -z3 -d:pserver:anonymous@ libtorrent.cvs.sourceforge.net:/cvsroot/libtorrent co -P libtorrent
cvs -d:pserver:anonymous@ libtorrent.cvs.sourceforge.net:/cvsroot/libtorrent logout
2006-10-12 23:24:24 +02:00
2006-10-13 01:51:10 +02:00
cvs -d:pserver:anonymous@ asio.cvs.sourceforge.net:/cvsroot/asio login
cvs -z3 -d:pserver:anonymous@ asio.cvs.sourceforge.net:/cvsroot/asio co -P asio
cvs -d:pserver:anonymous@ asio.cvs.sourceforge.net:/cvsroot/asio login
2006-10-12 23:24:24 +02:00
< / pre >
< / div >
2006-11-28 19:18:37 +01:00
< div class = "section" >
< h1 > < a id = "step-2-building-boost" name = "step-2-building-boost" > Step 2: Building boost< / a > < / h1 >
2006-10-12 23:24:24 +02:00
< p > To build boost, first build boost-build and then use that to build
2006-11-08 01:34:02 +01:00
the libraries themselves:< / p >
2006-10-12 23:24:24 +02:00
< pre class = "literal-block" >
2006-11-08 01:34:02 +01:00
BASE_DIR=${HOME} < em > ### Feel free to change this one.< / em >
BOOST_ROOT=${BASE_DIR}/boost
BOOST_BUILD_PATH=${BOOST_ROOT}/tools/build/v2
cd ${BOOST_ROOT}/tools/jam/src
2006-10-12 23:24:24 +02:00
./build.sh
2006-11-08 01:34:02 +01:00
sudo cp ./bin.linuxx86/bjam /usr/bin
cd $BOOST_ROOT
sudo bjam -sTOOLS=gcc install
2006-10-12 23:24:24 +02:00
< / pre >
2006-11-08 01:34:02 +01:00
< p > < em > It takes about 45 min. (so if you want to grap a coke, now is the time)< / em > < / p >
< p > If you're successful you will see the following files in < tt class = "docutils literal" > < span class = "pre" > /usr/local/lib< / span > < / tt > :< / p >
2006-10-12 23:24:24 +02:00
< pre class = "literal-block" >
libboost_date_time-gcc-d-1_31.so
libboost_date_time-gcc-mt-d-1_31.so
libboost_date_time-gcc-1_31.so
libboost_date_time-gcc-mt-1_31.so
libboost_date_time-gcc-d-1_31.a
libboost_date_time-gcc-mt-d-1_31.a
libboost_date_time-gcc-1_31.a
libboost_date_time-gcc-mt-1_31.a
< / pre >
< / div >
2006-11-28 19:18:37 +01:00
< div class = "section" >
< h1 > < a id = "step-3-copy-asio-into-the-libtorrent-directory" name = "step-3-copy-asio-into-the-libtorrent-directory" > Step 3: Copy asio into the libtorrent directory< / a > < / h1 >
2006-11-08 01:34:02 +01:00
< p > Skip this step if you're using a released tarball.< / p >
2006-10-12 23:24:24 +02:00
< p > Execute the following command:< / p >
< pre class = "literal-block" >
2006-11-08 01:34:02 +01:00
cp -R ${BASE_DIR}/asio/include/asio* ${BASE_DIR}/libtorrent/include/libtorrent
2006-10-12 23:24:24 +02:00
< / pre >
< / div >
2006-11-28 19:18:37 +01:00
< div class = "section" >
< h1 > < a id = "step-4-building-libtorrent" name = "step-4-building-libtorrent" > Step 4: Building libtorrent< / a > < / h1 >
< div class = "section" >
< h2 > < a id = "building-with-autotools" name = "building-with-autotools" > building with autotools< / a > < / h2 >
2006-11-08 01:34:02 +01:00
< p > First of all, you need to install automake and autoconf. Many unix/linux systems
comes with these preinstalled. The prerequisites for building libtorrent are
boost.thread, boost.date_time and boost.filesystem. Those are the < em > compiled< / em > boost
libraries needed. The headers-only libraries needed include (but is not necessarily
limited to) boost.bind, boost.ref, boost.multi_index, boost.optional,
boost.lexical_cast, boost.integer, boost.iterator, boost.tuple, boost.array,
boost.function, boost.smart_ptr, boost.preprocessor, boost.static_assert.< / p >
< p > If you want to build the client_test example, you'll also need boost.regex and boost.program_options.< / p >
< / div >
2006-11-28 19:18:37 +01:00
< div class = "section" >
< h2 > < a id = "generating-the-build-system" name = "generating-the-build-system" > generating the build system< / a > < / h2 >
2006-11-08 01:34:02 +01:00
< p > No build system is present if libtorrent is checked out from CVS - it needs to be
generated first. If you're building from a released tarball, you may skip directly
to < a class = "reference" href = "#running-configure" > running configure< / a > .< / p >
< p > Execute the following commands, in the given order, to generate the build system:< / p >
< pre class = "literal-block" >
cd ${BASE_DIR}/libtorrent
CXXFLAGS=" -I/usr/local/include/boost-1_35 -I${BASE_DIR}/libtorrent/include/libtorrent"
LDFLAGS=-L/usr/local/lib
aclocal -I m4
autoheader
libtoolize --copy --force
automake --add-missing --copy --gnu
autoconf
< / pre >
< p > On darwin/OSX you have to run glibtoolize instead of libtoolize.< / p >
< / div >
2006-11-28 19:18:37 +01:00
< div class = "section" >
< h2 > < a id = "running-configure" name = "running-configure" > running configure< / a > < / h2 >
2006-10-12 23:24:24 +02:00
< p > To use the auto tools to build libtorrent, execute the following commands:< / p >
< pre class = "literal-block" >
2006-11-08 01:34:02 +01:00
cd ${BASE_DIR}/libtorrent
CXXFLAGS=" -I/usr/local/include/boost-1_35 -I${BASE_DIR}/libtorrent/include/libtorrent"
LDFLAGS=-L/usr/local/lib
2006-10-12 23:24:24 +02:00
./configure --with-boost-date-time=boost_date_time-gcc \
--with-boost-filesystem=boost_filesystem-gcc \
--with-boost-thread=boost_thread-gcc-mt
make
sudo make install
< / pre >
2006-11-08 01:34:02 +01:00
< p > If successful, you will see the following files:< / p >
2006-10-12 23:24:24 +02:00
< pre class = "literal-block" >
/usr/local/lib/libtorrent.a
/usr/local/lib/libtorrent.so.0
/usr/local/lib/libtorrent.la
/usr/local/lib/libtorrent.so.0.1.0
/usr/local/lib/libtorrent.so
< / pre >
< / div >
< / div >
2006-11-08 01:34:02 +01:00
< / div >
2006-10-12 23:24:24 +02:00
< / body >
< / html >