Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to compile example from intel fortran website using gfortran compiler

Status
Not open for further replies.

awa5114

Structural
Feb 1, 2016
135
I am trying to compile the sample code provided in example 1 of [this link][1] using GNU Fortran. I have placed the source code in a .f95 file called "Test" and tried to compile it in `cmd` using

`gfortran test.95`

This throws quite a few errors as shown below:

C:\Program Files (x86)\mingw-w64\i686-5.1.0-posix-dwarf-rt_v4-rev0>echo off
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\>D;
'D' is not recognized as an internal or external command,
operable program or batch file.

C:\>D:

D:\>cd TEMP\FortranTest

D:\TEMP\FortranTest>gfortran test.f95
test.f95:8:20:

GENERIC :: READ (FORMATTED) => UDIO_READ_ARRAY
1
Error: Expected '=>' at (1)
test.f95:12:17:

INTERFACE WRITE(FORMATTED)
1
Error: Syntax error: Trailing garbage in INTERFACE statement at (1)
test.f95:13:21:

MODULE PROCEDURE UDIO_WRITE_ARRAY
1
Error: MODULE PROCEDURE at (1) must be in a generic module interface
test.f95:14:5:

END INTERFACE
1
Error: Expecting END MODULE statement at (1)
test.f95:51:6:

USE TYPES
1
Fatal Error: Can't open module file 'types.mod' for reading at (1): No such file
or directory
compilation terminated.

D:\TEMP\FortranTest>

Why is this happening? How can I fix it?

[1]:
 
Replies continue below

Recommended for you

You are ostensibly using a compiler than was current 22 years ago with Fortran code for a contemporary compiler.

???

MinGW is still actively supported as far as I know. The latest version for download is from 2013. That said, it isn't necessarily going to be compatible with code written for the Intel compiler.

awa5114 - have you checked that your compiler is working properly with a simpler example from the MinGW site?

Doug Jenkins
Interactive Design Services
 
Generic keyword is supported in the latest gfortran. Which version are you using?

Sorry - take that back - gfortran doesn't currently fully support user defined IO.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor