[MITgcm-support] configuring compilation dependencies in Makefile

Daniel Goldberg Dan.Goldberg at ed.ac.uk
Thu Jul 27 10:29:19 EDT 2023


Thanks J-M. I will attempt to follow this.

dan
________________________________
From: MITgcm-support <mitgcm-support-bounces at mitgcm.org> on behalf of Jean-Michel Campin <jmc at mit.edu>
Sent: Thursday, July 27, 2023 15:17
To: mitgcm-support at mitgcm.org <mitgcm-support at mitgcm.org>
Subject: Re: [MITgcm-support] configuring compilation dependencies in Makefile

This email was sent to you by someone outside the University.
You should only click on links or attachments if you are certain that the email is genuine and the content is safe.

Hi Dan,

The convention that is currently used is that F90 modules are declared inside src file
with a name that finishes with "_mod.F" (if fixed format, like in pkg/ptracers) or
with "_mod.F90" (if free format, like in pkg/atm_phys).
With these type of sufix the f90makedepend is able to work and make sure things are
compiled in the right order.

May be your pkg/streamice src files that contains F90 modules could follow the same
convention ?

Cheers,
Jean-Michel

PS: Oliver might know more about these pieces.

On Thu, Jul 27, 2023 at 08:50:42AM +0000, Daniel Goldberg wrote:
> 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.

> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support

_______________________________________________
MITgcm-support mailing list
MITgcm-support at mitgcm.org
http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20230727/73ced8fc/attachment-0001.html>


More information about the MITgcm-support mailing list