Skip to content

Fix relax_new test linkage for Relax_Data - #7737

Merged
mohanchen merged 1 commit into
deepmodeling:developfrom
Stardust0831:fix-relax-new-relax-linkage
Aug 1, 2026
Merged

Fix relax_new test linkage for Relax_Data#7737
mohanchen merged 1 commit into
deepmodeling:developfrom
Stardust0831:fix-relax-new-relax-linkage

Conversation

@Stardust0831

@Stardust0831 Stardust0831 commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Reminder

  • I have read AGENTS.md and docs/developers_guide/agent_governance.md.
  • I have explained why this PR does not need an upstream issue link.
  • I have run focused unit-test verification and listed the results below.
  • There are no user-visible or INPUT behavior changes.
  • Core-module impact is limited to test-target linkage.
  • No governance exception is requested.

Linked Issue

No upstream issue linked; this is a follow-up to the test-linkage regression introduced by PR #7456.

Unit Tests and/or Case Tests for my changes

  • Before the change, building MODULE_RELAX_relax_new_relax failed with undefined references to Relax_Data::dim and Relax_Data::largest_grad.
  • After the change, cmake --build build-debug --target MODULE_RELAX_relax_new_relax -j2 succeeds.
  • The same target also links in a Release reduced-feature build.
  • MODULE_RELAX_relax_new_relax --gtest_filter=Test_SETGRAD.relax_new passes.
  • The neighboring MODULE_RELAX_relax_new_line_search target builds and its CTest passes.
  • git diff --check and the agent governance check pass.
  • The full MODULE_RELAX_relax_new_relax CTest now runs, but the existing Test_RELAX.relax_new numerical assertions fail on current develop. This PR does not change relaxation behavior or numerical references.

What's changed?

PR #7456 moved shared relaxation state to static members of Relax_Data. As a result, relax_sync.cpp, through ions_move_basic.h, now references Relax_Data::dim and Relax_Data::largest_grad, whose definitions live in relax_data.cpp.

The production relaxation module already compiles relax_data.cpp. The failure occurs only with BUILD_TESTING=ON when CMake builds the standalone MODULE_RELAX_relax_new_relax unit-test executable from its explicit source list. That list included relax_sync.cpp but omitted relax_data.cpp, so the test executable failed at link time. The reduced non-LCAO configuration exposed the omission, but LCAO itself is not the cause.

This PR adds ../relax_data.cpp to that test target's source list. No production source, runtime behavior, or public interface changes.

Governance Notes

  • INPUT/docs changes: none; no INPUT or user-facing behavior changed.
  • Core module impact: test-target source linkage only.
  • Exceptions requested: none.

@mohanchen mohanchen added Input&Output Suitable for coders without knowing too many DFT details Refactor Refactor ABACUS codes labels Aug 1, 2026
@mohanchen
mohanchen merged commit 2ddd27b into deepmodeling:develop Aug 1, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Input&Output Suitable for coders without knowing too many DFT details Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants