[Numpy-discussion] Still having issues

Blubaugh, David A. dblubaugh@belcan....
Tue Sep 9 17:53:02 CDT 2008


I have taken the advice that you had given to me the other day.
However,  I am still having issues with actually executing the f2py.py

>   If numpy is installed, then f2py will be too.  >   On the windows
>   there is a file called f2py.py that you can >>> >   call from the
command line.  It
>   should be in the 'scripts' directory of your >  >   Python
>   Try something like this:
>   python c:\python25\scripts\f2py.py
>   (of course change to reflect your own python >  >   installation

It appears that once I run the f2py.py script from the IDLE environment,
I will then obtain the following error:

You will have to read at the end of the listed output. It looks as
though there was a premature system exit once f2py.py was executed.     


1) To construct extension module sources:

      f2py [<options>] <fortran files> [[[only:]||[skip:]] \
                                        <fortran functions> ] \
                                       [: <fortran files> ...]

2) To compile fortran files and build extension modules:

      f2py -c [<options>, <build_flib options>, <extra options>]
<fortran files>

3) To generate signature files:

      f2py -h <filename.pyf> ...< same options as in (1) >

Description: This program generates a Python C/API file
             that contains wrappers for given fortran functions so that
             can be called from Python. With the -c option the
             extension modules are built.


  --g3-numpy       Use numpy.f2py.lib tool, the 3rd generation of F2PY,
                   with NumPy support.
  --2d-numpy       Use numpy.f2py tool with NumPy support. [DEFAULT]
  --2d-numeric     Use f2py2e tool with Numeric support.
  --2d-numarray    Use f2py2e tool with Numarray support.

  -h <filename>    Write signatures of the fortran routines to file
                   and exit. You can then edit <filename> and use it
                   of <fortran files>. If <filename>==stdout then the
                   signatures are printed to stdout.
  <fortran functions>  Names of fortran routines for which Python C/API
                   functions will be generated. Default is all that are
                   in <fortran files>.
  <fortran files>  Paths to fortran/signature files that will be scanned
                   <fortran functions> in order to determine their
  skip:            Ignore fortran functions that follow until `:'.
  only:            Use only fortran functions that follow until `:'.
  :                Get back to <fortran files> mode.

  -m <modulename>  Name of the module; f2py generates a Python/C API
                   file <modulename>module.c or extension module
                   Default is 'untitled'.

  --[no-]lower     Do [not] lower the cases in <fortran files>. By
                   --lower is assumed with -h key, and --no-lower
without -h key.

  --build-dir <dirname>  All f2py generated files are created in
                   Default is tempfile.mktemp().

  --overwrite-signature  Overwrite existing signature file.

  --[no-]latex-doc Create (or not) <modulename>module.tex.
                   Default is --no-latex-doc.
  --short-latex    Create 'incomplete' LaTeX document (without commands
                   \documentclass, \tableofcontents, and

  --[no-]rest-doc Create (or not) <modulename>module.rst.
                   Default is --no-rest-doc.

  --debug-capi     Create C/API code that reports the state of the
                   during runtime. Useful for debugging.

  --[no-]wrap-functions    Create Fortran subroutine wrappers to Fortran
                   functions. --wrap-functions is default because it
                   maximum portability/compiler independence.

  --include_paths <path1>:<path2>:...   Search include files from the

  --help-link [..] List system resources found by system_info.py. See
                   --link-<resource> switch below. [..] is optional list
                   of resources names. E.g. try 'f2py --help-link

  --quiet          Run quietly.
  --verbose        Run with extra verbosity.
  -v               Print f2py version ID and exit.

numpy.distutils options (only effective with -c):

  --fcompiler=         Specify Fortran compiler type by vendor
  --compiler=          Specify C compiler type (as defined by distutils)

  --help-fcompiler     List available Fortran compilers and exit
  --f77exec=           Specify the path to F77 compiler
  --f90exec=           Specify the path to F90 compiler
  --f77flags=          Specify F77 compiler flags
  --f90flags=          Specify F90 compiler flags
  --opt=               Specify optimization flags
  --arch=              Specify architecture specific optimization flags
  --noopt              Compile without optimization
  --noarch             Compile without arch-dependent optimization
  --debug              Compile with debugging information

Extra options (only effective with -c):

  --link-<resource>    Link extension module with <resource> as defined
                       by numpy.distutils/system_info.py. E.g. to link
                       with optimized LAPACK libraries (vecLib on
                       ATLAS elsewhere), use --link-lapack_opt.
                       See also --help-link switch.

  -L/path/to/lib/ -l<libname>
  -D<define> -U<name>
  <filename>.o <filename>.so <filename>.a

  Using the following macros may be required with non-gcc Fortran

  When using -DF2PY_REPORT_ATEXIT, a performance report of F2PY
  interface is printed out at exit (platforms: Linux).

  When using -DF2PY_REPORT_ON_ARRAY_COPY=<int>, a message is
  sent to stderr whenever F2PY interface makes a copy of an
  array. Integer <int> sets the threshold for array sizes when
  a message should be shown.

Version:     2_4423
numpy Version: 1.0.4
Requires:    Python 2.3 or higher.
License:     NumPy license (see LICENSE.txt in the NumPy source code)
Copyright 1999 - 2005 Pearu Peterson all rights reserved.

Traceback (most recent call last):
  File "C:\Python25\Scripts\f2py.py", line 26, in <module>
  File "C:\Python25\lib\site-packages\numpy\f2py\f2py2e.py", line 560,
in main
  File "C:\Python25\lib\site-packages\numpy\f2py\f2py2e.py", line 339,
in run_main
  File "C:\Python25\lib\site-packages\numpy\f2py\f2py2e.py", line 241,
in scaninputline


I appears that the system has prematurely exited from execution.  Any


This e-mail transmission contains information that is confidential and may be 
privileged. It is intended only for the addressee(s) named above. If you receive 
this e-mail in error, please do not read, copy or disseminate it in any manner. 
If you are not the intended recipient, any disclosure, copying, distribution or 
use of the contents of this information is prohibited. Please reply to the 
message immediately by informing the sender that the message was misdirected. 
After replying, please erase it from your computer system. Your assistance in 
correcting this error is appreciated.

More information about the Numpy-discussion mailing list