Skip to content

Conversation

@zjibben
Copy link
Contributor

@zjibben zjibben commented Sep 19, 2025

Summary

Resolves #4666.

I was able to build my code on ifx without triggering ICE by removing these blocks. Turns out the ICE is triggered not just by finalizers, but any type-bound procedure which is also in an interface block and made independently public from the module, but fortunately I didn't find any such procedures in AMReX.

These blocks are no-ops and completely harmless to remove since they only contain single procedures each and don't rename anything. However if you prefer, since they are valid Fortran, we could wrap them in ifdefs so Intel compilers don't see them.

Additional background

These interface blocks trigger an ifx ICE on user codes which invoke use ..., only: on AMReX modules.

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

@WeiqunZhang
Copy link
Member

@zjibben I think we have to use ifdef, because nvfortran also has bug, and that was why we added interface. #4115.

@WeiqunZhang
Copy link
Member

Either only nvfotran sees it or only ifx does not is fine with me.

@WeiqunZhang
Copy link
Member

Let's also add a line to compile the fortran code with ifx in CI.

--- a/.github/workflows/intel.yml
+++ b/.github/workflows/intel.yml
@@ -46,6 +46,7 @@ jobs:
             -DAMReX_EB=OFF                                 \
             -DAMReX_ENABLE_TESTS=ON                        \
             -DAMReX_FORTRAN=ON                             \
+            -DAMReX_FORTRAN_INTERFACES=ON                  \
             -DAMReX_GPU_BACKEND=SYCL                       \
             -DAMReX_SYCL_AOT=ON                            \
             -DAMReX_INTEL_ARCH=pvc                         \

@WeiqunZhang
Copy link
Member

Let's also add a line to compile the fortran code with ifx in CI.

--- a/.github/workflows/intel.yml
+++ b/.github/workflows/intel.yml
@@ -46,6 +46,7 @@ jobs:
             -DAMReX_EB=OFF                                 \
             -DAMReX_ENABLE_TESTS=ON                        \
             -DAMReX_FORTRAN=ON                             \
+            -DAMReX_FORTRAN_INTERFACES=ON                  \
             -DAMReX_GPU_BACKEND=SYCL                       \
             -DAMReX_SYCL_AOT=ON                            \
             -DAMReX_INTEL_ARCH=pvc                         \

Ignore this. That seems to cause some other compiler issues at link time.

@zjibben
Copy link
Contributor Author

zjibben commented Sep 22, 2025

@WeiqunZhang Thanks for the feedback! I just pushed some changes so that the interfaces are only seen by nvfortran. We'll see if tests pass.

@WeiqunZhang WeiqunZhang enabled auto-merge (squash) September 23, 2025 00:29
@WeiqunZhang WeiqunZhang merged commit 488d156 into AMReX-Codes:development Sep 23, 2025
75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Triggering an ICE with ifx 2023.2 through 2025.2 and ifort 2023.2

2 participants