- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
is there any problem in compiling .f and .f90 files into the same program?
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
You may, however, have to compile the .f and .f90 sources on separate command lines, and then link them together. I know in the past that it did not work to mix file types on the same ifort line - have not tried that lately.
We are good in this regard with 11.1. I did not check earlier releases.
$ cat -n main.f90
1 program demo
2 call sub1
3 end
$ cat -n sub1.f
1 subroutine sub1
2 write(*,*)'In sub1'
3 end
$ ifort -V main.f90 sub1.f
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20091012 Package ID: l_cprof_p_11.1.059
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.
Intel Fortran 11.1-2620
Intel Fortran 11.1-2620
GNU ld version 2.17.50.0.6-5.el5 20061020
$ ./a.out
In sub1
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may, however, have to compile the .f and .f90 sources on separate command lines, and then link them together. I know in the past that it did not work to mix file types on the same ifort line - have not tried that lately.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
You may, however, have to compile the .f and .f90 sources on separate command lines, and then link them together. I know in the past that it did not work to mix file types on the same ifort line - have not tried that lately.
We are good in this regard with 11.1. I did not check earlier releases.
$ cat -n main.f90
1 program demo
2 call sub1
3 end
$ cat -n sub1.f
1 subroutine sub1
2 write(*,*)'In sub1'
3 end
$ ifort -V main.f90 sub1.f
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20091012 Package ID: l_cprof_p_11.1.059
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.
Intel Fortran 11.1-2620
Intel Fortran 11.1-2620
GNU ld version 2.17.50.0.6-5.el5 20061020
$ ./a.out
In sub1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
cool. many thanks for answering (and producing ifort)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Kevin, your test needed to have the .f file include fixed-form continuation or other coding that would not be acceptable in free-form source. However I did test this just now and it does work, so we're good.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes good point, or reverse the order of the source files to see if the lack of fixed-form indentation in main.f90 triggered errors.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page