Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
597f832
fix some typos in `_hsolver.py`
a1henu Sep 18, 2024
c0f35ea
Merge branch 'deepmodeling:develop' into develop
a1henu Sep 26, 2024
9e705b9
fix some bugs caused by #5134
a1henu Sep 26, 2024
4df6647
Merge branch 'deepmodeling:develop' into develop
a1henu Sep 26, 2024
873a6a7
Merge branch 'deepmodeling:develop' into develop
a1henu Oct 10, 2024
522d387
Merge branch 'deepmodeling:develop' into develop
a1henu Oct 23, 2024
8b2f66a
Refactor hsolver module and remove unused code
a1henu Oct 23, 2024
2e97a26
refactor the structure of pythonization source code
a1henu Oct 23, 2024
2f8cb6e
fix some bug
a1henu Oct 23, 2024
97ac95f
Refactor __getattr__ function in __init__.py to handle attribute errors
a1henu Oct 23, 2024
c9c6b50
Merge branch 'develop' of https://github.com/a1henu/abacus-develop int…
a1henu Oct 24, 2024
6e3ed8c
fix some bugs
a1henu Oct 24, 2024
8382659
Add CONTRIBUTING.md to facilitate contributing to pyabacus project
a1henu Oct 24, 2024
90d7197
Merge branch 'deepmodeling:develop' into develop
a1henu Oct 24, 2024
8cfb4c9
fix typos
a1henu Oct 24, 2024
8261618
Merge branch 'develop' of github.com:a1henu/abacus-develop into develop
a1henu Oct 24, 2024
68a0c76
Update CONTRIBUTING.md
a1henu Oct 24, 2024
a73c487
Update CONTRIBUTING.md
a1henu Oct 24, 2024
ebbef70
update README.md and CONTRIBUTING.md
a1henu Oct 24, 2024
9647167
update README.md
a1henu Oct 24, 2024
52b47b0
update CONTRIBUTING.md
a1henu Oct 24, 2024
c9aad8a
update CONTRIBUTING.md
a1henu Oct 24, 2024
baa781a
fix a bug caused by tuple in python3.8
a1henu Oct 24, 2024
bf55705
Merge branch 'develop' into develop
a1henu Oct 24, 2024
04e95ac
update
a1henu Oct 24, 2024
a3077d5
XXMerge branch 'develop' of github.com:a1henu/abacus-develop into dev…
a1henu Oct 24, 2024
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
100 changes: 14 additions & 86 deletions python/pyabacus/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
cmake_minimum_required(VERSION 3.15...3.26)

# project settings
project(
${SKBUILD_PROJECT_NAME}
VERSION ${SKBUILD_PROJECT_VERSION}
LANGUAGES CXX)

# find python and pybind11
find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
find_package(pybind11 CONFIG REQUIRED)

