Hi all, over the weekend with the help of Claude I took a the libcint library for quantum chemistry whose main code is generated via a lisp script to produce Fortran instead of C. I did this mostly as an experiment to see the difference in performance between the C code and the Fortran code for my application. Especially since the evaluation of the integrals performed by libcint can scale around O(N^4) so fast integrals are always needed in the QC.
As of now, performance seems to get a 5-8% penalty compared to C and I have narrowed it down to the Fortran compiler generating a couple more instructions than the C compiler. I’ve verified this across gfortran and ifx.
Before I push this code, I realize that this is port might not be at home in the same repository, since not all code is autogenerated. I was thinking on creating a new repository and clearly adverting that this is a Fortran port of the original library (I kept the interface) and cite and acknowledge the original code. For those that have something similar to this, is this the best approach or does anyone have a suggestion?
Another interest for me is producing a large and rather complex codebase for LFortran to try to compile. Plus navigating Fortran deps is easier if I can use the FPM for this. I know that fpm can compile C but dealing with the macros and partial includes was a bit painful in the C.
Cheers