Skip to main content

Overview

Dedalus is a Python 3 package with custom C-extensions (compiled with Cython) that relies on MPI, FFTW, HDF5, and a scientific Python stack. This guide covers multiple installation methods to suit different environments.
The conda installation is recommended for most users, especially on laptops and workstations. For HPC clusters, you may want to link against existing optimized MPI/FFTW libraries.

System Requirements

Python Requirements

  • Python: 3.9 or later
  • Required packages:
    • numpy >= 1.20.0
    • scipy >= 1.4.0
    • mpi4py >= 2.0.0
    • h5py >= 3.0.0
    • matplotlib >= 3.7.0
    • cython, numexpr, docopt, pytest

C Library Dependencies

  • MPI: Any MPI implementation (OpenMPI, MPICH, Intel MPI, etc.)
  • FFTW3: Fast Fourier Transform library with MPI support
  • HDF5: Hierarchical Data Format library
  • BLAS/LAPACK: For linear algebra operations
For optimal performance, you must disable threading by setting OMP_NUM_THREADS=1 before running Dedalus. This prevents thread conflicts and can improve performance by orders of magnitude.

Installation Methods

Verification

After installation, verify that Dedalus is working correctly:
# Run the full test suite
python3 -m dedalus test

Environment Configuration

Performance Settings

For optimal performance, always disable threading:
.bashrc / .bash_profile
# Add to your shell configuration file
export OMP_NUM_THREADS=1
export NUMEXPR_MAX_THREADS=1

Finding Library Paths

If you need to set MPI_PATH or FFTW_PATH:
# Locate MPI installation
which mpicc
# MPI_PATH is typically the parent of bin/mpicc

Updating Dedalus

Conda Installation

If installed via conda, update using:
conda activate dedalus3
conda update -c conda-forge dedalus

Pip Installation

If installed via pip from source:
# Set library paths if needed
export MPI_PATH=/path/to/mpi
export FFTW_PATH=/path/to/fftw

# Update from GitHub
CC=mpicc pip3 install --upgrade --force-reinstall --no-deps --no-cache \
  --no-build-isolation http://github.com/dedalusproject/dedalus/zipball/master/

Local Repository

If installed from a cloned repository:
cd /path/to/dedalus/repo
git pull
CC=mpicc pip3 install --upgrade --force-reinstall --no-deps \
  --no-cache --no-build-isolation .

Common Installation Issues

Problem: CC=mpicc fails with “command not found”Solution:
  • Ensure MPI is installed: which mpicc
  • Load MPI module on clusters: module load openmpi
  • Install MPI via conda: conda install -c conda-forge openmpi
Problem: Build fails with “cannot find -lfftw3”Solution:
  • Set FFTW_PATH: export FFTW_PATH=/path/to/fftw
  • Install FFTW: conda install -c conda-forge fftw
  • Check library location: locate libfftw3.so
Problem: Dedalus runs much slower than expectedSolution:
  • Check threading: echo $OMP_NUM_THREADS (should be 1)
  • Disable threading: export OMP_NUM_THREADS=1
  • Verify MPI is actually being used: mpiexec -n 2 python3 script.py
Problem: ImportError: cannot import name ...Solution:
  • Verify Python version: python3 --version (need 3.9+)
  • Check package versions: pip3 list | grep -E 'numpy|scipy|mpi4py|h5py'
  • Reinstall with proper isolation flags
Problem: Crashes or errors on M1/M2 MacsSolution:
  • Use x86 architecture: conda config --env --set subdir osx-64
  • Install Rosetta 2 if not already installed
  • Recreate the environment with the correct architecture

Uninstalling

To remove Dedalus:
# Remove the package
pip3 uninstall dedalus

# Or remove entire conda environment
conda env remove -n dedalus3

Next Steps

Quick Start Tutorial

Run your first Dedalus simulation

Back to Introduction

Learn more about Dedalus capabilities

Build docs developers (and LLMs) love