| 1 | 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. |
| 2 | |
| 3 | |
| 4 | == Ubuntu == |
| 5 | |
| 6 | ** These are the basic steps copied from the forum** |
| 7 | {{{ |
| 8 | ./configure --enable-python-binding |
| 9 | make |
| 10 | sudo checkinstall |
| 11 | }}} |
| 12 | |
| 13 | 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. |
| 14 | |
| 15 | Also if using a tarball from svn so you would need to create the configure script by runnning the autotool script: |
| 16 | |
| 17 | {{{ |
| 18 | ./autotool.sh |
| 19 | }}} |
| 20 | |
| 21 | 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: |
| 22 | |
| 23 | {{{ |
| 24 | sudo apt-get build-dep libtorrent-rasterbar |
| 25 | }}} |
| 26 | |
| 27 | |
| 28 | == Windows == |
| 29 | |
| 30 | **The versions of OpenSSL, Boost & libtorrent are outdated but should be no issue using latest releases** |
| 31 | |
| 32 | 1. Install the following: |
| 33 | |
| 34 | * MS VC++ 2008/2010 Express: http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express |
| 35 | * OpenSSL win32 v1.0.0 (non-light): http://www.slproweb.com/products/Win32OpenSSL.html |
| 36 | * Python 2.7 |
| 37 | |
| 38 | 2. Download lastest boost and libtorrent 0.15.10 tarball and extract to C:\ drive. |
| 39 | |
| 40 | 3. Build boost by opening command prompt and execute the following commands: |
| 41 | {{{ |
| 42 | bootstrap.bat |
| 43 | b2 |
| 44 | }}} |
| 45 | Building Boost takes a while and can take several gigabytes of space |
| 46 | Close the prompt when done. |
| 47 | |
| 48 | 4. Edit the file 'C:\boost_1_49_0\tools\build\v2\user-config.jam' to force msvc version: |
| 49 | |
| 50 | {{{ |
| 51 | using msvc : 9.0 ; |
| 52 | }}} |
| 53 | |
| 54 | 5. Open `Visual Studio` command prompt |
| 55 | a. Setup the environmental variables |
| 56 | {{{ |
| 57 | set INCLUDE=C:\OpenSSL-Win32\include;%INCLUDE% |
| 58 | set LIB=C:\OpenSSL-Win32\lib;%LIB% |
| 59 | set BOOST_ROOT=C:\boost_1_49_0 |
| 60 | set BOOST_BUILD_PATH=%BOOST_ROOT% |
| 61 | set PATH=%BOOST_ROOT%;%PATH% |
| 62 | }}} |
| 63 | b. Navigate to libtorrent python bindings folder |
| 64 | {{{ |
| 65 | cd C:\libtorrent-rasterbar-0.15.10\bindings\python |
| 66 | }}} |
| 67 | c. Build libtorrent with python bindings: |
| 68 | {{{ |
| 69 | C:\python27\python.exe setup.py build |
| 70 | }}} |
| 71 | |
| 72 | If there is no setup.py (i.e. downloaded from repository) on Windows you can simple use setup.py.in instead. |
| 73 | |
| 74 | You can create setup.py on Ubuntu: (although makes no difference to the windows section of the script) |
| 75 | {{{ |
| 76 | sudo apt-get install libtool libboost1.46-all-dev |
| 77 | ./autotool.sh |
| 78 | ./configure --enable-python-binding |
| 79 | }}} |
| 80 | |
| 81 | |
| 82 | Non-python build instructions for reference: [http://leechcraft.org/development-building-from-source-win32#Building_libtorrent Leechcraft] and [https://github.com/qbittorrent/qBittorrent/wiki/Compiling-with-MSVC-2008%28static-linkage%29 QBittorrent] |
| 83 | |
| 84 | |
| 85 | === Debugging libtorrent on Windows === |
| 86 | |
| 87 | References: |
| 88 | * [https://developer.mozilla.org/en/docs/How_to_get_a_stacktrace_with_WinDbg Mozilla WinDbg stacktrace] |
| 89 | * [http://gui-at.blogspot.co.uk/2010/01/windbg-for-beginners.html Windbg for Beginners] |
| 90 | |
| 91 | Download: |
| 92 | * http://www.microsoft.com/en-us/download/details.aspx?id=8279 |
| 93 | |
| 94 | Install only debug tools |
| 95 | |
| 96 | Build libtorrent with debug enabled (edit setup.py release to debug) |
| 97 | |
| 98 | {{{C:\libtorrent-rasterbar-0.16.6\bindings\python\bin\msvc-9.0\debug\boost-source\geoip-static\link-static\optimization-space\threading-multi}}} |
| 99 | |
| 100 | |
| 101 | |
| 102 | In windbg {{{C:\Program Files\Debugging Tools for Windows (x86)\windbg.exe}}}: |
| 103 | File|Open Executable and tick Debug child processes |
| 104 | |
| 105 | Hit F5 or Go a few times to get the program running |
| 106 | |
| 107 | The following command after a crash: |
| 108 | |
| 109 | {{{!analyze -v -f}}} |
| 110 | |
| 111 | |
| 112 | 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}}} |
| 113 | |
| 114 | {{{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}}} |
| 115 | |