Skip to content

Unable to find dependency from parent directory when building exe  #734

@samharrison7

Description

@samharrison7

Description

I am trying to build an executable from a project with the following structure:

src/
  a/
    a_mod.f90
  b_mod.f90
  main.f90

In the code, a_mod uses b_mod, and main uses a_mod. When I build just as a library, it works as expected. However, when I specify to build an executable from main.f90, the build fails with the error <ERROR>*cmd_build*:target error:Unable to find source for module dependency: "b_mod" used by "./src/a/a_mod.f90".

The issue seems to occur when a module depends on a module that is in a parent directory (i.e. a_mod depending on b_mod from its parent directory) and only when build an executable.

I have placed a minimum viable example of the project structure that causes this issue in this repo: https://github.com/samharrison7/fpm-test-exe-issues

Expected Behaviour

I expected fpm to build the executable from this project structure.

Version of fpm

0.6.0, alpha

Platform and Architecture

Ubuntu 20.04

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions