Easy Installation
This guide helps you install ABACUS with basic features. For DeePKS, Libxc support or building with make
, please refer to the advanced installation guide. We recommend building ABACUS with cmake
to avoid dependency issues.
Prerequisites
ABACUS currently supports Linux. To compile ABACUS, please make sure that the following prerequisites are present:
C++ compiler, supporting C++11. You can use Intel® C++ compiler or GCC.
MPI compiler. The recommended version are Intel MPI or MPICH.
Fortran compiler if you are building
BLAS
,LAPACK
,ScaLAPACK
, andELPA
from source file. You can use Intel® Fortran Compiler or GFortran.ELPA >= 2017.
GCC version 5 or later is required; Intel compilers also use GCC headers and libraries(ref).
These packages can be installed with popular package management system, such as apt
and yum
:
sudo apt update && sudo apt install -y libopenblas-dev liblapack-dev libscalapack-mpi-dev libelpa-dev libfftw3-dev libcereal-dev libxc-dev g++ make cmake bc git
Installing ELPA by apt only matches requirements on Ubuntu 22.04. For earlier linux distributions, you should install elpa from source.
Alternatively, you can choose Intel® oneAPI toolkit (former Parallel Studio) as toolchain. The Intel® oneAPI Base Toolkit contains Intel® oneAPI Math Kernel Library (aka MKL
), including BLAS
, LAPACK
, ScaLAPACK
and FFTW3
. The Intel® oneAPI HPC Toolkit contains Intel® MPI Library, and C++ compiler(including MPI compiler). Please noted that building elpa
with a different MPI library may cause conflict between MPI libraries. Don’t forget to set environment variables before you start! cmake
will use Intel MKL if the environment variable MKLROOT
is set.
Please refer to our guide on requirements.
And of course, a copy of ABACUS source code is required, which can be obtained via one of the following choices:
Clone the whole repo with git:
git clone https://github.com/deepmodeling/abacus-develop.git
Clone the minimum required part of repo:
git clone https://github.com/deepmodeling/abacus-develop.git --depth=1
Download the latest source code without git:
wget https://github.com/deepmodeling/abacus-develop/archive/refs/heads/develop.zip
Get the source code of a stable version here
If you have connection issues accessing GitHub, please try out our official Gitee repo: replacing ‘github.com’ with ‘gitee.com’ works for all the links above. e.g.
git clone https://gitee.com/deepmodeling/abacus-develop.git
Configure
ABACUS requires a minimum cmake
version of 3.16
. Check the version of cmake
on your machine with:
cmake --version
You can specify the bin path of ABACUS binary to install by CMAKE_INSTALL_PREFIX
. If no install prefix is specified, the binary will be installed to /usr/local/bin/abacus
by default.
cmake -B build -DCMAKE_INSTALL_PREFIX=${YOUR_PATH_TO_ABACUS_BINARY}
You can provide path of each dependent package if the package can not be automatically found by cmake. Keys LAPACK_DIR
, SCALAPACK_DIR
, ELPA_DIR
, FFTW3_DIR
, CEREAL_INCLUDE_DIR
, MPI_CXX_COMPILER
and MKLROOT
are currently available to specify. For example:
cmake -B build -DFFTW3_ROOT=/opt/fftw3
If environment variable MKLROOT
exists, cmake
will take MKL as a preference, i.e. not using LAPACK
and ScaLAPACK
. To disable MKL, unset environment variable MKLROOT
, or pass -DMKLROOT=OFF
to cmake
.
Build and Install
After configuring, start build and install by:
cmake --build build -j`nproc`
cmake --install build
You can change the number after -j
on your need: set to the number of CPU cores(nproc
) to reduce compilation time.
Container Deployment
We’ve built a ready-for-use version of ABACUS with docker here. For a quick start: pull the image, prepare the data, run container. Instructions on using the image can be accessed in Dockerfile. A mirror is available by docker pull registry.dp.tech/deepmodeling/abacus
.
We also offer a pre-built docker image containing all the requirements for development. Please refer to our Package Page.
The project is ready for VS Code development container. Please refer to Developing inside a Container. Choose Open a Remote Window -> Clone a Repository in Container Volume
in VS Code command palette, and put the git address of ABACUS
when prompted.
We also support Gitpod to offer an ready-to-use online development environment.
Please note that containers target at developing and testing, but not massively parallel computing. Docker has a bad support to MPI; for production, please compile ABACUS from source code to avoid compatibility issues and gain a better performace.