Closed zbeekman closed 5 years ago
“Variable Length Array's in Structs (VLAIS) and why they don't belong in your C code” https://blog.linuxplumbersconf.org/2013/ocw/system/presentations/1221/original/VLAIS.pdf
FX,
The student who worked on this did so as part of an 11-week visit to Sourcery Institute that ended yesterday. He's unlikely to be able to work on OpenCoarrays going forward other than writing up his work. He's also on vacation for all of June. It sounds like you might have the expertise to fix this and I'm hoping you might pitch in. Very nearly all OpenCoarrays development going forward will be from community contributions as there are no related contracts and the few people who have related funding have very specific objectives that don't relate to this file.
Damian
On Fri, Jun 1, 2018 at 7:55 AM, FX Coudert notifications@github.com wrote:
“Variable Length Array's in Structs (VLAIS) and why they don't belong in your C code” https://blog.linuxplumbersconf.org/2013/ ocw/system/presentations/1221/original/VLAIS.pdf
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sourceryinstitute/OpenCoarrays/issues/549#issuecomment-393906044, or mute the thread https://github.com/notifications/unsubscribe-auth/AMgGhL7n-DBIoreGnYZQbePvPUzur7aAks5t4VXfgaJpZM4UWwSj .
Hi @rouson I personally have no use for Opencoarrays, and though I wish the project well, I have no time to contribute. I also would not like to contribute to a project were certain contributors are paid, and myself (with what I would consider to be similar expertise, academic background and software skills) doing it on my free time.
It is sad that development is contract-based and does not include producing standard code. This could have been caught during review of the student's code, if GCC was systematically called with a standard-compliance option (-std=c99
), or if multiple compilers were tested (in this case, clang/llvm).
Regarding Homebrew, if there is no incentive to commit to cross-platform code, given this is the second release of Opencoarrays that is broken, I will recommend simply removing it unless there is a commitment from the Opencoarrays team to make a release which fixes the issue.
Hi @rouson, fyi if you'd like this is something that I could start working on tomorrow. On my flight I'll try to take a look at it. -Soren
Thanks, @scrasmussen. That would be great!
I have thought about this and there might be a solution.
I don't know if you can include if statements
in macros, or perhaps pounded ifs? That would make it so C can declare a variable according to a given an explicitly typed struct. That would solve our issue, we'd only have to define explicitly typed structs and the function-like macro.
@fxcoudert We are committed to fixing this and using standard conforming code.
Most of the development of OpenCoarrays is unfunded with very sporadic funding here and there. The goals of OpenCoarrays and SourceryInstitute are to (as best we can) advance support for the latest modern Fortran language standards in the broader community. Any funding for OpenCoarrays is usually from donations, and most work is performed by volunteers. We are committed to open source and supporting and enhancing the open source computing and broader scientific computing community.
The first issue that broke OpenCoarrays was due to a sloppy commit to the GFortran code base right before the 8.1 release, that was completely out of our control. In fact it can cause ICEs with any coarray code, even when using the serial testing backend that ships with GFortran.
We agree that OpenCoarrays should be portable and standards conforming and will ensure that OpenCoarrays can build cleanly on MacOS with Homebrew ASAP.
Thanks for your contributions to Homebrew, GFortran and your patience in working with us as we resolve this issue.
Best, Zaak
In general, we are not C99 or C11 compliant AFAICT. The first errors show up compiling mpi_caf.c
in macros for type conversion:
OpenCoarrays/src/mpi/mpi_caf.c:7180:70: error: expected ';' before 'opr'
type ## _t_by_value = (typeof (VALUE_FUNC(type ## _t)))opr; \
^~~
My C macro wrangling fu is not quite strong enough to see what the obvious solution to this is, but it seems like it should be fairly trivial. Perhaps an additional ##
?
PR #557 excludes ISO_Fortran_binding.h
when the C compiler is not GCC. This is a work around for now... in the long run we should plan to remove VLAs
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
I'm closing this. We're back down to only two warnings about structs with arrays that are not the final component. I should open a new issue for that.
Defect/Bug Report
uname -a
: x86_64 macOS (high sierra)Observed Behavior
iso_fortran_binding.h uses variable length arrays (VLAs) inside structs which is a GCC C extensionSee also discussion at https://github.com/Homebrew/homebrew-core/pull/28534SEE ALSO: #485 these issues are nearly duplicates.
Expected Behavior
Be able to compile all components written in C because the C code is standards conforming
Steps to Reproduce
compile using clang instead of gcc
Discussion
@dcelisgarza:
I don't want you to have to do anything that is "tedious as hell" but it would be nice to get standard complying C code. Otherwise I can just test for the ability to compile the code in question and if it fails exclude the iso_fortran_binding stuff.