Closed stefabat closed 6 months ago
Good catch! The function names should all be lowercase. It will be easier. Thanks! I will fix it.
I am not sure effc14c fixed it. From a fresh clone of the repo, and rebuilding everything from scratch, I still see the capital letters in the function names.
That's because @scemama forgot to regenerate the JSON part of the code from the modified table, it's an easy fix if you have emacs installed (Ctrl-C Ctrl-C)
Because Fortran is case insensitive, calls to
trexio_write_cell_G_a(trex_file, dset)
(the same forG_b
andG_c
) get translated totrexio_write_cell_g_a(trex_file, dset)
and are not found the in the C library. The latter is case sensitive, and thus the call should be totrexio_write_cell_G_a(trex_file, dset)
.Steps to reproduce the issue: Compiling the simple program
with
gfortran /opt/trexio/include/trexio_f.f90 test_trexio.F90 -L /opt/trexio/lib -ltrexio
results in the following error:To fix it, one simply needs to add the
name=
argument to thebind(C)
directive in the function signature in the Fortran interface. That is, one has to changeto
in
trexio_f.f90
.I looked into
src/templates_front/templator_front.org
to change it myself and make a PR, however, these functions are generated automatically based on a fix template and I do not know the syntax for inserting a special case.Very likely, all functions in the interface containing capital letters in their name will require the same modification, such that a regular expression could be used to identify the cases where it is necessary to explicitly add the
name=
argument tobind(C)
.