Changes between Version 2 and Version 3 of PyGammaBuildingLibrary


Ignore:
Timestamp:
Mar 23, 2016, 6:31:04 PM (3 years ago)
Author:
flip
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PyGammaBuildingLibrary

    v2 v3  
    1 = Building PyGAMMA =
     1= How To Build PyGamma =
     2
     3This document describes how to build PyGamma. Note that we offer
     4[PyGamma#InstallingPyGamma pip-installable binaries] for many platforms.
    25
    36== Overview ==
    47
    5 We'd like to provide prebuilt binaries for every platform, but that's not
    6 practical given the variety of operating systems, Python versions and
    7 architectures (32/64 bit) out there. Some of you will have to build the
    8 PyGAMMA binaries yourself.
     8Building PyGamma consists of 3 general steps --
     9 1. Satisfying prerequisites
     10 1. Building PyGamma
     11 1. Installing PyGamma
    912
    10 If you need a custom PyGAMMA, the process to build and install it is quite
    11 simple but the setup can take some time. Once the setup is complete, the build
    12 and install takes four steps --
     13These steps are explained in detail below.
    1314
    14  1. Change to the appropriate directory for your platform (e.g. `cd ~/gamma/platforms/Linux`)
    15  2. Build (for all non-Windows platforms, `make pysgdist`)
    16  3. Change to the pygamma directory (`cd ../../pygamma` or `cd ~/gamma/pygamma`)
    17  4. Run `setup.py` (`python setup.py install` or `sudo python setup.py install`)
     15== Satisfy Prerequsities (All Platforms) ==
    1816
    19 These steps and the setup for them are explained in detail below for
    20 building PyGAMMA on Windows, Unix and Unix-like platforms.
     17 1. Follow the [GammaBuildingLibrary#DownloadtheCode instructions for downloading the code].
     18 1. Install Python if you haven't already.
     19 1. Install [http://www.swig.org/ SWIG].
     20 1. Install a compiler (see platform-specific instructions below).
    2121
     22== Compiler (Unix[-Like] Platforms) ==
    2223
    23 = Building PyGAMMA (All Platforms) =
     24PyGamma builds with `gcc` 4.x and 5.x. It also builds with `clang/LLVM`.
    2425
    25 
    26 == Build Prerequsities (All Platforms) ==
    27 
    28 First you'll need to follow the
    29 [GammaBuildingLibrary#DownloadtheCode instructions for downloading the code]. Once you've
    30 done that, continue with the next paragraph.
    31 
    32 You'll need Python, a compiler (see below) and a tool called
    33 [http://www.swig.org/ SWIG]. We've had success with SWIG versions 1.3 through 2.0.
    34 
    35 == Building Binaries on Unix[-Like] Platforms (OS X, Linux, etc.)  ==
    36 
    37 === Prerequsities (Unix[-Like] Platforms) ===
    38 
    39 In addition to Python and SWIG, you'll need the `gcc` compiler. This build
    40 should work with any 4.x version of `gcc`.
    41 
    42 '''Under OS X''', download
    43 the [http://developer.apple.com/technologies/tools/ XCode/Developer Tools package]
    44 to get `make` and `gcc`.
    45 
    46 '''Linux users''', in addition to installing the packages `gcc` (and possibly
    47 `gcc-c++`), you might also need to install the development package for
     26'''Linux users''', in addition to installing `gcc` (and possibly
     27`gcc-c++`), you might also need to install the development package for
    4828your version of Python. If the build complains that `Python.h` is missing,
    4929you need to install a package called something like `python-dev`.
    5030
    51 If you're not on OS X, you might want to consider installing an
     31'''Under OS X''', download
     32[https://developer.apple.com/xcode/ XCode/Developer XCode]
     33to get the build tools you need.
     34
     35If you're not on OS X, you might want to consider installing an
    5236[GammaWithBlasLapack optimized linear algebra library]
    5337before building, although this is not essential and will complicate the build.
    5438OS X already has such a library
    55 installed, and PyGAMMA can take advantage of it.
     39installed, and PyGamma can take advantage of it.
    5640
     41== Compiler (Windows) ==
    5742
    58 === The Build (Unix[-Like] Platforms) ===
     43PyGamma is known to build with MSVC 2008. Note that under Windows, Python
     44extensions like PyGamma must be compiled with the same compiler as was used
     45to compile Python. MSVC 2008 is used to build Python 2.7.
    5946
    60 Once you have the prerequisites installed, go to a command line and then
    61 change to the `gamma/platforms` directory. Once there, change into the
     47== How To Build on Unix[-Like] Platforms (OS X, Linux, etc.)  ==
     48
     49Once you have the prerequisites installed, go to a command line and then
     50change to the `gamma/platforms` directory. Once there, change into the
    6251subdirectory appropriate for your platform. Then, execute this command --
    6352{{{
     
    6554}}}
    6655
    67 That will build PyGAMMA and place the relevant build output files in a place
    68 where `setup.py` can find them. When this process completes, you're ready to 
    69 run `setup.py` as explained above.
     56That will build PyGamma and place the relevant build output files in a place
     57where `setup.py` can find them. When this process completes, you're ready to
     58install PyGamma as explained below.
    7059
    7160
    72 == Building Binaries on Windows ==
     61== How To Build on Windows ==
    7362
    74 === Prerequsities (Windows) ===
    75 
    76 In addition to Python and SWIG, you'll need the free C++ compiler
    77 [http://www.microsoft.com/visualstudio/en-us/products/2008-editions/express Visual Studio Express Edition 2008].
    78 
    79 === The Build (Windows) ===
    80 
    81  1. Find the file `gamma/platforms/msvc2008e/dynamic/gamma.sln` and double
    82  click on it to open Visual Studio.
     63 1. Open file `gamma/platforms/msvc2008e/dynamic/gamma.sln` in Visual Studio.
    8364 1. Ensure that `python.exe` is in your PATH.
    8465 1. Either ensure that `swig.exe` is in your PATH, or edit the build properties
    85  to supply an explicit path to `swig.exe` on your machine. 
    86  
     66 to supply an explicit path to `swig.exe` on your machine.
     67
    8768 If you opt for the
    88  latter, open the Visual Studio ''Project-->Properties'' menu. 
    89  Then select ''Configuration Properties --> Build Events --> Pre-Build Events'' 
     69 latter, open the Visual Studio ''Project-->Properties'' menu.
     70 Then select ''Configuration Properties --> Build Events --> Pre-Build Events''
    9071 and then edit the ''Command Line'' property. Change "swig" to an explicit
    9172 path. The result will look something like this:
     
    9475 }}}
    9576 4. Hit F7 to start the build.
    96  
    97 The steps above will build PyGAMMA and place the relevant build output files
    98 in a place where `setup.py` can find them. When this process completes,
    99 you're ready to run `setup.py` as explained above.
     77
     78The steps above will build PyGamma and place the relevant build output files
     79in a place where `setup.py` can find them. When this process completes, you're ready to
     80install PyGamma as explained below.
    10081
    10182
    102 === Potential Windows Build Problems ===
     83== Installing PyGamma (All Platforms) ==
    10384
    104 The build may fail if built in debug mode due to a SWIG quirk and the lack of
    105 Python debug library. If you get an error like this --
    106 {{{
    107 LINK : fatal error LNK1104: cannot open file 'python25_d.lib'
    108 }}}
     85 1. `cd gamma/pygamma`
     86 1. `python setup.py install`
    10987
    110 You can work around this by building PyGAMMA in ''Release'' mode. In Visual
    111 Studio at the top of the screen, just beneath the menus, you can find a drop
    112 down that offers a choice between Release and Debug. Alternatively, you can
    113 select the ''Build-->Configuration Manager'' menu item. Visual Studio will
    114 display the Configuration Manager dialog. Under ''Active Solution
    115 Configuration'', select Release. Close the dialog and rebuild.
     88== Testing PyGamma (All Platforms) ==
    11689
    117 = Installing PyGAMMA After a Build (All Platforms) =
    118 
    119 Installing after a build works just the same as if you were using prebuilt
    120 binaries. Just follow the [#InstallingPyGAMMA installation instructions] above.
    121 
    122 = Testing PyGAMMA (All Platforms) =
    123 
    124 Once PyGAMMA is installed, you can run an automated test under any Unix-like
     90Once PyGamma is installed, you can run an automated test under any Unix-like
    12591operating system from the command line. Change directory to `gamma/platforms`
    12692and then move into the appropriate platform (Linux, OSX, etc.). From there,
     
    13096there manually.
    13197
    132 Under Windows, you can run the automated tests from within Visual Studio. 
    133 Right click on the `pytest` project and build it to run all the tests in the 
     98Under Windows, you can run the automated tests from within Visual Studio.
     99Right click on the `pytest` project and build it to run all the tests in the
    134100`gamma/trunk/src/pyTests` directory.