My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
FAQ2ed  
Frequently asked questions about f2py (numpy.f2py, f2py2e)
Featured
Updated Dec 3, 2011 by pearu.peterson

Usage of extension modules

Multiple copies of extension module

Problem: Wrapping of Fortran codes that use global data such as common blocks or module data, cannot be used recursively from Python because the global data is shared by the wrapped routines.

This problem has few solutions:

  1. For the same Fortran code, create extension modules with different names. See f2py-ml/2289 for an example. The problem with this approach is that the depth of recursion is limited with the number of extension modules.
  2. Prior the subsequent import of an extension module, copy its file to unique location and import it from there. See f2py-ml/921, f2py-ml/2290 that also provide the import code. Recommended solution.


Sign in to add a comment
Powered by Google Project Hosting