Mahol Dot Org

Icon

Weblog For All Your Need

Ifort -extend-source Option Errors & Fortran Fixed Formatting Use nofree

Problem Definition
Working on FORTRAN source code migrations from Solaris operating system to windows XP.  Fortran being most portable code so most of the time we do not see any problems while porting fortran code, but there is always problem with columns length exceeds to default value and while compilations we forgot to take care of option extend-source.

Intel® Fortran compiler(ifort) – Option -extend-source

       -extend-source [size]
	      Specifies the column number to use to end the  statement	field
	      in  fixed-form source files. [size] can be 72, 80, or 132.  The
	      default behavior is -noextend-source, which implies column  72.
	      If  you  do  not	specify	 size,	it  is the same as specifying
	      -extend-source 132.

source ifort help or man ifort

Solution
The Makefile has a compiler flag called /extend_source:132, which basically extends the number of columns the Fortran compiler looks at. The default value is 72. /extend_source extends the number of columns that the compiler looks at to 132.

Fortran generally uses something called as Fixed Formatting - which takes 72 valid columns, ignores the rest and also considers tabs and spaces as comments inside a statement field.
/nofree tells the compiler that fixed formatting needs to be used. Most of the time code follows fixed formatting.

TO remove all compiler errors which pertain to syntax errors at Format statement just add some variable in your makefile, like
COLEXTEND=/extend_source:132

And when facing problem while compiling any fortran module in Windows just compile with COLEXTEND= /nofree.

example of make command, assuming windows makefile name as win.make

on command prompt type : nmake /f win.make COLEXTEND=/nofree

Good luck and do comment your experiences as well.

Related problem regarding

-extend-source option

Number of View :898

Related posts:

  1. How To Capture X Protocol Traffic Using Wireshark On Windows XP?
  2. How To Capture X Protocol Traffic Using Wireshark On Windows XP
  3. Unresolved External Symbol _getenv_ USE IFPORT Link Error For Application Porting From UNIX To Win32
Receive Updates By Email

Enter your email address:

Delivered by FeedBurner

Category: Tech-Tips, Unix2Win32_Porting

Tagged: , , , ,

2 Responses

  1. admin says:
    fortran porting issues, fortran porting problems and solutions.. fortran to c migration.
  2. [...] getting this error, and I have no idea why. The program is in a very standard structure: I did check help / man page of IFORT but no luck.. This thread at intel.com also discuss about the same problem. the answer at this [...]

Leave a Reply

Lost !! Use Advanced Search

Categories

Content Protected Using Blog Protector By: PcDrome.

Mahol Dot Org is Digg proof thanks to caching by WP Super Cache