Skip to content

Add support for non_intrinsic modules #917

@dacarnazzola

Description

@dacarnazzola

Take for example the following 2 files:

constants.f90:

module constants
use, intrinsic :: iso_fortran_env
implicit none
private

    integer, parameter, public :: stdin = input_unit
    integer, parameter, public :: stdout = output_unit
    integer, parameter, public :: stderr = error_unit

    integer, parameter, public :: i8 = int8
    integer, parameter, public :: i16 = int16
    integer, parameter, public :: i32 = int32
    integer, parameter, public :: i64 = int64

    integer, parameter, public :: sp = real32
    integer, parameter, public :: dp = real64
    integer, parameter, public :: qp = real128

end module constants

And main.f90:

program main
use, non_intrinsic :: constants
implicit none

    write(stdout,'(a)') 'Hello World!'

end program main

fpm will fail to build this stating:

main.f90                               failed.
[ 50%] Compiling...
app/main.f90:2:22:

    2 | use, non_intrinsic :: constants
      |                      1
Fatal Error: Cannot open module file ‘constants.mod’ for reading at (1): No such file or directory
compilation terminated.
<ERROR> Compilation failed for object " app_main.f90.o "
<ERROR>stopping due to failed compilation
STOP 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions