Skip to content

Commit c43f2fa

Browse files
committed
docs(quick_start): Update easy_install.md
- 添加通过git更新到最新版本的详细步骤 - 扩展工具链安装说明,包括GCC-AMD和AOCC-AOCL支持 - 重新组织conda安装部分,增加开发环境配置说明 - 优化文档结构,将手动安装部分后移
1 parent 4ad64bb commit c43f2fa

File tree

1 file changed

+97
-89
lines changed

1 file changed

+97
-89
lines changed

docs/quick_start/easy_install.md

Lines changed: 97 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Easy Installation
22

3-
This guide helps you install ABACUS with basic features. **For DeePKS, DeePMD and Libxc support, or building with `make`, please refer to [the advanced installation guide](../advanced/install.md)** after going through this page. We recommend building ABACUS with `cmake` to avoid dependency issues. We recommend compiling ABACUS (and possibly its requirements) from the source code using the latest compiler for the best performace. You can try [toolchain](#install-requirements-by-toolchain) to install ABACUS and dependencies in a source-code compilation way with convience. You can also deploy ABACUS **without building** by [Docker](#container-deployment) or [conda](#install-by-conda). Please note that ABACUS only supports Linux; for Windows users, please consider using [WSL](https://learn.microsoft.com/en-us/windows/wsl/) or docker.
3+
This guide helps you install ABACUS with basic features. **For DeePKS, DeePMD and Libxc support, or building with `make`, please refer to [the advanced installation guide](../advanced/install.md)** after going through this page. We recommend building ABACUS with `cmake` to avoid dependency issues. We recommend compiling ABACUS (and possibly its requirements) from the source code using the latest compiler for the best performace. You can use [toolchain](#install-requirements-by-toolchain) to install ABACUS and dependencies in a source-code compilation way with convience. You can also deploy ABACUS **without building** by [Docker](#container-deployment) or [conda](#install-by-conda). Please note that ABACUS only supports Linux; for Windows users, please consider using [WSL](https://learn.microsoft.com/en-us/windows/wsl/) or docker.
44

55
## Get ABACUS source code
66

@@ -12,6 +12,34 @@ ABACUS source code can be obtained via one of the following choices:
1212
- Get the source code of a stable version [here](https://github.com/deepmodeling/abacus-develop/releases)
1313
- If you have connection issues accessing GitHub, please try out our official [Gitee repo](https://gitee.com/deepmodeling/abacus-develop/): e.g. `git clone https://gitee.com/deepmodeling/abacus-develop.git`. This Gitee repo is updated synchronously with GitHub.
1414

15+
## Update to latest release by git
16+
17+
Please check the [release page](https://github.com/deepmodeling/abacus-develop/releases) for the release note of a new version.
18+
19+
It is OK to download the new source code from beginning following the previous step.
20+
21+
You can update your cloned git repo (from Github or Gitee) in-place with the following commands:
22+
23+
```bash
24+
git remote -v
25+
# Check if the output contains the line below
26+
# origin https://github.com/deepmodeling/abacus-develop.git (fetch)
27+
# The remote name is marked as "upstream" if you clone the repo from your own fork.
28+
29+
# Replace "origin" with "upstream" or the remote name corresponding to deepmodeling/abacus-develop if necessary
30+
git fetch origin
31+
git checkout v3.x.x # Replace the tag with the latest version, like v3.10.0
32+
git describe --tags # Verify if the tag has been successfully checked out
33+
```
34+
35+
Then proceed to the [Build and Install](#build-and-install) part. If you encountered errors, try remove the `build` directory first and reconfigure.
36+
37+
To use the codes under active development:
38+
39+
```bash
40+
git checkout develop
41+
git pull
42+
```
1543

1644
## Prerequisites
1745

@@ -34,65 +62,83 @@ These requirements support the calculation of plane-wave basis in ABACUS. For LC
3462
- [CEREAL](https://uscilab.github.io/cereal/).
3563
- [ELPA](https://elpa.mpcdf.mpg.de/) >= 2017 (optional).
3664

37-
## Install requirements
65+
## Install ABACUS with requirements by toolchain
66+
67+
We offer a set of [toolchain](https://github.com/deepmodeling/abacus-develop/tree/develop/toolchain)
68+
scripts to compile and install all the requirements
69+
automatically and suitable for machine characteristic in an online or offline way.
70+
The toolchain can be downloaded with ABACUS repo, and users can easily compile the requirements by running *toolchain_[gnu,intel,gcc-aocl,aocc-aocl].sh* and ABACUS itself by running *build_abacus_[gnu,intel,gcc-aocl,aocc-aocl].sh* script in the toolchain directory in `GNU`, `Intel-oneAPI` , `GCC-AMD AOCL` and `AMD AOCC-AOCL` toolchain.
71+
Sometimes, ABACUS by toolchain installation may have better efficient performance due to the suitable compiled dependencies. One should read the [README in toolchain](https://github.com/deepmodeling/abacus-develop/tree/develop/toolchain/README.md) for most of the information before use, and related tutorials can be accessed via ABACUS WeChat platform.
72+
73+
## Install by conda
3874

39-
Some of these packages can be installed with popular package management system, such as `apt` and `yum`:
75+
Conda is a package management system with a separated environment, not requiring system privileges.
76+
You can refer to [DeepModeling conda FAQ](https://docs.deepmodeling.com/faq/conda.html) for how to setup a conda environment.
77+
A pre-built ABACUS binary with all requirements is available at [conda-forge](https://anaconda.org/conda-forge/abacus). It supports advanced features including Libxc, LibRI, and DeePKS. Conda will install the GPU-supported version of ABACUS if a valid GPU driver is present. Please refer to [the advanced installation guide](../advanced/install.md) for more details.
4078

4179
```bash
42-
sudo apt update && sudo apt install -y libopenblas-openmp-dev liblapack-dev libscalapack-mpi-dev libelpa-dev libfftw3-dev libcereal-dev libxc-dev g++ make cmake bc git pkgconf
43-
```
80+
# Install
81+
# We recommend installing ABACUS in a new environment to avoid potential conflicts:
82+
conda create -n abacus_env abacus "libblas=*=*mkl" mpich -c conda-forge
4483

45-
> Installing ELPA by apt only matches requirements on Ubuntu 22.04. For earlier linux distributions, you should build ELPA from source.
84+
# Run
85+
conda activate abacus_env
86+
OMP_NUM_THREADS=1 mpirun -n 4 abacus
4687

47-
We recommend [Intel® oneAPI toolkit](https://software.intel.com/content/www/us/en/develop/tools/oneapi/commercial-base-hpc.html) (former Intel® Parallel Studio) as toolchain. The [Intel® oneAPI Base Toolkit](https://software.intel.com/content/www/us/en/develop/tools/oneapi/all-toolkits.html#base-kit) contains Intel® oneAPI Math Kernel Library (aka `MKL`), including `BLAS`, `LAPACK`, `ScaLAPACK` and `FFTW3`. The [Intel® oneAPI HPC Toolkit](https://software.intel.com/content/www/us/en/develop/tools/oneapi/all-toolkits.html#hpc-kit) contains Intel® MPI Library, and C++ compiler(including MPI compiler).
48-
> Please note that building `elpa` with a different MPI library may cause conflict.
49-
> Don't forget to [set environment variables](https://software.intel.com/content/www/us/en/develop/documentation/get-started-with-intel-oneapi-render-linux/top/configure-your-system.html) before you start! `cmake` will use Intel MKL if the environment variable `MKLROOT` is set.
88+
# Update
89+
conda update -n abacus_env abacus -c conda-forge
90+
```
5091

51-
Please refer to our [guide](https://github.com/deepmodeling/abacus-develop/wiki/Building-and-Running-ABACUS) on installing requirements.
92+
> If OpenBLAS gives warning about OpenMP threads, please install conda package `"openblas=*=openmp*"` or `"libblas=*=*mkl"`. See [switching BLAS implementation in conda](https://conda-forge.org/docs/maintainer/knowledge_base.html#switching-blas-implementation).
5293
53-
## Install requirements by toolchain
94+
> ABACUS supports `OpenMPI` and `MPICH` variant. Install `mpich` or `openmpi` package to switch MPI library if required.
5495
55-
We offer a set of [toolchain](https://github.com/deepmodeling/abacus-develop/tree/develop/toolchain)
56-
scripts to compile and install all the requirements
57-
automatically and suitable for machine characteristic in an online or offline way.
58-
The toolchain can be downloaded with ABACUS repo, and users can easily compile the requirements by running *toolchain_[gnu,intel].sh* and ABACUS itself by running *build_abacus_[gnu,intel].sh* script in the toolchain directory in both `GNU` and `Intel-oneAPI` toolchain.
59-
Sometimes, ABACUS by toolchain installation may have better efficient performance due to the suitable compiled dependencies.
96+
For more details on building a conda package of ABACUS locally, please refer to the [conda recipe file](https://github.com/deepmodeling/abacus-develop/blob/develop/conda/meta.yaml).
6097

61-
Users should read the README in toolchain directory for most of the information before use, and a tutorial for using this toolchain can be accessed in [bohrium-notebook](https://nb.bohrium.dp.tech/detail/5215742477) as reference.
98+
> Note: The [deepmodeling conda channel](https://anaconda.org/deepmodeling/abacus) offers historical versions of ABACUS.
6299
63-
> Notice: the toolchain is under development, please let we know if you encounter any problem in using this toolchain by raising issue or contacting us.
100+
### Developing with conda
64101

102+
It is possible to build ABACUS from source based on the conda environment.
65103

66-
## Update to latest release by git
104+
```bash
105+
conda create -n abacus_env abacus -c conda-forge
106+
conda activate abacus_env
107+
export CMAKE_PREFIX_PATH=$CONDA_PREFIX:$CMAKE_PREFIX_PATH
67108

68-
Please check the [release page](https://github.com/deepmodeling/abacus-develop/releases) for the release note of a new version.
109+
# By default OpenBLAS is used; run `conda install "blas=*=mkl" mkl_fft mkl-devel -c conda-forge` to switch implementation.
110+
export MKLROOT=$CONDA_PREFIX # If Intel MKL is required.
69111

70-
It is OK to download the new source code from beginning following the previous step.
112+
export CMAKE_PREFIX_PATH=`python -c 'import torch;print(torch.utils.cmake_prefix_path)'`:$CMAKE_PREFIX_PATH # If DEEPKS support is required;
113+
# usually expands to `$CONDA_PREFIX/lib/python3.1/site-packages/torch/share/cmake`
114+
```
71115

72-
You can update your cloned git repo (from Github or Gitee) in-place with the following commands:
116+
And, follow the instructions in [Build and Install](#build-and-install) part above withou manually setting paths to dependencies.
117+
See [the advanced installation guide](../advanced/install.md) for more features.
118+
Make sure the environment variables are set before running `cmake`.
119+
Possible command: `cmake -B build -DENABLE_MLALGO=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON`.
73120

74-
```bash
75-
git remote -v
76-
# Check if the output contains the line below
77-
# origin https://github.com/deepmodeling/abacus-develop.git (fetch)
78-
# The remote name is marked as "upstream" if you clone the repo from your own fork.
79121

80-
# Replace "origin" with "upstream" or the remote name corresponding to deepmodeling/abacus-develop if necessary
81-
git fetch origin
82-
git checkout v3.x.x # Replace the tag with the latest version, like v3.10.0
83-
git describe --tags # Verify if the tag has been successfully checked out
84-
```
122+
## Install ABACUS manually
85123

86-
Then proceed to the [Build and Install](#build-and-install) part. If you encountered errors, try remove the `build` directory first and reconfigure.
124+
### Install requirements
87125

88-
To use the codes under active development:
126+
Some of these packages can be installed with popular package management system via root permission if you have, such as `apt` and `yum`:
89127

90128
```bash
91-
git checkout develop
92-
git pull
129+
sudo apt update && sudo apt install -y libopenblas-openmp-dev liblapack-dev libscalapack-mpi-dev libelpa-dev libfftw3-dev libcereal-dev libxc-dev g++ make cmake bc git pkgconf
93130
```
94131

95-
## Configure
132+
> Installing ELPA by apt only matches requirements on Ubuntu 22.04. For earlier linux distributions, you should build ELPA from source.
133+
134+
We recommend [Intel® oneAPI toolkit](https://software.intel.com/content/www/us/en/develop/tools/oneapi/commercial-base-hpc.html) (former Intel® Parallel Studio) as toolchain. The [Intel® oneAPI Base Toolkit](https://software.intel.com/content/www/us/en/develop/tools/oneapi/all-toolkits.html#base-kit) contains Intel® oneAPI Math Kernel Library (aka `MKL`), including `BLAS`, `LAPACK`, `ScaLAPACK` and `FFTW3`. The [Intel® oneAPI HPC Toolkit](https://software.intel.com/content/www/us/en/develop/tools/oneapi/all-toolkits.html#hpc-kit) contains Intel® MPI Library, and C++ compiler(including MPI compiler).
135+
> Please note that building `elpa` with a different MPI library may cause conflict.
136+
> Don't forget to [set environment variables](https://software.intel.com/content/www/us/en/develop/documentation/get-started-with-intel-oneapi-render-linux/top/configure-your-system.html) before you start! `cmake` will use Intel MKL if the environment variable `MKLROOT` is set.
137+
138+
Please refer to our [guide](https://github.com/deepmodeling/abacus-develop/wiki/Building-and-Running-ABACUS) on installing requirements.
139+
140+
141+
### Configure
96142

97143
The basic command synopsis is:
98144

@@ -139,7 +185,7 @@ Here is an example:
139185
CXX=mpiicpx cmake -B build -DCMAKE_INSTALL_PREFIX=~/abacus -DELPA_DIR=~/elpa-2025.01.001/build -DCEREAL_INCLUDE_DIR=~/cereal/include
140186
```
141187

142-
## Build and Install
188+
### Build and Install
143189

144190
After configuring, build and install by:
145191

@@ -150,7 +196,9 @@ cmake --install build
150196

151197
You can change the number after `-j` on your need: set to the number of CPU cores(`nproc`) to reduce compilation time.
152198

153-
## Run
199+
## Run ABACUS
200+
201+
### Load ABACUS
154202

155203
If ABACUS is installed into a custom directory using `CMAKE_INSTALL_PREFIX`, please add it to your environment variable `PATH` to locate the correct executable.
156204
*(Note: `my-install-dir` should be changed to the location of your installed abacus:`/home/your-path/abacus/bin/`.)*
@@ -165,6 +213,14 @@ If ABACUS is installed by toolchain, there will be an environment script in the
165213
source /path/to/abacus/toolchain/abacus_env.sh
166214
```
167215

216+
If ABACUS is installed by conda, please make sure the conda environment is activated before running ABACUS.
217+
218+
```bash
219+
conda activate abacus_env
220+
```
221+
222+
### Run with Parallelism Setting
223+
168224
Please set OpenMP threads by setting environment variable:
169225

170226
```bash
@@ -215,64 +271,16 @@ For online development environment, we support [GitHub Codespaces](https://githu
215271

216272
We also support [Gitpod](https://www.gitpod.io/): [Open in Gitpod](https://gitpod.io/#https://github.com/deepmodeling/abacus-develop)
217273

218-
## Install by conda
219-
220-
Conda is a package management system with a separated environment, not requiring system privileges.
221-
You can refer to [DeepModeling conda FAQ](https://docs.deepmodeling.com/faq/conda.html) for how to setup a conda environment.
222-
A pre-built ABACUS binary with all requirements is available at [conda-forge](https://anaconda.org/conda-forge/abacus). It supports advanced features including Libxc, LibRI, and DeePKS. Conda will install the GPU-supported version of ABACUS if a valid GPU driver is present. Please refer to [the advanced installation guide](../advanced/install.md) for more details.
223-
224-
```bash
225-
# Install
226-
# We recommend installing ABACUS in a new environment to avoid potential conflicts:
227-
conda create -n abacus_env abacus "libblas=*=*mkl" mpich -c conda-forge
228-
229-
# Run
230-
conda activate abacus_env
231-
OMP_NUM_THREADS=1 mpirun -n 4 abacus
232-
233-
# Update
234-
conda update -n abacus_env abacus -c conda-forge
235-
```
236-
237-
> If OpenBLAS gives warning about OpenMP threads, please install conda package `"openblas=*=openmp*"` or `"libblas=*=*mkl"`. See [switching BLAS implementation in conda](https://conda-forge.org/docs/maintainer/knowledge_base.html#switching-blas-implementation).
238-
239-
> ABACUS supports `OpenMPI` and `MPICH` variant. Install `mpich` or `openmpi` package to switch MPI library if required.
240-
241-
For more details on building a conda package of ABACUS locally, please refer to the [conda recipe file](https://github.com/deepmodeling/abacus-develop/blob/develop/conda/meta.yaml).
242-
243-
> Note: The [deepmodeling conda channel](https://anaconda.org/deepmodeling/abacus) offers historical versions of ABACUS.
244-
245-
### Developing with conda
246-
247-
It is possible to build ABACUS from source based on the conda environment.
248-
249-
```bash
250-
conda create -n abacus_env abacus -c conda-forge
251-
conda activate abacus_env
252-
export CMAKE_PREFIX_PATH=$CONDA_PREFIX:$CMAKE_PREFIX_PATH
253-
254-
# By default OpenBLAS is used; run `conda install "blas=*=mkl" mkl_fft mkl-devel -c conda-forge` to switch implementation.
255-
export MKLROOT=$CONDA_PREFIX # If Intel MKL is required.
256-
257-
export CMAKE_PREFIX_PATH=`python -c 'import torch;print(torch.utils.cmake_prefix_path)'`:$CMAKE_PREFIX_PATH # If DEEPKS support is required;
258-
# usually expands to `$CONDA_PREFIX/lib/python3.1/site-packages/torch/share/cmake`
259-
```
260-
261-
And, follow the instructions in [Build and Install](#build-and-install) part above withou manually setting paths to dependencies.
262-
See [the advanced installation guide](../advanced/install.md) for more features.
263-
Make sure the environment variables are set before running `cmake`.
264-
Possible command: `cmake -B build -DENABLE_MLALGO=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON`.
265-
266274
## Command line options
267275

268276
Users can check the version of ABACUS by running the command `abacus --version`, the result will be like:
269277
```
270-
ABACUS version v3.6.5
278+
ABACUS version v3.9.0.2
271279
```
272280

273281
Users may check the correctness of the setting of parameters in the `INPUT` file by running the command `abacus --check-input`, the result will be like:
274282
```
275-
ABACUS v3.6.5
283+
ABACUS v3.9.0.2
276284
277285
Atomic-orbital Based Ab-initio Computation at UStc
278286

0 commit comments

Comments
 (0)