Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

BUG: f2py fails to compile modules with derived types after changes in 2.2.0 #29037

Open
Labels
@zoghbi-a

Description

@zoghbi-a

Describe the issue:

Prior to changes in 2.2.0, the following works:

python -m numpy.f2py -m mod1 dummy.f90

withdummy.f90 having:

module mod1implicit none     type:: master_datainteger:: idat    end type master_data    type(master_data):: masterdataend module mod1subroutinesimple_subroutine(arg)  use mod1integer,intent(inout):: arg  arg= arg*5endsubroutine simple_subroutine

It worked before 2.2.0, since the module is in ause statement, it is skipped.

Withchanges in 2.2.0, only modules with acommon block are skipped, and this case is not. Running the above fails when trying to interpret the derived typemaster_data with the error below:

Reproduce the code example:

python-mnumpy.f2py-mmod1dummy.f90

Error message:

getctype: No C-type foundin"{'typespec': 'type', 'typename': 'master_data'}", assuming void.Traceback (most recent call last):  File"{path}/bin/f2py", line 8,in<module>sys.exit(main())             ^^^^^^File"{path}/lib/python3.12/site-packages/numpy/f2py/f2py2e.py", line 783,in main    run_main(sys.argv[1:])  File"{{path}}/lib/python3.12/site-packages/numpy/f2py/f2py2e.py", line 507,in run_main    ret = buildmodules(postlist)          ^^^^^^^^^^^^^^^^^^^^^^  File"{{path}}/lib/python3.12/site-packages/numpy/f2py/f2py2e.py", line 412,in buildmodules    dict_append(ret[name], rules.buildmodule(module, um))                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"{{path}}/lib/python3.12/site-packages/numpy/f2py/rules.py", line 1317,in buildmodule    mr, wrap = f90mod_rules.buildhooks(m)               ^^^^^^^^^^^^^^^^^^^^^^^^^^  File"{{path}}/lib/python3.12/site-packages/numpy/f2py/f90mod_rules.py", line 149,in buildhooks    at = capi_maps.c2capi_map[ct]~~~~~~~~~~~~~~~~~~~~^^^^KeyError:'void'

Python and NumPy Versions:

2.2.0 (and above)
3.12.10 | packaged by conda-forge | (main, Apr 10 2025, 22:21:13) [GCC 13.3.0]

Runtime Environment:

[{'numpy_version': '2.2.0',
'python': '3.12.10 | packaged by conda-forge | (main, Apr 10 2025, 22:21:13) '
'[GCC 13.3.0]',
'uname': uname_result(system='Linux', node='gs66', release='5.15.0-303.171.5.2.1.el8uek.x86_64', version='#2 SMP Mon Dec 23 14:37:50 PST 2024', machine='x86_64')},
{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
'found': ['SSSE3',
'SSE41',
'POPCNT',
'SSE42',
'AVX',
'F16C',
'FMA3',
'AVX2',
'AVX512F',
'AVX512CD',
'AVX512_SKX',
'AVX512_CLX',
'AVX512_CNL',
'AVX512_ICL'],
'not_found': ['AVX512_KNL', 'AVX512_KNM']}}]

Context for the issue:

Changes to f2py in 2.2.0 broke code that used to compile before

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp