SPARC Installation Guide
This guide provides step-by-step instructions to set up SPARC and its core dependencies.
Core Software Dependencies
Python Package Dependencies
numpy, pandas, dpdata, scipy
Step-by-Step Installation
Create and activate a conda environment:
conda create -n sparc python=3.10 conda activate sparc
Install DeepMD-kit v3:
pip install deepmd-kit
Refer to the DeepMD-kit installation guide for GPU-enabled or backend-specific (PyTorch / TensorFlow) installation options.
Clone and install SPARC:
git clone https://github.com/rahulumrao/sparc.git cd sparc pip install .
Install PLUMED (optional):
For standard CVs, install directly from conda-forge:
conda install -c conda-forge py-plumed
Note
Some Collective Variables (e.g.,
SPRINT) require the additional module and are not included in the standard PLUMED build. To enable them, build from source:./configure --enable-mpi=no --enable-modules=all \ PYTHON_BIN=$(which python) --prefix=$CONDA_PREFIX make -j$(nproc) && make install
To verify PLUMED installation:
>>> from ase.calculators import plumed >>> from plumed import Plumed
Install xTB (optional):
conda install -c conda-forge xtb-python
DFT Engine Requirements
SPARC supports the following DFT engines. Only install what you need:
Engine |
Use case |
Notes |
|---|---|---|
Periodic solids |
License required; set |
|
Periodic solids / molecules |
Free; ASE CP2K interface included |
|
Molecules |
Free for academia; set |
|
Periodic solids |
Free; set |
|
Semi-empirical (fast) |
|
|
Molecules |
License required |
Environment Setup
For VASP, set the POTCAR files path:
export VASP_PP_PATH=/path/to/vasp/potcar_files
If PLUMED was installed from source (not conda-forge):
export PLUMED_KERNEL="$CONDA_PREFIX/lib/libplumedKernel.so"
export PYTHONPATH="$CONDA_PREFIX/lib/plumed/python:$PYTHONPATH"
Verification
sparc -h
Expected output:
sparc [-h] [-i INPUT_FILE]
options:
-h, --help show this help message and exit
-i INPUT_FILE, --input_file INPUT_FILE
Input YAML file
Important
The pip install tensorflow[and-cuda] installation may not always detect
the GPU due to potential configuration issues. To verify whether TensorFlow
has successfully recognized the GPU, run:
python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
If the output is an empty list, check:
Your NVIDIA driver and CUDA toolkit installation
The CUDA version compatibility with TensorFlow
That environment variables (e.g.,
LD_LIBRARY_PATH) are correctly set
Refer to the TensorFlow GPU troubleshooting guide for details.