Install Lfortran

Lfortran is a unique Fortran compiler in that it is:

  • Interactive (or compiles as usual from command line)
  • works with Jupyter notebook
  • targets modern Fortran
  • loads module files from other compilers

Quite a unique feature set, but still quite experimental.

This method is for installing Lfortran from the Git repo in Linux / Windows Subsystem for Linux. It assumes Anaconda / Miniconda Python.

Install Java JRE

apt install default-java

Install Antler

mkdir ~/ext
cd ~/ext

curl -O

Setup Python for Lfortran

conda create -n lfortran python=3.7 pytest llvmlite prompt_toolkit
conda activate lfortran
pip install antlr4-python3-runtime

Add Antler to path:

export CLASSPATH="$HOME/ext/antlr-4.7.2-complete.jar:$CLASSPATH"

Clone Lfortran repo

cd ~
git clone
cd lfortran

Complete Lfortran install


Run the selftest