Skip to content

Fix: add missing <string> include in simple_pexsi.h (Intel classic build) - #7933

Merged
mohanchen merged 1 commit into
deepmodeling:developfrom
Flying-dragon-boxing:fix-pexsi-string-include
Sep 8, 2026
Merged

Fix: add missing <string> include in simple_pexsi.h (Intel classic build)#7933
mohanchen merged 1 commit into
deepmodeling:developfrom
Flying-dragon-boxing:fix-pexsi-string-include

Conversation

@Flying-dragon-boxing

Copy link
Copy Markdown
Collaborator

Reminder

  • I have read AGENTS.md and docs/developers_guide/agent_governance.md.
  • I have linked an issue or explained why this PR does not need one.
  • I have added adequate unit tests and/or case tests, or explained why not.
  • I have listed the exact verification commands run and their results.
  • I have described user-visible behavior changes, including INPUT parameter changes.
  • I have explained core-module impact for ESolver, HSolver, ElecState, Hamilt, Operator, Psi, or other source/ changes.
  • I have requested any needed governance exception below.

Linked Issue

None — trivial header self-containment fix for an Intel classic (icpc) build failure; a dedicated issue would add no information beyond this description.

Unit Tests and/or Case Tests for my changes

  • Commands run:
    • Self-containment check, post-fix: mpicxx -std=gnu++14 -fsyntax-only on a TU containing only #include "source_hsolver/module_pexsi/simple_pexsi.h" — passes.
    • Same check on the pre-fix header: fails with simple_pexsi.h:20:28: error: 'string' in namespace 'std' does not name a type — confirming the header was not self-contained and only compiled via transitive <string> includes.
    • Intel classic icpc 2021.6/2022.1 build of pexsi_solver.cpp (which previously emitted simple_pexsi.h(20): error: namespace "std" has no member "string"): verified on the Intel classic machine.
  • Result summary: all pass.
  • Checks not run, with reason: no unit test applicable to an #include addition; no runtime behavior change.

What's changed?

  • source_hsolver/module_pexsi/simple_pexsi.h: add #include <string>. The header declares simplePEXSI(..., const std::string PexsiOptionFile, ...) but only included <mpi.h>; std::string relied on transitive includes. GCC/icpx happen to pull in <string> through other headers; Intel classic (icpc) does not, so compiling pexsi_solver.cpp fails with namespace "std" has no member "string". Including <string> explicitly follows the self-contained-header principle and is safe on every compiler.

Governance Notes

  • INPUT/docs changes: none; no user-visible behavior change.
  • Core module impact: HSolver/PEXSI header only; no runtime behavior change.
  • Exceptions requested: none.

simple_pexsi.h uses std::string in the simplePEXSI declaration but
relies on transitive includes. Intel Classic (icpc) fails with
"namespace std has no member string"; include <string> explicitly.
Copilot AI lite review requested due to automatic review settings September 7, 2026 14:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is a minimal, correct header self-containment fix with no behavioral impact and no additional risks identified in the diff.

Pull request overview

This pull request fixes a header self-containment issue in the HSolver/PEXSI interface by adding an explicit standard library include required by the header’s public API, addressing an Intel classic (icpc) compilation failure without changing runtime behavior.

Changes:

  • Add #include <string> to simple_pexsi.h so std::string is available without relying on transitive includes.
File summaries
File Description
source/source_hsolver/module_pexsi/simple_pexsi.h Adds the missing <string> include to make the public declaration using std::string self-contained.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@mohanchen mohanchen added Bugs Bugs that only solvable with sufficient knowledge of DFT Refactor Refactor ABACUS codes labels Sep 8, 2026
@mohanchen
mohanchen merged commit 27be187 into deepmodeling:develop Sep 8, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugs Bugs that only solvable with sufficient knowledge of DFT Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants