[MITgcm-support] configuring compilation dependencies in Makefile

Daniel Goldberg Dan.Goldberg at ed.ac.uk
Thu Jul 27 04:50:42 EDT 2023


Hello there

I am working with a package (STREAMICE) which, depending on options, makes use of a subroutine<https://github.com/MITgcm/MITgcm/blob/master/pkg/streamice/streamice_cg_solve_petsc.F> which "uses" a module<https://github.com/MITgcm/MITgcm/blob/master/pkg/streamice/streamice_arg_common_petsc.F>, and therefore the source should be compiled after the module source. (I'm required to use the module, rather than a common block, due to restrictions of an external library, PETSc.) I've only been able to do this by compiling without the -j option and ensuring the alphabetical order of compilation.

However, I have seen that some packages (e.g. ptracers) trigger what looks like dependencies in the Makefile, e.g.

PTRACERS_MOD.h: ptracers_dyn_state_mod.o ptracers_dyn_state_data_mod.o

Assuming this actually is a dependency of the type I seek, Im not able to figure out how it was generated. One difference is that "ptracers_dyn_state_data_mod" is used in a header file (PTRACERS_MOD.h). Is there any way to change genmake2, or a file read by it, in order to ensure the compilation order I seek even when using parallel compilation?

Many thanks
Dan

--
Daniel Goldberg, PhD (he/him)
Reader in Glaciology
School of Geosciences, University of Edinburgh
Geography Building, Drummond Street, Edinburgh EH8 9XP

Please note I am not working Mondays during June/July/August 2023 due to childcare responsibility.

The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. Is e buidheann carthannais a th' ann an Oilthigh Dhùn Èideann, clàraichte an Alba, àireamh clàraidh SC005336.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20230727/734740ba/attachment.html>


More information about the MITgcm-support mailing list