small script to demonstrate the problem
if the module and submodule are in the same file, there is no error at compile time
if the module and submodule are in separate files, ther is an error at compile time
declaring the function as having a single optional argument gets rid of the error
#!/bin/bash
module load aocc/4.0.0 # acquire compiler
export FC=flang
set -x
rm -f *.o *mod
cat <<EOF >file1.F90
module fstd_98
implicit none
type :: fstd98
integer :: iun = -1 ! Fortran unit number
contains
procedure, NOPASS :: fst_version
end type
interface
module function fst_version() result(vers) ! problem if no argumnent
! module function fst_version(dummy) result(vers) ! no problem if optional dummy argument
! implicit none
! integer, optional :: dummy
integer :: vers
end function fst_version
end interface
end module
EOF
cat <<EOF >file2.F90
submodule (fstd_98) fstd_98_sub
contains
module procedure fst_version
implicit none
vers = 123
end procedure
end
EOF
$FC --version
# module and submodule in separate files
$FC -c file1.F90 file2.F90
# all code in a single file
cat file1.F90 file2.F90 >file3.F90
$FC -c file3.F90
Solved! Go to Solution.
Hello mfvalin,
Thanks for reporting this issue. I have filed a bug report for this issue. Will keep you posted on the progress of the same.
Hello mfvalin,
Thanks for reporting this issue. I have filed a bug report for this issue. Will keep you posted on the progress of the same.
Hi @vtangutu . I'm facing a very similar issue currently. Sorry to bump, but is there a solution to this issue yet?
---
Hi @nehabhushan94
Thank you for writing to us.
The resolution for the reported error is expected in next AOCC release(v4.1).