Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
515ff53
Add build info printing and update argument parsing
ZhouXY-PKU Nov 25, 2025
f202410
Add header guards and update ModuleIO namespace
ZhouXY-PKU Nov 25, 2025
95c2bbd
Add build_info.h.in for build configuration details
ZhouXY-PKU Nov 25, 2025
6429326
Enhance build info collection in CMakeLists.txt
ZhouXY-PKU Nov 25, 2025
32f7822
Add support for '-I' option in argument parsing
ZhouXY-PKU Nov 25, 2025
4555efc
Fix typo and enhance documentation in parse_args.h
ZhouXY-PKU Nov 25, 2025
9a917c5
Refactor para_json.h for JSON handling
ZhouXY-PKU Nov 25, 2025
c148348
Add script to generate build_info.h for builds
ZhouXY-PKU Nov 25, 2025
8d1a5cd
Enhance Makefile with build info generation rules
ZhouXY-PKU Nov 25, 2025
9aa044d
Add command to remove build directory before cmake
ZhouXY-PKU Nov 25, 2025
28267fe
Remove build directory before cmake commands
ZhouXY-PKU Nov 25, 2025
0d77358
Fix paths in Makefile for build_info generation
ZhouXY-PKU Nov 25, 2025
916f115
Update input and output file paths in script
ZhouXY-PKU Nov 25, 2025
2bb5bc3
Update build_test_makefile.yml
ZhouXY-PKU Nov 25, 2025
73cabe2
Refactor LCAO algorithm support check
ZhouXY-PKU Nov 25, 2025
4a0111a
Update preprocessor directives for commit info
ZhouXY-PKU Nov 25, 2025
7e53503
Fix preprocessor directive syntax for COMMIT
ZhouXY-PKU Nov 25, 2025
dcb9668
Add include path for build_info.h in test target
ZhouXY-PKU Nov 26, 2025
13f76fd
Update CMakeLists.txt
ZhouXY-PKU Nov 26, 2025
333536b
Create Testing.cmake
ZhouXY-PKU Nov 26, 2025
b254850
Create CollectBuildInfoVars.cmake
ZhouXY-PKU Nov 26, 2025
25f2787
Add BuildInfo.cmake for generating build info header
ZhouXY-PKU Nov 26, 2025
8643b65
Update generate_build_info.sh
ZhouXY-PKU Nov 26, 2025
7d27e1d
Update Makefile
ZhouXY-PKU Nov 26, 2025
f65ba9a
Fix indentation in Makefile for parse_args.o rule
ZhouXY-PKU Nov 26, 2025
eb6de45
Change target_link_libraries to PRIVATE for UT_TARGET
ZhouXY-PKU Nov 26, 2025
0e9a1d7
Update Makefile
ZhouXY-PKU Nov 26, 2025
9c894fe
Update Testing.cmake
ZhouXY-PKU Nov 27, 2025
bbd036a
Update Makefile
ZhouXY-PKU Nov 27, 2025
777e705
Update build_test_makefile.yml
ZhouXY-PKU Nov 27, 2025
d8b3b34
Update Makefile
ZhouXY-PKU Nov 27, 2025
f87e166
Update Testing.cmake
ZhouXY-PKU Nov 27, 2025
f256134
Update Testing.cmake
ZhouXY-PKU Nov 27, 2025
666e1bb
Link io_basic library with BuildInfo::Headers
ZhouXY-PKU Nov 27, 2025
2d005f6
target_link_libraries( io_basic PUBLIC BuildInfo::Headers )
ZhouXY-PKU Nov 27, 2025
9f91e27
Update CMakeLists.txt
ZhouXY-PKU Nov 27, 2025
eb27276
Add ABACUS_ROOT variable to Makefile
ZhouXY-PKU Nov 27, 2025
88b5dd7
Update Makefile
ZhouXY-PKU Nov 27, 2025
99f7138
Update CMakeLists.txt
ZhouXY-PKU Nov 27, 2025
eaef2f2
Fix formatting in Makefile for variable assignments
ZhouXY-PKU Nov 27, 2025
1d56ef9
Update CMakeLists.txt
ZhouXY-PKU Nov 27, 2025
f56f4ae
Update CMakeLists.txt
ZhouXY-PKU Nov 27, 2025
6cf8ccf
Update Testing.cmake
ZhouXY-PKU Nov 27, 2025
cf25b51
Update CMakeLists.txt
ZhouXY-PKU Nov 27, 2025
0c113f5
Update CMakeLists.txt
ZhouXY-PKU Nov 27, 2025
0d6b4b8
Update BuildInfo.cmake
ZhouXY-PKU Nov 27, 2025
71581eb
Update BuildInfo.cmake
ZhouXY-PKU Nov 27, 2025
12786a7
Update Testing.cmake
ZhouXY-PKU Nov 27, 2025
5345998
Update CMakeLists.txt
ZhouXY-PKU Nov 27, 2025
7f1214c
Update CMakeLists.txt
ZhouXY-PKU Nov 27, 2025
689600f
Update CMakeLists.txt
ZhouXY-PKU Nov 27, 2025
a34e16c
Update CMakeLists.txt
ZhouXY-PKU Nov 27, 2025
b2ab05d
Update parse_args_test.cpp
ZhouXY-PKU Nov 27, 2025
9411103
Update parse_args_test.cpp
ZhouXY-PKU Nov 27, 2025
dc2c06d
Update test.yml
ZhouXY-PKU Nov 27, 2025
e3b10a4
Update CMakeLists.txt
ZhouXY-PKU Nov 28, 2025
459d61f
Update CMakeLists.txt
ZhouXY-PKU Nov 28, 2025
a48f06c
Update CMakeLists.txt
ZhouXY-PKU Nov 28, 2025
afd44a0
Update .gitignore
ZhouXY-PKU Nov 28, 2025
6e237f8
Update test.yml
ZhouXY-PKU Nov 28, 2025
d99f01c
Merge branch 'develop' into ZhouXY-PKU-abacus-info
ZhouXY-PKU Nov 28, 2025
95eaf53
Update FindFFTW3.cmake
ZhouXY-PKU Nov 29, 2025
45b482d
Update CollectBuildInfoVars.cmake
ZhouXY-PKU Nov 29, 2025
73bd1f3
Update CollectBuildInfoVars.cmake
ZhouXY-PKU Nov 29, 2025
ab759f6
Update generate_build_info.sh
ZhouXY-PKU Nov 29, 2025
83e1c31
Update Testing.cmake
ZhouXY-PKU Nov 30, 2025
14ee845
Update Testing.cmake
ZhouXY-PKU Dec 1, 2025
de18523
Update CMakeLists.txt
ZhouXY-PKU Dec 1, 2025
cc39dcf
Update Testing.cmake
ZhouXY-PKU Dec 1, 2025
93e3f9b
Update parse_args_test.cpp
ZhouXY-PKU Dec 1, 2025
1226fef
Update parse_args_test.cpp
ZhouXY-PKU Dec 1, 2025
ba07123
Update parse_args_test.cpp
ZhouXY-PKU Dec 1, 2025
ebfc675
Update parse_args_test.cpp
ZhouXY-PKU Dec 1, 2025
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
1 change: 1 addition & 0 deletions .github/workflows/build_test_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ jobs:
export PKG_CONFIG_PATH=${GKLIB_ROOT}/lib/pkgconfig:${METIS32_ROOT}/lib/pkgconfig:${PARMETIS32_ROOT}/lib/pkgconfig:${SUPERLU32_DIST_ROOT}/lib/pkgconfig:${PEXSI32_ROOT}/lib/pkgconfig:${PKG_CONFIG_PATH}
export CPATH=${GKLIB_ROOT}/include:${METIS32_ROOT}/include:${PARMETIS32_ROOT}/include:${SUPERLU32_DIST_ROOT}/include:${PEXSI32_ROOT}/include:${CPATH}
export CMAKE_PREFIX_PATH=${PEXSI32_ROOT}:${SUPERLU_DIST32_ROOT}:${PARMETIS32_ROOT}:${METIS32_ROOT}:${GKLIB_ROOT}:${CMAKE_PREFIX_PATH}
rm -rf build
cmake -B build ${{ matrix.build_args }}
cmake --build build -j2
4 changes: 3 additions & 1 deletion .github/workflows/build_test_makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
- name: Build
run: |
export I_MPI_CXX=icpx
chmod a+x generate_build_info.sh
cd source
make -j2 ${{ matrix.build_args }}
mkdir build && cd build
make -f ../Makefile -j2 ${{ matrix.build_args }}

1 change: 1 addition & 0 deletions .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- name: Build
run: |
nvidia-smi
rm -rf build
cmake -B build -DUSE_CUDA=ON -DBUILD_TESTING=ON
cmake --build build -j4
cmake --install build
Expand Down
74 changes: 37 additions & 37 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,130 +60,130 @@ jobs:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V --timeout 1700 -R integrated_test"

ctest --test-dir build -V --timeout 1700 -R integrated_test
- name: Module_Base Unittests
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_BASE"

ctest --test-dir build -V --timeout 1700 -R MODULE_BASE
- name: Module_IO Unittests
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_IO"

ctest --test-dir build -V --timeout 1700 -R MODULE_IO
- name: Module_HSolver Unittests
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_HSOLVER"

ctest --test-dir build -V --timeout 1700 -R MODULE_HSOLVER
- name: Module_Cell Unittests
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_CELL"

ctest --test-dir build -V --timeout 1700 -R MODULE_CELL
- name: Module_MD Unittests
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_MD"

ctest --test-dir build -V --timeout 1700 -R MODULE_MD
- name: source_psi Unittests
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V --timeout 1700 -R source_psi"

ctest --test-dir build -V --timeout 1700 -R source_psi
- name: Module_RI Unittests
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_RI"

ctest --test-dir build -V --timeout 1700 -R MODULE_RI
- name: 01_PW Test
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V --timeout 1700 -R 01_PW"

ctest --test-dir build -V --timeout 1700 -R 01_PW
- name: 02_NAO_Gamma Test
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V --timeout 1700 -R 02_NAO_Gamma"

ctest --test-dir build -V --timeout 1700 -R 02_NAO_Gamma
- name: 03_NAO_multik Test
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V --timeout 1700 -R 03_NAO_multik"

ctest --test-dir build -V --timeout 1700 -R 03_NAO_multik
- name: 04_FF Test
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V --timeout 1700 -R 04_FF"

ctest --test-dir build -V --timeout 1700 -R 04_FF
- name: 05_rtTDDFT Test
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V --timeout 1700 -R 05_rtTDDFT"

ctest --test-dir build -V --timeout 1700 -R 05_rtTDDFT
- name: 06_SDFT Test
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V --timeout 1700 -R 06_SDFT"

ctest --test-dir build -V --timeout 1700 -R 06_SDFT
- name: 07_OFDFT Test
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V --timeout 1700 -R 07_OFDFT"

ctest --test-dir build -V --timeout 1700 -R 07_OFDFT
- name: 08_EXX Test
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V --timeout 1700 -R 08_EXX"

ctest --test-dir build -V --timeout 1700 -R 08_EXX
- name: 09_DeePKS Test
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V --timeout 1700 -R 09_DeePKS"

ctest --test-dir build -V --timeout 1700 -R 09_DeePKS
- name: 10_others Test
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V --timeout 1700 -R 10_others"

ctest --test-dir build -V --timeout 1700 -R 10_others
- name: Other Unittests
env:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V --timeout 1700 -E 'integrate_test|01_PW|02_NAO_Gamma|03_NAO_multik|04_FF|05_rtTDDFT|06_SDFT|07_OFDFT|08_EXX|09_DeePKS|10_others|11_PW_GPU|12_NAO_Gamma_GPU|13_NAO_multik_GPU|15_rtTDDFT_GPU|16_SDFT_GPU|MODULE_BASE|MODULE_IO|MODULE_HSOLVER|MODULE_CELL|MODULE_MD|source_psi|MODULE_RI'"
ctest --test-dir build -V --timeout 1700 -E 'integrate_test|01_PW|02_NAO_Gamma|03_NAO_multik|04_FF|05_rtTDDFT|06_SDFT|07_OFDFT|08_EXX|09_DeePKS|10_others|11_PW_GPU|12_NAO_Gamma_GPU|13_NAO_multik_GPU|15_rtTDDFT_GPU|16_SDFT_GPU|MODULE_BASE|MODULE_IO|MODULE_HSOLVER|MODULE_CELL|MODULE_MD|source_psi|MODULE_RI'
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/build*
build_info.h
bin
obj
*.o
Expand All @@ -24,4 +25,4 @@ abacus.json
*.npy
toolchain/install/
toolchain/abacus_env.sh
.trae
.trae
71 changes: 6 additions & 65 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ if(ENABLE_RAPIDJSON)
OFF
CACHE INTERNAL "")
FetchContent_MakeAvailable(rapidjson)
set(RapidJSON_INCLUDE_PATH "${rapidjson_SOURCE_DIR}/include")
endif()
set(RapidJSON_INCLUDE_PATH "${rapidjson_SOURCE_DIR}/include")
add_compile_definitions(__RAPIDJSON)
add_definitions(-DRAPIDJSON_HAS_CXX11_NOEXCEPT=0)
include_directories(${RapidJSON_INCLUDE_PATH})
Expand Down Expand Up @@ -182,6 +182,7 @@ if(ENABLE_COVERAGE)
add_coverage(${ABACUS_BIN_NAME})
endif()


