Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28441 Discussions

Intel oneAPI bug with submodules

Juergen_R_R
Valued Contributor I
742 Views

As I don't have priority support for oneAPI (only for the 'traditional' compiler series), I post this here, in hope that someone from the Intel team picks it up. Apparently, Intel oneAPI throws an error on standard-conformant code, namely when defining a UDT with private components in a module, and then using its structure constructor in a submodule of that module, Intel oneAPI (both 21 and 22) complain:

bla.f90(30): error #6053: Structure constructor may not have components with the PRIVATE attribute [42]
t = t1(42)
-----------^

However, the submodule should have the same scoping unit as its (parent) module, so the structure constructor should be usable in the submodule. Here is the reproducer:

module foo

  implicit none
  private

  type t1
     private
     integer :: i
  end type t1

  interface
     module function xxx ()
       integer :: xxx
     end function
  end interface
  
end module foo

submodule (foo) foo_s
  implicit none

contains
  module function xxx ()
    integer :: xxx
    xxx = 17
  end function
  
  pure function func () result (t)
    type(t1) :: t
    t = t1(42)
  end function func
end submodule foo_s
0 Kudos
1 Solution
Steve_Lionel
Honored Contributor III
689 Views

You need to specify which compiler version you are using. "oneAPI" is not sufficiently descriptive. Note that if you have active support for Parallel Studio XE, you also have support for the oneAPI compilers.

I can reproduce this error with ifort (Classic) 2021.5.0, and agree that it is a bug.

View solution in original post

4 Replies
Steve_Lionel
Honored Contributor III
690 Views

You need to specify which compiler version you are using. "oneAPI" is not sufficiently descriptive. Note that if you have active support for Parallel Studio XE, you also have support for the oneAPI compilers.

I can reproduce this error with ifort (Classic) 2021.5.0, and agree that it is a bug.

Juergen_R_R
Valued Contributor I
671 Views

Indeed, sorry for not having specified the detailed version, it was Intel(R) 64, Version 2021.4.0 Build 20210910_000000.

Regarding the support, I have to check with our IT department, whether they still have their license for Parallel Studio XE.

0 Kudos
Barbara_P_Intel
Moderator
618 Views

I filed a bug report on your behalf, CMPLRIL0-34524. I'll let you know when a fix is available.

Happy New Year!



0 Kudos
Barbara_P_Intel
Moderator
463 Views

This erroneous error message is gone with ifort 2021.6.0 which is part of oneAPI HPC Toolkit 2022.2 that was recently released.

Please check it out!



0 Kudos
Reply