METADATA 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. Metadata-Version: 2.1
  2. Name: pythran
  3. Version: 0.17.0
  4. Summary: Ahead of Time compiler for numeric kernels
  5. Author-email: Serge Guelton <serge.guelton@telecom-bretagne.eu>
  6. License: Copyright (c) 2012, HPC Project and Serge Guelton
  7. All rights reserved.
  8. Redistribution and use in source and binary forms, with or without
  9. modification, are permitted provided that the following conditions are met:
  10. Redistributions of source code must retain the above copyright notice, this
  11. list of conditions and the following disclaimer.
  12. Redistributions in binary form must reproduce the above copyright notice,
  13. this list of conditions and the following disclaimer in the documentation
  14. and/or other materials provided with the distribution.
  15. Neither the name of HPCProject, Serge Guelton nor the names of its
  16. contributors may be used to endorse or promote products derived from this
  17. software without specific prior written permission.
  18. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  19. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  20. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  21. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  22. FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  23. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  24. SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  25. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  27. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. Project-URL: Homepage, https://github.com/serge-sans-paille/pythran
  29. Project-URL: Documentation, https://pythran.readthedocs.io
  30. Project-URL: Changelog, https://pythran.readthedocs.io/en/latest/Changelog.html
  31. Classifier: Development Status :: 4 - Beta
  32. Classifier: Environment :: Console
  33. Classifier: Intended Audience :: Developers
  34. Classifier: License :: OSI Approved :: BSD License
  35. Classifier: Natural Language :: English
  36. Classifier: Operating System :: POSIX :: Linux
  37. Classifier: Operating System :: MacOS
  38. Classifier: Programming Language :: Python :: 3
  39. Classifier: Programming Language :: Python :: Implementation :: CPython
  40. Classifier: Programming Language :: C++
  41. Classifier: Topic :: Software Development :: Compilers
  42. Classifier: Topic :: Software Development :: Code Generators
  43. Requires-Python: >=3.7
  44. Description-Content-Type: text/x-rst
  45. License-File: LICENSE
  46. License-File: AUTHORS
  47. Requires-Dist: ply >=3.4
  48. Requires-Dist: setuptools
  49. Requires-Dist: gast ~=0.6.0
  50. Requires-Dist: numpy
  51. Requires-Dist: beniget ~=0.4.0
  52. Provides-Extra: doc
  53. Requires-Dist: numpy ; extra == 'doc'
  54. Requires-Dist: nbsphinx ; extra == 'doc'
  55. Requires-Dist: scipy ; extra == 'doc'
  56. Requires-Dist: guzzle-sphinx-theme ; extra == 'doc'
  57. Provides-Extra: test
  58. Requires-Dist: ipython ; extra == 'test'
  59. Requires-Dist: nbval ; extra == 'test'
  60. Requires-Dist: cython ; extra == 'test'
  61. Requires-Dist: wheel ; extra == 'test'
  62. Requires-Dist: packaging ; extra == 'test'
  63. Requires-Dist: ninja ; extra == 'test'
  64. Requires-Dist: meson ; extra == 'test'
  65. Pythran
  66. #######
  67. https://pythran.readthedocs.io
  68. What is it?
  69. -----------
  70. Pythran is an ahead of time compiler for a subset of the Python language, with a
  71. focus on scientific computing. It takes a Python module annotated with a few
  72. interface descriptions and turns it into a native Python module with the same
  73. interface, but (hopefully) faster.
  74. It is meant to efficiently compile **scientific programs**, and takes advantage
  75. of multi-cores and SIMD instruction units.
  76. Until 0.9.5 (included), Pythran was supporting Python 3 and Python 2.7.
  77. It now only supports Python **3**.
  78. Installation
  79. ------------
  80. Pythran sources are hosted on https://github.com/serge-sans-paille/pythran.
  81. Pythran releases are hosted on https://pypi.python.org/pypi/pythran.
  82. Pythran is available on conda-forge on https://anaconda.org/conda-forge/pythran.
  83. Debian/Ubuntu
  84. =============
  85. Using ``pip``
  86. *************
  87. 1. Gather dependencies:
  88. Pythran depends on a few Python modules and several C++ libraries. On a debian-like platform, run::
  89. $> sudo apt-get install libatlas-base-dev
  90. $> sudo apt-get install python-dev python-ply python-numpy
  91. 2. Install with ``pip``::
  92. $> pip install pythran
  93. Using ``mamba`` or ``conda``
  94. ****************************
  95. 1. Using ``mamba`` (https://github.com/conda-forge/miniforge#mambaforge) or ``conda`` (https://github.com/conda-forge/miniforge)
  96. 2. Run::
  97. $> mamba install -c conda-forge pythran
  98. or::
  99. $> conda install -c conda-forge pythran
  100. Mac OSX
  101. =======
  102. Using brew (https://brew.sh/)::
  103. $> pip install pythran
  104. $> brew install openblas
  105. $> printf '[compiler]\nblas=openblas\ninclude_dirs=/usr/local/opt/openblas/include\nlibrary_dirs=/usr/local/opt/openblas/lib' > ~/.pythranrc
  106. Depending on your setup, you may need to add the following to your ``~/.pythranrc`` file::
  107. [compiler]
  108. CXX=g++-4.9
  109. CC=gcc-4.9
  110. ArchLinux
  111. =========
  112. Using ``pacman``::
  113. $> pacman -S python-pythran
  114. Fedora
  115. ======
  116. Using ``dnf``::
  117. $> dnf install pythran
  118. Windows
  119. =======
  120. Windows support is on going and only targets Python 3.5+ with either Visual Studio 2017 or, better, clang-cl::
  121. $> pip install pythran
  122. Note that using ``clang-cl.exe`` is the default setting. It can be changed
  123. through the ``CXX`` and ``CC`` environment variables.
  124. Other Platform
  125. ==============
  126. See MANUAL file.
  127. Basic Usage
  128. -----------
  129. A simple pythran input could be ``dprod.py``
  130. .. code-block:: python
  131. """
  132. Naive dotproduct! Pythran supports numpy.dot
  133. """
  134. #pythran export dprod(int list, int list)
  135. def dprod(l0,l1):
  136. """WoW, generator expression, zip and sum."""
  137. return sum(x * y for x, y in zip(l0, l1))
  138. To turn it into a native module, run::
  139. $> pythran dprod.py
  140. That will generate a native dprod.so that can be imported just like the former
  141. module::
  142. $> python -c 'import dprod' # this imports the native module instead
  143. Documentation
  144. -------------
  145. The user documentation is available in the MANUAL file from the doc directory.
  146. The developer documentation is available in the DEVGUIDE file from the doc
  147. directory. There is also a TUTORIAL file for those who don't like reading
  148. documentation.
  149. The CLI documentation is available from the pythran help command::
  150. $> pythran --help
  151. Some extra developer documentation is also available using pydoc. Beware, this
  152. is the computer science incarnation for the famous Where's Waldo? game::
  153. $> pydoc pythran
  154. $> pydoc pythran.typing
  155. $> pydoc -b # in the browser
  156. Examples
  157. --------
  158. See the ``pythran/tests/cases/`` directory from the sources.
  159. Contact
  160. -------
  161. Praise, flame and cookies:
  162. - pythran@freelists.org -- register at https://www.freelists.org/list/pythran first!
  163. - #pythran on OFTC, https://oftc.net
  164. - serge.guelton@telecom-bretagne.eu
  165. The mailing list archive is available at https://www.freelists.org/archive/pythran/.
  166. Citing
  167. ------
  168. If you need to cite a Pythran paper, feel free to use
  169. .. code-block:: bibtex
  170. @article{guelton2015pythran,
  171. title={Pythran: Enabling static optimization of scientific python programs},
  172. author={Guelton, Serge and Brunet, Pierrick and Amini, Mehdi and Merlini,
  173. Adrien and Corbillon, Xavier and Raynaud, Alan},
  174. journal={Computational Science \& Discovery},
  175. volume={8},
  176. number={1},
  177. pages={014001},
  178. year={2015},
  179. publisher={IOP Publishing}
  180. }
  181. Authors
  182. -------
  183. See AUTHORS file.
  184. License
  185. -------
  186. See LICENSE file.