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
8 changes: 0 additions & 8 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
[submodule "deps/LibRI"]
path = deps/LibRI
url = https://github.com/abacusmodeling/LibRI.git
branch = master
[submodule "deps/LibComm"]
path = deps/LibComm
url = https://github.com/abacusmodeling/LibComm.git
branch = master
[submodule "deps/libpaw_interface"]
path = deps/libpaw_interface
url = https://github.com/wenfei-li/libpaw_interface
Expand Down
14 changes: 4 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -538,13 +538,10 @@ endif()
if(ENABLE_LIBRI)
set_if_higher(CMAKE_CXX_STANDARD 14)
if(LIBRI_DIR)
include_directories(${LIBRI_DIR}/include)
elseif(GIT_SUBMODULE)
git_submodule_update()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/LibRI/include)
else()
message(FATAL_ERROR "Must provide LIBRI_DIR for RI related features.")
find_package(LibRI REQUIRED)
endif()
include_directories(${LIBRI_DIR}/include)
target_link_libraries(${ABACUS_BIN_NAME} ri module_exx_symmetry)
add_compile_definitions(__EXX EXX_DM=3 EXX_H_COMM=2 TEST_EXX_LCAO=0
TEST_EXX_RADIAL=1)
Expand All @@ -555,13 +552,10 @@ if(ENABLE_LIBRI OR DEFINED LIBCOMM_DIR)
endif()
if(ENABLE_LIBCOMM)
if(LIBCOMM_DIR)
include_directories(${LIBCOMM_DIR}/include)
elseif(GIT_SUBMODULE)
git_submodule_update()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/LibComm/include)
else()
message(FATAL_ERROR "Must provide LIBCOMM_DIR for RI related features.")
find_package(LibComm REQUIRED)
endif()
include_directories(${LIBCOMM_DIR}/include)
endif()

if(ENABLE_PAW)
Expand Down
30 changes: 30 additions & 0 deletions cmake/FindLibComm.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
###############################################################################
# - Find LibComm
# Find the native LibComm files.
#
# LIBCOMM_FOUND - True if LibComm is found.
# LIBCOMM_DIR - Where to find LibComm files.

find_path(LIBCOMM_DIR
include/Comm/Comm_Tools.h
HINTS ${LIBCOMM_DIR}
HINTS ${LibComm_DIR}
HINTS ${libcomm_DIR}
)

if(NOT LIBCOMM_DIR)
include(FetchContent)
FetchContent_Declare(
LibComm
URL https://github.com/abacusmodeling/LibComm/archive/refs/tags/v0.1.1.tar.gz
)
FetchContent_Populate(LibComm)
set(LIBCOMM_DIR ${libcomm_SOURCE_DIR})
endif()
# Handle the QUIET and REQUIRED arguments and
# set LIBCOMM_FOUND to TRUE if all variables are non-zero.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibComm DEFAULT_MSG LIBCOMM_DIR)

# Copy the results to the output variables and target.
mark_as_advanced(LIBCOMM_DIR)
30 changes: 30 additions & 0 deletions cmake/FindLibRI.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
###############################################################################
# - Find LibRI
# Find the native LibRI files.
#
# LIBRI_FOUND - True if LibRI is found.
# LIBRI_DIR - Where to find LibRI files.

find_path(LIBRI_DIR
include/RI/version.h
HINTS ${LIBRI_DIR}
HINTS ${LibRI_DIR}
HINTS ${libri_DIR}
)

if(NOT LIBRI_DIR)
include(FetchContent)
FetchContent_Declare(
LibRI
URL https://github.com/abacusmodeling/LibRI/archive/refs/tags/v0.2.1.1.tar.gz
)
FetchContent_Populate(LibRI)
set(LIBRI_DIR ${libri_SOURCE_DIR})
endif()
# Handle the QUIET and REQUIRED arguments and
# set LIBRI_FOUND to TRUE if all variables are non-zero.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibRI DEFAULT_MSG LIBRI_DIR)

# Copy the results to the output variables and target.
mark_as_advanced(LIBRI_DIR)
1 change: 0 additions & 1 deletion deps/LibComm
Submodule LibComm deleted from ec9845
1 change: 0 additions & 1 deletion deps/LibRI
Submodule LibRI deleted from bd299f
2 changes: 1 addition & 1 deletion toolchain/scripts/stage4/install_libcomm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")/.." && pwd -P)"

libcomm_ver="0.1.1"
libcomm_sha256="3764c934c895bfd9d8fd766d46e6e3d03230f8076e3edbcc31e10ff8f30075a4"
libcomm_sha256="fa162a197678654f15d91a5a917cce7fb2748bd9b0e344363edea2db87547b72"
source "${SCRIPT_DIR}"/common_vars.sh
source "${SCRIPT_DIR}"/tool_kit.sh
source "${SCRIPT_DIR}"/signal_trap.sh
Expand Down