Unexpected syntax error compiling HYCOM with flang - array in include file for openmpi 4.0.0 has more than 7 dimensions

41 views
Skip to first unread message

alvaroafe...@gmail.com

unread,
Feb 13, 2019, 6:31:18 PM2/13/19
to HYCOM.org Forum

I compiled and ran HYCOM with gfortran 8.2.1 with no issues. 


I have switched to using clang and flang now.


The unused command line argument is not critical. The boldface error is more worrisome:  


flang -DIA32 -DREAL8 -DMPI -DENDIAN_IO -DTIMER -DARCTIC -DRELO -fPIC -O2 -mavx -m64 -fdefault-real-8 -fdefault-double-8 -fopenmp -march=znver1 -L/mnt/share/codes/hycom/LIBRARIES/openmpi-4.0.0_64_rhel_75/lib -I/mnt/share/codes/hycom/LIBRARIES/openmpi-4.0.0_64_rhel_75/include -c mod_xc.F
clang
-7: warning: argument unused during compilation: '-fdefault-double-8' [-Wunused-command-line-argument]
clang
-7: warning: argument unused during compilation: '-L/mnt/share/codes/hycom/LIBRARIES/openmpi-4.0.0_64_rhel_75/lib' [-Wunused-command-line-argument]
F90
-S-0047-More than seven dimensions specified for array (/mnt/share/codes/hycom/LIBRARIES/openmpi-4.0.0_64_rhel_75/include/mpif-sizeof.h: 66)


 I go to the file in question:


      SUBROUTINE MPI_Sizeof_character_r8(x, size, ierror)
      CHARACTER
, DIMENSION(1,1,1,1,1,1,1,*)::x
      INTEGER
, INTENT(OUT) :: size
      INTEGER
, INTENT(OUT) :: ierror
     
END SUBROUTINE MPI_Sizeof_character_r8



Has anyone ever seen this error before?


I did not get this error when compiling with gfortran. This is my first time trying flang on HYCOM. 

It may be a syntactic corner case because it is a character buffer?

Still, I don't see how this has not happened before.



alan.wa...@hycom.org

unread,
Feb 14, 2019, 8:18:14 AM2/14/19
to HYCOM.org Forum
Fortran 90 specified a maximum rank of 7, i.e. compilers must support 7 but could also support more than 7.

Fortran 2008 raised this to 15.  See http://fortranwiki.org/fortran/show/Fortran+2008+status for which compilers support 15.  Unfortunately the Flang column is mostly empty (i.e. unknown status).

It looks to me as if openmpi is trying to support multidimensional arrays by casting them to an array with all dimensions but the last set to 1, however it added one too many dimensions for Fortran 90.

Alan.

alvaroafernandez88

unread,
Feb 14, 2019, 8:38:29 AM2/14/19
to alan.wa...@hycom.org, HYCOM.org Forum
Right, I assumed we were doing the old trick of casting using char buffers. 

So basically flang is more of a f90 compiler. 
Never occurred to me flang might be behind in its fortran assumptions wrt openmpi's latest version.  

I can't do a one to one comparison of my gnu + ompi 4.0 run against flang + ompi 4.0 then, unless i hack this include file by commenting out the over dimensioned dummy vars. This might be doable.






Sent via the Samsung Galaxy Note9, an AT&T 5G Evolution smartphone
--
--
You received this message because you are a member of HYCOM.org
To ask a question, send an email to fo...@hycom.org

---
You received this message because you are subscribed to a topic in the Google Groups "HYCOM.org Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/a/hycom.org/d/topic/forum/dACVYwqxt2I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to forum+un...@hycom.org.
Reply all
Reply to author
Forward
0 new messages