#41: When an external library is rebuilt, its dependencies should also be rebuilt
Reporter:Erik Schnetter
Status:open
Milestone:
Version:
Type:bug
Priority:minor
Component:Cactus

Changes (by Roland Haas):

status:open (was new)

When an external library (such as e.g. BLAS) is rebuilt, then all its dependencies (such as e.g. LAPACK) should also be rebuilt. Cactus knows these dependencies via the configuration.ccl declarations, but these are not checked in the scripts that determine whether to rebuild.

Keyword:

Comment (by Roland Haas):

There are three cases of dependencies:

  1. the library file itself, which does not require recompilation of the client since the linker will take care of using the new library automatically
  2. any header files generated, these are already tracked in the .d files created by the various XXX_DEPEND tools in lib/make/make.config.rules.in
  3. Fortran module files .mod. These are not currently tracked by anything since the F_DEPEND_MODULES functionality is limited to modules in the same thorn and sets up a dependency assuming that a module foo is provided by a source file foo.F90 which is not sufficient.

For this last case one can however make use of the fact that gfortran accepts the same -M -MF options that gcc (or cpp) do to write out dependency files. These do track modules wherever they are but assume that the module must exist when gfortran is first called. For ExternalLibraries this will be the case since Cactus already ensures that thorns REQUIREing each other are build in the correct order (exactly for the reason to provide .mod files).

An example usage looks like this:

mkdir bing
cat <<EOF >bing/foo.F90
#include "bar.h"
subroutine foo
  use bar

  implicit none

end subroutine
EOF
cat >bar.F90 <<EOF
module bar
end module
EOF
gfortran -c bar.F90
gfortran -J$PWD/.. -M -MF foo.F90.d foo.F90

Thus the best way to achieve the goal in this ticket seems to be to extend F_DEPEND or F_DEPEND_MODULES to call F90 as well as FPP (since

--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/41/when-an-external-library-is-rebuilt-its