Skip to content

AOCC & AOCL compilation of Environ fails due to polymorphism #17

@BCAyers2000

Description

@BCAyers2000

Hi all,

I'm encountering an issue when running Environ compiled with AOCC/AOCL on both my HPC and another AMD-based machine. While the code compiles successfully, execution fails with the following runtime error:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Error in routine density_of_function (1):
Not implemented
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

This can be traced back to function.f90 in the src directory. I suspect the problem is related to Fortran polymorphism. Specifically, I believe that
type-bound procedures or deferred bindings are not being correctly handled by AOCC's Fortran compiler (likely flang), especially since:

The same code runs fine when compiled with Intel compilers on the same systems. The issue occurs only when using AOCC. It appears the method dispatch isn't resolving properly at runtime.

What I've tried:

  1. Compiling with -O0 to eliminate optimization-related issues.
  2. Using -fno-stack-arrays.
  3. Modifying Environ to avoid fatal errors, which confirmed the error is due to unresolved dynamic dispatch from polymorphic types.

I’ve attached the build script (AMD.txt) that shows how I'm compiling both Environ and Quantum ESPRESSO. If there's something wrong in how the compiler flags or environment is configured, I'd appreciate any insight.

Any help or suggestions would be greatly appreciated!

Best regards,
Brad

AMD.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions