Installation#

Prerequisites for installation#

To install line racer, you need the following:

  • Python 3.11+,

  • a Fortran compiler, for example gfortran,

  • a C compiler, for example gcc.

Linux#

On Linux, install Python, the Fortran and the C compiler with:

sudo apt-get install python python-pip gfortran gcc

On some distributions, python may need to be replaced with python3.

Note

A general Python recommendation is to use a Python virtual environment such as venv, conda, conda-forge or pixi to prevent potential conflicts.

Mac OS#

Important

On Mac, it is highly recommended to use a Python virtual environment such as venv, conda, conda-forge or pixi to prevent potential conflicts.

If you decide to use a virtual environment, run the following commands first to create and activate it. For conda run:

conda create -n line_racer_env python=3.11

And to activate it:

conda activate line_racer_env

For venv run:

python3 -m venv line_racer_env

And to activate it :

source line_racer_env/bin/activate

Using gfortran disk images#

Warning

While using homebrew is the preferred method for installing external libraries on Mac, alternative methods exist. Use them at your own risk.

François-Xavier Coudert’s github repository provides gfortran disk images (.dmg) with which you can install gfortran like any other program for Mac, through an installation wizard. Both Apple Silicon (M1, M2, M3) and Intel chip versions are available.

Windows#

Important

None of the line racer developers are Windows users themselves. While the instructions below should work, we can likely not help too much if you run into issues. If you spot something problematic below and fix it for yourself, we appreciate a merge request for an updated version of the docs.

Native installation prerequisites#

  1. Get a Fortran compiler through, for example, MSYS2 or Visual Studio.

  2. Go to the Python website, then download and execute the Python installer.

WSL-native dual installation#

Line racer can be installed both on the Windows and WSL sides. Files on WSL can be accessed from the Windows side using the path \\wsl.localhost\, and files on Windows can be accessed from the WSL side using /mnt (e.g., to get into “C:\Users” from WSL: cd /mnt/c/Users). Note however than accessing files across sides is slow.

Pre-installation packages#

Before starting the installation of line racer, make sure to install the following Python packages with the following command. If you decided to use a virtual environment, make sure it is activated before running the command.

pip install numpy meson-python ninja

On some distributions, pip may need to be replaced with pip3.

line racer Installation#

Installation from PyPI (using pip)#

To install line racer via pip install just type

pip install line-racer --no-build-isolation

Be sure to add the --no-build-isolation flag and activate your virtual environment beforehand if you are using one.

Installation from Gitlab#

Download line racer from Gitlab, or clone it from GitLab via

git clone https://gitlab.com/David_Haegele/line_racer.git
  • In the terminal, enter the line_racer folder

  • Type the following in the terminal pip install .  --no-build-isolation, and press Enter.

Testing the installation#

Open a new terminal window. Then open python and type:

import line_racer.line_racer as lr
lr.LineRacer.check_installation()