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

Compile/Build Problem

smarcher
Beginner
916 Views

I previously posted an inquiry about a problem I had when porting a CVF 6.6 application to IVF. I am in the process of porting a second application and have run into the same problem, but have a little more information to share.

This problem only occurs when compiling as part of the build process, not when individually compiling the code files. I am compiling fixed format files (.for) and the project and each file in the project are set to use fixed format. What happens is, after processing an include file (resource.fd) all fixed format column 1 comments and continuations are no longer recognized during the compile that is part of the build process and lots of error messages are generated.

The first 5 lines of the include file are:

!MS$FREEFORM

! Microsoft Developer Studio generated include file.

! Used by ITRAJ2TSIM_Qry.rc

!

integer, parameter :: IT2TS_Dlg1 = 101

When these lines are changed to:

C!MS$FREEFORM

C! Microsoft Developer Studio generated include file.

C! Used by ITRAJ2TSIM_Qry.rc

C!

integer, parameter :: IT2TS_Dlg1 = 101

the problem goes away.

It would seem that the line !MS$FREEFORM is changing the compiler mode somehow!

Any comments?

0 Kudos
6 Replies
Les_Neilson
Valued Contributor II
916 Views

I previously posted an inquiry about a problem I had when porting a CVF 6.6 application to IVF. I am in the process of porting a second application and have run into the same problem, but have a little more information to share.

This problem only occurs when compiling as part of the build process, not when individually compiling the code files. I am compiling fixed format files (.for) and the project and each file in the project are set to use fixed format. What happens is, after processing an include file (resource.fd) all fixed format column 1 comments and continuations are no longer recognized during the compile that is part of the build process and lots of error messages are generated.

The first 5 lines of the include file are:

!MS$FREEFORM

! Microsoft Developer Studio generated include file.

! Used by ITRAJ2TSIM_Qry.rc

!

integer, parameter :: IT2TS_Dlg1 = 101

When these lines are changed to:

C!MS$FREEFORM

C! Microsoft Developer Studio generated include file.

C! Used by ITRAJ2TSIM_Qry.rc

C!

integer, parameter :: IT2TS_Dlg1 = 101

the problem goes away.

It would seem that the line !MS$FREEFORM is changing the compiler mode somehow!

Any comments?

Yes !MS$FREEFORM is a "Compiler Directive" (see the help) which switches the compiler to freeform mode. If all your source is fixed form then just delete the !MS$FREEFORM line.

Les

0 Kudos
DavidWhite
Valued Contributor II
916 Views
Quoting - Les Neilson

Yes !MS$FREEFORM is a "Compiler Directive" (see the help) which switches the compiler to freeform mode. If all your source is fixed form then just delete the !MS$FREEFORM line.

Les

Or add !MS$NOFREEFORM at the end of the include file, so that the rest of the code is processed as fixed format.

David

0 Kudos
smarcher
Beginner
916 Views
Quoting - David White

Or add !MS$NOFREEFORM at the end of the include file, so that the rest of the code is processed as fixed format.

David

I understand what both of you are saying, but why does it only cause a problem when using Build or Rebuild to compile and link when it does not affect Complie only? I am running IVF 10.1.021 integrated into Visual Studio Professional Edition SP1

steve

0 Kudos
Steven_L_Intel1
Employee
916 Views

Would you please attach the buildlog.htm of a build showing the multiple errors? I admit I find the behavior difficult to understand. The effect of a !MS$FREEFORM directive is supposed to expire at the end of the file in which it appears, even if it is INCLUDEd in some other file.

0 Kudos
smarcher
Beginner
916 Views

Would you please attach the buildlog.htm of a build showing the multiple errors? I admit I find the behavior difficult to understand. The effect of a !MS$FREEFORM directive is supposed to expire at the end of the file in which it appears, even if it is INCLUDEd in some other file.

I had trouble adding the file so I copied it into here:

Compiling resources...
Rc /fo "Debug/ITRAJ2TSIM_Qry.res" "C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTITRAJ2TSIM_Qry.rc"
Compiling with Intel Fortran Compiler 10.1.021 [IA-32]...
ifort /nologo /Zi /Od /gen-interfaces /fixed /extend_source:80 /f66 /fpscomp:nolibs /warn:interfaces /module:"Debug" /object:"Debug" /traceback /check:bounds /libs:qwin /dbglibs /4Yportlib /c /Qvc8 /Qlocation,link,"C:Program FilesMicrosoft Visual Studio 8VCbin" "C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTITRAJ2TSIM.FOR"
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTCONTRL.FOR(1) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: => = . ( : %
C
-^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTCONTRL.FOR(9) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: // / 
      COMMON /CONTRL/ DTF,DTBF,DTRF,TNEXT,DTBUST,DTBUSG,TKINK,SKINK,
--------------------------------------------------------------------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTCONTRL.FOR(10) : Error: Syntax error, found ',' when expecting one of: => = . ( : %
     1                CKINK,VKINK,GKINK,HKINK,DAZK,RKINK,THKINK,
---------------------------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTCONTRL.FOR(10) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: ( * ::     ...
     1                CKINK,VKINK,GKINK,HKINK,DAZK,RKINK,THKINK,
----------------------------------------------------------------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTCONTRL.FOR(11) : Error: Syntax error, found ',' when expecting one of: => = . ( : %
     2                IDXCD,ISYS,NLAST,RUNIT,WUNIT,SUNIT,
---------------------------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTCONTRL.FOR(11) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: ( * ::     ...
     2                IDXCD,ISYS,NLAST,RUNIT,WUNIT,SUNIT,
---------------------------------------------------------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTCONTRL.FOR(12) : Error: Syntax error, found ',' when expecting one of: => = . ( : %
     3                LMODE,FMODE,IOUNIT,NOX,MODE,ICTOUT,BUNIT,
---------------------------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTCONTRL.FOR(12) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: ( * ::     ...
     3                LMODE,FMODE,IOUNIT,NOX,MODE,ICTOUT,BUNIT,
---------------------------------------------------------------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTCONTRL.FOR(13) : Error: Syntax error, found ',' when expecting one of: => = . ( : %
     4                BBOOUT,VBOOUT,IPOUT,EVENST,REOUT,DMODE,
----------------------------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTCONTRL.FOR(13) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: ( * ::     ...
     4                BBOOUT,VBOOUT,IPOUT,EVENST,REOUT,DMODE,
-------------------------------------------------------------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTCONTRL.FOR(14) : Error: Syntax error, found ',' when expecting one of: => = . ( : %
     5                STOUT,REFLY,RREFLY,DEBUG,RVTOUT,BSTOUT,FNAMES(5)
---------------------------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTCONSTS.FOR(1) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: => = . ( : %
C
-^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTCONSTS.FOR(6) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: // / 
      COMMON /CONSTS/ RE,GM,PI,WE,DTR,RTD,HALFPI,TWOPI,ONEG,FTONM,
------------------------------------------------------------------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTCONSTS.FOR(7) : Error: Syntax error, found ',' when expecting one of: => = . ( : %
	1                NMTOF,RP,GECC2,GECCEN,GCON1,GCON2,GCON3,ONESIX,
------------------------------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTCONSTS.FOR(7) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: ( * ::     ...
	1                NMTOF,RP,GECC2,GECCEN,GCON1,GCON2,GCON3,ONESIX,
------------------------------------------------------------------------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTCONSTS.FOR(8) : Error: Syntax error, found ',' when expecting one of: => = . ( %
     2                RSCON(5),ALTCON(3),EFLAT,TWOFLA,BLANK132
------------------------------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTCONSTS.FOR(8) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: :: , : )
     2                RSCON(5),ALTCON(3),EFLAT,TWOFLA,BLANK132
--------------------------------------------------------------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTITRAJ2TSIM.FOR(893) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: => = . ( : %
C
-^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTITRAJ2TSIM.FOR(894) : Error: Syntax error, found IDENTIFIER 'INITIALIZE' when expecting one of: => = . ( : %
C         Initialize variables
----------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTITRAJ2TSIM.FOR(902) : Error: Syntax error, found IDENTIFIER 'SCALEFACTOR' when expecting one of: => = . ( : %
c        ScaleFactor(1,1)=1.0
---------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTITRAJ2TSIM.FOR(903) : Error: Syntax error, found IDENTIFIER 'SCALEFACTOR' when expecting one of: => = . ( : %
c        ScaleFactor(2,1)=0.5
---------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTITRAJ2TSIM.FOR(904) : Error: Syntax error, found IDENTIFIER 'SCALEFACTOR' when expecting one of: => = . ( : %
c        ScaleFactor(3,1)=0.25
---------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTITRAJ2TSIM.FOR(916) : Error: Syntax error, found IDENTIFIER 'INITIALIZE' when expecting one of: => = . ( : %
C       Initialize The Dialog
--------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTITRAJ2TSIM.FOR(918) : Error: Syntax error, found IDENTIFIER 'SET' when expecting one of: => = . ( : %
C       Set The Check Boxe For The Standard Values
--------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTITRAJ2TSIM.FOR(922) : Error: Syntax error, found IDENTIFIER 'SET' when expecting one of: => = . ( : %
C       Set The Edit Boxes
--------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTITRAJ2TSIM.FOR(923) : Error: Syntax error, found IDENTIFIER 'STAGE' when expecting one of: => = . ( : %
C         Stage 1 Values
----------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTITRAJ2TSIM.FOR(934) : Error: Syntax error, found IDENTIFIER 'STAGE' when expecting one of: => = . ( : %
C         Stage 2 Values
----------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTITRAJ2TSIM.FOR(955) : Error: Syntax error, found IDENTIFIER 'STAGE' when expecting one of: => = . ( : %
C         Stage 3 Values
----------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTITRAJ2TSIM.FOR(976) : Error: Syntax error, found IDENTIFIER 'STAGE' when expecting one of: => = . ( : %
C         Stage 4 Values
----------^
C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTITRAJ2TSIM.FOR(997) : Error: Syntax error, found IDENTIFIER 'STAGE' when expecting one of: => = . ( : %
C         Stage 5 Values
----------^
(2023) : Severe: Too many errors, exiting
(2023) : Severe: Too many fatal errors, exiting
[ Aborting due to internal error. ]
compilation aborted for C:UsersSteveDocumentsVisual Studio 2005ProjectsITRAJ2TSIMCVTITRAJ2TSIMCVTITRAJ2TSIM.FOR (code 1)


ITRAJ2TSIMCVT - 33 error(s), 0 warning(s)

0 Kudos
Steven_L_Intel1
Employee
916 Views

Interesting - I'll have to play with this. You can probably remove the !MS$FREEFORM line without harm. Also, I don't think you need /fixed as an option as your sources are .FOR files.

0 Kudos
Reply