Changes between Version 11 and Version 12 of Building/libtorrent
- Timestamp:
- 11/30/2014 06:53:09 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Building/libtorrent
v11 v12 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 1 This page is for those cases where libtorrent is needing to be built from source. Remember to check the libtorrent docs for any updates to build procedures. 3 2 4 3 == Ubuntu == … … 6 5 1. Download libtorrent source tarball and extract it: 7 6 8 * [http://www.libtorrent.org/ libtorrent-rasterbar]7 * [http://www.libtorrent.org/ libtorrent-rasterbar] 9 8 10 9 2. Get the dependencies for libtorrent … … 19 18 }}} 20 19 21 Note: If the source code is from svn so you would need to create the configure script by runnning the autotool script: `./autotool.sh`20 Note: For source code from svn, create the `configure` script by runnning: `./autotool.sh` 22 21 23 22 4. Install: … … 40 39 * [http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express MS VC++ 2008/2010 Express][[br]] 41 40 '''OR''' 42 * [http://www.microsoft.com/en-us/download/details.aspx?id=44266 M icrosoft Visual C++ Compiler for Python 2.7]41 * [http://www.microsoft.com/en-us/download/details.aspx?id=44266 MS VC++ Compiler for Python] 43 42 44 2. Install these packages: 43 44 45 2. Download and install these packages: 45 46 * [http://www.slproweb.com/products/Win32OpenSSL.html OpenSSL win32 (non-light)] 46 47 * [http://www.python.org/ Python 2.7] 47 * [http://www.microsoft.com/en-us/download/details.aspx?id=5582 MSVC 2008 SP1 Redist ributablePackage (x86)]48 * [http://www.microsoft.com/en-us/download/details.aspx?id=5582 MSVC 2008 SP1 Redist Package (x86)] 48 49 49 50 3. Download source tarballs and extract to path without space e.g. C:\ drive: … … 51 52 * [http://www.libtorrent.org/ libtorrent-rasterbar] 52 53 53 4. Boost build - Open a command prompt and execute the following commands:54 4. Boost Build Steps: 54 55 55 ''If using 'Compiler for Python' you need to run `vcvarsall.bat` to setup compiler paths.'' 56 Open a `Visual Studio 2008 Command Prompt`[[br]] 57 '''OR'''[[br]] 58 If using `VC++ Compiler for Python`, open Windows Command Prompt and execute `vcvarsall.bat`, e.g.: 59 {{{ 60 C:\Users\User\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat 61 }}} 62 63 From Command Prompt, execute the following commands: 56 64 {{{ 57 65 bootstrap.bat … … 60 68 ''Building Boost can take a long time and uses 2-3 gigabytes of disk space.'' 61 69 62 5. Create a Boost `user-config.jam` file in `BOOST_ROOT` ( i.e. `C:\boost`) with the following to force `msvc` version:70 5. Create a Boost `user-config.jam` file in `BOOST_ROOT` (e.g. `C:\boost`) with the following to force `msvc` version: 63 71 {{{ 64 72 using msvc : 9.0 ; 65 73 }}} 66 74 67 6. libtorrent Build :75 6. libtorrent Build Steps: 68 76 a. Setup the Environmental Variables: 69 77 {{{ … … 74 82 set PATH=%BOOST_ROOT%;%PATH% 75 83 }}} 76 b. Navigate to libtorrent python bindings folder:84 b. Navigate to libtorrent Python bindings folder: 77 85 {{{ 78 86 cd C:\libtorrent-rasterbar\bindings\python 79 87 }}} 80 c. Build libtorrent with python bindings: 81 {{{ 88 c. Build libtorrent with Python bindings: 89 90 {{{ 82 91 b2 boost=source link=static geoip=static boost-link=static release optimization=space encryption=openssl 83 92 }}} … … 102 111 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` 103 112 }}} 104 Upon a successful build the library file named `libtorrent.pyd` is created in the current directory.113 Upon a successful build the library file named `libtorrent.pyd` is created in the current bindings directory. 105 114 106 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] 115 107 116 108 117 109 118 === Debugging libtorrent on Windows === 110 119 111 References: 112 * [https://developer.mozilla.org/en/docs/How_to_get_a_stacktrace_with_WinDbg Mozilla WinDbg stacktrace] 113 * [http://gui-at.blogspot.co.uk/2010/01/windbg-for-beginners.html Windbg for Beginners] 120 * Download: 121 * [http://msdn.microsoft.com/en-us/windows/hardware/hh852365.aspx Standalone Debugging Tools for Windows (WinDbg)] 114 122 115 Download: 116 * http://www.microsoft.com/en-us/download/details.aspx?id=8279 123 ''Note: Only need to install debug tools.'' 117 124 118 Install only debug tools125 * Build libtorrent with debug enabled by changing `release` to `debug` in `setup.py` or `b2` line in steps above. 119 126 120 Build libtorrent with debug enabled (edit setup.py release to debug) 127 * In windbg `C:\Program Files\Debugging Tools for Windows (x86)\windbg.exe`: 128 * `File|Open Executable` and tick Debug child processes 121 129 122 {{{C:\libtorrent-rasterbar-0.16.6\bindings\python\bin\msvc-9.0\debug\boost-source\geoip-static\link-static\optimization-space\threading-multi}}}130 * Hit F5 or Go a few times to get the program running 123 131 124 125 126 In windbg {{{C:\Program Files\Debugging Tools for Windows (x86)\windbg.exe}}}: 127 File|Open Executable and tick Debug child processes 128 129 Hit F5 or Go a few times to get the program running 130 131 The following command after a crash: 132 133 {{{!analyze -v -f}}} 132 * Execute the following command after a crash: 133 {{{ 134 !analyze -v -f 135 }}} 134 136 135 137 136 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}}} 138 * Symbols for libtorrent will be in the following path: 139 {{{ 140 C:\libtorrent-rasterbar\bindings\python\bin\msvc-9.0\debug\boost-source\geoip-static\link-static\optimization-space\threading-multi 141 }}} 142 So the full symbols line should look something like this: 143 {{{ 144 srv*;C:\libtorrent-rasterbar\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 145 }}} 137 146 138 {{{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}}} 147 Debug References: 148 * [https://developer.mozilla.org/en/docs/How_to_get_a_stacktrace_with_WinDbg Mozilla WinDbg stacktrace] 149 * [http://gui-at.blogspot.co.uk/2010/01/windbg-for-beginners.html Windbg for Beginners] 139 150 151 == Resources == 152 153 * [http://libtorrent.org/building.html libtorrent] 154 * [http://leechcraft.org/development-building-from-source-win32#Building_libtorrent Leechcraft] 155 * [https://github.com/qbittorrent/qBittorrent/wiki/Compiling-with-MSVC-2008%28static-linkage%29 QBittorrent]