From e896577b19728e909f15e670162f6b6393785825 Mon Sep 17 00:00:00 2001 From: Quinten Stokkink Date: Mon, 18 Jul 2016 20:32:14 +0200 Subject: [PATCH] Added set-up instructions for developement with protobuf --- doc/development/development_on_linux.rst | 2 +- doc/development/development_on_osx.rst | 2 +- doc/development/development_on_windows.rst | 67 ++++++++++++++++++++++ 3 files changed, 69 insertions(+), 2 deletions(-) diff --git a/doc/development/development_on_linux.rst b/doc/development/development_on_linux.rst index a96696ee09c..8a0c7af8769 100644 --- a/doc/development/development_on_linux.rst +++ b/doc/development/development_on_linux.rst @@ -7,7 +7,7 @@ Execute the following command in your terminal: .. code-block:: none - sudo apt-get install libav-tools libjs-excanvas libjs-mootools libsodium13 libx11-6 python-apsw python-cherrypy3 python-crypto python-cryptography python-feedparser python-leveldb python-libtorrent python-m2crypto python-netifaces python-pil python-pyasn1 python-requests python-twisted python-wxgtk2.8 python2.7 vlc python-pip + sudo apt-get install libav-tools libjs-excanvas libjs-mootools libsodium13 libx11-6 python-apsw python-cherrypy3 python-crypto python-cryptography python-feedparser python-leveldb python-libtorrent python-m2crypto python-netifaces python-pil python-pyasn1 python-requests python-twisted python-wxgtk2.8 python2.7 vlc python-pip python-protobuf sudo pip install decorator libnacl Experimental support for Ubuntu 16.04 diff --git a/doc/development/development_on_osx.rst b/doc/development/development_on_osx.rst index 63a8dd86087..b9f0d0a8bf7 100644 --- a/doc/development/development_on_osx.rst +++ b/doc/development/development_on_osx.rst @@ -120,7 +120,7 @@ There are a bunch of other packages that can easily be installed using pip and b .. code-block:: none - brew install homebrew/python/pillow gmp mpfr libmpc libsodium + brew install homebrew/python/pillow gmp mpfr libmpc libsodium protobuf pip install --user cherrypy pillow cffi cryptography decorator feedparser gmpy2 idna leveldb netifaces numpy pyasn1 pycparser requests twisted service_identity If you encounter any error during the installation of Pillow, make sure that libjpeg and zlib are installed. They can be installed using: diff --git a/doc/development/development_on_windows.rst b/doc/development/development_on_windows.rst index 547a1a84e09..020c4d3a93b 100644 --- a/doc/development/development_on_windows.rst +++ b/doc/development/development_on_windows.rst @@ -110,6 +110,73 @@ VLC To install VLC, you can download the official installer from the `VideoLAN website `_. Make sure to install the 64-bit version of VLC. +Protocol Buffers +---------------- +To build the Protocol Buffers library for Windows you will first need to download and install Microsoft Visual C++ Compiler for Python 2.7. You can get it at http://aka.ms/vcpython27 . + +You then need to download the Protocol Buffers 2.6.1 full source from https://developers.google.com/protocol-buffers/docs/downloads . Extract the contents to some folder. The rest of this section will refer to this folder as :code:`%FULLSOURCELOCATION%`. + +From https://developers.google.com/protocol-buffers/docs/downloads again, now download the Protocol Compiler 2.6.1 binary for windows. Place its contents (a single file :code:`protoc.exe`) in :code:`%FULLSOURCELOCATION%\src` . + +Now create a new file :code:`CoreWin.vsprops` in :code:`%FULLSOURCELOCATION%\vsprojects`, with the following contents: + +.. code-block:: none + + + + + + +Now open a Command Prompt (:code:`cmd`) set the Current Directory (:code:`cd`) to :code:`%FULLSOURCELOCATION%\vsprojects`. +Then execute the following commands in order (for either a **64** or **32** bit build): + +------------ + +**FOR A 64 BIT BUILD** + +------------ + +.. code-block:: none + + SETLOCAL + SET PATH=%PATH%;%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\bin\amd64 + "%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat" amd64 + "%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\bin\amd64\vcbuild.exe" /upgrade libprotobuf.vcproj + "%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\bin\amd64\vcbuild.exe" /useenv libprotobuf.vcproj "Release|Win32" + +------------ + +------------ + +**FOR A 32 BIT BUILD** + +------------ + +.. code-block:: none + + SETLOCAL + SET PATH=%PATH%;%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\bin\x86 + "%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat" x86 + "%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\bin\amd64\vcbuild.exe" /upgrade libprotobuf.vcproj + "%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\bin\amd64\vcbuild.exe" /useenv libprotobuf.vcproj "Release|Win32" +------------ + +For all other builds (cross compile, ARM, etc.) see https://msdn.microsoft.com/en-us/library/f2ccy3wt.aspx#Anchor_1. + +If everything completed correctly this should have created the file: +:code:`%FULLSOURCELOCATION%\vsprojects\Release\libprotobuf.lib` +Copy **and rename** this file to: +:code:`%FULLSOURCELOCATION%\python\protobuf.lib` + +Now create the directory :code:`%FULLSOURCELOCATION%\python\google\protobuf\compiler`. + +Finally run :code:`python %FULLSOURCELOCATION%\python\setup.py install --cpp_implementation`. + Additional Packages -------------------