You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to compile a fix-form Fortran file with f2py. In the past I have had this working, but apparently some recent change has broken this? Or perhaps I'm doing something wrong.
I'm including a very simple test file on which it is also failing. I'm getting the same type of error on a much larger file. It seems to me like it doesn't like the fix-form spacing or something, but the file hasn't changed since I previously had it working with f2py.
Reproduce the code example:
Example Fortran File where I'm having the issue:
TEST.f
subroutinetest ()
implicit nonecharacter(8) name
name ='TEST'returnend
Then running:
f2py -h TEST.pyf TEST.f -m TEST --overwrite-signature --verbose
My actual program is an Abaqus UMAT, so it also only implements subroutines and no main.
Error message:
Reading fortran codes...
Reading file 'TEST.f' (format:fix,strict)
analyzeline: Creating module block 'TEST'
analyzeline: Creating additional interface block (groupcounter=2).
Line #7 in TEST.f:" name = 'TEST' "
crackline:3: No pattern for line
Line #8 in TEST.f:" return "
crackline:3: No pattern for line
Post-processing...
Block: TEST
Block: test
In: :TEST:TEST.f:test
buildimplicitrules: no implicit rules for routine 'test'.
In: :TEST:TEST.f:test
buildimplicitrules: no implicit rules for routine 'test'.
Applying post-processing hooks...
character_backward_compatibility_hook
Post-processing (stage 2)...
Saving signatures to file "./TEST.pyf"
Stopping. Edit the signature file and then run f2py on the signature file: f2py ./TEST.pyf
Python and NumPy Versions:
2.2.4
3.13.0 (main, Oct 16 2024, 03:23:02) [Clang 18.1.8 ]
I think it's very possible that I'm just formatting something incorrectly, but I need a second set of eyes to look at this. I have run into a similar issue before, but I was using non-standard Fortran extensions, and now I have fixed that issue, but this seems to persist.
Happy to include a longer traceback of what's failing with my actual script, but it's the same "crackline:3; No pattern for line"
TIA for any and all help!
The text was updated successfully, but these errors were encountered:
So, to update, I had something broken in my Fortran. This code had not changed since I'd last used f2py, but it also isn't working in the proprietary software (Abaqus), so I must have done something wrong.
Regardless, t he "crackline:3: No pattern for line" error is showing up, but I realize now that it's essentially just a warning for lines it can't match, i.e. bare returns or variable definitions. I would suggest that those be formatted different to make it clear that those are simply ignored for the .pyf generation, rather than an actual error, because that is what confused me, but clearly it's not a real issue.
I won't close this myself, since that was a little unclear to me, but my issue has been managed!
Uh oh!
There was an error while loading. Please reload this page.
Describe the issue:
I'm trying to compile a fix-form Fortran file with f2py. In the past I have had this working, but apparently some recent change has broken this? Or perhaps I'm doing something wrong.
I'm including a very simple test file on which it is also failing. I'm getting the same type of error on a much larger file. It seems to me like it doesn't like the fix-form spacing or something, but the file hasn't changed since I previously had it working with f2py.
Reproduce the code example:
Example Fortran File where I'm having the issue:
TEST.f
Then running:
My actual program is an Abaqus UMAT, so it also only implements subroutines and no main.
Error message:
Python and NumPy Versions:
2.2.4
3.13.0 (main, Oct 16 2024, 03:23:02) [Clang 18.1.8 ]
Runtime Environment:
[{'numpy_version': '2.2.4',
'python': '3.13.0 (main, Oct 16 2024, 03:23:02) [Clang 18.1.8 ]',
'uname': uname_result(system='Linux', node='clarklaptop', release='6.14.2-arch1-1', version='#1 SMP PREEMPT_DYNAMIC Thu, 10 Apr 2025 18:43:59 +0000', 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']}},
{'architecture': 'SkylakeX',
'filepath': '/home/clark/Research/SinglePointSimulator/.venv/lib/python3.13/site-packages/numpy.libs/libscipy_openblas64_-6bb31eeb.so',
'internal_api': 'openblas',
'num_threads': 16,
'prefix': 'libscipy_openblas',
'threading_layer': 'pthreads',
'user_api': 'blas',
'version': '0.3.28'}]
Context for the issue:
I think it's very possible that I'm just formatting something incorrectly, but I need a second set of eyes to look at this. I have run into a similar issue before, but I was using non-standard Fortran extensions, and now I have fixed that issue, but this seems to persist.
Happy to include a longer traceback of what's failing with my actual script, but it's the same "crackline:3; No pattern for line"
TIA for any and all help!
The text was updated successfully, but these errors were encountered: