Anton B
Anton B

Reputation: 181

ifort line length limit

So it seems there are a few questions regarding the gfortran's line width limit, but not a single one about ifort's. I'm having the following issue when compiling:

../../../src/70_gw/gwls_lineqsolver.F90(298): error #5082: Syntax error, found IDENTIFIER 'ENDIF' when expecting one of: ( * ) :: , <END-OF-STATEMENT> ; + . - (/ [ : ] /) ' ** / // > ...
&"        endif
----------^
../../../src/70_gw/gwls_lineqsolver.F90(298): error #6404: This name does not have a type, and must have an explicit type.   [ENDIF]
&"        endif
----------^
../../../src/70_gw/gwls_lineqsolver.F90(297): warning #6043: This Hollerith or character constant is too long and cannot be used in the current numeric context.   ['=# of valence states).']
             write(std_out,*) "              subspace (the kernel contains state i=",min_index," > ",nbandv,"=# of valence states).&
------------------------------------------------------------------------------------------------------------^
../../../src/70_gw/gwls_lineqsolver.F90(290): error #6321: An unterminated block exists.
  if (singular .and. ( (project_on_what==1 .and. (min_index > nbandv)) .or. project_on_what==0 ))  then
^
compilation aborted for ../../../src/70_gw/gwls_lineqsolver.F90 (code 1)
make[3]: *** [gwls_lineqsolver.o] Error 1
make[3]: Leaving directory `/home/stud2/7.11.3-private/build/src/70_gw'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/stud2/7.11.3-private/build/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/stud2/7.11.3-private/build'
make: *** [all] Error 2

The actual code that triggers the error is below:

if (project_on_what==1 .and. (min_index > nbandv)) then
             write(std_out,*) " "
             write(std_out,*) "              There is a projection on the conduction states, but A is singular in this "
             write(std_out,*) "              subspace (the kernel contains state i=",min_index," > ",nbandv,"=# of valence states)."
end if

I do not have a gfortran compiler to test it out, but I believe that I get this because of the line length limit. Is there a flag in ifort to remove this limit?

Upvotes: 3

Views: 5167

Answers (1)

credondo
credondo

Reputation: 744

The error is probably caused by a bug in ifort 11.x (Source):

Beginning with the 11.x release, the Intel Fortran compiler does not correctly ignore the -extend-source (and other variants) for free-form source files named with the .F90 extension. The option is correctly ignored for source files named with the lower-case .f90 extension.

The mishandling of the option will cause erroneous syntax errors for any Fortran source statement that extends beyond the designated statement field length specified with the -extend-source option.

The error can be easily avoided by changing the file extension to .f90 and by adding the flag -fpp in order to maintain the preprocessing.

Upvotes: 9

Related Questions