Skip to content

Refactor: reorganize some files - #8126

Open
mohanchen wants to merge 10 commits into
deepmodeling:developfrom
mohanchen:2026-10-11-a
Open

mohanchen wants to merge 10 commits into
deepmodeling:developfrom
mohanchen:2026-10-11-a

Conversation

@mohanchen

Copy link
Copy Markdown
Collaborator

Refactor: reorganize some files

abacus_fixer added 3 commits October 11, 2026 21:27
Delete unused sources: main.cpp (empty stub), mcd.h/mcd.c (third-party
memory checker, only reachable via never-defined _MCD_CHECK), export
(declared "not used yet", no consumers), and matrix_wrapper_tianhe2.h
(dead #else branch). Drop the guarded mcd.h include and empty
_MCD_CHECK guards, and remove export.cpp from the base OBJECT library.
…_nao

projgen is a PW on-site projector generator with no production callers
outside module_proj; move it from source_base to source_pw/module_proj
(next to its only active consumer onsite_proj_init and its unit test)
and rename the stale MODULE_NAO_PROJGEN include guard.

Split smoothgen, a second independent function sharing the old file,
into source_basis/module_nao: its active callers are atomic_radials
(NAO) and onsite_proj_init (PW). This keeps source_basis free of any
new dependency on source_pw.

- move projgen unit test to module_proj/unittests; delete the duplicate
  projgen_test from module_nao/test; add module_nao/unittests with
  test_smoothgen
- wire both CMake (module/unit tests) and Makefile.Objects: drop
  projgen.o from OBJS_ORBITAL, add smoothgen.o to OBJS_SRCPW so both
  PW and LCAO links resolve it without duplicate objects
- remove dead commented projgen call in atomic_radials and the
  unnecessary projgen include in onsite_proj_init
@mohanchen
mohanchen requested a review from Critsium-xy October 11, 2026 23:05
@mohanchen mohanchen added Refactor Refactor ABACUS codes The Absolute Zero Reduce the "entropy" of the code to 0 labels Oct 11, 2026
mohanchen and others added 7 commits October 12, 2026 13:21
Commit 9f846a0 removed source_base/export.cpp but left export.o in
OBJS_BASE of source/Makefile.Objects, so the legacy Makefile build
fails with "No rule to make target 'build/obj/export.o'". Remove the
stale entry to restore the Makefile build.
Commit 78f3891 moved smoothgen into the ENABLE_LCAO-guarded
numerical_atomic_orbitals OBJECT library, but its PW caller
onsite_proj_init is linked unconditionally via module_proj. PW-only
builds (ENABLE_LCAO=OFF) fail with undefined reference to smoothgen.

Extract smoothgen.cpp into a standalone nao_smoothgen OBJECT library
built regardless of ENABLE_LCAO, link it into the main binary
unconditionally, and add it to the test targets that link
numerical_atomic_orbitals (atomic_radials inside calls smoothgen).
Commit 78f3891 moved smoothgen to source_basis/module_nao but missed
the pyabacus build. libnaopack.so compiles atomic_radials.cpp which
calls smoothgen, but the source was not in the _naos list, causing
an undefined symbol on import.
Lessons from 2026-10-11-a branch: three CI failures (stale export.o in
Makefile.Objects, smoothgen trapped in ENABLE_LCAO guard, pyabacus
naopack missing smoothgen.cpp) all stem from incomplete build-surface
updates when moving/splitting source files.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Refactor ABACUS codes The Absolute Zero Reduce the "entropy" of the code to 0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant