Installation

Prerequisites

  • 🐍 Python 3.10 – 3.11

  • ⚙️ MPI compiler (mpicc) for parallel execution

Clone the repo

git clone https://github.com/Yi5817/Genarris.git
cd Genarris
git submodule update --init --recursive

Create a virtual environment

python3 -m venv gnrs_env
source gnrs_env/bin/activate
virtualenv -p python3.11 gnrs_env
source gnrs_env/bin/activate
conda create -n gnrs_env python=3.11
conda activate gnrs_env

Install Build Dependencies

Install the build dependencies before installing the package, so that mpi4py is compiled against the correct MPI compiler on your system:

pip install "setuptools>=61.0" wheel "swig>=4.1,<4.3" pybind11 Cython "numpy>=2.0,<2.3"
MPICC=$(which mpicc) pip install mpi4py --no-cache-dir

Note

On HPC systems, the C MPI compiler may differ (e.g., cc on Cray systems). Refer to the mpi4py documentation or your system administrator.

Install the package

Use --no-build-isolation so the build uses the mpi4py you just installed:

pip install -e . --no-build-isolation

Note

MPI compiler: mpicc is used to build the C extensions. To use a different MPI compiler, modify the MPICC variable in setup.py.

BLAS/LAPACK: The rigid_press extension links against BLAS and LAPACK (-llapack -lblas by default). On HPC systems the library names or paths may differ — edit the libraries and library_dirs fields of the rigid_press Extension in setup.py before installing.

Example — TACC Vista (aarch64, NVPL): Vista uses NVIDIA Performance Libraries (NVPL) instead of the standard BLAS/LAPACK. After loading the nvpl module (module load nvpl), update setup.py:

rigid_press = Extension(
    "gnrs.cgenarris.src.rpack.rigid_press._rigid_press",
    include_dirs=include_rigid_press,
    sources=sources_rigid_press,
    extra_compile_args=["-std=gnu99", "-O3"],
    libraries=["nvpl_blas_lp64_gomp", "nvpl_lapack_lp64_gomp"],
    library_dirs=[os.path.join(os.environ.get("TACC_NVPL_DIR"), "lib")],
    swig_opts=["-I./gnrs/cgenarris/src/rpack/rigid_press", "-I./gnrs/cgenarris/src/spglib_src"],
)

Optional Energy Calculators

Genarris supports various energy calculators through the ASE Calculator interface.

Machine Learning Interatomic Potentials (MLIPs)

pip install -e .[uma]

UMA requires a HuggingFace account with access to the UMA model repository.

pip install -e .[mace]
pip install git+https://github.com/isayevlab/aimnetcentral.git

DFT and Semi-Empirical

Calculator

Type

Notes

DFTB+

Semi-Empirical

Install separately; provide path in config

FHI-aims

DFT

Licensed software; provide binary path in config

VASP

DFT

Licensed software; provide binary path in config