Installation guide
This page is a guide for installing and executing FEW tests on most platforms and some clusters available to members of the user community.
Important
Last updated in July 2025, after the release of FastEMRIWaveforms v2.0.0 and the
publication of a conda package on conda-forge.
If you read this page at a significantly latter date, note that these instructions might be outdated.
How to use this installation guide
To quickly find the right installation instructions for your needs, follow these steps:
Identify your user type:
If you want to modify the source code, follow the from source installation instructions.
If you just want to use the package, follow the pip or conda installation instructions.
Select your platform:
Linux (including Ubuntu and most clusters)
Mac OS
Windows
HPC/Cluster (e.g., CNES, CC-IN2P3)
Decide if you need GPU support:
Look for instructions mentioning CUDA or GPU backends if you require GPU acceleration.
Otherwise, follow the standard CPU installation steps.
Choose your environment manager:
Use the conda instructions if you prefer conda/mamba/micromamba.
Use the pip instructions if you prefer pip/venv.
Jupyter Hub integration:
If you need to use FEW in Jupyter Hub on a cluster, refer to the dedicated Jupyter Hub section in the relevant cluster instructions.
Quick navigation table:
User Type / Platform |
Linux / Cluster |
Mac OS |
Windows |
CNES Cluster |
CC-IN2P3 Cluster |
|---|---|---|---|---|---|
Install via pip (user) |
Not available |
||||
Install via conda (user) |
|||||
From source (developer) |
|||||
GPU support |
Not available |
Not available |
|||
Jupyter Hub |
N/A |
N/A |
N/A |
Tip
Use the navigation table above to jump to the section that matches your needs. Each section provides both package and from-source installation instructions, as well as notes on GPU support and Jupyter Hub integration where relevant.
Generic installation instructions
Using pip
You may install FEW in your environment with
pip install fastemriwaveforms
If NVIDIA GPUs are available in your environment, you may install the GPU backend with
pip install fastemriwaveforms-cuda12x # For CUDA 12.x support
# or
pip install fastemriwaveforms-cuda11x # For CUDA 11.x support
Attention
Be sure to select the right version of the package according to your CUDA driver
version. Use nvidia-smi to check the version of your CUDA driver. Nothing will
happen if you install the wrong version, but you will not be able to use the GPU
backend.
Using conda
When possible, we recommend using a conda distribution which defaults to the
conda-forge channel, like mamba or micromamba.
Important
In following instructions,
you can replace mamba create by conda create -c conda-forge --override-channels
if you only have the base conda distribution available.
To install the CPU version of FEW in a new conda environment, run:
mamba create -n few_env python=3.12 fastemriwaveforms # You may use any python version >=3.10,<3.14
If your environment supports CUDA 12.x, you can install the GPU version with:
mamba create -n few_env python=3.12 fastemriwaveforms-cuda12x
Caution
There is no CUDA 11.x support for conda-based installations.
From source
To install FEW from source in any environment, follow these steps:
Clone the repository:
git clone https://github.com/BlackHolePerturbationToolkit/FastEMRIWaveforms.git
cd FastEMRIWaveforms
(Optional) Checkout a specific release:
git checkout v2.0.0
Create and activate a specific environment:
If you use
conda, create a new environment namedfew_envwith the required compilers and libraries:conda create -n few_env python=3.12 cxx-compiler pkgconfig conda-forge/label/lapack_rc::liblapacke conda activate few_env
If you prefer
virtualenv, create a virtual environment, your environment will need a C++ compiler, and either a Fortran compiler orliblapackelibrary:python3 -m venv few_env source few_env/bin/activate
Install FEW in editable mode:
pip install -e '.[testing]'
To enable GPU support (if available), add the CMake option and install manually the required GPU dependencies:
pip install -e '.[testing]' --config-settings=cmake.define.FEW_WITH_GPU=ON pip install cupy-cuda12x 'nvidia-cuda-runtime-cu12==12.4.*' # Replace 12.4 by the CUDA driver version returned by nvidia-smi, keep the '.*' at the end
Many options can be passed to the
pip installcommand, see below for more details.
(Optional) For advanced debugging, in case of compilation errors, add:
pip install -e . -v -Cbuild.verbose=true -Clogging.level=INFO
This will build and install FEW from source, allowing you to modify the code and have changes reflected immediately in your environment.
Configure file storage
To configure where FEW stores its required data files, you need to create a configuration file specifying the storage directory. The location and content of this file depend on your operating system:
Linux:
~/.config/few.iniMac OS:
~/Library/Application Support/few.iniWindows:
%APPDATA%\few.ini
Example configuration for Linux:
[few]
file-storage-dir=/home/${USER}/few
file-extra-paths=/home/${USER}/few;/home/${USER}/few/download
See also
Available options and their descriptions can be found here.
Replace the paths as needed for your environment or storage preferences.
After creating the configuration file, you can pre-download all required files for testing with:
few_files fetch --tag testfile
This ensures all necessary files are available before running tests or using FEW.
Test FEW is working correctly
To verify your FEW installation, run the test suite provided with the package. This ensures that all dependencies are correctly installed and the code is functioning as expected.
Simply execute, in the environment where FEW is installed:
python3 -m few.tests
You should see output indicating the backend in use (e.g., cpu or cuda12x)
and a summary of the tests run. For example:
AAKWaveform test is running with backend 'cpu'
[...]
.......
----------------------------------------------------------------------
Ran 27 tests in 87.305s
OK
If you want to restrict FEW to use only the CPU backend, set the environment variable before running the tests:
FEW_ENABLED_BACKENDS="cpu" python -m few.tests
To force the use of the GPU backend (and thus fail the test if it is not available), set the environment variable accordingly:
FEW_ENABLED_BACKENDS="cpu;cuda12x" python -m few.tests
If any test fails, review the error messages for missing dependencies or configuration issues. Refer to the relevant installation section above for troubleshooting tips.
Platform-specific installation instructions
On Mac OS, from sources
The recommended way to install FastEMRIWaveforms on a Mac OSX workstation
from-sources is by using a conda environment to obtain the necessary
compilers and dependencies.
We recommend using the micromamba conda distribution which can be installed
using brew:
brew install micromamba
Then, create a new conda environment few_env with the required compilers and
a specific version of liblapacke:
micromamba create -n few_env python=3.12 cxx-compiler pkgconfig conda-forge/label/lapack_rc::liblapacke
Then activate this environment and proceed with the installation of FEW as described above.
On Windows
Attention
For now, only from-source and conda installations are supported on Windows. The PyPI package is not available for Windows users.
To install FEW from sources, ensure you have a recent Microsoft Visual Studio release installed locally. Tests were performed with Visual Studio 2022 Community Edition. Install the required dependencies in a new conda environment:
$ conda create -n few_env -c conda-forge --override-channels \
python=3.12 cxx-compiler pkgconfig conda-forge/label/lapack_rc::liblapacke
Then proceed with the installation of FEW as described above.
You may also directly install the package from conda with:
$ conda install -n few_env -c conda-forge --override-channels fastemriwaveforms
Attention
Only the CPU backend is available on Windows using conda packages. If you manage to compile the GPU backend using from-source install, please let us know so we can update this documentation.
On CNES cluster, with GPU and jupyter hub supports
To install FEW on the CNES cluster, you need to use a GPU node in an interactive
session. Following instructions assume you have access to the lisa project but
can be easily adapted to any other project you have access to.
First, log into the TREX cluster and request an interactive session on a GPU node:
# Here with the "lisa" project and a session of 1h
$ sinter -A lisa -p gpu_std -q gpu_all --gpus 1 --time=01:00:00 --pty bash
On the GPU node, load the conda module and create a new conda environment named few_env,
then activate it:
$ module load conda/24.3.0
$ conda create -n few_env -c conda-forge --override-channels python=3.12
$ conda activate few_env
Load the nvhpc modules access the CUDA compiler, as well as the cuda module:
(few_env) $ module load cuda/12.4.1
(few_env) $ module load nvhpc/22.9
Then follow the instructions for from-source installation as described above
but replace the pip install command with:
(few_env) $ CXX=g++ CC=gcc pip install -e '.[testing]' --config-settings=cmake.define.FEW_WITH_GPU=ON
Configure file storage
As explained previously, it is advised
to create a configuration file to specify where the files should be downloaded.
Use a high-volumetry storage space for that purpose,
like project shared-spaces on /work/
If you have access to the LISA project, you can for example use the following:
$ mkdir -p /work/LISA/${USER}/few_files
# Write FEW configuration into ~/.config/few.ini
$ cat << EOC > ~/.config/few.ini
[few]
file-storage-dir=/work/LISA/${USER}/few_files
EOC
Make the conda environment available as a Jupyter Hub kernel
After ensuring that few is working as expected, enable support for Jupyter Hub.
First install ipykernel and declare a new kernel named few_env:
(few_env) $ conda install ipykernel
(few_env) $ python -m ipykernel install --user --name few_env
Installed kernelspec few_env in ~/.local/share/jupyter/kernels/few_env
Next, create a python wrapper to preload the modules in the Python context:
(few_env) $ python_wrapper_path=$(dirname $(which python))/wpython
(few_env)$ cat << EOC > ${python_wrapper_path}
#!/bin/bash
# Load the necessary modules
module load cuda/12.4.1
module load nvhpc/22.9
# Run the python command
$(which python) \$@
EOC
$ chmod +x ${python_wrapper_path}
And change the kernel start command to use this wrapper: edit the file ~/.local/share/jupyter/kernels/few_env/kernel.json and
replace the first item in the argv field by replacing .../bin/python with .../bin/wpython.
Now, when connected to the CNES Jupyter Hub, you
should have access to the few_env kernel and FEW should work correctly in it.
On the CC-IN2P3 cluster with GPU support
First log into the CC-IN2P3 cluster and request an interactive session on a GPU node:
# Here a 2h session with 64GB of RAM
$ srun -p gpu_interactive -t 0-02:00 --mem 64G --gres=gpu:v100:1 --pty bash -i
All installation methods described above are available on the CC-IN2P3 cluster but need little adjustments.
For a conda installation, you can use the
anacondamodule available on the cluster. Load it and create a new environment namedfew_envwithfastemriwaveforms-cuda12x:$ module load Programming_Languages/anaconda/3.11 $ conda create -n few_env -c conda-forge --override-channels \ python=3.13 fastemriwaveforms-cuda12x $ conda activate few_env
From a pip installation, you can use the
Programming_Languages/python/3.12.2module available on the cluster. Load it and create a new virtual environment namedfew_env:$ module load Programming_Languages/python/3.12.2 $ python -m venv few_env $ source ./few_env/bin/activate $ pip install fastemriwaveforms-cuda12x
For a from-source installation, follow the instructions from above but first load the
nvhpcmodule to get access to the CUDA compilers and use the followingpip installcommand:# Create and activate a conda or venv environment named `few_env` (few_env) $ module load HPC_GPU/nvhpc/24.5 # Load the NVHPC module # ... Clone sources (few_env) $ CXX=g++ CC=gcc FC=gfortran pip install -e '.[testing]' \ --config-settings=cmake.define.FEW_WITH_GPU=ON \ --config-settings=cmake.define.FEW_LAPACKE_FETCH=ON
On this cluster, it is recommended to configure the file storage directory
to a large storage volume you have access to, such as /sps/lisaf/${USER}/few_files.
(you may use any large storage volume
you have access to).
You can do this by creating a configuration file in ~/.config/few.ini
as explained before:
(few_env) $ cat << EOC > ~/.config/few.ini
[few]
file-storage-dir=/sps/lisaf/${USER}/few_files
file-download-dir=/sps/lisaf/${USER}/few_files
EOC
(few_env) $ mkdir /sps/lisaf/${USER}/few_files
Enable the Jupyter Hub kernel
If you installed FEW in a conda environment, you may enable support for
Jupyter Hub by first adding the ipykernel package
and then declaring a new kernel named few_env:
(few_env) $ conda install -c conda-forge --override-channels ipykernel
(few_env) $ python -m ipykernel install --user --name few_env
Installed kernelspec few_env in ~/.local/share/jupyter/kernels/few_env
Next, create a python wrapper to preload the modules in the Python context:
(few_env) $ python_wrapper_path=$(dirname $(which python))/wpython
(few_env) $ cat << EOC > ${python_wrapper_path}
#!/bin/bash
# Load the necessary modules
source /usr/share/Modules/init/bash
module load Programming_Languages/anaconda/3.11
conda activate few_env
unset PYTHONPATH
# Run the python command
exec $(which python) \$@
EOC
$ chmod +x ${python_wrapper_path}
And change the kernel start command to use this wrapper: edit the file
~/.local/share/jupyter/kernels/few_env/kernel.json and replace the first item
in the argv field by replacing .../bin/python with .../bin/wpython.
The kernel should be available in the Jupyter Hub interface and FEW should work correctly in this environment.
Knowledge base
Advanced installation options
Many options are available to change the installation behaviour. These can be set by adding --config-settings=cmake.define.OPTION_NAME=OPTION_VALUE to the pip command. Available options are:
FEW_LAPACKE_FETCH=ON|OFF|[AUTO]: WhetherLAPACKandLAPACKEshould be automatically fetched from internet.ON: ignore pre-installedLAPACK(E)and always fetch and compile their sourcesOFF: disableLAPACK(E)fetching and only use pre-installed library and headers (install will fail if pre-installed lib and headers are not available)AUTO(default): try to detect pre-installedLAPACK(E)and their headers. If found, use them, otherwise fetchLAPACK(E).
FEW_LAPACKE_DETECT_WITH=[CMAKE]|PKGCONFIG: HowLAPACK(E)should be detectedCMAKE:LAPACK(E)will be detected using the cmakeFindPackagecommand. If yourLAPACK(E)install provideslapacke-config.cmakein a non-standard location, add its path to theCMAKE_PREFIX_PATHenvironment variable.PKGCONFIG:LAPACK(E)will be detected usingpkg-configby searching for the fileslapack.pcandlapacke.pc. If these files are provided by yourLAPACK(E)install in a non-standard location, add their path to the environment variablePKG_CONFIG_PATHAUTO(default): attempt both CMake and PkgConfig approaches
FEW_WITH_GPU=ON|OFF|[AUTO]: Whether GPU-support must be enabledON: Forcefully enable GPU support (install will fail if GPU prerequisites are not met)OFF: Disable GPU supportAUTO(default): Check whethernvccand theCUDA Toolkitare available in environment and enable/disable GPU support accordingly.
FEW_CUDA_ARCH: List of CUDA architectures that will be targeted by the CUDA compiler using CMake CUDA_ARCHITECTURES syntax. (Default =all).
Example of custom install with specific options to forcefully enable GPU support with support for the host’s GPU only (native architecture) using LAPACK fetched from internet:
pip install . \
--config-settings=cmake.define.FEW_WITH_GPU=ON \
--config-settings=cmake.define.FEW_CUDA_ARCH="native" \
--config-settings=cmake.define.FEW_LAPACKE_FETCH=ON
If you enabled GPU support (or it was automatically enabled by the AUTO mode), you will also need to install the nvidia-cuda-runtime
package corresponding to the CUDA version detected by nvidia-smi as explained in the Getting Started section above.
You will also need to manually install cupy-cuda11x or cupy-cuda12x according to your CUDA version.
conda vs pip installation
Both conda and pip+venv installations are supported, but they have different
advantages and disadvantages:
conda:
Pros:
Automatically manages compilers and dependencies which makes it easier to define a build-from-source environment.
Provides a consistent environment across different platforms.
On some platforms,
condawill automatically detect the capabilities of your CPU and will install a package optimized for it (for x86_64 architectures on linux/macOS).
Cons:
May not always have the latest version of FEW available immediately.
Requires conda/mamba/micromamba to be installed.
pip+venv:
Pros:
More flexible in terms of package versions and dependencies.
Can be used in any Python environment without requiring conda.
Allows for more control over the installation process.
Cons:
Requires manual installation of compilers and dependencies.
May install non-optimized builds of the package to allow for broader hardware compatibility.