clawpack / clawutil

General utility programs
BSD 3-Clause "New" or "Revised" License
10 stars 31 forks source link

WIP: perhaps create .o from .f and .o90 from .f90? #111

Closed rjleveque closed 7 years ago

rjleveque commented 7 years ago

The way Makefile.common works now, if you have two files say qinit.f and qinit.f90 in your directory and qinit.f is listed in the Makefile, the file qinit.f90 will be used instead (because the rule on line 127 that creates qinit.o from qinit.f90 is invoked first and then the rule on line 128 that would use qinit.f is not invoked since the .o is now up to date). Since we have a hodge podge of .f and .f90 files, users might possibly end up with two versions in the same directory (I have at times).

Here is one proposed way to address this, by making .o90 files from .f90 files that are distinct from .o files, made only from .f files.

This is non-standard and perhaps too bizarre, so discussion of this is welcome. Or maybe someone knows a better way to address this?

mandli commented 7 years ago

I am worried this would cause havoc with all sorts of default rules that expect object files to always have the .o suffix. What if we wrote a Makefile rule that checked to see if there were two sources with .f and .f90 with the same base name and raised a warning?

mjberger commented 7 years ago

Is there a way to do that? That would be the best solution.

— Marsha

On Dec 21, 2016, at 9:45 AM, Kyle Mandli notifications@github.com wrote:

I am worried this would cause havoc with all sorts of default rules that expect object files to always have the .o suffix. What if we wrote a Makefile rule that checked to see if there were two sources with .f and .f90 with the same base name and raised a warning?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

rjleveque commented 7 years ago

Maybe we could add this check to the src/check_src.py in #97?

mandli commented 7 years ago

Doing it in Python would be significantly easier for sure. I can play with it and see if I can get something working.

mandli commented 7 years ago

I just added some code to #97 that will check to see if there are source with the same base name but different extensions. I am not exactly sure where to put this so right now I implemented it as a debug check with a pointer to new documentation. Does this seems like a good compromise or should we try to do something every compilation?

rjleveque commented 7 years ago

This PR was determined to be a bad idea, so I'm closing it. See the alternative implemented in #97 and raise an issue if there is still something needed in this direction.