-
Notifications
You must be signed in to change notification settings - Fork 861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-compliant C90 comments at mpi.h file leads to compilation failure for codes compiled with gcc -ansi or -std=c90 flags #12710
Comments
@bcmundim Sorry for the delay; this question slipped by me. Open MPI has required a C99 compiler for many years. It's a bit surprising that a IceT is requiring a 30 year old C standard, especially if it requires |
The MPI standard is silent about specific C versions and we intentionally have not used any post-C90 features so it could be argued that the header |
@devreal True, but the MPI standard is silent about compiler support, too -- and Open MPI only supports a specific set of compilers. FWIW: It looks like the portable_platform file was last imported from Gasnet in 2021. I won't object if someone wants to post a PR to update these things, but it seems like codes that require compiling with |
More specifically: since we import that portable_platform.h from Gasnet, we would really like to see the fix put upstream so that we can pull it down here again (including the fix). Otherwise, we'll have to keep track of local edits the next time we pull this down (i.e., we'll forget). |
It looks like this issue is expecting a response, but hasn't gotten one yet. If there are no responses in the next 2 weeks, we'll assume that the issue has been abandoned and will close it. |
Per the above comment, it has been a month with no reply on this issue. It looks like this issue has been abandoned. I'm going to close this issue. If I'm wrong and this issue is not abandoned, please feel free to re-open it. Thank you! |
@jsquyres What is gasnet? Why is this issue being abandoned when the fix is really simple? If there is no plan to change this could you please at least announce the lack of openmpi support for C90 compiler options? Unfortunately I don't have control over IceT. My workaround was to use mpich instead of openmpi. But I would like to avoid that workaround as much as possible. Thanks. |
Pull update from https://bitbucket.org/berkeleylab/gasnet/src/stable/other/gasnet_portable_platform.h at git hash a90966674. This update brings in two things: 1. Remove the need for the #define workarounds in opal/include/opal/opal_portable_platform.h 2. Remove all //-style comments, making this file safe to use with C89-style applications (per open-mpi#12710). Many thanks to the gasnet team for including these changes in their upstream repo. Note that we still need the #ifndef SIZEOF_VOID_P protection in mpi.h. This commit also makes a minor update in mpi.h[.in] to prefix an OMPI-specific #define with "OMPI_". No one has ever complained about this un-prefixed macro, but prefixing it it felt like the Right Thing to do while mucking around with other portable_platform stuff. Signed-off-by: Jeff Squyres <[email protected]>
I notice that we accidentally closed this issue before resolving it. I worked with the gasnet team and got the changes put in upstream (https://bitbucket.org/berkeleylab/gasnet/pull-requests/543). I then made #12829 as an alternative to @devreal's PR. Let's figure out which of our 2 PR's we should merge here (and cherry pick over to the v5.0.x series). |
Pull update from https://bitbucket.org/berkeleylab/gasnet/src/stable/other/gasnet_portable_platform.h at git hash a90966674. This update brings in two things: 1. Remove the need for the #define workarounds in opal/include/opal/opal_portable_platform.h 2. Remove all //-style comments, making this file safe to use with C89-style applications (per open-mpi#12710). Many thanks to the gasnet team for including these changes in their upstream repo. Note that we still need the #ifndef SIZEOF_VOID_P protection in mpi.h. This commit also makes a minor update in mpi.h[.in] to prefix an OMPI-specific #define with "OMPI_". No one has ever complained about this un-prefixed macro, but prefixing it it felt like the Right Thing to do while mucking around with other portable_platform stuff. Signed-off-by: Jeff Squyres <[email protected]> (cherry picked from commit 50c05da)
v5.0.x PR is pending. Probably won't bring this back to v4.1.x -- I did a cherry-pick and it didn't immediately apply. I didn't look into the conflict details, but since this issue was about v5.0.x, unless there's a specific reason to bring it to v4.1.x, I think bringing the update to main and v5.0.x is probably good enough. |
Background information
What version of Open MPI are you using? (e.g., v4.1.6, v5.0.1, git branch name and hash, etc.)
v5.0.2
Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)
From a source/distribution tarball
Please describe the system on which you are running
Details of the problem
While trying to compile one of Visit software dependencies, IceT, the compilation was interrupted with an error while parsing OpenMPI mpi.h file included in one of their files. I tracked the problem down to non C90 compliant comments in the mpi.h. IceT uses the gcc -ansi flag and that triggers this bug. You can easily reproduce it by trying to compile the hello_c example you ship with the OpenMPI source code:
This could be tracked down further at two comments on the header file ./opal/include/opal/opal_portable_platform_real.h at lines 294 and 593. I am not sure if there are other places that eventually will end up in the public facing mpi.h file though. Would it be possible to replace those comments with the C90 ones? At least on the public facing header files such as mpi.h?
Thanks!
The text was updated successfully, but these errors were encountered: