Skip to content

Consistent module / include search paths #441

Closed
@awvwgk

Description

@awvwgk

Just found this Q&A here: https://stackoverflow.com/questions/23991664/gfortran-include-path-is-there-an-alternative-to-passing-multiple-i-options

In summary, GFortran will not use the CPATH environment variable to resolve Fortran include or use directives, the -I flag has to be manually added with -I to the command line. In contrast, #include via the C preprocessor will use the include directories from CPATH.

With Intel Fortran the situation is different, include, use and #include will use the directories specified in CPATH to find include files and module files.

For consistency (and convenience), I would suggest we “fix” the GFortran behaviour by automatically adding the entries in CPATH as include directories to the compile arguments to allow the user to rely on the environment variables rather than having to use --flag.

Activity

awvwgk

awvwgk commented on Apr 15, 2021

@awvwgk
MemberAuthor

Here is a patch https://github.com/awvwgk/fortran-package-manager/tree/gfortran-cpath I will propose after the external modules (#438) are merged.

self-assigned this
on Apr 15, 2021
removed their assignment
on Sep 5, 2021
awvwgk

awvwgk commented on Jan 17, 2022

@awvwgk
MemberAuthor

Here is the respective GFortran ticket for future references https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35707.

Can probably be closed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @awvwgk

      Issue actions

        Consistent module / include search paths · Issue #441 · fortran-lang/fpm