|
| 1 | +.. _usage-installation: |
| 2 | + |
| 3 | +Installation |
| 4 | +============ |
| 5 | + |
| 6 | + |
| 7 | +Boost-histogram (`source <https://github.com/scikit-hep/boost-histogram>`__) is a Python package providing Python bindings for Boost.Histogram_ (`source <https://github.com/boostorg/histogram>`__). |
| 8 | + |
| 9 | +.. _Boost.Histogram: https://www.boost.org/doc/libs/release/libs/histogram/doc/html/index.html |
| 10 | + |
| 11 | + |
| 12 | +You can install this library from |
| 13 | +`PyPI <https://pypi.org/project/boost-histogram/>`__ with pip: |
| 14 | + |
| 15 | +.. code:: bash |
| 16 | +
|
| 17 | + python -m pip install boost-histogram |
| 18 | +
|
| 19 | +or you can use Conda through |
| 20 | +`conda-forge <https://github.com/conda-forge/boost-histogram-feedstock>`__: |
| 21 | + |
| 22 | +.. code:: bash |
| 23 | +
|
| 24 | + conda install -c conda-forge boost-histogram |
| 25 | +
|
| 26 | +All the normal best-practices for Python apply; you should be in a |
| 27 | +virtual environment, etc. |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | +Supported platforms |
| 32 | +------------------- |
| 33 | + |
| 34 | +Binaries available: |
| 35 | +^^^^^^^^^^^^^^^^^^^ |
| 36 | + |
| 37 | +These are the supported platforms for which wheels are produced: |
| 38 | + |
| 39 | +=========================== =========== ======================= |
| 40 | +System Arch Python versions |
| 41 | +=========================== =========== ======================= |
| 42 | +ManyLinux1 (custom GCC 9.2) 64 & 32-bit 2.7, 3.5, 3.6, 3.7, 3.8 |
| 43 | +ManyLinux2010 64-bit 2.7, 3.5, 3.6, 3.7, 3.8 |
| 44 | +macOS 10.9+ 64-bit 2.7, 3.6, 3.7, 3.8 |
| 45 | +Windows 64 & 32-bit 2.7, 3.6, 3.7, 3.8 |
| 46 | +=========================== =========== ======================= |
| 47 | + |
| 48 | +- Linux: I’m not supporting 3.4 because I have to build the Numpy |
| 49 | + wheels to do so. |
| 50 | +- manylinux1: Using a custom docker container with GCC 9.2; should work |
| 51 | + but can’t be called directly other compiled extensions unless they do |
| 52 | + the same thing (think that’s the main caveat). Supporting 32 bits |
| 53 | + because it’s there. |
| 54 | +- manylinux2010: Requires pip 10+ and a version of Linux newer than |
| 55 | + 2010. This is very new technology. |
| 56 | +- MacOS: Uses the dedicated 64 bit 10.9+ Python.org builds. We are not |
| 57 | + supporting 3.5 because those no longer provide binaries (could add a |
| 58 | + 32+64 fat 10.6+ that really was 10.9+, but not worth it unless there |
| 59 | + is a need for it). |
| 60 | +- Windows: PyBind11 requires compilation with a newer copy of Visual |
| 61 | + Studio than Python 2.7’s Visual Studio 2008; you need to have the |
| 62 | + `Visual Studio 2015 |
| 63 | + distributable <https://www.microsoft.com/en-us/download/details.aspx?id=48145>`__ |
| 64 | + installed (the dll is included in 2017 and 2019, as well). |
| 65 | + |
| 66 | +If you are on a Linux system that is not part of the “many” in |
| 67 | +manylinux, such as Alpine or ClearLinux, building from source is usually |
| 68 | +fine, since the compilers on those systems are often quite new. It will |
| 69 | +just take a little longer to install when it’s using the sdist instead |
| 70 | +of a wheel. |
| 71 | + |
| 72 | +Conda-Forge |
| 73 | +^^^^^^^^^^^ |
| 74 | + |
| 75 | +The boost-histogram package is available on Conda-Forge, as well. All |
| 76 | +supported versions are available with the exception of Windows + Python |
| 77 | +2.7, which cannot built due to the age of the compiler. Please use Pip |
| 78 | +if you *really* need Python 2.7 on Windows. You will also need the VS |
| 79 | +2015 distributable, as described above. |
| 80 | + |
| 81 | +:: |
| 82 | + |
| 83 | + conda install -c conda-forge boost-histogram |
| 84 | + |
| 85 | +Source builds |
| 86 | +^^^^^^^^^^^^^ |
| 87 | + |
| 88 | +For a source build, for example from an “sdist” package, the only |
| 89 | +requirements are a C++14 compatible compiler. The compiler requirements |
| 90 | +are dictated by Boost.Histogram’s C++ requirements: gcc >= 5.5, clang >= |
| 91 | +3.8, msvc >= 14.1. You should have a version of pip less than 2-3 years |
| 92 | +old (10+). |
| 93 | + |
| 94 | +If you are using Python 2.7 on Windows, you will need to use a recent |
| 95 | +version of Visual studio and force distutils to use it, or just upgrade |
| 96 | +to Python 3.6 or newer. Check the PyBind11 documentation for `more |
| 97 | +help <https://pybind11.readthedocs.io/en/stable/faq.html#working-with-ancient-visual-studio-2009-builds-on-windows>`__. |
| 98 | +On some Linux systems, you may need to use a newer compiler than the one |
| 99 | +your distribution ships with. |
| 100 | + |
| 101 | +Numpy is downloaded during the build (enables multithreaded builds). |
| 102 | +Boost is not required or needed (this only depends on included |
| 103 | +header-only dependencies).This library is under active development; you |
| 104 | +can install directly from GitHub if you would like. |
| 105 | + |
| 106 | +.. code:: bash |
| 107 | +
|
| 108 | + python -m pip install git+https://github.com/scikit-hep/boost-histogram.git@develop |
| 109 | +
|
0 commit comments