macro(set_if_higher VARIABLE VALUE)
if(${VARIABLE} LESS ${VALUE})
set(${VARIABLE} ${VALUE})
Expand Down Expand Up @@ -669,73 +670,13 @@ if(INFO)
# modifications on blas_connector and lapack_connector
endif()

# Add performance test in abacus
if(ENABLE_GOOGLEBENCH)
set(BUILD_TESTING ON)
find_package(benchmark HINTS ${BENCHMARK_DIR})
if(NOT ${benchmark_FOUND})
set(BENCHMARK_USE_BUNDLED_GTEST OFF)
include(FetchContent)
FetchContent_Declare(
benchmark
GIT_REPOSITORY https://github.com/google/benchmark.git
GIT_TAG "origin/main"
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE)
set(BENCHMARK_ENABLE_TESTING OFF)
FetchContent_MakeAvailable(benchmark)
endif()
endif()

if(BUILD_TESTING)
set_if_higher(CMAKE_CXX_STANDARD 14) # Required in orbital
include(CTest)
enable_testing()
find_package(GTest HINTS /usr/local/lib/ ${GTEST_DIR})
if(NOT ${GTest_FOUND})
include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG "origin/main"
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE)
FetchContent_MakeAvailable(googletest)
endif()
# TODO: Try the GoogleTest module.
# https://cmake.org/cmake/help/latest/module/GoogleTest.html
add_subdirectory(tests) # Contains integration tests

function(AddTest) # function for UT
cmake_parse_arguments(UT "DYN" "TARGET"
"LIBS;DYN_LIBS;STATIC_LIBS;SOURCES;DEPENDS" ${ARGN})
add_executable(${UT_TARGET} ${UT_SOURCES})

if(ENABLE_COVERAGE)
add_coverage(${UT_TARGET})
endif()

# dependencies & link library
target_link_libraries(${UT_TARGET} ${UT_LIBS} Threads::Threads
GTest::gtest_main GTest::gmock_main)
if(ENABLE_GOOGLEBENCH)
target_link_libraries(
${UT_TARGET} benchmark::benchmark)
endif()

if(USE_OPENMP)
target_link_libraries(${UT_TARGET} OpenMP::OpenMP_CXX)
endif()
install(TARGETS ${UT_TARGET} DESTINATION ${CMAKE_BINARY_DIR}/tests)
add_test(
NAME ${UT_TARGET}
COMMAND ${UT_TARGET}
WORKING_DIRECTORY $<TARGET_FILE_DIR:${UT_TARGET}>)
endfunction(AddTest)
endif()
include(cmake/Testing.cmake)

add_subdirectory(source)

include(cmake/BuildInfo.cmake)
setup_build_info()

target_link_libraries(
${ABACUS_BIN_NAME}
base
Expand Down
28 changes: 28 additions & 0 deletions cmake/BuildInfo.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# =============================================================================
# Generate Build Information Header (Including Information Collection)
# ==============================================================================

# include_guard(GLOBAL)

function(setup_build_info)
message(STATUS "Setting up build information...")

include(cmake/CollectBuildInfoVars.cmake)

set(BUILD_INFO_TEMPLATE "${CMAKE_SOURCE_DIR}/source/source_io/build_info.h.in")
set(BUILD_INFO_OUTPUT "${CMAKE_BINARY_DIR}/source/source_io/build_info.h")

configure_file(
${BUILD_INFO_TEMPLATE}
${BUILD_INFO_OUTPUT}
@ONLY
)

# add_library(BuildInfo::Headers INTERFACE IMPORTED GLOBAL)
# target_include_directories(BuildInfo::Headers
# INTERFACE
# ${CMAKE_BINARY_DIR}/source/source_io
# )

message(STATUS "Build info header configured: ${BUILD_INFO_OUTPUT}")
endfunction()
Loading
Loading