Skip to content

Commit ad68796

Browse files
committed
update ENABLE_MLALGO
1 parent 5188baa commit ad68796

File tree

16 files changed

+27
-27
lines changed

16 files changed

+27
-27
lines changed

.github/workflows/build_test_cmake.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
name: "Build with Intel toolchain"
1818

1919
- tag: gnu
20-
build_args: "-DENABLE_LIBXC=1 -DDENABLE_ML4DFT=1 -DENABLE_LIBRI=1"
20+
build_args: "-DENABLE_LIBXC=1 -DDENABLE_MLALGO=1 -DENABLE_LIBRI=1"
2121
name: "Build extra components with GNU toolchain"
2222
- tag: intel
23-
build_args: "-DENABLE_LIBXC=1 -DENABLE_ML4DFT=1 -DENABLE_LIBRI=1"
23+
build_args: "-DENABLE_LIBXC=1 -DENABLE_MLALGO=1 -DENABLE_LIBRI=1"
2424
name: "Build extra components with Intel toolchain"
2525

2626
- tag: cuda

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
apt update && apt install -y lcov gpg curl jq ca-certificates
1919
- name: Building
2020
run: |
21-
cmake -B build -DENABLE_COVERAGE=ON -DBUILD_TESTING=ON -DENABLE_ML4DFT=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON
21+
cmake -B build -DENABLE_COVERAGE=ON -DBUILD_TESTING=ON -DENABLE_MLALGO=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON
2222
cmake --build build -j`nproc`
2323
cmake --install build
2424
- name: Testing

.github/workflows/dynamic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: actions/checkout@v4
1717
- name: Building
1818
run: |
19-
cmake -B build -DENABLE_ASAN=1 -DENABLE_ML4DFT=1 -DENABLE_LIBXC=1
19+
cmake -B build -DENABLE_ASAN=1 -DENABLE_MLALGO=1 -DENABLE_LIBXC=1
2020
cmake --build build -j8
2121
cmake --install build
2222
- name: Testing

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
3232
- name: Configure
3333
run: |
34-
cmake -B build -DBUILD_TESTING=ON -DENABLE_ML4DFT=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DENABLE_FLOAT_FFTW=ON
34+
cmake -B build -DBUILD_TESTING=ON -DENABLE_MLALGO=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DENABLE_FLOAT_FFTW=ON
3535
3636
# Temporarily removed because no one maintains this now.
3737
# And it will break the CI test workflow.

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ option(ENABLE_FLOAT_FFTW "Enable using single-precision FFTW library." OFF)
2525
# option(ENABLE_DEEPKS "Enable the DeePKS algorithm" OFF)
2626
# option(ENABLE_MLKEDF "Enable the Machine-Learning-based KEDF for OFDFT" OFF)
2727

28-
option(ENABLE_ML4DFT "Enable the Machine-Learning for OFDFT" OFF)
28+
option(ENABLE_MLALGO "Enable the Machine-Learning for OFDFT" OFF)
2929

3030
option(ENABLE_LCAO "Enable LCAO algorithm" ON)
3131
option(USE_ELPA "Enable ELPA for LCAO" ON)
@@ -118,7 +118,7 @@ endif()
118118
# Serial version of ABACUS will not use ELPA
119119
if(NOT ENABLE_MPI)
120120
set(USE_ELPA OFF)
121-
set(ENABLE_ML4DFT OFF)
121+
set(ENABLE_MLALGO OFF)
122122
endif()
123123

124124
# Different exe files of ABACUS
@@ -256,7 +256,7 @@ if(ENABLE_LCAO)
256256
add_compile_definitions(__NEW_GINT)
257257
endif()
258258
else()
259-
set(ENABLE_ML4DFT OFF)
259+
set(ENABLE_MLALGO OFF)
260260
set(ENABLE_LIBRI OFF)
261261
endif()
262262

@@ -483,7 +483,7 @@ if(ENABLE_FLOAT_FFTW)
483483
add_definitions(-D__ENABLE_FLOAT_FFTW)
484484
endif()
485485

486-
if(ENABLE_ML4DFT)
486+
if(ENABLE_MLALGO)
487487
target_link_libraries(${ABACUS_BIN_NAME} deepks)
488488

489489
find_path(libnpy_SOURCE_DIR npy.hpp HINTS ${libnpy_INCLUDE_DIR})
@@ -502,7 +502,7 @@ if(ENABLE_ML4DFT)
502502
add_compile_definitions(__DEEPKS)
503503
endif()
504504

505-
if(ENABLE_ML4DFT)
505+
if(ENABLE_MLALGO)
506506
target_link_libraries(${ABACUS_BIN_NAME} hamilt_mlkedf)
507507

508508
find_path(libnpy_SOURCE_DIR npy.hpp HINTS ${libnpy_INCLUDE_DIR})
@@ -524,7 +524,7 @@ endif()
524524
# Torch uses outdated components to detect CUDA arch, causing failure on
525525
# latest CUDA kits. Set CMake variable TORCH_CUDA_ARCH_LIST in the form of
526526
# "major.minor" if required.
527-
if(ENABLE_ML4DFT OR DEFINED Torch_DIR)
527+
if(ENABLE_MLALGO OR DEFINED Torch_DIR)
528528
find_package(Torch REQUIRED)
529529
if(NOT Torch_VERSION VERSION_LESS "2.1.0")
530530
set_if_higher(CMAKE_CXX_STANDARD 17)

