Skip to content

Commit 905f820

Browse files
authored
Merge branch 'develop' into 2026-08-30-line1
2 parents 83d4d0e + f29968d commit 905f820

75 files changed

Lines changed: 8120 additions & 7164 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ rules. Read the complete governance document before making or reviewing changes:
3434
is required.
3535
- Report the exact verification performed. Do not claim completion without
3636
fresh test or check output.
37+
- For multi-step refactors (e.g., splitting a large `.cpp` into several
38+
files), build and commit after each step rather than batching all changes
39+
before verification. This keeps the blast radius small when a step
40+
surfaces a missing include or instantiation error.
3741
- Prefer `std::vector` over raw `new`/`delete` for dynamic arrays; before
3842
converting class members, confirm no external code consumes them as raw
3943
pointers (e.g., `std::vector<bool>` has no `.data()`), and use
@@ -106,6 +110,8 @@ rules. Read the complete governance document before making or reviewing changes:
106110
python3 tools/03_code_analysis/agent_governance_check.py --staged
107111
python3 tools/03_code_analysis/agent_governance_check.py --base upstream/develop --head HEAD --format text
108112
pre-commit run abacus-agent-governance --all-files
113+
# Score changed C++ files for quality debt (pass line is 60):
114+
python3 tools/03_code_analysis/code_quality_score.py $(git diff --name-only upstream/develop...HEAD | grep -E '\.(cpp|h)$')
109115
```
110116

111117
The repository text files have been normalized to LF once. Day-to-day line

generate_build_info.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ if [ "${USE_CUDA}" == "ON" ]; then
257257
fi
258258
# --- Final File Generation ---
259259

260-
INPUT_FILE="source_io/build_info.h.in"
260+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
261+
INPUT_FILE="${SCRIPT_DIR}/source/source_io/build_info.h.in"
261262

262263
# Use sed to replace all placeholders with detected values
263264
# Note the use of different delimiters (#) for paths to avoid conflicts with /

source/Makefile

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ OBJ_DIR = $(BUILD_DIR)/obj
66
BIN_DIR = $(BUILD_DIR)/bin
77
BUILD_INFO_DIR = $(BUILD_DIR)/source_io
88

9+
# The first rule in this file only generates build_info.h, so make would
10+
# stop after generating that header unless the default goal is set here.
11+
.DEFAULT_GOAL := abacus
12+
913
include $(ABACUS_ROOT)Makefile.vars
1014

1115
#==========================
@@ -252,18 +256,25 @@ ${OBJ_DIR}/parse_args.o: $(ABACUS_ROOT)source_io/parse_args.cpp $(BUILD_INFO_DIR
252256
@mkdir -p $(dir $@)
253257
${CXX} ${OPTS} ${OPTS_MPI} -c ${HONG} $< -o $@
254258

259+
# Explicit rule: source_cell/module_symmetry and source_estate/module_charge
260+
# both contain a symm_rho.cpp. VPATH resolves symm_rho.o to the source_cell
261+
# one (listed first), so the Symmetry_rho implementation needs an explicit
262+
# object name to be compiled from the correct source.
263+
${OBJ_DIR}/symm_rho_charge.o: $(ABACUS_ROOT)source_estate/module_charge/symm_rho.cpp
264+
@mkdir -p $(dir $@)
265+
${CXX} ${OPTS} ${OPTS_MPI} -c ${HONG} $< -o $@
266+
255267
###### END of ABACUS INFO PART ######
256268

257269
#==========================
258270
# MAKING OPTIONS
259271
#==========================
260272
abacus:
261-
@ if [ ! -d $(OBJ_DIR) ]; then mkdir $(OBJ_DIR); fi
262-
@ if [ ! -d $(BIN_DIR) ]; then mkdir $(BIN_DIR); fi
263-
@ $(MAKE) $(BIN_DIR)/${VERSION}.$(suffix)
273+
@ mkdir -p $(OBJ_DIR) $(BIN_DIR)
274+
@ $(MAKE) -f $(firstword $(MAKEFILE_LIST)) $(BIN_DIR)/${VERSION}.$(suffix)
264275

265276
test:
266-
@ $(MAKE) abacus
277+
@ $(MAKE) -f $(firstword $(MAKEFILE_LIST)) abacus
267278
@ cd $(ABACUS_ROOT)../tests/integrate/;sh Autotest.sh -a $(realpath $(BIN_DIR))/ABACUS.mpi -n $(TESTNP)
268279

269280
pw $(BIN_DIR)/${VERSION}-PW.x:
@@ -280,7 +291,8 @@ $(BIN_DIR)/${VERSION}.$(suffix) : ${FP_OBJS} ${PDIAG_OBJS} ${HEADERS}
280291
#==========================
281292
# Note: The specific rule for parse_args.o above is more precise.
282293
# This generic rule will apply to all other .cpp files.
283-
${OBJ_DIR}/%.o:$(realpath $(BIN_DIR))%.cpp
294+
${OBJ_DIR}/%.o:%.cpp
295+
@ mkdir -p $(dir $@)
284296
${CXX} ${OPTS} ${OPTS_MPI} -c ${HONG} $< -o $@
285297

286298
.PHONY:clean test

0 commit comments

Comments
 (0)