Installation¶
Prerequisites¶
🐍 Python 3.10+
⚙️ MPI compiler
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 build dependencies, PyTorch, and mpi4py with the correct MPI compiler before installing the package:
pip install "setuptools>=61.0" "setuptools-scm>=8" wheel "swig>=4.1,<4.3" Cython "numpy>=2.0,<2.3"
pip install torch==2.8.0 --index-url https://download.pytorch.org/whl/cu129
MPICC=$(which mpicc) pip install mpi4py --no-binary mpi4py
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: 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"],
)
Updating¶
git pull alone does not sync submodules. To update an existing clone, run:
git pull
git submodule sync --recursive
git submodule update --init --recursive
sync is only required when .gitmodules changes (URL, branch, or path), but running it every time is harmless.
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