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
Installation Methods
- Conda (Recommended)
- Custom Conda
- From PyPI
- From Source
Full-Stack Conda Installation
This is the easiest and recommended method for laptops, workstations, and many cluster environments.Install Conda
If you don’t have conda installed, we recommend miniforge:
Configure for Apple Silicon (Mac Only)
Apple Silicon users only: There are currently upstream issues preventing native arm64 support. Use Rosetta emulation:
Disable Threading (Strongly Recommended)
Configure the environment to disable threading for optimal performance:
Verification
After installation, verify that Dedalus is working correctly:Environment Configuration
Performance Settings
For optimal performance, always disable threading:.bashrc / .bash_profile
Finding Library Paths
If you need to set MPI_PATH or FFTW_PATH:Updating Dedalus
Conda Installation
If installed via conda, update using:Pip Installation
If installed via pip from source:Local Repository
If installed from a cloned repository:Common Installation Issues
MPI compiler not found
MPI compiler not found
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
FFTW libraries not found
FFTW libraries not found
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
Slow performance
Slow performance
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
Import errors
Import errors
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
Apple Silicon issues
Apple Silicon issues
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:Next Steps
Quick Start Tutorial
Run your first Dedalus simulation
Back to Introduction
Learn more about Dedalus capabilities