• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

docs/H03-May-2022-3,8352,549

omp/H14-Dec-2021-13295

pythran/H14-Dec-2021-484,363383,880

pythran.egg-info/H03-May-2022-3732

third_party/H14-Dec-2021-394,344310,108

AUTHORSH A D09-Nov-2018265 108

ChangelogH A D14-Dec-202116.5 KiB684345

LICENSEH A D09-Nov-20181.5 KiB3022

MANIFEST.inH A D15-Feb-2021141 87

PKG-INFOH A D14-Dec-20211.5 KiB3732

README.rstH A D14-Oct-20214.4 KiB201122

setup.cfgH A D14-Dec-202138 53

setup.pyH A D14-Aug-20216.1 KiB180137

README.rst

1Pythran
2#######
3
4https://pythran.readthedocs.io
5
6What is it?
7-----------
8
9Pythran is an ahead of time compiler for a subset of the Python language, with a
10focus on scientific computing. It takes a Python module annotated with a few
11interface descriptions and turns it into a native Python module with the same
12interface, but (hopefully) faster.
13
14It is meant to efficiently compile **scientific programs**, and takes advantage
15of multi-cores and SIMD instruction units.
16
17Until 0.9.5 (included), Pythran was supporting Python 3 and Python 2.7.
18It now only supports Python **3**.
19
20Installation
21------------
22
23Pythran sources are hosted on https://github.com/serge-sans-paille/pythran.
24
25Pythran releases are hosted on https://pypi.python.org/pypi/pythran.
26
27Pythran is available on conda-forge on https://anaconda.org/conda-forge/pythran.
28
29Debian/Ubuntu
30=============
31
32Using ``pip``
33*************
34
351. Gather dependencies:
36
37   Pythran depends on a few Python modules and several C++ libraries. On a debian-like platform, run::
38
39        $> sudo apt-get install libatlas-base-dev
40        $> sudo apt-get install python-dev python-ply python-numpy
41
422. Install with ``pip``::
43
44        $> pip install pythran
45
46Using ``mamba`` or ``conda``
47****************************
48
491. Using ``mamba`` (https://github.com/conda-forge/miniforge#mambaforge) or ``conda`` (https://github.com/conda-forge/miniforge)
50
512. Run::
52
53       $> mamba install -c conda-forge pythran
54
55   or::
56
57       $> conda install -c conda-forge pythran
58
59Mac OSX
60=======
61
62Using brew (https://brew.sh/)::
63
64    $> pip install pythran
65    $> brew install openblas
66    $> printf '[compiler]\nblas=openblas\ninclude_dirs=/usr/local/opt/openblas/include\nlibrary_dirs=/usr/local/opt/openblas/lib' > ~/.pythranrc
67
68Depending on your setup, you may need to add the following to your ``~/.pythranrc`` file::
69
70    [compiler]
71    CXX=g++-4.9
72    CC=gcc-4.9
73
74ArchLinux
75=========
76
77Using ``pacman``::
78
79    $> pacman -S python-pythran
80
81
82Fedora
83======
84
85Using ``dnf``::
86
87    $> dnf install pythran
88
89Windows
90=======
91
92Windows support is on going and only targets Python 3.5+ with either Visual Studio 2017 or, better, clang-cl::
93
94    $> pip install pythran
95
96Note that using ``clang-cl.exe`` is the default setting. It can be changed
97through the ``CXX`` and ``CC`` environment variables.
98
99
100Other Platform
101==============
102
103See MANUAL file.
104
105
106Basic Usage
107-----------
108
109A simple pythran input could be ``dprod.py``
110
111.. code-block:: python
112
113    """
114    Naive dotproduct! Pythran supports numpy.dot
115    """
116    #pythran export dprod(int list, int list)
117    def dprod(l0,l1):
118        """WoW, generator expression, zip and sum."""
119        return sum(x * y for x, y in zip(l0, l1))
120
121
122To turn it into a native module, run::
123
124    $> pythran dprod.py
125
126That will generate a native dprod.so that can be imported just like the former
127module::
128
129    $> python -c 'import dprod' # this imports the native module instead
130
131
132Documentation
133-------------
134
135The user documentation is available in the MANUAL file from the doc directory.
136
137The developer documentation is available in the DEVGUIDE file from the doc
138directory. There is also a TUTORIAL file for those who don't like reading
139documentation.
140
141The CLI documentation is available from the pythran help command::
142
143    $> pythran --help
144
145Some extra developer documentation is also available using pydoc. Beware, this
146is the computer science incarnation for the famous Where's Waldo? game::
147
148    $> pydoc pythran
149    $> pydoc pythran.typing
150    $> pydoc -b  # in the browser
151
152
153Examples
154--------
155
156See the ``pythran/tests/cases/`` directory from the sources.
157
158
159Contact
160-------
161
162Praise, flame and cookies:
163
164- pythran@freelists.org -- register at https://www.freelists.org/list/pythran first!
165
166- #pythran on OFTC, https://oftc.net
167
168- serge.guelton@telecom-bretagne.eu
169
170The mailing list archive is available at https://www.freelists.org/archive/pythran/.
171
172Citing
173------
174
175If you need to cite a Pythran paper, feel free to use
176
177.. code-block:: bibtex
178
179    @article{guelton2015pythran,
180      title={Pythran: Enabling static optimization of scientific python programs},
181      author={Guelton, Serge and Brunet, Pierrick and Amini, Mehdi and Merlini,
182                      Adrien and Corbillon, Xavier and Raynaud, Alan},
183      journal={Computational Science \& Discovery},
184      volume={8},
185      number={1},
186      pages={014001},
187      year={2015},
188      publisher={IOP Publishing}
189    }
190
191
192Authors
193-------
194
195See AUTHORS file.
196
197License
198-------
199
200See LICENSE file.
201