How to install AMICO - daducci/AMICO GitHub Wiki

Install from PyPI

pip install dmri-amico

or

pip install --upgrade dmri-amico

to upgrade to the latest version.

PyPI available prebuilt wheels

Windows MacOS Linux
Python 3.6 cp36-win_amd64cp36-win32 cp36-macosx_x86_64 cp36-manylinux_x86_64cp36-manylinux_aarch64
Python 3.7 cp37-win_amd64cp37-win32 cp37-macosx_x86_64 cp37-manylinux_x86_64cp37-manylinux_aarch64
Python 3.8 cp38-win_amd64cp38-win32 cp38-macosx_x86_64cp38-macosx_arm64 cp38-manylinux_x86_64cp38-manylinux_aarch64
Python 3.9 cp39-win_amd64cp39-win32 cp39-macosx_x86_64cp39-macosx_arm64 cp39-manylinux_x86_64cp39-manylinux_aarch64
Python 3.10 cp310-win_amd64cp310-win32 cp310-macosx_x86_64cp310-macosx_arm64 cp310-manylinux_x86_64cp310-manylinux_aarch64
Python 3.11 cp311-win_amd64cp311-win32 cp311-macosx_x86_64cp311-macosx_arm64 cp311-manylinux_x86_64cp311-manylinux_aarch64
Python 3.12 cp312-win_amd64cp312-win32 cp312-macosx_x86_64cp312-macosx_arm64 cp312-manylinux_x86_64cp312-manylinux_aarch64
Python 3.13 cp313-win_amd64cp313-win32 cp313-macosx_x86_64cp313-macosx_arm64 cp313-manylinux_x86_64cp313-manylinux_aarch64

[!NOTE] MacOS wheels require MacOS 12.0 (Monterey) or later. If you are using an older version of MacOS, you can build dmri-amico from source (see the instructions below).

[!NOTE] If any of the prebuilt wheels listed above are compatible with your system, please feel free to contact us or open an issue here.

Install from source

[!IMPORTANT] To build and install dmri-amico you need to have the OpenBLAS library on your system. Other BLAS/LAPACK libraries may be supported in the future (e.g. Intel MKL). You can find instructions on how to compile and install OpenBLAS at www.openblas.net.

1. Clone the repository

git clone https://github.com/daducci/AMICO.git
cd AMICO

2. Set up OpenBLAS dependencies

The location of the OpenBLAS library must be specified in a site.cfg file located in the root of the AMICO repository. You can use the setup_site.py helper script, which will create a site.cfg file with the specified settings for you.

Help

python setup_site.py --help
usage: setup_site.py [-h] section library library_dir include_dir

positional arguments:
  section      Section name
  library      Library name
  library_dir  Library directory path
  include_dir  Include directory path

optional arguments:
  -h, --help   show this help message and exit

Windows

python setup_site.py openblas libopenblas C:\OpenBLAS\lib C:\OpenBLAS\include

MacOS/Linux

python setup_site.py openblas openblas /home/OpenBLAS/lib /home/OpenBLAS/include

You can create a site.cfg file by yourself. See the site.cfg.example file included in the AMICO repository for documentation.

Windows

[openblas]
libraries = libopenblas
library_dirs = C:\OpenBLAS\lib
include_dirs = C:\OpenBLAS\include

MacOS/Linux

[openblas]
libraries = openblas
library_dirs = /home/OpenBLAS/lib
include_dirs = /home/OpenBLAS/include

3. Install dmri-amico

pip install .

4. Specify the OpenBLAS dynamic library path

On MacOS and Linux, you need to specify the path to the OpenBLAS dynamic library. You can do this by setting the DYLD_LIBRARY_PATH environment variable on MacOS or the LD_LIBRARY_PATH environment variable on Linux.

MacOS

export DYLD_LIBRARY_PATH=/home/OpenBLAS/lib

Linux

export LD_LIBRARY_PATH=/home/OpenBLAS/lib

[!TIP] You can add the DYLD_LIBRARY_PATH or LD_LIBRARY_PATH environment variable to your shell profile (e.g. .bashrc, .bash_profile, .zshrc, etc.) to make it permanent.

On Windows, you need to add the OpenBLAS dynamic library with the os.add_dll_directory() method before importing the amico module. For example, you can do this at the beginning of your Python code.

import os
os.add_dll_directory('C:\\OpenBLAS\\bin')