-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: F2py creates bad wrapper functions when fortran code has nested procedures #20103
Comments
We find the same issue with a contained function for a similar example. |
Please also note that generating a signature file as given in the smart way does not have this problem. |
here is a minimal example that fails, and I am not sure why.
I find this peculiar because both
and
work. What am I missing here? BYW, the error message I get is
(only the first error is relevant) |
for completeness, I also add the pyf file it generates
|
that is really weird, because it doesn't fail if you use |
we create an intermediate pyf file from a build script. |
Your example works for me; |
@ShrirajHegde you have a typo here: However after fixing this, the issue of not being able to deal with the nested submodules is there. Full output
|
@melissawm OK, I include the full call from my script. Eventually it is supposed to link with an external library in the build framework, os there is a but extra fuzz. The good thing is that the framework prints out the calls to f2py it makes as well as what f2py returns.
the first call seems to be
and the second
(it appears not all the |
It looks like the Anyway, I think this is a different issue and should be discussed separately, can you please create a separate issue for this problem not involving the nested procedures if the error persists? Thanks. |
yes, the @melissawm You think that this issue I get is a different one than what started this thread? |
@2sn With this code:
I get the following pyf file:
Editing it to read
and compiling with
everything works fine. I see no nested subroutines or any other issues. Note that the problem here was the |
I think the issue I have is that the auto-generated f2py causes some issues with line continuation I do not understand. In development we continuously change the fortran file, so editing pyf by hand is not ideal. the example may be slightly atypical (was code written by a student doing this for the first time). |
Describe the issue:
A detailed description is at Stackoverflow, here
to summarize, a procedure like this
should produce a wrapper function like this
instead f2py produces a wrapper function like this (notice the nested procedures even in the interface)
The bad interface fails to compile. This happens every single time when there are nested procedures.
Reproduce the code example:
Error message:
NumPy/Python version information:
The text was updated successfully, but these errors were encountered: