Skip to content

Commit b18a2ff

Browse files
authored
Merge branch 'develop' into 2026-06-30
2 parents b5572e4 + a76c946 commit b18a2ff

73 files changed

Lines changed: 756 additions & 822 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ase_plugin_test.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,8 @@ jobs:
4848
- name: Configure & Build ABACUS (GNU)
4949
run: |
5050
git config --global --add safe.directory `pwd`
51-
export LD_LIBRARY_PATH=${GKLIB_ROOT}/lib:${METIS32_ROOT}/lib:${PARMETIS32_ROOT}/lib:${SUPERLU_DIST32_ROOT}/lib:${PEXSI32_ROOT}/lib:${LD_LIBRARY_PATH}
52-
export PKG_CONFIG_PATH=${GKLIB_ROOT}/lib/pkgconfig:${METIS32_ROOT}/lib/pkgconfig:${PARMETIS32_ROOT}/lib/pkgconfig:${SUPERLU_DIST32_ROOT}/lib/pkgconfig:${PEXSI32_ROOT}/lib/pkgconfig:${PKG_CONFIG_PATH}
53-
export CPATH=${GKLIB_ROOT}/include:${METIS32_ROOT}/include:${PARMETIS32_ROOT}/include:${SUPERLU_DIST32_ROOT}/include:${PEXSI32_ROOT}/include:${CPATH}
54-
export CMAKE_PREFIX_PATH=${PEXSI32_ROOT}:${SUPERLU_DIST32_ROOT}:${PARMETIS32_ROOT}:${METIS32_ROOT}:${GKLIB_ROOT}:${CMAKE_PREFIX_PATH}
5551
source toolchain/install/setup
52+
prepend_path CMAKE_PREFIX_PATH ${PEXSI32_ROOT}:${SUPERLU_DIST32_ROOT}:${PARMETIS32_ROOT}:${METIS32_ROOT}:${GKLIB_ROOT}
5653
rm -rf build
5754
cmake -B build -G Ninja
5855
cmake --build build -j2

.github/workflows/build_test_cmake.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,8 @@ jobs:
7070
- name: Build
7171
run: |
7272
git config --global --add safe.directory `pwd`
73-
export LD_LIBRARY_PATH=${GKLIB_ROOT}/lib:${METIS32_ROOT}/lib:${PARMETIS32_ROOT}/lib:${SUPERLU_DIST32_ROOT}/lib:${PEXSI32_ROOT}/lib:${LD_LIBRARY_PATH}
74-
export PKG_CONFIG_PATH=${GKLIB_ROOT}/lib/pkgconfig:${METIS32_ROOT}/lib/pkgconfig:${PARMETIS32_ROOT}/lib/pkgconfig:${SUPERLU_DIST32_ROOT}/lib/pkgconfig:${PEXSI32_ROOT}/lib/pkgconfig:${PKG_CONFIG_PATH}
75-
export CPATH=${GKLIB_ROOT}/include:${METIS32_ROOT}/include:${PARMETIS32_ROOT}/include:${SUPERLU_DIST32_ROOT}/include:${PEXSI32_ROOT}/include:${CPATH}
76-
export CMAKE_PREFIX_PATH=${PEXSI32_ROOT}:${SUPERLU_DIST32_ROOT}:${PARMETIS32_ROOT}:${METIS32_ROOT}:${GKLIB_ROOT}:${CMAKE_PREFIX_PATH}
7773
source toolchain/install/setup
74+
prepend_path CMAKE_PREFIX_PATH ${PEXSI32_ROOT}:${SUPERLU_DIST32_ROOT}:${PARMETIS32_ROOT}:${METIS32_ROOT}:${GKLIB_ROOT}
7875
rm -rf build
7976
cmake -B build -G Ninja ${{ matrix.build_args }}
8077
cmake --build build -j $(nproc)

CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ if(NOT DEFINED CMAKE_CXX_STANDARD)
244244
endif()
245245
set(CMAKE_CXX_STANDARD_REQUIRED ON)
246246

247-
# Enable DFT-D4 languages before finding OpenMP.
248-
if(ENABLE_DFTD4)
247+
# Enable languages required by optional dependencies
248+
if(ENABLE_DFTD4 OR ENABLE_PEXSI)
249249
enable_language(C)
250250
enable_language(Fortran)
251251
endif()
@@ -323,7 +323,10 @@ if(ENABLE_LCAO)
323323
endif()
324324

325325
if(ENABLE_PEXSI)
326-
find_package(PEXSI REQUIRED)
326+
find_package(PEXSI REQUIRED CONFIG)
327+
if(PEXSI_VERSION VERSION_LESS "2.0.0")
328+
message(FATAL_ERROR "PEXSI >= 2.0.0 is required")
329+
endif()
327330
abacus_add_feature_definitions(__PEXSI)
328331
set(CMAKE_CXX_STANDARD 14)
329332
endif()

cmake/CollectBuildInfoVars.cmake

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -370,12 +370,7 @@ else()
370370
endif()
371371

372372
if(ENABLE_PEXSI)
373-
set(ABACUS_PEXSI_VERSION "yes (version unknown)")
374-
if(PEXSI_VERSION)
375373
set(ABACUS_PEXSI_VERSION "yes (v${PEXSI_VERSION})")
376-
elseif(PEXSI_DIR)
377-
set(ABACUS_PEXSI_VERSION "yes (path: ${PEXSI_DIR})")
378-
endif()
379374
else()
380375
set(ABACUS_PEXSI_VERSION "no")
381376
endif()

