Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/ase_plugin_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,8 @@ jobs:
- name: Configure & Build ABACUS (GNU)
run: |
git config --global --add safe.directory `pwd`
export LD_LIBRARY_PATH=${GKLIB_ROOT}/lib:${METIS32_ROOT}/lib:${PARMETIS32_ROOT}/lib:${SUPERLU_DIST32_ROOT}/lib:${PEXSI32_ROOT}/lib:${LD_LIBRARY_PATH}
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}
export CPATH=${GKLIB_ROOT}/include:${METIS32_ROOT}/include:${PARMETIS32_ROOT}/include:${SUPERLU_DIST32_ROOT}/include:${PEXSI32_ROOT}/include:${CPATH}
export CMAKE_PREFIX_PATH=${PEXSI32_ROOT}:${SUPERLU_DIST32_ROOT}:${PARMETIS32_ROOT}:${METIS32_ROOT}:${GKLIB_ROOT}:${CMAKE_PREFIX_PATH}
source toolchain/install/setup
prepend_path CMAKE_PREFIX_PATH ${PEXSI32_ROOT}:${SUPERLU_DIST32_ROOT}:${PARMETIS32_ROOT}:${METIS32_ROOT}:${GKLIB_ROOT}
rm -rf build
cmake -B build -G Ninja
cmake --build build -j2
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/build_test_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,8 @@ jobs:
- name: Build
run: |
git config --global --add safe.directory `pwd`
export LD_LIBRARY_PATH=${GKLIB_ROOT}/lib:${METIS32_ROOT}/lib:${PARMETIS32_ROOT}/lib:${SUPERLU_DIST32_ROOT}/lib:${PEXSI32_ROOT}/lib:${LD_LIBRARY_PATH}
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}
export CPATH=${GKLIB_ROOT}/include:${METIS32_ROOT}/include:${PARMETIS32_ROOT}/include:${SUPERLU_DIST32_ROOT}/include:${PEXSI32_ROOT}/include:${CPATH}
export CMAKE_PREFIX_PATH=${PEXSI32_ROOT}:${SUPERLU_DIST32_ROOT}:${PARMETIS32_ROOT}:${METIS32_ROOT}:${GKLIB_ROOT}:${CMAKE_PREFIX_PATH}
source toolchain/install/setup
prepend_path CMAKE_PREFIX_PATH ${PEXSI32_ROOT}:${SUPERLU_DIST32_ROOT}:${PARMETIS32_ROOT}:${METIS32_ROOT}:${GKLIB_ROOT}
rm -rf build
cmake -B build -G Ninja ${{ matrix.build_args }}
cmake --build build -j $(nproc)
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ if(NOT DEFINED CMAKE_CXX_STANDARD)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Enable DFT-D4 languages before finding OpenMP.
if(ENABLE_DFTD4)
# Enable languages required by optional dependencies
if(ENABLE_DFTD4 OR ENABLE_PEXSI)
Comment thread
Growl1234 marked this conversation as resolved.
enable_language(C)
enable_language(Fortran)
endif()
Expand Down Expand Up @@ -323,7 +323,10 @@ if(ENABLE_LCAO)
endif()

if(ENABLE_PEXSI)
find_package(PEXSI REQUIRED)
find_package(PEXSI REQUIRED CONFIG)
if(PEXSI_VERSION VERSION_LESS "2.0.0")
message(FATAL_ERROR "PEXSI >= 2.0.0 is required")
endif()
abacus_add_feature_definitions(__PEXSI)
set(CMAKE_CXX_STANDARD 14)
endif()
Expand Down
5 changes: 0 additions & 5 deletions cmake/CollectBuildInfoVars.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,7 @@ else()
endif()

if(ENABLE_PEXSI)
set(ABACUS_PEXSI_VERSION "yes (version unknown)")
if(PEXSI_VERSION)
set(ABACUS_PEXSI_VERSION "yes (v${PEXSI_VERSION})")
elseif(PEXSI_DIR)
set(ABACUS_PEXSI_VERSION "yes (path: ${PEXSI_DIR})")
endif()
else()
set(ABACUS_PEXSI_VERSION "no")
endif()
Expand Down
57 changes: 0 additions & 57 deletions cmake/modules/FindPEXSI.cmake

This file was deleted.

10 changes: 3 additions & 7 deletions docs/advanced/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,11 @@ cmake -B build -DUSE_ABACUS_LIBM=1

## Build with PEXSI support

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.
ABACUS supports the PEXSI library for gamma only LCAO calculations. PEXSI version >=2.0.0 is required.

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.
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.

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.

```bash
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}
```
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`.

## Build ABACUS with make

Expand Down
12 changes: 2 additions & 10 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,7 @@ if(ENABLE_LCAO)
endif()

if(ENABLE_PEXSI)
# Temporary adapter for the legacy FindPEXSI.cmake result. Replace this with
# PEXSI::PEXSI when config-package discovery is adopted.
list(APPEND _abacus_feature_libs
${PEXSI_LIBRARY}
${SuperLU_DIST_LIBRARY}
${ParMETIS_LIBRARY}
${METIS_LIBRARY})
list(APPEND _abacus_feature_include_dirs
${PEXSI_INCLUDE_DIR}
${ParMETIS_INCLUDE_DIR})
list(APPEND _abacus_feature_libs PEXSI::PEXSI)
endif()
endif()

Expand Down Expand Up @@ -337,6 +328,7 @@ foreach(_abacus_feature_target IN ITEMS
NEP::nep
TensorFlow::tensorflow_cc
ZLIB::ZLIB
PEXSI::PEXSI
NCCL::NCCL
CAL::CAL
cusolverMp::cusolverMp
Expand Down
4 changes: 2 additions & 2 deletions source/source_hsolver/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ if (ENABLE_MPI)
)
endif()

if (ENABLE_PEXSI)
if (TARGET PEXSI::PEXSI)
AddTest(
TARGET MODULE_HSOLVER_LCAO_PEXSI
LIBS parameter ${PEXSI_LIBRARY} ${SuperLU_DIST_LIBRARY} ${ParMETIS_LIBRARY} ${METIS_LIBRARY} MPI::MPI_CXX base psi device pexsi
LIBS parameter PEXSI::PEXSI base psi device pexsi
SOURCES diago_pexsi_test.cpp ../diago_pexsi.cpp ../../source_basis/module_ao/parallel_orbitals.cpp
)
endif()
Expand Down
Loading