Dockerfile.gnu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ADD https://api.github.com/repos/deepmodeling/abacus-develop/git/refs/heads/deve
3434

3535
RUN git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
3636
cd abacus-develop && \
37-
cmake -B build -DENABLE_ML4DFT=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_RAPIDJSON=ON && \
37+
cmake -B build -DENABLE_MLALGO=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_RAPIDJSON=ON && \
3838
cmake --build build -j`nproc` && \
3939
cmake --install build && \
4040
rm -rf build

Dockerfile.intel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ ADD https://api.github.com/repos/deepmodeling/abacus-develop/git/refs/heads/deve
5858
RUN source /opt/intel/oneapi/setvars.sh && \
5959
git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
6060
cd abacus-develop && \
61-
cmake -B build -DENABLE_ML4DFT=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_RAPIDJSON=ON && \
61+
cmake -B build -DENABLE_MLALGO=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_RAPIDJSON=ON && \
6262
cmake --build build -j`nproc` && \
6363
cmake --install build && \
6464
rm -rf build && \

conda/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ build:
2626
skip: true # [not linux]
2727
script: |
2828
export CMAKE_PREFIX_PATH=`python -c "import torch;print(torch.__path__[0])"`/share/cmake:$CMAKE_PREFIX_PATH
29-
cmake -B conda_build ${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Release -DENABLE_ML4DFT=1 -DENABLE_LIBXC=1
29+
cmake -B conda_build ${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Release -DENABLE_MLALGO=1 -DENABLE_LIBXC=1
3030
cmake --build conda_build -j`nproc`
3131
cmake --install conda_build
3232
# ${CMAKE_ARGS} applys restrictions for CMake to search libs under conda building env.

docs/advanced/install.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ If machine learning algorithms is required for DFT calculation, the following pr
2626
- [Libnpy](https://github.com/llohse/libnpy/)
2727

2828
```bash
29-
cmake -B build -DENABLE_ML4DFT=1 -DTorch_DIR=~/libtorch/share/cmake/Torch/ -Dlibnpy_INCLUDE_DIR=~/libnpy/include
29+
cmake -B build -DENABLE_MLALGO=1 -DTorch_DIR=~/libtorch/share/cmake/Torch/ -Dlibnpy_INCLUDE_DIR=~/libnpy/include
3030
```
3131

3232
> CMake will try to download Libnpy if it cannot be found locally.
@@ -191,7 +191,7 @@ CEREAL_DIR = /usr/local/include/cereal
191191

192192

193193
##------------------- OPTIONAL LIBS ---------------------------------
194-
## To use ML4DFT: set ENABLE_ML4DFT = ON, and set LIBTORCH_DIR and LIBNPY_DIR
194+
## To use ML4DFT: set ENABLE_MLALGO = ON, and set LIBTORCH_DIR and LIBNPY_DIR
195195

196196
## To use LIBXC: set LIBXC_DIR which contains include and lib/libxc.a (>5.1.7)
197197
## To use DeePMD: set DeePMD_DIR LIBTORCH_DIR and TensorFlow_DIR
@@ -201,7 +201,7 @@ CEREAL_DIR = /usr/local/include/cereal
201201

202202
# LIBTORCH_DIR = /usr/local
203203
# LIBNPY_DIR = /usr/local
204-
ENABLE_ML4DFT = OFF
204+
ENABLE_MLALGO = OFF
205205

206206
# LIBXC_DIR = /public/soft/libxc
207207

@@ -278,10 +278,10 @@ directly.
278278

279279
### Add ML-ALGO Support
280280

281-
To compile ABACUS with machine learning algorithms, you need to set `ENABLE_ML4DFT = ON`, and define `LIBTORCH_DIR` and `LIBNPY_DIR` in the file `Makefile.vars` or use
281+
To compile ABACUS with machine learning algorithms, you need to set `ENABLE_MLALGO = ON`, and define `LIBTORCH_DIR` and `LIBNPY_DIR` in the file `Makefile.vars` or use
282282

283283
```makefile
284-
make ENABLE_ML4DFT=ON LIBTORCH_DIR=/opt/libtorch/ LIBNPY_DIR=/opt/libnpy/
284+
make ENABLE_MLALGO=ON LIBTORCH_DIR=/opt/libtorch/ LIBNPY_DIR=/opt/libnpy/
285285
```
286286

287287
directly.

python/pyabacus/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ if(MKLROOT)
4444

4545
# Since libtorch will find its own MKL, the fftw part conflicts with the original one.
4646
# When enable deepks, mkl will be linked within ${TORCH_LIBRARIES}.
47-
if(NOT ENABLE_ML4DFT)
47+
if(NOT ENABLE_MLALGO)
4848
list(APPEND math_libs IntelMKL::MKL)
4949
endif()
5050

0 commit comments

Comments
 (0)