Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DedalusProject/dedalus_conda/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Theconda_install_dedalus2.sh script automates the installation of Dedalus v2, a spectral PDE solver framework, using conda package management. The script creates an isolated conda environment with all necessary dependencies including MPI, FFTW, HDF5, and scientific Python libraries.
What It Does
The script performs the following operations:- Validates that the conda base environment is active
- Checks configuration requirements (custom library paths if not using conda packages)
- Creates or updates a conda environment (default:
dedalus2) - Configures conda-forge as the primary package channel
- Installs Python and build tools (pip, wheel, setuptools, cython)
- Installs BLAS libraries (OpenBLAS or MKL) with numpy and scipy
- Installs MPI implementation (OpenMPI from conda or custom)
- Installs FFTW library (from conda or custom)
- Installs HDF5 and h5py (with parallel support if using MPI)
- Installs additional dependencies (docopt, matplotlib)
- Installs Dedalus v2 from PyPI via pip
- Configures threading environment variables
Prerequisites
Install Conda
Install Miniconda or Anaconda distribution. Download from:
Usage
Basic Installation
For a standard installation with all dependencies from conda:Custom Configuration
Edit the script before running to customize the installation:Configuration Options
See the Script Options page for detailed documentation of all configurable parameters.Key Options Summary
- CONDA_ENV: Name of the conda environment (default:
dedalus2) - INSTALL_MPI: Install OpenMPI from conda (1) or use custom (0)
- INSTALL_FFTW: Install FFTW from conda (1) or use custom (0)
- INSTALL_HDF5: Install HDF5 from conda (1) or use custom (0)
- BLAS: BLAS library choice:
openblasormkl - PYTHON_VERSION: Python version to install (default:
3.12) - APPLE_SILICON_BUILD_ARM: Native arm64 on Apple Silicon (default: 0)
Platform-Specific Behavior
Apple Silicon (M1/M2/M3)
By default, the script installs x86_64 packages via Rosetta 2 emulation on Apple Silicon Macs:Native arm64 builds may exhibit numerical errors with certain OpenBLAS versions. The script automatically pins
libopenblas<0.3.20 when using arm64 builds to avoid known issues with the ggev function.Linux
On Linux systems, the script uses the native architecture (typicallylinux-64).
Installation Flow
Environment Setup
The script sources conda configuration and sets Python environment variables:
PYTHONNOUSERSITE=1: Prevents conda from looking in~/.local- Unsets
PYTHONPATH: Ensures clean environment
Environment Creation
Creates a new conda environment or warns if it already exists. On Apple Silicon with
APPLE_SILICON_BUILD_ARM=0, sets the environment to use osx-64 packages.Channel Configuration
Adds conda-forge as a channel and sets strict channel priority to ensure consistent package sources.
BLAS and Scientific Python
Installs either OpenBLAS or MKL along with numpy and scipy. Sets
FFTW_STATIC based on BLAS choice:- OpenBLAS: Dynamic FFTW linking
- MKL: Static FFTW linking to avoid symbol conflicts
MPI Installation
If
INSTALL_MPI=1: Installs conda-forge compilers, OpenMPI, and mpi4py.If INSTALL_MPI=0: Adds custom MPI to PATH and installs mpi4py via pip.FFTW Installation
If
INSTALL_FFTW=1: Installs FFTW from conda-forge with OpenMPI support.If INSTALL_FFTW=0: Uses custom FFTW specified in FFTW_PATH.HDF5 Installation
If
INSTALL_HDF5=1: Installs HDF5 and h5py from conda-forge. Uses parallel versions if MPI is installed from conda.If INSTALL_HDF5=0: Installs h5py via pip, building against custom HDF5. Sets CC=mpicc for parallel builds.Environment Variables Set
The script configures the following environment variables in the conda environment:OpenMP thread count. Set to 1 to disable threading by default.
NumExpr maximum thread count. Set to 1 to disable threading by default.
Prevents Python from adding user site-packages to sys.path during installation.
Controls FFTW linking mode:
0: Dynamic linking (with OpenBLAS)1: Static linking (with MKL to avoid symbol conflicts)
Activating the Environment
After installation completes:Troubleshooting
Environment Already Exists
If the conda environment already exists, the script will prompt:y to continue installation into the existing environment, or n to abort.
Custom Library Path Errors
If using custom MPI, FFTW, or HDF5 installations:Base Environment Not Active
conda activate base before executing the script.
Differences from Dedalus v3 Script
The main difference between v2 and v3 scripts is the Dedalus installation source:- v2 script: Installs
dedalus==2.*from PyPI - v3 script: Installs from the development branch on GitHub