- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Support the generation of Makefile dependencies via the `-M...` flags of GCC; you may need to specify additionally the -cpp option. The dependencies take modules, Fortran's include, and CPP's #include into account. Note: Using -M for the module path is no longer supported, use -J instead.
Any hope of seeing similar functionality in Intel Fortran compilers in the future (or in an additional tool packaged with the compiler)?
Parsing out the modules used and provided, along with the complexity of support for older language features like common blocks makes writing a robust, generic tool to do this a real nightmare. Resolving Fortran dependencies is a headache, even doing this manually with only a handful of source files if they are pathological enough, but writing an automated tool to handle all of the possible pathologies (like token continuation) is really a huge headache.
Since the compiler must already be parsing the source code, and is able to complain when missing .mod files are absent, it should be possible to leverage the source code parsing already in place for the compiler to implement this.
I know seeing this functionality added would make a lot of users happy. In the mean time I am asking my sysadmins to install gfortran 4.6 just so that I can stop writing tens or hundreds of absurd dependency resolution lines in my Makefiles. I'm still using ifort for the actual compilation though ;-p
Thanks in response for getting back to me! (And my appologies if this feature is already included; if it is, there is no evidence of it in the man page.)
-Z
Link Copied
- 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
[bash]$ ifort -M ~/xetest.f90 > ~/xetest.d ifort: command line error: option '-M' is ambiguous $ ifort -V Intel Fortran Intel 64 Compiler XE for applications running on Intel 64, Version 12.0.1.107 Build 20101116 Copyright (C) 1985-2010 Intel Corporation. All rights reserved. [/bash]
[fortran]module mymodule use foo use bar use baz implicit none real :: stuff contains subroutine foobar(in,out) real, intent(in) :: in real, intent(out) :: out out = in end subroutine foobar end module mymodule [/fortran]
[plain]xetest.o mymodule.mod: xetest.f90 foo.mod bar.mod baz.mod[/plain]Do i need a more recent version of composer xe 2011? Is something else amiss?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ifort /gen-dep:opqp.mak /gen-depformat:make xx.f90 yy.f90 zz.f90
Caveat: if you use in addition the /fpp option, the preprocessor outputs will be given temporary-file-names, and those name will appear in the generated makefile.
Longer answer:
You can do
ifort -help | grep -A5 -B5 -i make (on Linux)
ifort -? | find /I "make" (on Windows)
to see the options related (possibly) to your question.
- 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
ifort -?
ifort: command line warning #10006: ignoring unknown option '-?'
ifort: command line error: no files specified; for help type "ifort -help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the command "ifort -?" will work on Windows, not Linux or MacOS.
On the other hand, "ifort -help" works on all three.
-- Lorri
- 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
I still have problems with the module dependency detection in ifort version 12:
The compiler seems to resolve only dependencies that are directly in the code-file, but not dependencies to modules that are used inside included files. Can you have a look at that?
Tobias
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried an example and it seemed to work ok. Can you attach a tar file of a small example thst shows the problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have to preprocess my Fortran files before compile, so I use the /fpp option. Is there a way to avoid temporary file names to appear in the dependency file?
Regards, Luiz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Luiz -
That is a known problem, and we're working on it, but we haven't resolved it yet.
May I suggest that you use -save-temps on your command line as a temporary workaround? There will still be temporary filenames in the dependency file, but they will be reasonably named and the files will be persistent.
--Lorri

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