I would like to generate a list of dependencies for MAKE from the source file in Fortran. From the INtel Fortran Help, I got the "-gen-dep" (or /QMMD) option, but this does not seem to work as I expect it to work...
Assume the following source file "class_a.F90":
module class_a use interface_b, only: i_configuration_type implicit none private public :: configuration_type type, extends(i_configuration_type) :: configuration_type logical :: use_is_calculated = .false. contains procedure :: is_calculated end type configuration_type contains function is_calculated(this) implicit none class(configuration_type), intent(in) :: this logical :: is_calculated is_calculated = this%use_is_calculated return end function is_calculated end module class_a
If I then run the following command on that file
ifort /QMMD /syntax-only class_a.F90
I get a (partial) "class_a.d" file
class_a.obj : \ class_a.F90 INTERFACE_CONFIGURATION_TYPE
and a bunch of errors
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 184.108.40.206 Build 20160204 Copyright (C) 1985-2016 Intel Corporation. All rights reserved. class_a.F90(3): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [INTERFACE_B] use interface_b, only: i_configuration_type ------^ class_a.F90(10): error #6406: Conflicting attributes or multiple declaration of name. [I_CONFIGURATION_TYPE] type, extends(i_configuration_type) :: configuration_type ----------------^ class_a.F90(3): error #6580: Name in only-list does not exist. [I_CONFIGURATION_TYPE] use interface_b, only: i_configuration_type -------------------------^
I would expect the compiler to just output the dependency for "i_configuration_type.mod" into the ".d" file.
Or how is this feature of dependency generation from the compiler to be used? - I must somehow be able to run the dependency generation on the source files before the actual compilation happens to get the full list of (first order) dependencies and then include this in MAKE such that this then knows in which order to build which files.
Thanks and best regards,
The idea of -gen-dep is to create a set of text pieces which can be incorporated into a makefile. You'll need to ignore compile errors from the pass that generates the dependencies.
class_a.obj : \ class_a.F90 interface_configuration_type.modin my opinion, or did I miss anything? (Sure then just ignoring the compiler error)
Thank you, Steve, for logging it as defect. - Should I do anything further now? (I also have Intel Premier login, should I also file there?) - Will you then log here, once fixed? - Is there any time estimate?
Thanks and best regards,
You don't need to do anything more - I will update this thread when there is news. I can't predict when this will get fixed, though it seems likely to me that it will get done before the final release of the "2017" product later this year.
The issue occurs when there is no .mod file for the module. A possible workaround is to create a temporary Visual Studio project, add all the sources and do a build with /gen-dep specified. The VS integration knows how to do the order right and you'll get the dependency info. Then you can take that and do what you want with it.