Path: ...!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Thomas Koenig Newsgroups: comp.lang.fortran Subject: Re: in gfortran, is it faster compile times with *.mod files ? Date: Tue, 12 Nov 2024 08:01:40 -0000 (UTC) Organization: A noiseless patient Spider Lines: 42 Message-ID: References: Injection-Date: Tue, 12 Nov 2024 09:01:40 +0100 (CET) Injection-Info: dont-email.me; posting-host="89d82190ed5c06d2708965acd9c9935d"; logging-data="1582177"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4IkkhZSe6U7mrlO3TmvPvf3R0BL2C91I=" User-Agent: slrn/1.0.3 (Linux) Cancel-Lock: sha1:edbVH7hrR5gsFAA+yxBYKhKLq1E= Bytes: 2641 Lynn McGuire schrieb: > On 11/11/2024 4:01 PM, Thomas Koenig wrote: >> Lynn McGuire schrieb: >>> In gfortran, is it faster compile times with *.mod files ? Or is it >>> just as fast compiling to include the module interface information in >>> each subroutine / function file ? >> >> I haven't benchmarked this, but I think likely that there would only >> be a small difference. Usually, the front end only takes a small part of >> compilation time (but there are pathological cases). >> >> In general, modules are better because of automatic checking. >> If you want to avoid recompilation cascades, submodules (where >> you can separate the definition from the implementation) might >> be worth looking into. >> >>> Is there any chance that gfortran will automatically generate and use >>> module files in the future like IVF ? >> >> Not sure what you're asking for. Can you give an example? > > 1. you compile abc.f in IVF > 2. IVF automagically creates an abc__genmod.f90 file in your release > subdirectory with the subroutine / function module interface in it I think I get the general gist (but it would help me understand if you could post a complete example). But gfortran currently does not have such a feature (which appears to duplicate modules). It is also not immediately clear what should happen if, for example, a procedure uses a derived type from another module... (This may not be relevant to your case, but as a compiler writer, you have to think about this kind of thing :-|) What would go wrong if you simply encapsulated abc.f in MODULE ABC CONTAINS C Your code here END MODULE ABC ?