f2py-jit-0.9.2
توضیحات
Just-in-time Fortran extension builder for Python
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | f2py-jit-0.9.2 |
| نام | f2py-jit |
| نسخه کتابخانه | 0.9.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Daniele Coslovich |
| ایمیل نویسنده | daniele.coslovich@umontpellier.fr |
| آدرس صفحه اصلی | https://framagit.org/coslo/f2py-jit |
| آدرس اینترنتی | https://pypi.org/project/f2py-jit/ |
| مجوز | GPLv3 |
f2py-jit
==================
[](https://pypi.python.org/pypi/f2py-jit/)
[](https://pypi.python.org/pypi/f2py-jit/)
[](https://en.wikipedia.org/wiki/GNU_General_Public_License)
[](https://mybinder.org/v2/git/https%3A%2F%2Fframagit.org%2Fcoslo%2Ff2py-jit/HEAD?labpath=docs%2Findex.ipynb)
[](https://framagit.org/coslo/f2py-jit/-/commits/master)
[](https://framagit.org/coslo/f2py-jit/-/commits/master)
Just-in-time compilation of Fortran code in Python via [f2py](https://numpy.org/doc/stable/f2py/).
Check out the [documentation](https://coslo.frama.io/f2py-jit/) for full details.
Quick start
-----------
Start from a piece of Fortran `code.f90`
```fortran
subroutine hello()
print*, "Hello world!"
end subroutine
```
Compile the code, import it and execute it
```python
from f2py_jit import jit
f90 = jit('code.f90')
f90.hello()
```
Do the same but from a python string containing the source block
```python
source = """
subroutine hello()
print*, "Hello world!"
end subroutine
"""
f90 = jit(source)
f90.hello()
```
If the Fortran source contains multiple subroutines calling each other, `f2py` will not perform interprocedural optimizations (at least not by default). `f2py_jit` can inline the source code before compiling it, and you will get a [performace boost](https://coslo.frama.io/f2py-jit/tutorial/#performance) [**This feature is experimental**]
```python
f90 = jit('code.f90', inline=True)
```
Features
--------
- Compilation of Fortran source blocks as Python strings
- Caching of module builds across executions
- Support for Fortran derived types via f90wrap
- Inlining to improve performance (experimental)
Dependencies
------------
- numpy
- f90wrap
- Fortran compiler
Installation
------------
From pip
```
pip install f2py-jit
```
From source
```
git clone https://framagit.org/coslo/f2py-jit.git
cd f2py_jit
make install
```
Credits
-------
Part of this code is adapted from `numpy.f2py` module by Pearu Peterson, in accordance with the NumPy license.
Authors
-------
Daniele Coslovich: https://www.units.it/daniele.coslovich/
نیازمندی
| مقدار | نام |
|---|---|
| ~=0.2.12 | f90wrap |
| - | numpy |
نحوه نصب
نصب پکیج whl f2py-jit-0.9.2:
pip install f2py-jit-0.9.2.whl
نصب پکیج tar.gz f2py-jit-0.9.2:
pip install f2py-jit-0.9.2.tar.gz