<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Increasing the size of the interface/contains stack in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1594845#M172053</link>
    <description>&lt;P&gt;Would sub-modules avoid the error? (This would place the code in different source files)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
    <pubDate>Fri, 03 May 2024 17:44:07 GMT</pubDate>
    <dc:creator>jimdempseyatthecove</dc:creator>
    <dc:date>2024-05-03T17:44:07Z</dc:date>
    <item>
      <title>Increasing the size of the interface/contains stack</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1594824#M172052</link>
      <description>&lt;P&gt;Is there a way to increase the size of the interface/contains stack in ifx? It would take a while to explain why, but I have a Fortran code which generates a Fortran module containing a ton of types with type-bound operators and associated functions. With ifx 2024.1.0 on Ubuntu 20.04 LTS, when I exceed about 800 functions generated with about 30 associated types, I get the following error when compiling a program using my generated module (but not when compiling the module itself):&lt;/P&gt;&lt;P&gt;error #6618: The INTERFACE/CONTAINS stack is full. This means that modules are being 'used' in a circular way.&lt;/P&gt;&lt;P&gt;There are no circular dependencies, so I think the actual problem is the size of my module. I do not necessarily mind slow compilation here, so if there is a way to increase the size of the interface/contains stack, I'm interested. (For what it's worth, ifx and gfortran compile the module far faster than nvfortran.)&lt;/P&gt;&lt;P&gt;If there is no way to increase the size of the interface/contains stack, what is the precise limit for the interface/contains stack and what exactly should I be counting in my generator to avoid hitting the limit? I am looking into ways to reduce the number of generated types and functions to do what I want to here, but I don't yet have a good solution.&lt;/P&gt;&lt;P&gt;(If I should not be seeing this error with ~800 functions, let me know and I can post a reproducer.)&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 15:50:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1594824#M172052</guid>
      <dc:creator>btrettel</dc:creator>
      <dc:date>2024-05-03T15:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Increasing the size of the interface/contains stack</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1594845#M172053</link>
      <description>&lt;P&gt;Would sub-modules avoid the error? (This would place the code in different source files)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 17:44:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1594845#M172053</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2024-05-03T17:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Increasing the size of the interface/contains stack</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1594851#M172054</link>
      <description>&lt;P&gt;Good idea. All I can say is maybe at the moment because I don't know what ifx is doing under the hood. But breaking the module up into submodules might work. I'll try it.&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 18:04:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1594851#M172054</guid>
      <dc:creator>btrettel</dc:creator>
      <dc:date>2024-05-03T18:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Increasing the size of the interface/contains stack</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1594945#M172059</link>
      <description>&lt;P&gt;There is no user control over the size of the compiler's internal data structures.&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 13:21:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1594945#M172059</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2024-05-04T13:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Increasing the size of the interface/contains stack</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1595276#M172070</link>
      <description>&lt;P&gt;A possible alternative is to disable IPO. I believe single file IPO is on by default, disabling this may reduce the internal compile storage requirements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 13:29:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1595276#M172070</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2024-05-06T13:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: Increasing the size of the interface/contains stack</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1595330#M172072</link>
      <description>&lt;P&gt;I'm skeptical that IPO is involved here, as this is a "front-end" message I have seen before.&amp;nbsp; I have routinely compiled modules with thousands of interface blocks (the Windows API modules) so I'm unsure if the size of the module itself is an issue. Please attach a reproducer if you can.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 16:48:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1595330#M172072</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2024-05-06T16:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Increasing the size of the interface/contains stack</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1595451#M172075</link>
      <description>&lt;P&gt;I've attached a zip file containing a reproducer. Included are 3 different versions of the module of varying sizes:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;pdim_12.f90: 12 types, 170 functions (compiles both the module and program)&lt;/LI&gt;&lt;LI&gt;pdim_30.f90: 30 types, 837 functions (fails to compile the program, but compiles the module)&lt;/LI&gt;&lt;LI&gt;pdim_50.f90: 50 types, 2205 functions (fails to compile the program, but compiles the module; included in case pdim_30.f90 compiles fine on you all's end as this probably won't compile)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Here's a command line log showing what I see:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$ ifx --version
