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

WRF-DA compilation error #5082: Syntax error, found '/'

nick_c
Beginner
500 Views

Hello,

Im try to compile WRFDA v4.4 with HPC intel ifort v2021.6.0 after successfully compiling of WRF/WPS v4.4 

 

Seems to be a problem with syntax with file .f90, part of error:

/lib/cpp -C -P -traditional -I../inc -I. -C -P -traditional -DEM_CORE=1 -DNMM_CORE=0 -DNMM_MAX_DIM=2600 -DCOAMPS_CORE=0 -DDA_CORE=0 -DEXP_CORE=0 -DGRIB1 -DINTIO -DRSL_LITE -DDM_PARALLEL -DIWORDSIZE=4 -DDWORDSIZE=8 -DRWORDSIZE=4 -DLWORD$
rm -f module_configure.b
/opt/intel/oneapi/mpi/latest/bin/mpif90 -f90=ifort -c -no-ip -align all -FR -convert big_endian -fno-alias -fno-fnalias -I../external/io_netcdf/ -I. -fp-model precise -I../main -I../external/io_netcdf -I../external/io_int -I../externa$
module_configure.f90(1): error #5082: Syntax error, found '/' when expecting one of: <LABEL> <END-OF-STATEMENT> ; <IDENTIFIER> TYPE MODULE ELEMENTAL IMPURE NON_RECURSIVE ...
/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
^
module_configure.f90(16): error #5145: Invalid blank/tab
<http://www.gnu.org/licenses/>. */
----------------------------------^
module_configure.f90(20): error #5145: Invalid blank/tab
include it implicitly at the start of every compilation. It must
-----------------------------------------------------------^
module_configure.f90(27): error #5120: Unterminated character constant
/* glibc's intent is to support the IEC 559 math functionality, real
--------^
module_configure.f90(27): error #5144: Invalid character_kind_parameter. No underscore
/* glibc's intent is to support the IEC 559 math functionality, real
--------------------------------------------------------------------^
module_configure.f90(28): error #5145: Invalid blank/tab
and complex. If the GCC (4.9 and later) predefined macros
---------------^
module_configure.f90(30): error #5277: Syntax error, found ',' following statement keyword
whether the overall intent is to support these features; otherwise,
----------------------------------------------------------------------^
module_configure.f90(32): error #5145: Invalid blank/tab
define these macros by default. */
----------------------------------^
module_configure.f90(36): error #5145: Invalid blank/tab
/* wchar_t uses Unicode 10.0.0. Version 10.0 of the Unicode Standard is
-------------------------------^
module_configure.f90(43): error #5145: Invalid blank/tab
/* We do not support C11 <threads.h>. */
-------------------------------------^
module_configure.f90(1): catastrophic error: Could not recover from previous syntax error

 

Configure file and log file is attached below.

 

Anyone have any suggestions? Thanks

0 Kudos
3 Replies
Arjen_Markus
Honored Contributor I
463 Views

It looks as if the C preprocessor has left in the C/C++ style comments. This is not something a typical Fortran compiler will accept. I almost never use the C preprocessor on its own, but perhaps there is a flag that instructs it to remove such comments (or vice versa, to keep them and then removing that flag might solve the issue)?

jimdempseyatthecove
Black Belt
445 Views

Is there a reason why you are using CPP on your *.F files?

There is the Fortran PreProcessor (fpp) that is normally used to preprocess Fortran files:

C:\Program Files (x86)\IntelSWTools>fpp -help

usage: fpp [options] [input_file [output_file]]
Options:
/B                  Do not recognize C++ style comments.
/C                  Do not recognize C style comments.
/D<macro>           Define a <macro> with string '1' as its value.
/D<macro>=<val>     Define a <macro> with <val> as its value.
/I<dir>             Add <dir> to the end of the main include paths.
/M                  Generate make dependencies.
/MF=<file>          Makes fpp append dependencies to <file>.
/MX                 Exclude source file from make dependencies.
/P                  Do not generate #line directives.
/V                  Display the version number.
/U<macro>           Undefine <macro>.
/Xw                 For fixed form source files fpp assumes that the
                    symbol ' ' is insignificant.
/Xu                 Convert uppercase letters to lowercase, except
                    within character-string constants.
/Y<dir>             Add <dir> to the end of the system include paths
/c_com=<yes|no>     Recognize or not C style comments. Default value /c_com=yes.
/e                  For fixed form source files accept extended source lines,
                    up to 132 characters long.
/e80                For fixed form source files accept extended source lines,
                    up to 80 characters long.
/f_com=<yes|no>     If value is 'yes', Fortran style end-of-line comments are
                    recognized by fpp on preprocessor lines and will be ignored
                    by fpp. Default value /f_com=yes.
/free               Assume free format input source.
/fixed              Assume fixed format input source.
/f77                Assume Fortran 77 language input source.
/f90                Assume Fortran 90 language input source.
/m                  Macros are expanded anywhere in source file.
/macro=yes          Macros are expanded anywhere in source file.
/macro=no_com       Turn off macro expansion in comments.
/macro=no           Turn off macro expansion altogether.
/macro_expand=vc    Macros are expanded in Microsoft Visual C/C++ order.
/macro_expand=cpp   Macros are expanded in GNU CPP order.
/noB                Recognize C++ style comments.
/noC                Recognize C style comments.
/no-fort-cont       Recognize IDL style format. For IDE only.
/what               Display detailed version information.
/w[0]               Do not output warnings to stderr.
/undef              Do not predefine any macros.
/help               Display this information.

Copyright (C) 1985-2019 Intel Corporation.  All rights reserved.

Jim Dempsey

 

Shiquan_Su
Employee
373 Views

Thanks the input from James and Arjen. Does the suggestion of Fortran preprocessor help, Nick? Is there a way to reproduce this compilation error with a small test case? I see the uploaded compile log and configure file here


Reply