# set source path
set(ABACUS_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../../source")
set(BASE_PATH "${ABACUS_SOURCE_DIR}/module_base")
set(NAO_PATH "${ABACUS_SOURCE_DIR}/module_basis/module_nao")
set(HSOLVER_PATH "${ABACUS_SOURCE_DIR}/module_hsolver")
set(HAMILT_PATH "${ABACUS_SOURCE_DIR}/module_hamilt_general")
set(PSI_PATH "${ABACUS_SOURCE_DIR}/module_psi")
set(ENABLE_LCAO ON)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../../cmake")
Expand Down Expand Up @@ -63,11 +65,14 @@ else()
endif()
endif()

include_directories(${BASE_PATH}
# add include directories
include_directories(
${BASE_PATH}
${ABACUS_SOURCE_DIR}
${ABACUS_SOURCE_DIR}/module_base/module_container)
${ABACUS_SOURCE_DIR}/module_base/module_container
)

# add library
# add basic libraries
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# add base
set(BASE_BINARY_DIR "${PROJECT_SOURCE_DIR}/build/base")
Expand All @@ -80,83 +85,6 @@ set(ORB_BINARY_DIR "${PROJECT_SOURCE_DIR}/build/orb")
add_subdirectory(${ABACUS_SOURCE_DIR}/module_basis/module_ao ${ORB_BINARY_DIR})
# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

# add nao shared library
list(APPEND _naos
${NAO_PATH}/atomic_radials.cpp
${NAO_PATH}/beta_radials.cpp
${NAO_PATH}/hydrogen_radials.cpp
${NAO_PATH}/numerical_radial.cpp
${NAO_PATH}/pswfc_radials.cpp
${NAO_PATH}/radial_collection.cpp
${NAO_PATH}/radial_set.cpp
${NAO_PATH}/real_gaunt_table.cpp
${NAO_PATH}/sphbes_radials.cpp
${NAO_PATH}/two_center_bundle.cpp
${NAO_PATH}/two_center_integrator.cpp
${NAO_PATH}/two_center_table.cpp
${NAO_PATH}/projgen.cpp
# dependency
${ABACUS_SOURCE_DIR}/module_base/kernels/math_op.cpp
# ${ABACUS_SOURCE_DIR}/module_psi/kernels/psi_memory_op.cpp
${ABACUS_SOURCE_DIR}/module_base/module_device/memory_op.cpp
)
add_library(naopack SHARED
${_naos}
)
# add diago shared library
list(APPEND _diago
${HSOLVER_PATH}/diago_dav_subspace.cpp
${HSOLVER_PATH}/diago_david.cpp
${HSOLVER_PATH}/diag_const_nums.cpp
${HSOLVER_PATH}/diago_iter_assist.cpp

${HSOLVER_PATH}/kernels/dngvd_op.cpp
${HSOLVER_PATH}/kernels/math_kernel_op.cpp
# dependency
${BASE_PATH}/module_device/device.cpp
${BASE_PATH}/module_device/memory_op.cpp

${HAMILT_PATH}/operator.cpp
${PSI_PATH}/psi.cpp
)
add_library(diagopack SHARED
${_diago}
)
target_link_libraries(diagopack
PRIVATE
${OpenBLAS_LIBRARIES}
${LAPACK_LIBRARIES}
)
# link math_libs
if(MKLROOT)
target_link_libraries(naopack
base
parameter
container
orb
${math_libs}
MPI::MPI_CXX
OpenMP::OpenMP_CXX
)
else()
target_link_libraries(naopack
base
parameter
container
orb
${math_libs}
)
endif()
# list(APPEND _sources ${_naos} ${_bases})
list(APPEND _sources
${PROJECT_SOURCE_DIR}/src/py_abacus.cpp
${PROJECT_SOURCE_DIR}/src/py_base_math.cpp
${PROJECT_SOURCE_DIR}/src/py_m_nao.cpp
${PROJECT_SOURCE_DIR}/src/py_hsolver.cpp
)
pybind11_add_module(_core MODULE ${_sources})
target_link_libraries(_core PRIVATE pybind11::headers naopack diagopack)
target_compile_definitions(_core PRIVATE VERSION_INFO=${PROJECT_VERSION})
# set RPATH
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
Expand All @@ -167,9 +95,9 @@ execute_process(
# set package name to pyabacus
set(TARGET_PACK pyabacus)
set(CMAKE_INSTALL_RPATH "${PYTHON_SITE_PACKAGES}/${TARGET_PACK}")
set_target_properties(_core PROPERTIES INSTALL_RPATH "$ORIGIN")
set_target_properties(naopack PROPERTIES INSTALL_RPATH "$ORIGIN")
set_target_properties(diagopack PROPERTIES INSTALL_RPATH "$ORIGIN")
install(TARGETS _core naopack DESTINATION ${TARGET_PACK})
install(TARGETS _core diagopack DESTINATION ${TARGET_PACK})

# add subdirectories for submodules
add_subdirectory(${PROJECT_SOURCE_DIR}/src/hsolver)
add_subdirectory(${PROJECT_SOURCE_DIR}/src/ModuleBase)
add_subdirectory(${PROJECT_SOURCE_DIR}/src/ModuleNAO)

Loading