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

error #5082 (Tell fpp to ignore c++ style comment?)

FortCpp
Beginner
1,048 Views

Dear ifort users and intel developers,

I am trying a small hello world program. But I got some error messages like these:

>C:\Program Files\WinPETSc\PETSc\c-debug_icl_mkl\include/petscconf.h(374): error #5082: Syntax error, found '//' when expecting one of: <LABEL> <END-OF-STATEMENT> ; BLOCK BLOCKDATA PROGRAM MODULE TYPE INTEGER REAL ...
1>C:\Program Files\WinPETSc\PETSc\c-debug_icl_mkl\include/petscconf.h(374): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( =
1>C:\Program Files\WinPETSc\PETSc\c-debug_icl_mkl\include/petscconf.h(375): error #5082: Syntax error, found '//' when expecting one of: <LABEL> <END-OF-STATEMENT> ; BLOCK BLOCKDATA PROGRAM MODULE TYPE INTEGER REAL ...
1>C:\Program Files\WinPETSc\PETSc\c-debug_icl_mkl\include/petscconf.h(375): error #5082: Syntax error, found INTEGER_CONSTANT '1' when expecting one of: ( =
1>C:\Program Files\WinPETSc\PETSc\c-debug_icl_mkl\include/petscconf.h(376): error #5082: Syntax error, found '//' when expecting one of: <LABEL> <END-OF-STATEMENT> ; BLOCK BLOCKDATA PROGRAM MODULE TYPE INTEGER REAL ...

the corresponding lines are:

//#ifndef PETSC_HAVE__INTEL_FAST_MEMCPY
//#define PETSC_HAVE__INTEL_FAST_MEMCPY 1
//#endif

Here is the command line:

/nologo /debug:full /Od /fpp /I"C:\Program Files\WinPETSc\PETSc\include" /I"C:\Program Files\WinPETSc\PETSc\c-debug_icl_mkl\include" /I"C:\MPICH2_x86-64\include" /module:"x64\Debug\\" /object:"x64\Debug\\" /Fd"x64\Debug\vc100.pdb" /traceback /check:bounds /check:stack /libs:static /threads /dbglibs /c

I guess the problem is that fpp didn't ignore c++ sytle comment. But I can't find how to tell fpp to do so. Could you help me out? Thanks!

0 Kudos
3 Replies
mecej4
Honored Contributor III
1,048 Views

Fortran is not C++. The double slash is used as the string concatenation operator in Fortran, so it cannot be used to signify "start of comment".

0 Kudos
FortCpp
Beginner
1,048 Views

OK. I see. Thanks.

0 Kudos
Steven_L_Intel1
Employee
1,048 Views

However, if you really want to do this, you need to use:

/fpp:"-noB"

on the command line. This variation can't be specified using the Visual Studio property, so you'd have to add it on the "Command Line" property page.  I don't recommend it.

0 Kudos
Reply