METADATA 7.7 KB

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