[CMake] Fortran 90 module output directories, dependency analysis
Brad King
brad.king at kitware.com
Tue Jun 1 13:48:21 EDT 2010
Jed Brown wrote:
> There is still the issue that module files don't get rebuild if they are
> deleted,
>
> make[2]: *** No rule to make target `include/petscmat.mod', needed by `CMakeFiles/petscdm.dir/src/dm/f90-mod/petscdmmod.F.o'. Stop.
> make[1]: *** [CMakeFiles/petscdm.dir/all] Error 2
>
> I don't seem to be able to regenerate the module by any lightweight
> procedure (make -B SpecificTarget works).
You can delete the object file the provides the module.
> Perhaps that scenario where
> module files are deleted independent of the object/libraries is
> artificial, but it's not really correct for the build to break if they
> are deleted.
The problem is that the build system doesn't actually point directly
at the .mod files so it doesn't know when they are missing. I don't
remember all details off the top of my head, but there are very good
reasons that the build system doesn't see .mod files directly.
Fixing this would require some kind of side-effect map. At the start
of each build the object file providing a missing module would need
to be deleted. We already have something similar for custom commands
with multiple outputs, but a major distinction is that CMake knows
what files are paired together at generation time. Object->module
mapping is not known until build time (during dependency scanning).
I have no time to look at this, but I can get you started if you want
to try it yourself.
-Brad
More information about the CMake
mailing list