Version 2 (modified by Cas, 10 years ago) (diff) |
---|
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
- Install the following:
- Download source tarballs and extract to path without space e.g. C:\ drive:
- Build boost - Open a command prompt and execute the following commands:
bootstrap.bat b2
Note: Building Boost takes a while and can use several gigabytes of space.
- Edit C:\boost\tools\build\v2\user-config.jam to force msvc version:
using msvc : 9.0 ;
- Open Visual Studio command prompt
- Setup the environmental variables
set INCLUDE=C:\OpenSSL-Win32\include;%INCLUDE% set LIB=C:\OpenSSL-Win32\lib;%LIB% set BOOST_ROOT=C:\boost set BOOST_BUILD_PATH=%BOOST_ROOT% set PATH=%BOOST_ROOT%;%PATH%
- Navigate to libtorrent python bindings folder
cd C:\libtorrent-rasterbar\bindings\python
- Build libtorrent with python bindings:
C:\python27\python.exe setup.py build
- Setup the environmental variables
If there is no setup.py (i.e. tarball from version control repo) 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
There might be an error at the end about shutil unable to move the lib but can be ignored.
Upon a successful build the resulting library file is named libtorrent.pyd and is located under this directory: libtorrent-rasterbar\bindings\python\bin\msvc-9.0\release\boost-source\geoip-static\link-static\optimization-space
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