[Numpy-discussion] f2py and type construct

lorenzo bolla lbolla@gmail....
Mon Jun 11 07:11:12 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()
  File
"/xlv1/labsoi_devices/bollalo001/lib/python2.5/site-packages/numpy/distutils/command/build_src.py",
line 87, in run
    self.build_sources()
  File
"/xlv1/labsoi_devices/bollalo001/lib/python2.5/site-packages/numpy/distutils/command/build_src.py",
line 106, in build_sources
    self.build_extension_sources(ext)
  File
"/xlv1/labsoi_devices/bollalo001/lib/python2.5/site-packages/numpy/distutils/command/build_src.py",
line 218, in build_extension_sources
    sources = self.f2py_sources(sources, ext)
  File
"/xlv1/labsoi_devices/bollalo001/lib/python2.5/site-packages/numpy/distutils/command/build_src.py",
line 471, in f2py_sources
    ['-m',ext_name]+f_sources)
  File
"/xlv1/labsoi_devices/bollalo001/lib/python2.5/site-packages/numpy/f2py/f2py2e.py",
line 362, in run_main
    ret=buildmodules(postlist)
  File
"/xlv1/labsoi_devices/bollalo001/lib/python2.5/site-packages/numpy/f2py/f2py2e.py",
line 314, in buildmodules
    dict_append(ret[mnames[i]],rules.buildmodule(modules[i],um))
  File
"/xlv1/labsoi_devices/bollalo001/lib/python2.5/site-packages/numpy/f2py/rules.py",
line 1130, in buildmodule
    mr,wrap = f90mod_rules.buildhooks(m)
  File
"/xlv1/labsoi_devices/bollalo001/lib/python2.5/site-packages/numpy/f2py/f90mod_rules.py",
line 127, in buildhooks
    at = capi_maps.c2capi_map[ct]
KeyError: 'void'
Exit 1
------------------------------------

module basic gives no problems, but module basic2 yes, because of the type
construct.
what am I doing wrong?
thank you very much,
lorenzo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070611/531783a9/attachment-0001.html 


More information about the Numpy-discussion mailing list