Changes between Version 16 and Version 17 of Building/libtorrent
- Timestamp:
- 09/05/2015 01:27:56 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Building/libtorrent
v16 v17 3 3 [[PageOutline(2-4,,inline, unnumbered)]] 4 4 5 Check thelibtorrent [http://www.libtorrent.org/building.html documentation] for any updates to build procedures.5 Check libtorrent [http://www.libtorrent.org/building.html documentation] for any updates to build procedures. 6 6 7 7 == Ubuntu / Debian == 8 8 9 1. Download libtorrent source tarball and extract it: 9 1. Install dependencies for libtorrent build automatically using `build-dep`: 10 {{{ 11 sudo apt-get build-dep libtorrent-rasterbar 12 sudo apt-get install checkinstall 13 }}} 10 14 11 * [https://github.com/arvidn/libtorrent/releases libtorrent-rasterbar] 15 '''OR''' if that fails manually install them: 16 {{{ 17 sudo apt-get install build-essential checkinstall libboost-system-dev libboost-python-dev libssl-dev libgeoip-dev 18 }}} 19 20 2. Download [https://github.com/arvidn/libtorrent/releases libtorrent] and extract: 12 21 {{{ 13 22 tar xf libtorrent-rasterbar.tar.gz … … 15 24 }}} 16 25 17 2. Get the dependencies automatically for libtorrent build: 18 {{{ 19 sudo apt-get build-dep libtorrent-rasterbar 20 sudo apt-get install checkinstall 21 }}} 22 23 Or manually install libtorrent dependencies: 24 {{{ 25 sudo apt-get build-essential checkinstall libboost-system-dev libboost-python-dev libssl-dev libgeoip-dev 26 }}} 27 28 3. Build (in the extracted tarball directory): 26 3. Build: 29 27 {{{ 30 28 ./configure --enable-python-binding 31 make 29 make -j$(nproc) 32 30 }}} 33 34 '' Note:'' For source code from repository, create the `configure` script by runnning: `./autotool.sh`31 ''The `make` option `-j$(nproc)` will utilize all available cpu cores.[[br]] 32 ''For source code from directly from git, the `configure` script will need creating by runnning: `./autotool.sh`'' 35 33 36 34 4. Install library and python bindings: 37 35 {{{ 38 36 sudo checkinstall 39 }}}40 {{{41 37 sudo ldconfig 42 38 }}} 43 ''Substituted `make install` for `checkinstall` as it creates a deb package for easier removal/re-install by `dpkg`.'' 44 45 ''Running ldconfig avoids an `ImportError` for `libtorrent-rasterbar.so`, a result of Python being unable to find the main library.'' 39 ''Substituted `make install` for `checkinstall` as it creates a deb package for easier removal/re-install by `dpkg`.'' [[br]] 40 ''Running `ldconfig` avoids an `ImportError` for `libtorrent-rasterbar.so`, a result of Python being unable to find the main library.'' 46 41 47 42 5. Verify libtorrent and the python bindings are installed correctly: 48 43 {{{ 49 44 python -c "import libtorrent; print libtorrent.version" 50 }}} 51 {{{ 52 >> 0.16.17.0 45 >> 1.0.6.0 53 46 }}} 54 47 … … 56 49 == Windows == 57 50 58 1. Install Visual Studio or just the compiler: 59 * [http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express MS VC++ 2008/2010 Express][[br]] 60 '''OR''' 51 1. Download and install/extract these packages: 61 52 * [http://www.microsoft.com/en-us/download/details.aspx?id=44266 MS VC++ Compiler for Python] 62 63 2. Download and install these packages:64 53 * [http://www.slproweb.com/products/Win32OpenSSL.html OpenSSL win32 (non-light)] 65 54 * [http://www.python.org/ Python 2.7] 66 55 * [http://www.microsoft.com/en-us/download/details.aspx?id=5582 MSVC 2008 SP1 Redist Package (x86)] 67 56 * [https://www.microsoft.com/en-gb/download/details.aspx?id=21 .NET Framework 3.5] 68 3. Download source tarballs and extract to path without space e.g. C:\ drive:69 * [http ://www.boost.org/ boost]70 * [http://www.libtorrent.org/ libtorrent-rasterbar]57 * [http://sourceforge.net/projects/boost/files/boost/ Boost] 58 * [https://github.com/arvidn/libtorrent/releases libtorrent] 59 ''Note: Install/Extract to a path without spaces e.g. `C:\` drive.'' 71 60 72 4. Boost Build Steps: 73 74 Open a `Visual Studio 2008 Command Prompt`[[br]] 75 '''OR'''[[br]] 76 If using `VC for Python`, open Windows Command Prompt and execute `vcvarsall.bat`, e.g.: 61 2. Setup the Windows Command Prompt by executing `VC for Python` `vcvarsall.bat`, e.g.: 77 62 {{{ 78 63 "%USERPROFILE%\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat" 79 64 }}} 80 and due to a bug in boost when using `VC for Python` requires editing `project-config.jam` line to the following: 65 ''Note: If using Visual Studio simple open a `Visual Studio 2008 Command Prompt`.'' 66 67 3. Boost Build Steps: 68 69 Due to a [https://svn.boost.org/trac/boost/ticket/10817 boost bug] with `VC for Python`, need to edit `project-config.jam` in boost folder to the following: 81 70 {{{ 82 71 using msvc : : : <setup>"%USERPROFILE%\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\vcvarsall.bat" ; 83 72 }}} 84 85 From Command Prompt, execute the following commands: 73 In the boost directory run the following: 86 74 {{{ 87 75 bootstrap.bat … … 91 79 5. Create a Boost `user-config.jam` file in the toplevel folder (e.g. `C:\boost`) with the following to force `msvc` version: 92 80 {{{ 93 using msvc : 9.0 ;94 }}}95 96 Again if using `VC for Python` the boost bug requires modifing the above line to this:97 {{{98 81 using msvc : 9.0 : : <setup>"%USERPROFILE%\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\vcvarsall.bat" ; 99 82 }}} 83 ''Note: For Visual Studio, simply `using msvc : 9.0 ;` is required. 100 84 101 85 6. libtorrent Build Steps: … … 135 119 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` 136 120 }}} 137 Upon a successful build the library file named `libtorrent.pyd` is created in the current bindingsdirectory.121 Upon a successful build the library file named `libtorrent.pyd` is created in the current `bindings/python` directory. 138 122 139 123 … … 142 126 === Debugging libtorrent on Windows === 143 127 144 * Download :128 * Download and install just the `debug tools`: 145 129 * [http://msdn.microsoft.com/en-us/windows/hardware/hh852365.aspx Standalone Debugging Tools for Windows (WinDbg)] 146 147 ''Note: Only need to install debug tools.'' 148 149 * Build libtorrent with debug enabled by changing `release` to `debug` in `setup.py` or `b2` line in steps above. 150 151 * In windbg `C:\Program Files\Debugging Tools for Windows (x86)\windbg.exe`: 152 * `File|Open Executable` and tick Debug child processes 153 154 * Hit F5 or Go a few times to get the program running 155 156 * Execute the following command after a crash: 157 {{{ 158 !analyze -v -f 159 }}} 160 161 162 * Symbols for libtorrent will be in the following path: 130 * Build libtorrent with debug enabled by changing `release` to `debug` in the `b2` build line. 131 * Open `windbg` ''(C:\Program Files\Debugging Tools for Windows (x86)\windbg.exe)'': 132 * `File|Open Executable` and tick `Debug child processes` 133 * Hit `F5` or `Go` a few times to get the program running 134 * After the crash execute: `!analyze -v -f`. 135 * Symbols for libtorrent will be in the build output path: 163 136 {{{ 164 137 C:\libtorrent-rasterbar\bindings\python\bin\msvc-9.0\debug\boost-source\geoip-static\link-static\optimization-space\threading-multi