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

error #5082: Syntax error, found END-OF-STATEMENT when expecting one of ...

Jervie
Novice
11,147 Views

Hello,

 

I'm trying to compile my Fortran code using OneAPI mpiifort, and I got the following error:

 

mpiifort -O2 -ip -w -ftz -align all -fno-alias -no-heap-arrays -c -i4 -r8 -convert big_endian -assume byterecl -mcmodel=medium -extend_source -fp-model strict -free -I. -I/usr/local/include -I/usr/include -I/opt/intel/oneapi/mpi/2021.2.0/include endrun.f90

areaMod.f90(313): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: <LABEL> <IDENTIFIER> TYPE MODULE ELEMENTAL IMPURE NON_RECURSIVE PURE RECURSIVE ...
do jo = 1, nlat_o
----^
mpiifort -O2 -ip -w -ftz -align all -fno-alias -no-heap-arrays -c -i4 -r8 -convert big_endian -assume byterecl -mcmodel=medium -extend_source -fp-model strict -free -I. -I/usr/local/include -I/usr/include -I/opt/intel/oneapi/mpi/2021.2.0/include mkrank.f90
areaMod.f90(273): error #6218: This statement is positioned incorrectly and/or has syntax errors.
subroutine areaave (nlat_i , nlon_i , numlon_i, fld_i , &
-------------^
areaMod.f90(346): error #6702: END statement confusion.
end subroutine areaave
^
compilation aborted for areaMod.f90 (code 1)
gmake: *** [/home/bianqy/BCC_ESM_OneAPI//models/bld/Makefile:138: areaMod.o] Error 1
gmake: *** Waiting for unfinished jobs....
exit 2

 

However, the code could be compiled using Intel 2018 (2018.1.163) mpiifort. But for some reason, I have to use OneAPI to compile my code. Any suggestions are aprreciated!

I attached the code of areaMod.f90 in case. 

 

Labels (2)
0 Kudos
6 Replies
Arjen_Markus
Honored Contributor I
11,136 Views

When I compiled it, I noticed an error message about "!dir$ inlinenever areaave. The complaint was about an identifier "never", so I guess the keyword "inlinenever" is unknown. Removing that line made the error about subroutine areaave go away.

0 Kudos
Jervie
Novice
11,092 Views

Hi, thank you very much for your reply. Following you advice, I commented the line "!dir$ inlinenever areaave", and the error go away.  I also tried Andrew's advice, by changing "!dir$ inlinenever areaave" to "!DIR$ ATTRIBUTES NOINLINE :: areaave", the error also go away. It turned out to be a format issue. The ATTRIBUTES directive option NOINLINE should be written as "!DIR$ ATTRIBUTES NOINLINE :: procedure" for OneAPI fortran compiler.  

0 Kudos
andrew_4619
Honored Contributor II
11,123 Views
!DIR$ ATTRIBUTES NOINLINE :: procedure

0 Kudos
Jervie
Novice
11,088 Views

Thank you very much! It solves my issue.

0 Kudos
mecej4
Honored Contributor III
11,117 Views

Check the INLINE directives in your source files. They appear to be be meant for the Cray Fortran compiler, and not all are supported in Intel Fortran.

0 Kudos
Jervie
Novice
11,087 Views

Hi, yes! By changing "!dir$ inlinenever areaave" to "!DIR$ ATTRIBUTES NOINLINE :: areaave", the error go away. It turned out to be a format issue. The ATTRIBUTES directive option NOINLINE should be written as "!DIR$ ATTRIBUTES NOINLINE :: procedure" for OneAPI fortran compiler.  

0 Kudos
Reply