[petsc-users] How to use f2py on a PETSc/SLEPc-based fortran code
Lisandro Dalcin
dalcinl at gmail.com
Sat Mar 25 07:38:39 CDT 2017
On 22 March 2017 at 20:29, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
> Lisandro,
>
> We've had a couple questions similar to this with f2py; is there a way
> we could add to the PETSc/SLEPc makefile rules something to allow people to
> trivially use f2py without having to make their own (often incorrect)
> manual command lines?
>
> Thanks
>
>
Barry, it is quite hard and hacky to get f2py working in the general case.
I think the email from Gaetan in this thread proves my point.
IMHO, it is easier to write a small Fortran source exposing the API to call
using ISO_C_BINDINGS, then wrap that code with the more traditional C-based
"static" tools (SWIG, Cython) or even "dynamically" with ctypes or cffi
(which use dlopen'ing).
--
Lisandro Dalcin
============
Research Scientist
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
Extreme Computing Research Center (ECRC)
King Abdullah University of Science and Technology (KAUST)
http://ecrc.kaust.edu.sa/
4700 King Abdullah University of Science and Technology
al-Khawarizmi Bldg (Bldg 1), Office # 0109
Thuwal 23955-6900, Kingdom of Saudi Arabia
http://www.kaust.edu.sa
Office Phone: +966 12 808-0459
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170325/fcae9ecf/attachment.html>
More information about the petsc-users
mailing list