ifx (IFX) 2024.1.0 20240308
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.

$ uname -a
Linux trident 5.15.0-105-generic #115~20.04.1-Ubuntu SMP Mon Apr 15 17:33:04 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
$ ls
pdim_12.f90  pdim_30.f90  pdim_50.f90  test_pdim_types.f90
$ time ifx pdim_12.f90 test_pdim_types.f90 

real    0m0.499s
user    0m0.386s
sys     0m0.113s
$ ./a.out 
  0.000000000000000E+000
   2.00000000000000     
  -1.50000000000000     
  0.500000000000000     
   2.00000000000000     
   3.00000000000000     
   16.0000000000000     
$ rm a.out pdim_types.mod 
removed 'a.out'
removed 'pdim_types.mod'
$ time ifx pdim_30.f90 test_pdim_types.f90 
test_pdim_types.f90(18): error #6618: The INTERFACE/CONTAINS stack is full. This means that modules are being 'used' in a circular way.
x%v = 1.0_WP
^
compilation aborted for test_pdim_types.f90 (code 1)

real    0m2.346s
user    0m2.119s
sys     0m0.227s
1 trident$ rm a.out pdim_types.mod 
rm: cannot remove 'a.out': No such file or directory
removed 'pdim_types.mod'
1 trident$ time ifx pdim_50.f90 test_pdim_types.f90 
test_pdim_types.f90(18): error #6618: The INTERFACE/CONTAINS stack is full. This means that modules are being 'used' in a circular way.
x%v = 1.0_WP
^
compilation aborted for test_pdim_types.f90 (code 1)

real    0m15.114s
user    0m14.627s
sys     0m0.482s&lt;/LI-CODE&gt;&lt;P&gt;For comparison, gfortran compiles all of these fine, and fast too.&lt;/P&gt;&lt;P&gt;To be clear, all of these modules are generated by another Fortran program. As far as I'm aware, the generated modules are valid Fortran, though the generated modules are unusually large. So I am not surprised to run into issues compiling and maybe even run into some hard-coded compiler limits. I'm not sure there is a bug in ifx, but please take a look and let me know. If my code is doing anything wrong, let me know too. If it might help, I can explain what I'm trying to do here as well.&lt;/P&gt;&lt;P&gt;(Also: Trying `-no-ipo` did not help here.)&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 01:11:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1595451#M172075</guid>
      <dc:creator>btrettel</dc:creator>
      <dc:date>2024-05-07T01:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Increasing the size of the interface/contains stack</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1595629#M172081</link>
      <description>&lt;P&gt;FWIW:&amp;nbsp;&lt;EM&gt;This means that modules are being 'used' in a circular way.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The fact that one compiler can compile your code is no confirmation that your code's module usage is not circular.&lt;/P&gt;&lt;P&gt;Intel, it would be helpful, when you emit this error, that you include a stack dump of the USE contexts. This would identify where the circular references are located (when this be the cause) or provide feedback to Intel developers about a non-circular reference issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 13:27:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1595629#M172081</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2024-05-07T13:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: Increasing the size of the interface/contains stack</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1595668#M172084</link>
      <description>&lt;P&gt;I reproduced the problem without IPO in ifort. NAG Fortran builds all three versions quite quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 15:35:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1595668#M172084</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2024-05-07T15:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Increasing the size of the interface/contains stack</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1596063#M172102</link>
      <description>&lt;P&gt;It's a bug in our front end.&amp;nbsp; We'll get it fixed.&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 22:20:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Increasing-the-size-of-the-interface-contains-stack/m-p/1596063#M172102</guid>
      <dc:creator>Ron_Green</dc:creator>
      <dc:date>2024-05-08T22:20:56Z</dc:date>
    </item>
  </channel>
</rss>

