Building libtorrent - gazpachoking/deluge GitHub Wiki
This page is for edge cases where libtorrent is needing to be built from source. Always check the libtorrent docs for any updates to build procedures.
Ubuntu
** These are the basic steps copied from the forum**
./configure --enable-python-binding
make
sudo checkinstall
This will install libtorrent and bindings in correct place. I have substituted make install for checkinstall because checkinstall creates a deb package that then can be used by dpkg to remove all the installed files easily.
Also if using a tarball from svn so you would need to create the configure script by runnning the autotool script:
./autotool.sh
I have not mentioned dependencies however both running autotool.sh
and configure will warn if missing. If updating from an already included libtorrent you can get the dependencies using apt-get:
sudo apt-get build-dep libtorrent-rasterbar
Windows
The versions of OpenSSL, Boost & libtorrent are outdated but should be no issue using latest releases
- Install the following:
- MS VC++ 2008/2010 Express: http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express
- OpenSSL win32 v1.0.0 (non-light): http://www.slproweb.com/products/Win32OpenSSL.html
- Python 2.7
-
Download lastest boost and libtorrent 0.15.10 tarball and extract to C:\ drive.
-
Build boost by opening command prompt and execute the following commands:
bootstrap.bat
b2
Building Boost takes a while and can take several gigabytes of space Close the prompt when done.
- Edit the file 'C:\boost_1_49_0\tools\build\v2\user-config.jam' to force msvc version:
using msvc : 9.0 ;
- Open
Visual Studio
command prompt a. Setup the environmental variables
set INCLUDE=C:\OpenSSL-Win32\include;%INCLUDE%
set LIB=C:\OpenSSL-Win32\lib;%LIB%
set BOOST_ROOT=C:\boost_1_49_0
set BOOST_BUILD_PATH=%BOOST_ROOT%
set PATH=%BOOST_ROOT%;%PATH%
b. Navigate to libtorrent python bindings folder
cd C:\libtorrent-rasterbar-0.15.10\bindings\python
c. Build libtorrent with python bindings:
C:\python27\python.exe setup.py build
If there is no setup.py (i.e. downloaded from repository) on Windows you can simple use setup.py.in instead.
You can create setup.py on Ubuntu: (although makes no difference to the windows section of the script)
sudo apt-get install libtool libboost1.46-all-dev
./autotool.sh
./configure --enable-python-binding
Non-python build instructions for reference: Leechcraft and QBittorrent
Debugging libtorrent on Windows
References:
Download:
Install only debug tools
Build libtorrent with debug enabled (edit setup.py release to debug)
C:\libtorrent-rasterbar-0.16.6\bindings\python\bin\msvc-9.0\debug\boost-source\geoip-static\link-static\optimization-space\threading-multi
In windbg C:\Program Files\Debugging Tools for Windows (x86)\windbg.exe
:
File|Open Executable and tick Debug child processes
Hit F5 or Go a few times to get the program running
The following command after a crash:
`!analyze -v -f`
Symbols will be in: C:\libtorrent-rasterbar-0.16.6\bindings\python\bin\msvc-9.0\debug\boost-source\geoip-static\link-static\optimization-space\threading-multi
srv*;C:\libtorrent-rasterbar-0.16.6\bindings\python\bin\msvc-9.0\debug\boost-source\geoip-static\link-static\optimization-space\threading-multi;C:\Python27\symbols;srv*c:\Symbols*http://msdl.microsoft.com/download/symbols