[Bug fortran/47720] problems with makefile dependency generation using -M
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47720 Bernhard Reutner-Fischer changed: What|Removed |Added CC||aldot at gcc dot gnu.org --- Comment #9 from Bernhard Reutner-Fischer --- To avoid the duplicate module names, we would have to remember which modules we emitted already (or maybe deps_add_ not when opening and reading the module but way later). But, as said, is this really a problem? As to the fact that -M... requires cpp, we could enable cpp when seeing -M, yes. I'm not sure about the implications this has on the source we're reading though. Maybe none.
[Bug fortran/47720] problems with makefile dependency generation using -M
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47720 Dominique d'Humieres changed: What|Removed |Added CC||eh.toussaint at gmail dot com --- Comment #8 from Dominique d'Humieres --- *** Bug 84513 has been marked as a duplicate of this bug. ***
[Bug fortran/47720] problems with makefile dependency generation using -M
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47720 Dominique d'Humieres dominiq at lps dot ens.fr changed: What|Removed |Added Status|UNCONFIRMED |WAITING Last reconfirmed||2013-12-29 Ever confirmed|0 |1 --- Comment #7 from Dominique d'Humieres dominiq at lps dot ens.fr --- The duplicate module names are still there at r206227. Is it really a problem? Should it be documented?
[Bug fortran/47720] problems with makefile dependency generation using -M
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47720 Daniel Franke dfranke at gcc dot gnu.org changed: What|Removed |Added CC||dfranke at gcc dot gnu.org --- Comment #6 from Daniel Franke dfranke at gcc dot gnu.org 2011-07-24 19:35:42 UTC --- See also #44526 (I think there's another related PR somewhere, can't find it right now). The -cpp is required as the C preprocesor and libcpp are being used to generate the Makefile dependencies. As you probably know, in itself Fortran doesn't really have a concept of a preprocessor.
[Bug fortran/47720] problems with makefile dependency generation using -M
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47720 --- Comment #2 from Kris kristopher.kuhlman at gmail dot com 2011-05-25 19:36:48 UTC --- (In reply to comment #1) May I ask what version of gfortran this is? (Trunk build of gfortran from yesterday is a bit ambiguous) I was using a build of gfortran from CVS 2/12/2011. The reason I ask is that I am not getting as far as you. on gfortran 4.6.0 if have a program which uses two modules and dependency listing I get is myprog.0: myprog.f90 which is less than helpful. Using a more recent trunk build (sometime last week), I still get what I originally posted. $ gfortran-4.7 -cpp -M makegen?.f90 makegen1.o constants.mod: makegen1.f90 makegen2.o utility.mod: makegen2.f90 constants.mod constants.mod \ constants.mod If it is considered to be ok that there is all this duplication, then I guess I don't have a problem. Maybe the documentation for this feature could be cleared up to mention this too?
[Bug fortran/47720] problems with makefile dependency generation using -M
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47720 --- Comment #3 from Kris kristopher.kuhlman at gmail dot com 2011-05-25 19:45:15 UTC --- (In reply to comment #2) I was using a build of gfortran from CVS 2/12/2011. I meant SVN, not CVS.
[Bug fortran/47720] problems with makefile dependency generation using -M
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47720 --- Comment #4 from Zaak zbeekman at gmail dot com 2011-05-25 19:56:38 UTC --- I'm not a gfortran dev, but the duplicates are likely due to the fact the the source code is being parsed and there is need to remove duplicates, since the output is intended for consumption by make. The idea is to run gfortran -M -cpp before running gfortran -c to compile the code. Then you can include the .d files produced with the -M flag in your makefile. See for example: http://theory.uwinnipeg.ca/localfiles/infofiles/make/make_43.html I suspect, however, that if you swapped the names of your two files, and removed all of the .mod files, you will run into the bug posted here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49149 (Or rename makegen1.f90 to makegen3.f90) You should be able to start with only source files (no compiled or objects processed by gfortran) and do: $ gfortran-4.6 -cpp -M makegen?.f90 If the nighly build, or whatever you're using still has the same bug as 4.6.0 then the above command will complain about missing .mod files, which defeats the purpose of having such a utility in the first place. (The goal is to resolve dependencies, but to do this you need some .mod files. Which ones? well go resolve some dependencies and find out. Oh...wait I can't resolve dependencies unless I already have them in which case I don't need to resolve them anymore)
[Bug fortran/47720] problems with makefile dependency generation using -M
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47720 --- Comment #5 from Zaak zbeekman at gmail dot com 2011-05-25 20:01:01 UTC --- In comment 4, in the first sentence there is a typo. I meant: I'm not a gfortran dev, but the duplicates are likely due to the fact the the source code is being parsed and there is *NO* need to remove duplicates, since the output is intended for consumption by make.
[Bug fortran/47720] problems with makefile dependency generation using -M
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47720 Zaak zbeekman at gmail dot com changed: What|Removed |Added CC||zbeekman at gmail dot com --- Comment #1 from Zaak zbeekman at gmail dot com 2011-05-24 18:33:33 UTC --- The page here: http://gcc.gnu.org/wiki/GFortran#GCC4.6 seems to suggest that you need to specify -cpp. I must admit, however, the documentation for this features is a bit murky. I suspect that the module constants shows up three times because it is used in three procedures in the second module. This is by no means a deficiency. If you include this in your makefile it will not cause problems. In fact, make has ways of removing duplicates. gfortran/cpp likely parse your source code and every time they encounter a use statement ad the module(s) mentioned there to the list of dependencies. May I ask what version of gfortran this is? (Trunk build of gfortran from yesterday is a bit ambiguous) The reason I ask is that I am not getting as far as you. on gfortran 4.6.0 if have a program which uses two modules and dependency listing I get is myprog.0: myprog.f90 which is less than helpful.