Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 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
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
72 changes: 7 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 @@ -673,73 +674,14 @@ 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)
setup_testing()

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