E3SM-Project / scorpio

A high-level Parallel I/O Library for structured grid applications
19 stars 16 forks source link

Cray Fortran build errors with updated Fortran interface of SCORPIO #527

Closed dqwu closed 10 months ago

dqwu commented 1 year ago

Steps to reproduce this issue on Frontier with Cray Clang compiler (not reproducible with GNU or AMD Clang)

. /usr/share/lmod/lmod/init/sh
module reset 
module switch PrgEnv-cray PrgEnv-cray/8.3.3
module switch cce cce/15.0.1
module switch craype craype/2.7.20

git clone https://github.com/E3SM-Project/scorpio.git
cd scorpio

mkdir build
cd build

CC=cc CXX=CC FC=ftn \
cmake -Wno-dev \
-DWITH_NETCDF=OFF \
-DPnetCDF_PATH=/opt/cray/pe/parallel-netcdf/1.12.3.1/crayclang/14.0 \
-DPIO_USE_MALLOC=ON \
..

make

Build errors

[ 76%] Building Fortran object src/flib/CMakeFiles/piof.dir/spio_inq_att.F90.o

ftn-855 ftn: ERROR SPIO_INQ_ATT, File = scorpio/src/flib/spio_inq_att.F90, Line = 13, Column = 8 
  The compiler has detected errors in module "SPIO_INQ_ATT".  No module information file will be created for this module.

ftn-878 ftn: WARNING SPIO_INQ_ATT, File = scorpio/src/flib/spio_inq_att.F90, Line = 20, Column = 7 
  A module named "ISO_C_BINDING" has already been directly or indirectly use associated into this scope.

ftn-1725 ftn: ERROR PIO_INQ_ATTNAME_FH_VID, File = scorpio/src/flib/spio_inq_att.F90, Line = 426, Column = 25 
  Unexpected syntax while parsing the WRITE statement : "EOS" was expected but found """.

Cray Fortran : Version 15.0.1 (20230120205242_66f7391d6a03cf932f321b9f6b1d8612ef5f362c)
Cray Fortran : Compile time:  0.0219 seconds
Cray Fortran : 1042 source lines
Cray Fortran : 2 errors, 1 warnings, 0 other messages, 0 ansi
Cray Fortran : "explain ftn-message number" gives more information about each message.
make[2]: *** [src/flib/CMakeFiles/piof.dir/build.make:162: src/flib/CMakeFiles/piof.dir/spio_inq_att.F90.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:255: src/flib/CMakeFiles/piof.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
dqwu commented 10 months ago

Similar build errors on Summit with the default IBM XL compiler:

[ 76%] Building Fortran object src/flib/CMakeFiles/piof.dir/spio_inq_att.F90.o
cd /ccs/home/wuda/scorpio/build/src/flib && /sw/summit/spack-envs/base/opt/linux-rhel8-ppc64le/xl-16.1.1-10/spectrum-mpi-10.4.0.3-20210112-dzedzfvocsuzkm4jkqe7o64x53yhq7nm/bin/mpif90 -WF,-DCPRIBM -WF,-DHAVE_MPI -WF,-DINCLUDE_CMAKE_FCI -WF,-DLINUX -WF,-DLOGGING -WF,-DMPICH_SKIP_MPICXX -WF,-DMPI_NO_CPPBIND -WF,-DNETCDF_C_LOGGING_ENABLED -WF,-DNETCDF_C_NC__ENDDEF_EXISTS -WF,-DOMPI_SKIP_MPICXX -WF,-DSPIO_NO_CXX_REGEX -WF,-DTIMING -WF,-D_NETCDF -WF,-D_NOPNETCDF -I/ccs/home/wuda/scorpio/src/flib -I/ccs/home/wuda/scorpio/build/src/flib -I/sw/summit/spack-envs/base/opt/linux-rhel8-ppc64le/xl-16.1.1-10/netcdf-fortran-4.4.5-wmedvlkliwpllcswp3dmqz5wq2ntahuc/include -I/ccs/home/wuda/scorpio/src/gptl -I/ccs/home/wuda/scorpio/build/src/gptl -I/sw/summit/spack-envs/base/opt/linux-rhel8-ppc64le/xl-16.1.1-10/netcdf-c-4.8.0-dkuu4se5zxpdmm6ah4ckfgdvp2anserh/include -I/ccs/home/wuda/scorpio/src/clib -I/ccs/home/wuda/scorpio/build/src/clib -qthreaded -qhalt=e -c /ccs/home/wuda/scorpio/src/flib/spio_inq_att.F90 -o CMakeFiles/piof.dir/spio_inq_att.F90.o
"/ccs/home/wuda/scorpio/src/flib/spio_inq_att.F90", line 426.25: 1515-022 (S) Syntax Error: Extra token " 'or variable id (varid =  " was found. The token is ignored.
"/ccs/home/wuda/scorpio/src/flib/spio_inq_att.F90", line 426.51: 1515-022 (S) Syntax Error: Extra token " , " was found. The token is ignored.
"/ccs/home/wuda/scorpio/src/flib/spio_inq_att.F90", line 426.53: 1515-022 (S) Syntax Error: Extra token " varid " was found. The token is ignored.
"/ccs/home/wuda/scorpio/src/flib/spio_inq_att.F90", line 426.58: 1515-022 (S) Syntax Error: Extra token " , " was found. The token is ignored.
"/ccs/home/wuda/scorpio/src/flib/spio_inq_att.F90", line 427.25: 1515-022 (S) Syntax Error: Extra token " 'or attribute id (attid =  " was found. The token is ignored.
"/ccs/home/wuda/scorpio/src/flib/spio_inq_att.F90", line 427.52: 1515-022 (S) Syntax Error: Extra token " , " was found. The token is ignored.
"/ccs/home/wuda/scorpio/src/flib/spio_inq_att.F90", line 427.54: 1515-022 (S) Syntax Error: Extra token " attid " was found. The token is ignored.
"/ccs/home/wuda/scorpio/src/flib/spio_inq_att.F90", line 427.59: 1515-022 (S) Syntax Error: Extra token " , " was found. The token is ignored.
"/ccs/home/wuda/scorpio/src/flib/spio_inq_att.F90", line 428.25: 1515-022 (S) Syntax Error: Extra token " ') passed to pio_inq_attname() function, pio_inq_attname_fh_vid() " was found. The token is ignored.
** spio_inq_att   === End of Compilation 1 ===
1501-511  Compilation failed for file spio_inq_att.F90.