.. -*- rest -*-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
F2PY: Fortran to Python interface generator
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Author: Pearu Peterson <pearu@cens.ioc.ee>
:License: NumPy License
:Web-site: http://cens.ioc.ee/projects/f2py2e/
:Discussions to: `f2py-users mailing list`_
:Documentation: `User's Guide`__, FAQ__
:Platforms: All
:Date: $Date: 2005/01/30 18:54:53 $
.. _f2py-users mailing list: http://cens.ioc.ee/mailman/listinfo/f2py-users/
__ usersguide/index.html
__ FAQ.html
-------------------------------
.. topic:: NEWS!!!
January 5, 2006
WARNING -- these notes are out of date! The package structure for NumPy and
SciPy has changed considerably. Much of this information is now incorrect.
January 30, 2005
Latest F2PY release (version 2.45.241_1926).
New features: wrapping unsigned integers, support for ``.pyf.src`` template files,
callback arguments can now be CObjects, fortran objects, built-in functions.
Introduced ``intent(aux)`` attribute. Wrapped objects have ``_cpointer``
attribute holding C pointer to wrapped functions or variables.
Many bug fixes and improvements, updated documentation.
`Differences with the previous release (version 2.43.239_1831)`__.
__ http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/docs/HISTORY.txt.diff?r1=1.163&r2=1.137&f=h
October 4, 2004
F2PY bug fix release (version 2.43.239_1831).
Better support for 64-bit platforms.
Introduced ``--help-link`` and ``--link-<resource>`` options.
Bug fixes.
`Differences with the previous release (version 2.43.239_1806)`__.
__ http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/docs/HISTORY.txt.diff?r1=1.137&r2=1.131&f=h
September 25, 2004
Latest F2PY release (version 2.43.239_1806).
Support for ``ENTRY`` statement. New attributes:
``intent(inplace)``, ``intent(callback)``. Supports Numarray 1.1.
Introduced ``-*- fix -*-`` header content. Improved ``PARAMETER`` support.
Documentation updates. `Differences with the previous release
(version 2.39.235-1693)`__.
__ http://cens.ioc.ee/cgi-bin/cvsweb/python/f2py2e/docs/HISTORY.txt.diff?r1=1.131&r2=1.98&f=h
`History of NEWS`__
__ OLDNEWS.html
-------------------------------
.. Contents::
==============
Introduction
==============
The purpose of the F2PY --*Fortran to Python interface generator*--
project is to provide connection between Python_ and Fortran
languages. F2PY is a Python extension tool for creating Python C/API
modules from (handwritten or F2PY generated) signature files (or
directly from Fortran sources). The generated extension modules
facilitate:
* Calling Fortran 77/90/95, Fortran 90/95 module, and C functions from
Python.
* Accessing Fortran 77 ``COMMON`` blocks and Fortran 90/95 module
data (including allocatable arrays) from Python.
* Calling Python functions from Fortran or C (call-backs).
* Automatically handling the difference in the data storage order of
multi-dimensional Fortran and Numerical Python (i.e. C) arrays.
In addition, F2PY can build the generated extension modules to shared
libraries with one command. F2PY uses the ``numpy_distutils`` module
from SciPy_ that supports number of major Fortran compilers.
..
(see `COMPILERS.txt`_ for more information).
F2PY generated extension modules depend on NumPy_ package that
provides fast multi-dimensional array language facility to Python.
---------------
Main features
---------------
Here follows a more detailed list of F2PY features:
* F2PY scans real Fortran codes to produce the so-called signature
files (.pyf files). The signature files contain all the information
(function names, arguments and their types, etc.) that is needed to
construct Python bindings to Fortran (or C) functions.
The syntax of signature files is borrowed from the
Fortran 90/95 language specification and has some F2PY specific
extensions. The signature files can be modified to dictate how
Fortran (or C) programs are called from Python:
+ F2PY solves dependencies between arguments (this is relevant for
the order of initializing variables in extension modules).
+ Arguments can be specified to be optional or hidden that
simplifies calling Fortran programs from Python considerably.
+ In principle, one can design any Python signature for a given
Fortran function, e.g. change the order arguments, introduce
auxiliary arguments, hide the arguments, process the arguments
before passing to Fortran, return arguments as output of F2PY
generated functions, etc.
* F2PY automatically generates __doc__ strings (and optionally LaTeX
documentation) for extension modules.
* F2PY generated functions accept arbitrary (but sensible) Python
objects as arguments. The F2PY interface automatically takes care of
type-casting and handling of non-contiguous arrays.
* The following Fortran constructs are recognized by F2PY:
+ All basic Fortran types::
integer[ | *1 | *2 | *4 | *8 ], logical[ | *1 | *2 | *4 | *8 ]
integer*([ -1 | -2 | -4 | -8 ])
character[ | *(*) | *1 | *2 | *3 | ... ]
real[ | *4 | *8 | *16 ], double precision
complex[ | *8 | *16 | *32 ]
Negative ``integer`` kinds are used to wrap unsigned integers.
+ Multi-dimensional arrays of all basic types with the following
dimension specifications::
<dim> | <start>:<end> | * | :
+ Attributes and statements::
intent([ in | inout | out | hide | in,out | inout,out | c |
copy | cache | callback | inplace | aux ])
dimension(<dimspec>)
common, parameter
allocatable
optional, required, external
depend([<names>])
check([<C-booleanexpr>])
note(<LaTeX text>)
usercode, callstatement, callprotoargument, threadsafe, fortranname
pymethoddef
entry
* Because there are only little (and easily handleable) differences
between calling C and Fortran functions from F2PY generated
extension modules, then F2PY is also well suited for wrapping C
libraries to Python.
* Practice has shown that F2PY generated interfaces (to C or Fortran
functions) are less error prone and even more efficient than
handwritten extension modules. The F2PY generated interfaces are
easy to maintain and any future optimization of F2PY generated
interfaces transparently apply to extension modules by just
regenerating them with the latest version of F2PY.
* `F2PY Users Guide and Reference Manual`_
===============
Prerequisites
===============
F2PY requires the following software installed:
* Python_ (versions 1.5.2 or later; 2.1 and up are recommended).
You must have python-dev package installed.
* NumPy_ (versions 13 or later; 20.x, 21.x, 22.x, 23.x are recommended)
* Numarray_ (version 0.9 and up), optional, partial support.
* Scipy_distutils (version 0.2.2 and up are recommended) from SciPy_
project. Get it from Scipy CVS or download it below.
Python 1.x users also need distutils_.
Of course, to build extension modules, you'll need also working C
and/or Fortran compilers installed.
==========
Download
==========
You can download the sources for the latest F2PY and numpy_distutils
releases as:
* `2.x`__/`F2PY-2-latest.tar.gz`__
* `2.x`__/`numpy_distutils-latest.tar.gz`__
Windows users might be interested in Win32 installer for F2PY and
Scipy_distutils (these installers are built using Python 2.3):
* `2.x`__/`F2PY-2-latest.win32.exe`__
* `2.x`__/`numpy_distutils-latest.win32.exe`__
Older releases are also available in the directories
`rel-0.x`__, `rel-1.x`__, `rel-2.x`__, `rel-3.x`__, `rel-4.x`__, `rel-5.x`__,
if you need them.
.. __: 2.x/
.. __: 2.x/F2PY-2-latest.tar.gz
.. __: 2.x/
.. __: 2.x/numpy_distutils-latest.tar.gz
.. __: 2.x/
.. __: 2.x/F2PY-2-latest.win32.exe
.. __: 2.x/
.. __: 2.x/numpy_distutils-latest.win32.exe
.. __: rel-0.x
.. __: rel-1.x
.. __: rel-2.x
.. __: rel-3.x
.. __: rel
没有合适的资源?快使用搜索试试~ 我知道了~
numpy-1.6.1.tar.gz
需积分: 1 0 下载量 169 浏览量
2024-02-13
02:36:11
上传
评论
收藏 2.52MB GZ 举报
温馨提示
共2000个文件
rst:1337个
py:397个
h:76个
py依赖包
资源推荐
资源详情
资源评论
收起资源包目录
numpy-1.6.1.tar.gz (2000个子文件)
f2py.1 6KB
mtrand.c 1.18MB
dlapack_lite.c 972KB
zlapack_lite.c 744KB
blas_lite.c 271KB
ufunc_object.c 158KB
ctors.c 110KB
dtype_transfer.c 104KB
multiarraymodule.c 102KB
_capi.c 95KB
descriptor.c 82KB
nditer_pywrap.c 71KB
methods.c 65KB
iterators.c 60KB
item_selection.c 54KB
mapping.c 50KB
fftpack.c 50KB
numpyx.c 48KB
convert_datatype.c 47KB
_dotblas.c 43KB
arrayobject.c 42KB
_compiled_base.c 42KB
fortranobject.c 32KB
lapack_litemodule.c 31KB
calculation.c 27KB
shape.c 25KB
datetime.c 24KB
dlamch.c 24KB
getset.c 23KB
number.c 23KB
buffer.c 23KB
scalarapi.c 23KB
distributions.c 20KB
numpyos.c 20KB
conversion_utils.c 19KB
flagsobject.c 18KB
halffloat.c 15KB
convert.c 14KB
common.c 14KB
randomkit.c 10KB
numpymemoryview.c 9KB
fftpack_litemodule.c 9KB
wrapmodule.c 9KB
hashdescr.c 8KB
f2c_lite.c 8KB
refcount.c 7KB
usertypes.c 7KB
initarray.c 5KB
sequence.c 5KB
ucsnarrow.c 3KB
fenv.c 2KB
python_xerbla.c 1KB
multiarraymodule_onefile.c 1KB
_signbit.c 426B
example.c 227B
gfortran_vs2003_hack.c 74B
umathmodule_onefile.c 71B
zoo.cc 268B
docutils.conf 383B
docutils.conf 382B
default.css 3KB
default.css 3KB
scipy.css 2KB
array_session.dat 2KB
simple_session.dat 1KB
allocarr_session.dat 839B
moddata_session.dat 589B
string_session.dat 572B
run_main_session.dat 547B
ftype_session.dat 534B
common_session.dat 496B
scalar_session.dat 488B
callback_session.dat 463B
extcallback_session.dat 398B
calculate_session.dat 228B
compile_session.dat 223B
spam_session.dat 124B
var_session.dat 28B
string.f 447B
fib3.f 404B
array.f 399B
fib1.f 347B
fib1.f 347B
common.f 318B
calculate.f 309B
extcallback.f 307B
scalar.f 271B
simple.f 242B
ftype.f 232B
callback.f 218B
hello.f 124B
foo.f 85B
.f2py_f2cmap 29B
foo.f90 815B
foo_mod.f90 499B
foo_free.f90 460B
moddata.f90 422B
foo.f90 347B
allocarr.f90 325B
foo_use.f90 269B
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
程序员Chino的日记
- 粉丝: 2939
- 资源: 4万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功