I have successfully (e.g. it compiled into a Python module, that can
be imported) my fortran code.
However, I had to comment out the fortran module stuff and only keep
the subroutines as they are.
Is there any way to support compiling fortran modules? I saw some
tests for that in tests/todo. :)
Ondrej
The 0.1 release focused on getting top-level (non-module) functions &
subroutines wrapped, which covers a large portion of F77-style code.
The 0.2 release has planned support for 'use' statements and basic
module wrappers. There's always a competition for resources between
supporting the new F90-stuff and the legacy F77 stuff.
There is some significant work to be done in the parser to get module
support working correctly, which is why there isn't more mod support
right now.
Kurt
>
> --
> Regards Tony Hallam 19 Hefferan St Fairfield 4103 0407394671
>
> --
> You received this message because you are subscribed to the Google Groups
> "Fwrap Users" group.
> To post to this group, send email to fwrap...@googlegroups.com.
> To unsubscribe from this group, send email to
> fwrap-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/fwrap-users?hl=en.
>
Thanks for the link, I was not aware of this project.
I would use Cython to wrapp the C++ classes (I don't use swig
anymore...), but otherwise it would be useful.
Ondrej
Do you have an idea of the quality and completeness of the Fortran
parser used by fortwrap?
Dag Sverre
Well, I am actually the author and as of now sole maintainer. I just
put FortWrap on SourceForge last month, but have been using a
specialized version of it internally for about a year.
Unlike Fwrap, FortWrap doesn't use a general purpose Fortran parser --
basically I just wrote the parser myself and have been adapting it as
new cases have come up. As far as I know, it should be able to handle
most F90-F03 constructs and at least print errors/warnings for
constructs that it doesn't wrap. I have run it through most of the
Fwrap test cases, and while not all of those features are supported by
the wrapper generation (e.g. assumed shape arrays), it at least
doesn't crash and writes error messages where appropriate.
One construct it doesn't yet handle is a declaration like "integer x"
(i.e. no "::"), but hopefully I will get that added soon.
Overall, I haven't gotten any feedback on it yet, as it's pretty new,
so if someone wanted to run some code through it and see how it works
that would be appreciated. I'm more than happy to take my best stab
at fixing any bugs or making any enhancements needed to make it more
useful (assuming they're not too inconsistent with FortWrap's
objective, which is wrapping modern code).
John
Hi,
If you are comfortable using Swig, you may want to check out FortWrap:
http://fortwrap.sourceforge.net/. It will wrap module procedures (and
also derived types) as C++ classes. If you want to create a Python
module, you would then need to use Swig to wrap the C++ header files
that it generates (although this is usually pretty easy). Make sure
to take a look at the list of unsupported features though: FortWrap
doesn't currently (maybe in the near future) wrap assumed shape
arrays, and it only has very limited support for KIND= specifiers
right now.
John
Dag Sverre