Skip to content

Latest commit

 

History

History
152 lines (109 loc) · 3.75 KB

File metadata and controls

152 lines (109 loc) · 3.75 KB
title Installation
description Install PRIK from PyPI and choose a C or Fortran toolchain
audience users, contributors
prerequisites Python 3.10 or newer
related verification.md
status maintained
publication reviewed

Installation

Install PRIK from the Python Package Index with pip. A Fortran build requires a Fortran compiler and its matching C compiler. A C-only build requires a C compiler. Both paths need the standard Python extension build tools.


Supported Python Versions

PRIK requires Python 3.10 or newer. The project is regularly tested on Python 3.10, 3.11, and 3.12.

Check your Python version first:

python3 --version

Native Prerequisites

Every build needs NumPy, Python development headers, a linker, and a C compiler. The Fortran path also needs a Fortran compiler from the same toolchain family.

The recommended Fortran path uses:

  • gfortran (GNU Fortran compiler)
  • gcc (normally provided by build-essential)
  • python3-dev (Python development headers)
  • NumPy (includes required development files)
  • build-essential (linker and build tools)

On Ubuntu / Debian, install the C-only prerequisites with:

sudo apt-get update
sudo apt-get install build-essential python3-dev

Add GNU Fortran when wrapping Fortran code:

sudo apt-get install gfortran

On macOS, the Xcode command-line tools provide Clang for C-only builds:

xcode-select --install

Install GNU Fortran with Homebrew when wrapping Fortran code:

brew install gcc@13

Homebrew provides versioned commands such as gfortran-13 and gcc-13.

Compiler Toolchains

For C-only builds, cc is the default; pass --compiler gcc, clang, or another compatible executable when needed. Fortran builds use gfortran by default. Use --compiler to choose another Fortran option and install its matching C compiler from the table.

Fortran compiler Required C compiler Test status
gfortran gcc Default; tested on Linux and macOS
ifx icx Tested on Linux with version 2026.1.1
flang clang Tested on Linux and macOS with version 22.1.8
ifort icx Recognized; not routinely tested
nvfortran nvc Recognized; not yet tested
pgfortran pgcc Legacy option; not yet tested

The versions shown are the versions currently tested, not minimum requirements. For the best-tested experience, use GNU, IFX, or Flang.


User Installation

Create a virtual environment and install the published prik distribution:

python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install prik

This installs PRIK and its runtime dependencies, including NumPy. Verify both supported command entry points:

prik --version
prik --help
python3 -m prik --help

IPython and Jupyter support is optional. Install it when you want to use the %%fortran, %%c, and %%pyi cell magics:

python3 -m pip install "prik[jupyter]"

Contributor Installation

For an editable checkout with the QA tools, clone the repository first:

git clone https://github.com/PyNumLab/prik.git
cd prik
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install -e ".[qa]"

Platform Support

Platform Current status
Ubuntu Linux x86-64 Tested with GNU Fortran, Intel IFX, and LLVM Flang
Other Linux Expected to work; compiler coverage varies
macOS 15 on Apple Silicon Full suite with GNU Fortran 13; smoke tests with LLVM Flang
Windows Not yet supported

Next

  • Go to Verification to check the installation and your selected toolchain.