Fix: Intel classic (icpc) build error — ambiguous Conv_Coulomb_Pot_K::cal_orbs_ccp overloads - #7932
Merged
mohanchen merged 1 commit intoSep 8, 2026
Conversation
icpc (Intel Classic 2021.6/2022.1) cannot order the scalar cal_orbs_ccp / cal_orbs_ccp_spencer templates against the recursive std::vector overloads and fails with 'more than one instance of overloaded function matches the argument list' at the call sites in exx_lri.hpp and ewald_vq.hpp. Disable the scalar overload for std::vector arguments via std::enable_if so only the vector overload participates; behavior on GCC and icpx is unchanged.
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped to template overload participation and aligns with the reported icpc ambiguity without introducing behavioral changes.
Pull request overview
This PR resolves an Intel Classic (icpc/EDG) compilation failure caused by ambiguous overload resolution between the scalar and recursive std::vector template overloads of Conv_Coulomb_Pot_K::cal_orbs_ccp (and the Spencer variant) in the RI Coulomb-convolution helpers.
Changes:
- Constrain the scalar
cal_orbs_ccp/cal_orbs_ccp_spencertemplates via SFINAE so they do not participate in overload resolution whenTis astd::vector, ensuring icpc selects the intended recursive vector overload.
File summaries
| File | Description |
|---|---|
| source/source_lcao/module_ri/conv_coulomb_pot_k.h | Adds a std::vector type trait and SFINAE constraints to prevent icpc overload ambiguity for nested-vector call sites. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- 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
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reminder
AGENTS.mdanddocs/developers_guide/agent_governance.md.source/changes.Linked Issue
Fix #7928
Unit Tests and/or Case Tests for my changes
icpc2021.6/2022.1 build of the previously failing call sites (exx_lri.hpp:77,ewald_vq.hpp:59, instantiated frommodule_rdmft/rdmft.cpp) — verified by the patch author; see commit message.g++ -std=gnu++14 -fsyntax-only source/source_lcao/module_ri/conv_coulomb_pot_k.cppwith the standard ABACUS define set (__EXX,__LCAO,__MPI, ...), GCC 11.4.0.g++ -std=gnu++14 -fsyntax-only source/source_lcao/module_rdmft/rdmft.cpp(same flags) — the translation unit icpc failed on; passes, confirming no regression for GCC.is_std_vector: no name collisions.What's changed?
source_lcao/module_ri/conv_coulomb_pot_k.h: the scalar overloads ofConv_Coulomb_Pot_K::cal_orbs_ccp/cal_orbs_ccp_spencerare now constrained withstd::enable_if<!is_std_vector<T>::value>, so forstd::vectorarguments only the recursive vector overload participates in overload resolution. icpc's EDG frontend cannot order the two function templates by partial ordering and reported "more than one instance of overloaded function matches the argument list"; with the scalar candidate SFINAE'd out there is exactly one viable overload. GCC/icpx behavior is unchanged (they already picked the vector overload via partial ordering).Note:
get_rmesh_proportionin the same header keeps the old primary-template +.cpp-only explicit specialization pattern, but it has no call sites and is never instantiated, so it does not trigger the issue; it can be cleaned up in a follow-up if desired.Governance Notes
module_rionly (Coulomb-potential convolution helpers used by EXX/RDMFT); no runtime behavior change.