Getting Started

This guide takes you from a fresh clone to your first working Python extension built from Fortran code.

Start with GNU (gfortran and gcc), tested on Linux and macOS. LLVM Flang is tested on both platforms; Intel IFX is tested on Linux. See Installation for every compiler option.


Beginner Path

Follow these pages in order:

  1. Installation — Install prik and the required native compilers.
  2. Verification — Check the package, headers, and compiler.
  3. Your First Function — Wrap a simple scalar Fortran function.
  4. Your First Module — Work with Fortran modules and saved state.
  5. Development Workflow — Learn the edit → review → build → test loop.

What You Will Build

In Your First Function, you will create scale.f90, build it as a Python extension named scale, and call its scale function:

import numpy as np

import scale

result = scale.scale(np.float64(3.0), np.float64(2.5))
print(result)        # 7.5

The first example exposes a standalone Fortran function directly on the extension. Later guides show how Fortran modules become Python namespaces and derived types become Python classes.


Next

Ready? Start with Installation.