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

Intel oneAPI bug with submodules

Juergen_R_R
Valued Contributor I
407 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
Black Belt Retired Employee
354 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
Black Belt Retired Employee
355 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
336 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.

Barbara_P_Intel
Moderator
283 Views

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

Happy New Year!



Barbara_P_Intel
Moderator
128 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!



Reply