Your IP : 216.73.216.213
B
��Fd� � @ s� d Z ddlmZmZmZ dddgZddlZddlmZ dd lm Z dd
lm
Z
ejZejZddd�Z
ddlmZ e� jZe� jZdS )z(Fortran to Python Interface Generator.
� )�division�absolute_import�print_function�run_main�compile�f2py_testingN� )�f2py2e)r )�diagnose�untitled� T�.fc
C s� ddl m} ddl}|dkr*|j|d�}n
t|d�}zP|�| � |�� d�||j|�} d}
|
�t j
| �}
||
�\}}|r�t|� W d|�� X |S )aN
Build extension module from processing source with f2py.
Parameters
----------
source : str
Fortran source of module / subroutine to compile
modulename : str, optional
The name of the compiled python module
extra_args : str, optional
Additional parameters passed to f2py
verbose : bool, optional
Print f2py output to screen
source_fn : str, optional
Name of the file where the fortran source is written.
The default is to use a temporary file with the extension
provided by the `extension` parameter
extension : {'.f', '.f90'}, optional
Filename extension if `source_fn` is not provided.
The extension tells which fortran standard is used.
The default is `.f`, which implies F77 standard.
.. versionadded:: 1.11.0
r )�exec_commandN)�suffix�wz -c -m {} {} {}z4{} -c "import numpy.f2py as f2py2e;f2py2e.main()" {})
�numpy.distutils.exec_commandr �tempfile�NamedTemporaryFile�open�write�flush�format�name�sys�
executable�print�close)
�source�
modulename�
extra_args�verboseZ source_fn� extensionr r �f�args�c�status�output� r'