Latest f2py(version 1.26) fails to write singature file of api

THE f2py command subprocess, of function “compile_api_f2py” in module “compilation.compil_tools”, exits with an error, which is caused by an AssertionError at function “markoutercomma” in numpy module “f2py.crackfortran”.

It is found that f2py-1.24.3 will work well.

Specific error infor is:

Traceback (most recent call last):

File “/home/model/scripts/compile_telemac.py”, line 142, in

main()

File “/home/model/scripts/compile_telemac.py”, line 134, in main

compile_api_files(silent=not options.verbose,

File “/home/model/scripts/compilation/compil_tools.py”, line 1001, in compile_api_files

compile_api_f2py('api', api_dir, source_api, skip_source, ld_flags,

File “/home/model/scripts/compilation/compil_tools.py”, line 915, in compile_api_f2py

raise TelemacException(\

utils.exceptions.TelemacException: Error during first part of f2py for api 1

Traceback (most recent call last):

File “/usr/local/bin/f2py”, line 8, in

sys.exit(main())

         ^^^^^^

File “/usr/local/lib/python3.11/site-packages/numpy/f2py/f2py2e.py”, line 734, in main

run_main(sys.argv[1:])

File “/usr/local/lib/python3.11/site-packages/numpy/f2py/f2py2e.py”, line 462, in run_main

postlist = callcrackfortran(files, options)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File “/usr/local/lib/python3.11/site-packages/numpy/f2py/f2py2e.py”, line 363, in callcrackfortran

postlist = crackfortran.crackfortran(files)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File “/usr/local/lib/python3.11/site-packages/numpy/f2py/crackfortran.py”, line 3355, in crackfortran

readfortrancode(files, crackline)

File “/usr/local/lib/python3.11/site-packages/numpy/f2py/crackfortran.py”, line 552, in readfortrancode

dowithline(finalline)

File “/usr/local/lib/python3.11/site-packages/numpy/f2py/crackfortran.py”, line 858, in crackline

analyzeline(m, pat[1], line)

File “/usr/local/lib/python3.11/site-packages/numpy/f2py/crackfortran.py”, line 1300, in analyzeline

for e in markoutercomma(ll).split('@,@'):

         ^^^^^^^^^^^^^^^^^^

File “/usr/local/lib/python3.11/site-packages/numpy/f2py/crackfortran.py”, line 895, in markoutercomma

assert not f, repr((f, line, l))

AssertionError: (1, ’ pos_name = (‘, ’ pos_name = (’)

Hello,

The error has already been reported: https://opentelemac.org/index.php/kunena/telapy/14381-api-compilation-fails-with-numpy-1-24-0#43378

And regarding [name removed], while the API might compile with it, in fact the generated Python modules are bugged. We’re already working on a fix which should be available with the upcoming V8P5 version.

Thanks [name removed].

I’ve been running api, compiled by f2py-1.24.3, only calling t2d. It’s been working without problem, above CentOS 7.9.2009, both x86_64 and aarch64.

1 Like