Skip to content

Dependency checker generates false dependencies from generated interface files #213

@gdcarver

Description

@gdcarver

FCM can falsely report dependencies from FCM generated interface files because it assumes 'USE'd modules in the .F90 are needed in the interface. This can lead to non-existent cyclic dependencies being reported halting the build.

Consider, dr_hook_util.F90:

   SUBROUTINE DR_HOOK_UTIL(PKEY)
   USE PARKIND1  ,ONLY : JPRB
   USE MPL_INIT_MOD, ONLY : MPL_INIT
   REAL(KIND=JPRB),INTENT(INOUT) :: PKEY
   END

The generated interface is then, dr_hook_util.intfb.h :

   INTERFACE
   SUBROUTINE DR_HOOK_UTIL(PKEY)
   USE PARKIND1  ,ONLY : JPRB
   REAL(KIND=JPRB),INTENT(INOUT) :: PKEY
   END INTERFACE

The module MPL_INIT_MOD is not needed for the interface file. However, for this (larger than shown) code, FCM incorrectly reports a cyclic dependency stemming from dr_hook_util.intfb.h (intfb.h being automatically generated).
e.g:

... snipped ...
[FAIL]     required by: mpl_init_mod.mod
[FAIL]     required by: dr_hook_util.intfb.h
... snipped ...

The dependency is on the dr_hook_util.o file, but the 'mpl_init_mod.mod' should not be considered a dependency on the generated interface file in this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions