Topic: Include files

Hi,
first I would like to thank Jeff for his support concerning the error with missing media in a "hidden" drive. With the 1.30 version this error disappeared.
I am just restoring an old FORTRAN program with uses the INCLUDE statement for parts of the code, mainly COMMON blocks like 
>>>>>>>>>>>>>> begin of file c_ela.for
c ... c_ela.for
c
      real*4     
     &   mr     (mn,mn) ,
     &   dr     (mn,mn)
      complex*8     
     &   kr     (mn,mn)
      common /ela/
     &   kr ,
     &   mr ,
     &   dr
c
c ...
<<<<<<<<<<<<<<< end of file c_ela. for
This file is member of the project file and should be used in the following subroutine
      subroutine ELASTO
c
      include 'c_ela.for'
c
and so on.
I get the following error:

Open Watcom Make Version 1.9 (Built on May 17 2012)
Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
    "C:\Program Files (x86)\Simply Fortran\mingw-w64\bin\gfortran.exe" -c -o build\c_ela.o -m32   -Jmodules .\c_ela.for
Error: Unexpected end of file in '.\c_ela.for'
Error(E42): Last command making (build\c_ela.o) returned a bad status
Error(E02): Make execution terminated

* Complete *

What is my mistake? Are there restrictions in the use of the INCLUDE statement or special naming conventions for include-files?

Frederick

Re: Include files

Frederick,

The issue stems from the include file ending in a valid Fortran extension.  What happens is that Simply Fortran includes c_ela.for in the build process, when in reality, it should not be built alone.

One solution is to disable c_ela.for in the Project Outline.  Find the file, right click, and select "Disable File" from the popup menu.  Now Simply Fortran should not try to directly build c_ela.for, but it will still be properly included via INCLUDE statements in your code.

Let me know if this fix works for you.

Jeff Armstrong
Approximatrix, LLC

Re: Include files

Jeff,

Thank you, your fix worked.

During addition of other files in the project I got occasionally (after some time) the error

f951.exe
"There is no disk. Please insert a disk in unit \Device\Harddisk1\DR1"

The message can be removed by pressing "continue".

Seems there are still some problems with this kind of error.

Re: Include files

Frederick,

Which version of Simply Fortran are you using, 1.30?  If so, I'll have to investigate why there is still an error being emitted from the compiler requesting access to nonexistent disks.

Jeff Armstrong
Approximatrix, LLC

Re: Include files

Jeff,
the version I am using is 1.30. Previously the error occurred earlier (when loading a project) and was quite persistent (no way out with "Continue").

Frederick

Re: Include files

Jeff,

My colleague, also an SF user, gets a similar error with 1.30. I think his error message further mentions drive F:. Odd thing is that his F: is assigned to a bluetooth device I think.

Regards

Re: Include files

What you're reporting is symptomatic of the issue.  Because the GCC build was performed on an F: drive, it is somehow remembering this information and looking for said drive on the install system.  There is usually no problem unless you've assigned an unattached device the "F:" drive letter.  If the device is attached, there isn't a problem, oddly enough.  I'll look into how the problem is sticking around.  I had thought that 1.30 eliminated the issue.

Jeff Armstrong
Approximatrix, LLC

Re: Include files

Is it of any help if I mention that I have no problems of this kind, and I have, permanantly, two 'virtual drive' assignments, as follows:

"F: drive"
---------
C:\Program Files (x86)\Fortran\Simply64\
(This is where I keep all the Simply Fortran software)

"G: drive"
---------
C:\Users\JWasilewski\Documents\Dev\Fortran\GNU\
(This is where I keep all my projects)

As I say, I do not encounter this problem.  If anyone wants to know, I use the excellent utility (with a poor name), 'Virtual Subst'
---
John