Closed cferenba closed 6 days ago
I've done some more digging and I think I've found (at least part of) the answer to my own question:
gftl-shared
to be an alias for gftl-shared-v1
.gftl-v2
and gftl-shared-v2
.gftl-shared
and fargparse
. gftl-shared
gives it a dependency on v1, and fargparse
gives it a dependency on v2.I can see several ways the mismatch could be resolved. @tclune do you have a recommendation?
The build really is using both, but probably just for historical reasons. There is no Fortran issue with involving both v1 and v2 containers in the same executable so long as they are not both referenced in the same scope. (And even then, I've used Fortran rename without any major issues.) So this is definitely a compiler bug.
But I suspect a simple fix is to simply update FUnit to only use the V2 interfaces. Let me know if you want to attempt that yourself. The main difference with V2 for map is that instead of %key()
and %value()
it is now %first()
and %second()
to be more compatible with C++ STL. (But there are a few other gotchas.) If not, I can probably try it this weekend.
But I suspect a simple fix is to simply update FUnit to only use the V2 interfaces. Let me know if you want to attempt that yourself.
I can try that. I'll let you know what happens.
The conversion to V2 fixed the issue, thanks for the suggestion! I'll make a PR with the changes soon.
Great. I'm torn as to whether this should be a hotfix on main vs a new feature on develop branch. I lean towards the latter, as technically the bug is with the compiler ... I'll let you decide. Either way I'll propagate and get a new release out quickly.
Please be sure to add an entry in the ChangeLog.
OK, changes are ready. This required a small change to gFTL-shared which is in Goddard-Fortran-Ecosystem/gFTL-shared#77. A PR for pFUnit will follow.
Just to note that I see a related warning with gfortran 13.3.1
src/funit/core/FUnit_Core.F90:29:7:
29 | use gFTL_StringUnlimitedMap
| 1
Warning: Although not referenced, ‘generic interface 'stringunlimitedmap'’ has ambiguous interfaces at (1)
I'm trying to get pFunit compiling using the Cray CCE compiler, and I'm getting an odd error in the compile of FUnit_Core.F90:
The offending source line is:
and the compile line that gave the error is:
As best I can tell, the issue is that there are two different (and incompatible) versions of the StringUnlimitedMap module being generated:
and somehow both of these are getting pulled into the build (note that the v1/mod and v2/mod paths are both showing up as include directories in the compile line above).
I'm not sure what to do about this. Is the build really supposed to include both v1 and v2 directories? And if so, how is the compiler supposed to disambiguate between them?