Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 4,105
    • Issues 4,105
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 16
    • Merge requests 16
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMakeCMake
  • CMakeCMake
  • Issues
  • #19586
Closed
Open
Issue created Aug 10, 2019 by James Foucar@jgfouca

Fortran/Makefiles: Some preprocessor patterns break dependency scanning

I wrote a simple reproducer program; it can be acquired here: https://github.com/jgfouca/f90_dep_bug

The broken file contains:

module ice_flux

  implicit none
  save

  real, dimension (1,2,3) :: &
       daidtd  , &
       dvidtd

  ! The presence of this segment breaks the detection of the ice_state dependency
  real, dimension(1,2,3) :: &
#ifdef FOO
       baz, &
#endif
#ifdef BAR
       bla, &
#endif
       goo
  ! end broken segment

contains

  subroutine init_history_dyn
    use ice_state, only: aice, vice

    daidtd  (:,:,:) = aice(:,:,:)
    dvidtd  (:,:,:) = vice(:,:,:)

  end subroutine init_history_dyn

end module ice_flux

With this code, the dependency on ice_state is missed. If either (or both) of the FOO or BAR ifdefs are removed, the dependency is found. If the 'use ice_state' statement is moved to before the ifdefs, the dependency is found.

This issue looks somewhat similar to #18188 but is a bit different since the ifdefs are removed from the use statement.

Edited Jun 10, 2021 by Brad King
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking