I agree with Steve that the lack of finalization support in gfortran means 
there are not many open-source Fortran projects that rely on it.

I've made extensive use of finalization:

https://github.com/galacticusorg/galacticus

An issue with this is that I had to work-around the missing pieces of 
finalization (e.g. finalization of function results). Now that those are 
implemented, my code breaks with Paul's finalization patch applied. This just 
requires me to go through the code and remove those workarounds (which will 
result in much cleaner code - so I'm very happy that finalization is now fully 
implemented).

So, it's possible that any other projects that have used the previous, 
incomplete finalization implementation might similarly break with the new 
patch. So, maybe some explanation of this in the release notes would be 
helpful so that users are made aware of possible problems.

-Andrew

On Wednesday, March 8, 2023 7:12:04 AM PST Steve Kargl via Fortran wrote:
> On Wed, Mar 08, 2023 at 07:32:55AM +0000, Paul Richard Thomas wrote:
> > Could you please review the patch on that self same time scale? I would be
> > happy to have feedback one file at a time.
> 
> Yes, I'll commit time to review individual patches.  Smaller
> patches are typically easier to review.
> 
> As to other topics in the thread, I suspect you won't
> find a lot of open-source Fortran project that make heavy
> use of finalization.  This is likely due to gfortran's
> current lack of robust support.  There, however, must
> some implicit finalization already occurring.  For one
> of my codes, I see
> 
> % foreach i (*.o)
> foreach? nm $i | grep final
> foreach? end
> 0000000000000280 T __beamsm_MOD___final_beamsm_Table_t
> 0000000000000580 T __bsam_MOD___final_bsam_Bsa_info_t
> 00000000000001e0 T __bsam_MOD___final_bsam_Bsa_t
> 00000000000000a0 T __ffn_data_MOD___final_ffn_data_Fe_t
> 
> I do not explicitly use finalization nor do I have
> subprograms named __final_*.  To me, this re-inforces
> Richard's point about not breaking existing code.


-- 

* Andrew Benson: https://abensonca.github.io

* Galacticus: https://github.com/galacticusorg/galacticus



Reply via email to