cmake/modules/FindPEXSI.cmake

Lines changed: 0 additions & 57 deletions
This file was deleted.

docs/advanced/install.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,11 @@ cmake -B build -DUSE_ABACUS_LIBM=1
145145

146146
## Build with PEXSI support
147147

148-
ABACUS supports the PEXSI library for gamma only LCAO calculations. PEXSI version 2.0.0 is tested to work with ABACUS, please always use the latest version of PEXSI.
148+
ABACUS supports the PEXSI library for gamma only LCAO calculations. PEXSI version >=2.0.0 is required.
149149

150-
To build ABACUS with PEXSI support, you need to compile PEXSI (and its dependencies) first. Please refer to the [PEXSI Installation Guide](https://pexsi.readthedocs.io/en/latest/install.html) for more details. Note that PEXSI requires ParMETIS and SuperLU_DIST.
150+
To build ABACUS with PEXSI support, you need to compile PEXSI and its dependencies first. Please refer to the [PEXSI Installation Guide](https://pexsi.readthedocs.io/en/latest/install.html) for more details. You can also use [Spack](https://github.com/spack/spack) to install the required packages more easily. Note that PEXSI requires ParMETIS and SuperLU_DIST.
151151

152-
After compiling PEXSI, you can set `ENABLE_PEXSI` to `ON`. If the libraries are not installed in standard paths, you can set `PEXSI_DIR`, `ParMETIS_DIR` and `SuperLU_DIST_DIR` to the corresponding directories.
153-
154-
```bash
155-
cmake -B build -DENABLE_PEXSI=ON -DPEXSI_DIR=${path to PEXSI installation directory} -DParMETIS_DIR=${path to ParMETIS installation directory} -DSuperLU_DIST_DIR=${path to SuperLU_DIST installation directory}
156-
```
152+
After compiling PEXSI, pass `-DENABLE_PEXSI=ON` to CMake. ABACUS uses the CMake config package provided by PEXSI; if PEXSI or its dependencies are not installed in standard paths, add their installation prefixes to `CMAKE_PREFIX_PATH`.
157153

158154
## Build ABACUS with make
159155

source/CMakeLists.txt

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,7 @@ if(ENABLE_LCAO)
201201
endif()
202202

203203
if(ENABLE_PEXSI)
204-
# Temporary adapter for the legacy FindPEXSI.cmake result. Replace this with
205-
# PEXSI::PEXSI when config-package discovery is adopted.
206-
list(APPEND _abacus_feature_libs
207-
${PEXSI_LIBRARY}
208-
${SuperLU_DIST_LIBRARY}
209-
${ParMETIS_LIBRARY}
210-
${METIS_LIBRARY})
211-
list(APPEND _abacus_feature_include_dirs
212-
${PEXSI_INCLUDE_DIR}
213-
${ParMETIS_INCLUDE_DIR})
204+
list(APPEND _abacus_feature_libs PEXSI::PEXSI)
214205
endif()
215206
endif()
216207

@@ -337,6 +328,7 @@ foreach(_abacus_feature_target IN ITEMS
337328
NEP::nep
338329
TensorFlow::tensorflow_cc
339330
ZLIB::ZLIB
331+
PEXSI::PEXSI
340332
NCCL::NCCL
341333
CAL::CAL
342334
cusolverMp::cusolverMp

source/source_cell/sep_cell.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
#include <string>
1010
#include <vector>
1111

12-
// namespace GlobalC
13-
// {
14-
// Sep_Cell sep_cell;
15-
// }
16-
1712
Sep_Cell::Sep_Cell() noexcept : ntype(0), omega(0.0), tpiba2(0.0)
1813
{
1914
}

source/source_cell/sep_cell.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,4 @@ class Sep_Cell
6666
double tpiba2; // tpiba ^ 2
6767
};
6868

69-
// namespace GlobalC
70-
// {
71-
// extern Sep_Cell sep_cell;
72-
// }
73-
7469
#endif // SEP_CEll

source/source_cell/unitcell.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,6 @@ void UnitCell::setup_cell(const std::string& fn, std::ofstream& log)
253253
// readl sep potential, currently using the pseudopotential folder (pseudo_dir in INPUT)
254254
//==========================
255255
if (PARAM.inp.dfthalf_type > 0) {
256-
// GlobalC::sep_cell.init(this->ntype);
257-
// ok3 = GlobalC::sep_cell.read_sep_potentials(ifa, PARAM.inp.pseudo_dir, GlobalV::ofs_warning, this->atom_label);
258-
259256
sep_cell.init(this->ntype);
260257
ok3 = sep_cell.read_sep_potentials(ifa, PARAM.inp.pseudo_dir, GlobalV::ofs_warning, this->atom_label);
261258
}
@@ -285,7 +282,6 @@ void UnitCell::setup_cell(const std::string& fn, std::ofstream& log)
285282

286283
#ifdef __MPI
287284
unitcell::bcast_unitcell(*this);
288-
// GlobalC::sep_cell.bcast_sep_cell();
289285
sep_cell.bcast_sep_cell();
290286
#endif
291287

@@ -350,7 +346,6 @@ void UnitCell::setup_cell(const std::string& fn, std::ofstream& log)
350346
//===================================
351347
this->set_iat2itia();
352348

353-
// GlobalC::sep_cell.set_omega(this->omega, this->tpiba2);
354349
sep_cell.set_omega(this->omega, this->tpiba2);
355350

356351
return;

0 commit comments

Comments
 (0)