track Fortran module dependency for modules in subdirs

Issue #1362 closed
Roland Haas created an issue

Cactus' module dependency and autogeneration feature (ie adding proper dependencies when a "use module" is found) currently fails for modules defined in SUBDIRS of src (even when the SUBDIRS are properly declared in make.code.defn).

It would be nice if Cactus kept track of those as well.

Keyword:

Comments (8)

  1. Erik Schnetter
    • changed status to open
    • removed comment

    I have rewritten the dependency tracker to take subdirectories into account.

    I have also rewritten and partly redesigned some other features, correcting some unrelated errors in the course, and simplifying the code a bit. I have also added some comments.

  2. Roland Haas reporter
    • removed comment

    The patch fixes the issue described in the description for me. The patch uses "find" to get all subdirs an a src tree and then checks for include files in all of them. This seems dangerous if eg a "bak" folder exists where one has stored the original versions of files while working on a new-and-improved version. It might be better to instead use the SUBDIRS entry of make.code.defn which if I read the Cactus doc correctly has to list all SUBDIRS incl. the ones themselves contained in subdirs.

    Otherwise: please apply.

  3. Frank Löffler
    • removed comment

    Will this script also take into account files like somename_old.F90 - which is just an old backup of somename.F90 and shouldn't be taken into account? somename_old.F90 might contain an use/include to another file which shouldn't be compiled, and the script might generate a dependency for these, while it should ignore them.

  4. Erik Schnetter
    • removed comment

    (1) Additional dependencies are not bad. Missing dependencies are bad.

    (2) A dependency generator does not cause files to be compiled that would otherwise not be compiled. It specifies the order in which files need to be compiled, leading to make errors if a dependency cannot be met. It can also trigger recompiles of a file even if that file itself didn't change, namely when e.g. one of its include files changed.

    (3) [tongue-in-cheek] The script will not exclude filenames that end in "_old.F90", just in case you use this convention for backups. If you really want such file names to be excluded, please teach the flesh first that specifying such file names should be an error.

    (4) Please fix GRHydro, the way modules are used there leads to many more problems than this dependency tracker.

  5. Roland Haas reporter
    • removed comment

    Please apply. I retract my reservation from comment:2 (I tried coding up something that get SUBDIRS out of the makefile and there seems to be no nice way of doing this while dealing properly with line continuation, # comments and quotation marks.

  6. Log in to comment