Skip to content

Commit

Permalink
Merge branch 'develop' into warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhuxuegang2022 authored Apr 2, 2024
2 parents d1b3017 + 974ebed commit 7d13dc3
Show file tree
Hide file tree
Showing 304 changed files with 26,035 additions and 7,700 deletions.
82 changes: 41 additions & 41 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
---
Language: Cpp
Language: Cpp
BasedOnStyle: Microsoft

AlignArrayOfStructures: Left
AlignArrayOfStructures: Right
AlwaysBreakTemplateDeclarations: Yes

AllowAllArgumentsOnNextLine: 'false'
AllowAllParametersOfDeclarationOnNextLine: 'false'
BinPackArguments: 'false'
BinPackParameters: 'false'
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
BinPackArguments: false
BinPackParameters: false

BreakBeforeBinaryOperators: All
BreakBeforeTernaryOperators: 'true'
BreakBeforeTernaryOperators: true

Cpp11BracedListStyle: 'true'
FixNamespaceComments: 'true'
Cpp11BracedListStyle: true
FixNamespaceComments: true

# About include
IncludeBlocks: Regroup
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^<.*\.h>'
Priority: 1
SortPriority: 0
CaseSensitive: false
- Regex: '^<.*'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '^<ext/.*\.h>'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^<.*\.h>'
Priority: 1
SortPriority: 0
CaseSensitive: false
- Regex: '^<.*'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 3
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '([-_](test|unittest))?$'
IncludeIsMainSourceRegex: ''

IndentWidth: '4'
IndentWidth: 4
IndentWrappedFunctionNames: true

# About Point
Expand All @@ -47,22 +47,22 @@ PointerAlignment: Left

PackConstructorInitializers: NextLine

ReflowComments: 'true'
SortIncludes: 'true'
SortUsingDeclarations: 'true'
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true

# About space
SpaceAfterCStyleCast: 'false'
SpaceAfterLogicalNot: 'false'
SpaceBeforeRangeBasedForLoopColon: 'false'
SpaceInEmptyParentheses: 'false'
SpacesInAngles: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInContainerLiterals: 'false'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceBeforeRangeBasedForLoopColon: false
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false

Standard: Cpp11
TabWidth: '4'
Standard: c++11
TabWidth: 4
UseTab: Never
...
4 changes: 4 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
### Reminder
- [ ] Have you linked an issue with this pull request?
- [ ] Have you added adequate unit tests and/or case tests for your pull request?
- [ ] Have you noticed possible changes of behavior below or in the linked issue?
- [ ] Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)

### Linked Issue
Fix #...

### Unit Tests and/or Case Tests for my changes
- A unit test is added for each new feature or bug fix.

### What's changed?
- Example: My changes might affect the performance of the application under certain conditions, and I have tested the impact on various scenarios...

Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Pyabacus Build and Test

on:
pull_request:

jobs:
test:
name: PyTest
runs-on: ubuntu-latest
container:
image: ghcr.io/deepmodeling/abacus-gnu
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Build Pyabacus
run: |
cd python/pyabacus
python -m pip install -v .[test]
- name: Test Pyabacus
run: |
cd python/pyabacus/tests
pytest -v
13 changes: 1 addition & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ if(POLICY CMP0135) # https://cmake.org/cmake/help/git-stage/policy/CMP0135.html
endif()

project(ABACUS
VERSION 3.0.0
DESCRIPTION "ABACUS is an electronic structure package based on DFT."
HOMEPAGE_URL "https://github.com/deepmodeling/abacus-develop"
LANGUAGES CXX
Expand Down Expand Up @@ -394,19 +393,9 @@ if(MKLROOT)
list(APPEND math_libs -lifcore)
endif()
else()
# In compatibility to builtin FindLAPACK.cmake before v3.5.4
if(DEFINED LAPACK_DIR)
string(APPEND CMAKE_PREFIX_PATH ";${LAPACK_DIR}")
endif()
if(DEFINED LAPACK_LIBRARY)
set(LAPACK_LIBRARIES ${LAPACK_LIBRARY})
endif()
if(DEFINED BLAS_DIR)
string(APPEND CMAKE_PREFIX_PATH ";${BLAS_DIR}")
endif()

find_package(FFTW3 REQUIRED)
find_package(LAPACK REQUIRED)
find_package(Lapack REQUIRED)
include_directories(${FFTW3_INCLUDE_DIRS})
list(APPEND math_libs FFTW3::FFTW3 LAPACK::LAPACK BLAS::BLAS)

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.cuda
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ADD https://api.github.com/repos/deepmodeling/abacus-develop/git/refs/heads/deve

RUN git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
cd abacus-develop && \
cmake -B build -DUSE_CUDA=ON && \
cmake -B build -DUSE_CUDA=ON -DENABLE_RAPIDJSON=ON && \
cmake --build build -j`nproc` && \
cmake --install build && \
rm -rf build && \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.gnu
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ADD https://api.github.com/repos/deepmodeling/abacus-develop/git/refs/heads/deve

RUN git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
cd abacus-develop && \
cmake -B build -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON && \
cmake -B build -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_RAPIDJSON=ON && \
cmake --build build -j`nproc` && \
cmake --install build && \
rm -rf build && \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.intel
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ ADD https://api.github.com/repos/deepmodeling/abacus-develop/git/refs/heads/deve
RUN source /opt/intel/oneapi/setvars.sh && \
git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
cd abacus-develop && \
cmake -B build -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON && \
cmake -B build -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_RAPIDJSON=ON && \
cmake --build build -j`nproc` && \
cmake --install build && \
rm -rf build && \
Expand Down
15 changes: 15 additions & 0 deletions cmake/FindBlas.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
if(DEFINED BLAS_DIR)
string(APPEND CMAKE_PREFIX_PATH ";${BLAS_DIR}")
endif()
if(DEFINED BLAS_LIBRARY)
set(BLAS_LIBRARIES ${BLAS_LIBRARY})
endif()

find_package(BLAS REQUIRED)

if(NOT TARGET BLAS::BLAS)
add_library(BLAS::BLAS UNKNOWN IMPORTED)
set_target_properties(BLAS::BLAS PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${BLAS_LIBRARIES}")
endif()
17 changes: 17 additions & 0 deletions cmake/FindLapack.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# In compatibility to builtin FindLAPACK.cmake before v3.5.4
if(DEFINED LAPACK_DIR)
string(APPEND CMAKE_PREFIX_PATH ";${LAPACK_DIR}")
endif()
if(DEFINED LAPACK_LIBRARY)
set(LAPACK_LIBRARIES ${LAPACK_LIBRARY})
endif()

find_package(Blas REQUIRED)
find_package(LAPACK REQUIRED)

if(NOT TARGET LAPACK::LAPACK)
add_library(LAPACK::LAPACK UNKNOWN IMPORTED)
set_target_properties(LAPACK::LAPACK PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${LAPACK_LIBRARIES}")
endif()
2 changes: 1 addition & 1 deletion cmake/FindLibxc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ endif()
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_search_module(Libxc IMPORTED_TARGET GLOBAL libxc)
find_package_handle_standard_args(Libxc DEFAULT_MSG Libxc_LINK_LIBRARIES Libxc_INCLUDE_DIRS)
find_package_handle_standard_args(Libxc DEFAULT_MSG Libxc_LINK_LIBRARIES Libxc_FOUND)
endif()
if(NOT Libxc_FOUND)
find_package(Libxc REQUIRED HINTS
Expand Down
Loading

0 comments on commit 7d13dc3

Please sign in to comment.