- --build flag: One-step wrap and build for extension modules. Use
f90wrap --build -m module source.f90. Automatically uses Direct-C mode. For f2py or complex builds, continue using Makefiles. - Direct-C mode: Alternative to f2py for generating Python extension modules. Use
--direct-cflag to generate C code that directly calls f90wrap Fortran helpers via the Python C API, eliminating the f2py dependency.
- More reliable cleanup: Switched from
__del__toweakref.finalizefor derived type destructors. This fixes cleanup in reference cycles, improves thread-safety, and provides deterministic finalization order. Recommended Python best practice since 3.4.
f90wrap/build.py: Build orchestration module with clean API for both CLI and programmatic usef90wrap/setuptools_ext.py: Setuptools integration with F90WrapExtension and build_ext_cmdclassf90wrap/directc.py: ISO C interoperability analysis and procedure classificationf90wrap/directc_cgen/: C code generator package for Python C API wrappersf90wrap/numpy_utils.py: NumPy C API type mapping utilitiesf90wrap/runtime.py: Runtime support for Direct-C array handling- CLI:
--buildand--clean-buildflags for automated compilation - CLI:
--direct-cflag generates_module.cfiles alongside standard Fortran wrappers
- Respects standard environment variables:
FC,F90,CC,FFLAGS,CFLAGS,LDFLAGS,F2PY,F2PY_F90WRAP - Auto-detects Python and NumPy include paths (overridable via
PYTHON_INCLUDES,NUMPY_INCLUDES) - Platform-specific defaults (Darwin bundle vs Linux shared library)
- Compiles f90wrap-generated wrappers and links with specified source files
- Programmatic API for Python package builds (pyproject.toml/setup.py integration)
- For complex builds with external libraries, continue using Makefiles or build systems
- Generates standalone C extension modules using Python C API
- All procedures call existing
f90wrap_<module>__<proc>Fortran helpers - Works with
--buildflag for one-step generation and compilation - Normal f2py workflow unchanged when
--direct-cnot specified - See README.md for complete usage instructions