- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
is there any problem in compiling .f and .f90 files into the same program?
- Marcas:
- Intel® Fortran Compiler
1 Solução
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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 copiado
6 Respostas
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
cool. many thanks for answering (and producing ifort)
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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.

Responder
Opções do tópico
- Subscrever fonte RSS
- Marcar tópico como novo
- Marcar tópico como lido
- Flutuar este Tópico para o utilizador atual
- Marcador
- Subscrever
- Página amigável para impressora