AMReX-Astro / mini-Castro

a mini-app version of castro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't compile eos_type.f90 with gcc/6.3.1 + OpenACC

bcfriesen opened this issue · comments

Hi,

on commit eaa153c ("Add a .gitignore for Util/") I encounter the following error trying to compile eos_type.f90 with GCC 6.3.1 using OpenACC:

..//Source/eos_type.F90:177:38:

..//Source/eos_type.F90:175:21:

     !$acc routine seq
                     2
..//Source/eos_type.F90:177:38:

     use bl_constants_module, only: ONE
                                      1
Error: USE statement at (1) cannot follow !$ACC ROUTINE statement at (2)
..//Source/eos_type.F90:178:43:

..//Source/eos_type.F90:175:21:

     !$acc routine seq
                     2
..//Source/eos_type.F90:178:43:

     use network, only: aion, aion_inv, zion
                                           1
Error: USE statement at (1) cannot follow !$ACC ROUTINE statement at (2)
..//Source/eos_type.F90:180:17:

..//Source/eos_type.F90:175:21:

     !$acc routine seq
                     2
..//Source/eos_type.F90:180:17:

     implicit none
                 1
Error: IMPLICIT NONE statement at (1) cannot follow !$ACC ROUTINE statement at (2)
..//Source/eos_type.F90:207:38:

..//Source/eos_type.F90:205:21:

     !$acc routine seq
                     2
..//Source/eos_type.F90:207:38:

     use bl_constants_module, only: ONE
                                      1
Error: USE statement at (1) cannot follow !$ACC ROUTINE statement at (2)
..//Source/eos_type.F90:208:43:

..//Source/eos_type.F90:205:21:

     !$acc routine seq
                     2
..//Source/eos_type.F90:208:43:

     use extern_probin_module, only: small_x
                                           1
Error: USE statement at (1) cannot follow !$ACC ROUTINE statement at (2)
..//Source/eos_type.F90:210:17:

..//Source/eos_type.F90:205:21:

     !$acc routine seq
                     2
..//Source/eos_type.F90:210:17:

     implicit none
                 1
Error: IMPLICIT NONE statement at (1) cannot follow !$ACC ROUTINE statement at (2)
..//Source/eos_type.F90:228:17:

..//Source/eos_type.F90:226:21:

     !$acc routine seq
                     2
..//Source/eos_type.F90:228:17:

     implicit none
                 1
Error: IMPLICIT NONE statement at (1) cannot follow !$ACC ROUTINE statement at (2)
..//Source/eos_type.F90:259:17:

..//Source/eos_type.F90:257:21:

     !$acc routine seq
                     2
..//Source/eos_type.F90:259:17:

     implicit none
                 1
Error: IMPLICIT NONE statement at (1) cannot follow !$ACC ROUTINE statement at (2)
..//Source/eos_type.F90:272:17:

..//Source/eos_type.F90:270:21:

     !$acc routine seq
                     2
..//Source/eos_type.F90:272:17:

     implicit none
                 1
Error: IMPLICIT NONE statement at (1) cannot follow !$ACC ROUTINE statement at (2)
..//Source/eos_type.F90:286:17:

..//Source/eos_type.F90:284:21:

     !$acc routine seq
                     2
..//Source/eos_type.F90:286:17:

     implicit none
                 1
Error: IMPLICIT NONE statement at (1) cannot follow !$ACC ROUTINE statement at (2)
..//Source/eos_type.F90:300:17:

..//Source/eos_type.F90:298:21:

     !$acc routine seq
                     2
..//Source/eos_type.F90:300:17:

     implicit none
                 1
Error: IMPLICIT NONE statement at (1) cannot follow !$ACC ROUTINE statement at (2)
make: *** [tmp_build_dir/o/3d.gnu.MPI.EXE/eos_type.o] Error 1```

I have not tried this with gcc but I'm going to assume that this is a bug in the compiler. The OpenACC standard says that the !$acc routine statement occurs within the specification part of the subroutine, but does not require where in the specification part it occurs. If it works by moving the routine declaration to after the use/implicit none statements, I guess we can make that change to accommodate gcc, as long as it works with PGI and Cray too.