-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fortran interface compilation issue with nvhpc
#4111
Comments
That being said, we try to work around compiler bugs as much as we can. So you are welcome to submit a PR addressing the issue. |
I did a bit more experimentation, and it appears that the Apparently, making a module procedure before the I am willing to make a PR for this, but I'm not sure if you prefer the BTW, does the nvhpc test compile all the Fortran interfaces? I can't find the messages for |
@ylee88 I prefer the As for the nvhpc test, we could enable |
Let's see if this can catch it. #4114 |
## Summary This PR will fix the compilation issue for Fortran interfaces when using `nvfortran`, reported in #4111. ## Additional background The new `module procedure` interfaces for `final` subroutines are introduced to bypass the `nvfortran` compilation error. This change may not be needed according to the Fortran standard, but it effectively resolves compilation errors using `nvfortran` with `-DAMReX_FORTRAN_INTERFACES=ON`.
I am getting the following errors when compiling the
AMReX
withnvhpc
:As the error message suggests, adding the following lines helps to resolve the error:
So forth for every
final
subroutines in Fortran interfaces:❯ ag "final\s::" Src/F_Interfaces/Base/AMReX_physbc_mod.F90 21: final :: amrex_physbc_destroy Src/F_Interfaces/Base/AMReX_multifab_mod.F90 95: final :: amrex_multifab_destroy 123: final :: amrex_imultifab_destroy 149: final :: amrex_mfiter_destroy Src/F_Interfaces/Base/AMReX_distromap_mod.F90 24: final :: amrex_distromap_destroy Src/F_Interfaces/Base/AMReX_boxarray_mod.F90 35: final :: amrex_boxarray_destroy Src/F_Interfaces/Base/AMReX_fab_mod.F90 36: final :: amrex_fab_destroy Src/F_Interfaces/Base/AMReX_geometry_mod.F90 39: final :: amrex_geometry_destroy Src/F_Interfaces/Particle/AMReX_particlecontainer_mod.F90 40: final :: amrex_particlecontainer_destroy Src/F_Interfaces/AmrCore/AMReX_fluxregister_mod.F90 30: final :: amrex_fluxregister_destroy Src/F_Interfaces/AmrCore/AMReX_flash_fluxregister_mod.F90 39: final :: amrex_flash_fluxregister_destroy Src/F_Interfaces/LinearSolvers/AMReX_poisson_mod.F90 16: final :: amrex_poisson_destroy Src/F_Interfaces/LinearSolvers/AMReX_abeclaplacian_mod.F90 19: final :: amrex_abeclaplacian_destroy Src/F_Interfaces/LinearSolvers/AMReX_multigrid_mod.F90 50: final :: amrex_multigrid_destroy Src/Base/AMReX_parmparse_mod.F90 55: final :: amrex_parmparse_destroy
I'm not sure whether having an explicit interface for the
final
subroutine is indeed necessary or if this issue should be considered as a compiler bug fornvhpc.
The text was updated successfully, but these errors were encountered: