Skip to content

Fix: correct nvc++ compiler compatibility issues#6854

Merged
mohanchen merged 8 commits intodeepmodeling:developfrom
dzzz2001:fix-pgi
Jan 13, 2026
Merged

Fix: correct nvc++ compiler compatibility issues#6854
mohanchen merged 8 commits intodeepmodeling:developfrom
dzzz2001:fix-pgi

Conversation

@dzzz2001
Copy link
Collaborator

@dzzz2001 dzzz2001 commented Jan 13, 2026

Summary

This PR fixes several nvc++ (NVIDIA HPC SDK) compiler compatibility issues in the codebase.

Changes

  1. OpenMP directive corrections: Fixed OpenMP usages that are not supported by nvc++ compiler
  2. Gint module fixes: Corrected code patterns in the Gint GPU module that caused compilation errors with nvc++
  3. DFTU Yukawa fix: Refactored loop and conditional logic in dftu_yukawa.cpp to resolve NVC++ internal compiler error (by simplifying the restricted loop and switch statement to direct array access)
  4. VDW-D3 optimization: Used static const arrays for C6 and r0ab parameters in vdwd3 to avoid nvc++ compilation issues

dzzz2001 and others added 8 commits December 4, 2025 01:02
Add -O1 compile flag for dftu_yukawa.cpp when using NVHPC/PGI compiler
to avoid 'gen_llvm_expr(): unknown opcode' internal compiler error.
Replace std::vector with static const array to avoid runtime initialization
overhead and reduce memory allocations.
Refactor the loop over 'n' (which was restricted to n=0) and the switch statement in 'cal_slater_UJ' to use direct array access with index 0 and if-else blocks.

This simplification resolves the NVC++ internal compiler error without needing the -O1 optimization workaround, so the workaround in CMakeLists.txt has been removed.
@dzzz2001 dzzz2001 changed the title fix: correct nvc++ compiler compatibility issues Fix: correct nvc++ compiler compatibility issues Jan 13, 2026
@mohanchen mohanchen added Compile & CICD & Docs & Dependencies Issues related to compiling ABACUS Refactor Refactor ABACUS codes labels Jan 13, 2026
@mohanchen mohanchen merged commit f96f14e into deepmodeling:develop Jan 13, 2026
14 checks passed
@dzzz2001 dzzz2001 deleted the fix-pgi branch January 13, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Compile & CICD & Docs & Dependencies Issues related to compiling ABACUS Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants