Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/ase_plugin_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

- name: Install external tools from toolchain
run: |
sudo apt update && sudo apt install -y xz-utils ninja-build
sudo apt update && sudo apt install -y xz-utils ninja-build pkg-config
cd toolchain
./install_abacus_toolchain_new.sh --with-dftd4=install --dry-run -j8
./scripts/stage4/install_stage4.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_test_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:

- name: Install external tools from toolchain
run: |
sudo apt update && sudo apt install -y gfortran ninja-build xz-utils
sudo apt update && sudo apt install -y gfortran ninja-build pkg-config xz-utils
cd toolchain
./install_abacus_toolchain_new.sh --with-dftd4=install --dry-run ${{matrix.external_toolchain_args}}
./scripts/stage4/install_stage4.sh
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
python3-pip \
xz-utils \
ninja-build \
pkg-config \
lcov \
perl-modules \
libcapture-tiny-perl \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
with:
submodules: recursive

- name: Install Ccache
- name: Install CI tools
run: |
sudo apt-get update
sudo apt-get install -y ccache xz-utils ninja-build
sudo apt-get install -y ccache xz-utils ninja-build pkg-config

- name: Install external tools from toolchain
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dynamic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: actions/checkout@v7
- name: Install external tools from toolchain
run: |
sudo apt update && sudo apt install -y xz-utils ninja-build
sudo apt update && sudo apt install -y xz-utils ninja-build pkg-config
cd toolchain
./install_abacus_toolchain_new.sh --with-dftd4=install --dry-run -j8
./scripts/stage4/install_stage4.sh
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
gfortran \
ccache \
ca-certificates \
pkg-config \
python-is-python3 \
python3-pip \
ninja-build \
Expand Down
14 changes: 0 additions & 14 deletions cmake/CollectBuildInfoVars.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -146,21 +146,7 @@ endif()

# Core Math Libraries
if(ENABLE_LCAO AND ENABLE_ELPA)
set(ABACUS_ELPA_VERSION "yes (version unknown)")
if(ELPA_VERSION)
set(ABACUS_ELPA_VERSION "yes (v${ELPA_VERSION})")
else()
find_program(ELPA_VERSION_EXE elpa2_print_version PATHS ${ELPA_DIR}/bin NO_DEFAULT_PATH)
if(ELPA_VERSION_EXE)
execute_process(COMMAND ${ELPA_VERSION_EXE} OUTPUT_VARIABLE ELPA_VER_RAW OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
if(ELPA_VER_RAW)
set(ABACUS_ELPA_VERSION "yes (${ELPA_VER_RAW})")
endif()
endif()
endif()
if(ABACUS_ELPA_VERSION STREQUAL "yes (version unknown)" AND ELPA_DIR)
set(ABACUS_ELPA_VERSION "yes (path: ${ELPA_DIR})")
endif()
else()
set(ABACUS_ELPA_VERSION "no")
endif()
Expand Down
65 changes: 34 additions & 31 deletions cmake/modules/FindELPA.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
###############################################################################
# - Find ELPA
# Find the native ELPA headers and libraries.
#
# ELPA_FOUND - True if libelpa is found.
# ELPA_LIBRARIES - List of libraries when using libyaml
# ELPA_INCLUDE_DIR - Where to find ELPA headers.
# Find the native ELPA headers and libraries through pkg-config.
#

find_package(PkgConfig)
# ========================================================================
# Deprecated (TODO: Remove this part)
# ========================================================================

# Compatible layer towards old manual routines
if(DEFINED ELPA_DIR)
message(WARNING "ELPA_DIR is deprecated and will be removed in the future release.")
endif()
if(DEFINED ELPA_INCLUDE_DIR)
set(ELPA_INCLUDE_DIRS ${ELPA_INCLUDE_DIR})
endif()
Expand All @@ -31,34 +32,35 @@ if(ELPA_INCLUDE_DIRS MATCHES "^/usr/include/elpa/.*")
endif()
endif()
if(ENABLE_OPENMP)
find_library(ELPA_LINK_LIBRARIES
find_library(ELPA_LINK_LIBRARIES
NAMES elpa_openmp elpa
HINTS ${ELPA_DIR}
PATH_SUFFIXES "lib"
)
)
else()
find_library(ELPA_LINK_LIBRARIES
find_library(ELPA_LINK_LIBRARIES
NAMES elpa
HINTS ${ELPA_DIR}
PATH_SUFFIXES "lib"
)
)
endif()

# Incompatible with ELPA earlier than 2021.11.001
# Before ELPA 2021.11.001, its pkg-config file
# is named like "elpa-2021.05.002.pc".
if(NOT ELPA_INCLUDE_DIRS AND PKG_CONFIG_FOUND)
if(DEFINED ELPA_DIR)
string(APPEND CMAKE_PREFIX_PATH ";${ELPA_DIR}")
# ========================================================================

if(NOT ELPA_INCLUDE_DIRS)
find_package(PkgConfig)
if(NOT PKG_CONFIG_FOUND)
message(FATAL_ERROR "Pkg-config is needed to get all information about the ELPA library")
endif()
# Find preferred library corresponding with ABACUS configuration first
if(ENABLE_OPENMP)
pkg_search_module(ELPA REQUIRED IMPORTED_TARGET GLOBAL elpa_openmp)
pkg_search_module(ELPA REQUIRED IMPORTED_TARGET GLOBAL elpa_openmp elpa)
else()
pkg_search_module(ELPA REQUIRED IMPORTED_TARGET GLOBAL elpa)
endif()
elseif(NOT PKG_CONFIG_FOUND)
message(STATUS
"ELPA : We need pkg-config to get all information about the elpa library")
if(${ELPA_VERSION} VERSION_LESS "2021.05.001")
message(FATAL_ERROR "ELPA version >= 2021.05.001 is required.")
endif()
endif()

# Handle the QUIET and REQUIRED arguments and
Expand All @@ -68,20 +70,21 @@ find_package_handle_standard_args(ELPA DEFAULT_MSG ELPA_LINK_LIBRARIES ELPA_INCL

# Copy the results to the output variables and target.
if(ELPA_FOUND)
list(GET ELPA_LINK_LIBRARIES 0 ELPA_LIBRARY)
set(ELPA_INCLUDE_DIR ${ELPA_INCLUDE_DIRS})

if(NOT TARGET ELPA::ELPA)
add_library(ELPA::ELPA UNKNOWN IMPORTED)
set_target_properties(ELPA::ELPA PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${ELPA_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${ELPA_INCLUDE_DIR}")
endif()
list(GET ELPA_LINK_LIBRARIES 0 ELPA_LIBRARY)
set(ELPA_INCLUDE_DIR ${ELPA_INCLUDE_DIRS})
if(NOT TARGET ELPA::ELPA)
add_library(ELPA::ELPA UNKNOWN IMPORTED)
set_target_properties(ELPA::ELPA PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${ELPA_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${ELPA_INCLUDE_DIR}")
endif()
endif()

set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${ELPA_INCLUDE_DIR})

# Compability workaround for ELPA_DIR
# TODO: Remove this check
include(CheckCXXSourceCompiles)
check_cxx_source_compiles("
#include <elpa/elpa_version.h>
Expand All @@ -93,7 +96,7 @@ int main(){}
ELPA_VERSION_SATISFIES
)
if(NOT ELPA_VERSION_SATISFIES)
message(FATAL_ERROR "ELPA version is too old. We support version 2021 or higher.")
message(FATAL_ERROR "ELPA version is too old. We support version 2021 or higher.")
endif()

mark_as_advanced(ELPA_INCLUDE_DIR ELPA_LIBRARY)
10 changes: 6 additions & 4 deletions docs/quick_start/easy_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ Here, 'build' is the path for building ABACUS; and '-D' is used for setting up s
- `MKLROOT`: If environment variable `MKLROOT` exists, `cmake` will take MKL as a preference, i.e. not using `LAPACK`, `ScaLAPACK` and `FFTW`. To disable MKL, unset environment variable `MKLROOT`, or pass `-DMKLROOT=OFF` to `cmake`.
- `LAPACK_DIR`: Path to OpenBLAS library `libopenblas.so`(including BLAS and LAPACK)
- `SCALAPACK_DIR`: Path to ScaLAPACK library `libscalapack.so`
- `ELPA_DIR`: Path to ELPA install directory; should be the folder containing 'include' and 'lib'.
> Note: In ABACUS v3.5.1 or earlier, if you install ELPA from source , please add a symlink to avoid the additional include file folder with version name: `ln -s elpa/include/elpa-2021.05.002/elpa elpa/include/elpa` to help the build system find ELPA headers.

- `FFTW3_DIR`: Path to FFTW3.
- `LIBRI_DIR`: (Optional) Path to LibRI.
- `LIBCOMM_DIR`: (Optional) Path to LibComm when `ENABLE_LIBRI=ON`.
Expand All @@ -184,7 +181,12 @@ For some dependencies built with CMake, such as Libxc, dftd4, cereal, and RapidJ
Here is an example:

```bash
CXX=mpiicpx cmake -B build -DCMAKE_INSTALL_PREFIX=~/abacus -DELPA_DIR=~/elpa-2025.01.001/build
CXX=mpiicpx cmake -B build \
Comment thread
Growl1234 marked this conversation as resolved.
-DCMAKE_INSTALL_PREFIX=~/abacus \
-DENABLE_MPI=ON \
-DENABLE_LCAO=ON \
-DENABLE_ELPA=ON \
-DENABLE_LIBXC=ON
```

### Build and Install
Expand Down
2 changes: 0 additions & 2 deletions toolchain/build_abacus_aocc-aocl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ BUILD_DIR=build_abacus_aocc_aocl
rm -rf $BUILD_DIR

PREFIX=$ABACUS_DIR
ELPA=${ELPA_ROOT}
CEREAL=${CEREAL_ROOT}/include
LAPACK=$AOCLhome/lib
SCALAPACK=$AOCLhome/lib
Expand Down Expand Up @@ -67,7 +66,6 @@ cmake -B $BUILD_DIR -DCMAKE_INSTALL_PREFIX=$PREFIX \
-DLAPACK_DIR=$LAPACK \
-DSCALAPACK_DIR=$SCALAPACK \
-DFFTW3_DIR=$FFTW3 \
-DELPA_DIR=$ELPA \
-DCEREAL_INCLUDE_DIR=$CEREAL \
-DENABLE_LCAO=ON \
-DENABLE_LIBXC=ON \
Expand Down
2 changes: 0 additions & 2 deletions toolchain/build_abacus_gcc-aocl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ BUILD_DIR=build_abacus_gcc_aocl
rm -rf $BUILD_DIR

PREFIX=$ABACUS_DIR
ELPA=${ELPA_ROOT}
LAPACK=$AOCLhome/lib
SCALAPACK=$AOCLhome/lib
FFTW3=$AOCLhome
Expand Down Expand Up @@ -64,7 +63,6 @@ cmake -B $BUILD_DIR -DCMAKE_INSTALL_PREFIX=$PREFIX \
-DLAPACK_DIR=$LAPACK \
-DSCALAPACK_DIR=$SCALAPACK \
-DFFTW3_DIR=$FFTW3 \
-DELPA_DIR=$ELPA \
-DENABLE_LCAO=ON \
-DENABLE_LIBXC=ON \
-DENABLE_OPENMP=ON \
Expand Down
2 changes: 0 additions & 2 deletions toolchain/build_abacus_gcc-mkl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ BUILD_DIR=build_abacus_gcc_mkl
rm -rf $BUILD_DIR

PREFIX=$ABACUS_DIR
ELPA=${ELPA_ROOT}
LIBRI=${LIBRI_ROOT}
LIBCOMM=${LIBCOMM_ROOT}
USE_CUDA=OFF # set ON to enable gpu-abacus
Expand Down Expand Up @@ -60,7 +59,6 @@ cmake -B $BUILD_DIR -DCMAKE_INSTALL_PREFIX=$PREFIX \
-DMPI_CXX_COMPILER=mpicxx \
-DMKLROOT=$MKLROOT \
-DENABLE_FLOAT_FFTW=ON \
-DELPA_DIR=$ELPA \
-DENABLE_LCAO=ON \
-DENABLE_LIBXC=ON \
-DENABLE_OPENMP=ON \
Expand Down
2 changes: 0 additions & 2 deletions toolchain/build_abacus_gnu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ rm -rf $BUILD_DIR
PREFIX=$ABACUS_DIR
LAPACK=${OPENBLAS_ROOT}/lib
SCALAPACK=${SCALAPACK_ROOT}/lib
ELPA=${ELPA_ROOT}
FFTW3=${FFTW_ROOT}
LIBRI=${LIBRI_ROOT}
LIBCOMM=${LIBCOMM_ROOT}
Expand Down Expand Up @@ -61,7 +60,6 @@ cmake -B $BUILD_DIR -DCMAKE_INSTALL_PREFIX=$PREFIX \
-DMPI_CXX_COMPILER=mpicxx \
-DLAPACK_DIR=$LAPACK \
-DSCALAPACK_DIR=$SCALAPACK \
-DELPA_DIR=$ELPA \
-DFFTW3_DIR=$FFTW3 \
-DENABLE_LCAO=ON \
-DENABLE_LIBXC=ON \
Expand Down
2 changes: 0 additions & 2 deletions toolchain/build_abacus_intel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ BUILD_DIR=build_abacus_intel
rm -rf $BUILD_DIR

PREFIX=$ABACUS_DIR
ELPA=${ELPA_ROOT}
LIBRI=${LIBRI_ROOT}
LIBCOMM=${LIBCOMM_ROOT}
USE_CUDA=OFF # set ON to enable gpu-abacus
Expand Down Expand Up @@ -61,7 +60,6 @@ cmake -B $BUILD_DIR -DCMAKE_INSTALL_PREFIX=$PREFIX \
-DMPI_CXX_COMPILER=mpiicpx \
-DMKLROOT=$MKLROOT \
-DENABLE_FLOAT_FFTW=ON \
-DELPA_DIR=$ELPA \
Comment thread
Growl1234 marked this conversation as resolved.
-DENABLE_LCAO=ON \
-DENABLE_LIBXC=ON \
-DENABLE_OPENMP=ON \
Expand Down
Loading