[Numpy-discussion] f2py and type construct

lorenzo bolla lbolla@gmail....
Mon Jun 18 02:18:24 CDT 2007


hi all.
I'm trying to compile an F90 source file with f2py, but it fails with the
construct "type ... end type".
here is an example:

--------------------
! file test19.f90
module
basic
  implicit
none


save
  integer, parameter :: ciao =
17

end module
basic



module
basic2
  implicit
none


save
  type
test_t

     integer ::
x

  end type
test_t
  type(test_t) ::
ciao

end module
basic2

----------------------

$>f2py -c test19.f90 -m test --fcompiler=intele --compiler=intel
(I'm compiling on an SGI Altix)

and this is the error message:

----------------------
running build
running config_fc
running build_src
building extension "test" sources
f2py options: []
f2py:> /tmp/tmprBrnf7/src.linux-ia64-2.5/testmodule.c
creating /tmp/tmprBrnf7
creating /tmp/tmprBrnf7/src.linux- ia64-2.5
Reading fortran codes...
        Reading file 'test19.f90' (format:free)
Post-processing...
        Block: test
                        Block: basic
                        Block: basic2
                                Block: test_t
Post-processing (stage 2)...
        Block: test
                Block: unknown_interface
                        Block: basic
                        Block: basic2
                                Block: test_t
Building modules...
        Building module "test"...
                Constructing F90 module support for "basic"...
                  Variables: ciao
                Constructing F90 module support for "basic2"...
                  Variables: ciao
getctype: No C-type found in "{'typespec': 'type', 'typename': 'test_t'}",
assuming void.
Traceback (most recent call last):
  File "/xlv1/labsoi_devices/bollalo001/bin/f2py", line 26, in <module>
    main()
  File "/xlv1/labsoi_devices/bollalo001/lib/python2.5/site-packages/numpy/f2py/f2py2e.py",
line 552, in main
    run_compile()
  File "/xlv1/labsoi_devices/bollalo001/lib/python2.5/site-packages/numpy/f2py/f2py2e.py",
line 539, in run_compile
    setup(ext_modules = [ext])
  File "/xlv1/labsoi_devices/bollalo001/lib/python2.5/site-packages/numpy/distutils/core.py",
line 174, in setup
    return old_setup(**new_attr)
  File "/xlv1/labsoi_devices/bollalo001/lib/python2.5/distutils/core.py",
line 151, in setup
    dist.run_commands()
  File "/xlv1/labsoi_devices/bollalo001/lib/python2.5/distutils/dist.py",
line 974, in run_commands
    self.run_command(cmd)
  File "/xlv1/labsoi_devices/bollalo001/lib/python2.5/distutils/dist.py",
line 994, in run_command
    cmd_obj.run()
  File
"/xlv1/labsoi_devices/bollalo001/lib/python2.5/distutils/command/build.py",
line 112, in run
    self.run_command(cmd_name)
  File "/xlv1/labsoi_devices/bollalo001/lib/python2.5/distutils/cmd.py",
line 333, in run_command
    self.distribution.run_command(command)
  File "/xlv1/labsoi_devices/bollalo001/lib/python2.5/distutils/dist.py",
line 994, in run_command
    cmd_obj.run()
[...]
KeyError: 'void'
Exit 1
------------------------------------

module basic gives no problems, but module basic2 yes, because of the type
construct.
it seems that f2py doesn't support "type" construct. am I right? is there a
workaround?
thank you very much,
lorenzo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070618/5905704a/attachment-0001.html 


More information about the Numpy-discussion mailing list