-
Notifications
You must be signed in to change notification settings - Fork 891
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
Mark mpif.h as deprecated #13123
base: main
Are you sure you want to change the base?
Mark mpif.h as deprecated #13123
Conversation
i guess you can enable this when |
I reworked this patch so that we capture the compiler output and check that it contains the warning we expect. I'm not sure that my m4 is correct so please check. Verified that the warning is enabled with flang-new and disabled with gfortran (which does not print the warning if the include file is in a separate directory). |
@janjust Looks like the NVIDIA CI is out of disk space |
we're checking |
5aec98f
to
f2720ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
I made a suggestion on the exact deprecation message.
Thanks @jsquyres! Once approved, I will squash everything down to one commit. |
4732e9a
to
2a81c9f
Compare
MPI 4.1 has deprecated mpif.h. We add a `#warning` directive that may be interpreted correctly if the Fortran compiler uses a C-style preprocessor or generate a warning about a illegal directive, showing the warning anyway: ``` 1 | #warning mpif.h is deprecated since MPI 4.1. Refer to MPI Sec. 19.1.4. | 1 Error: Illegal preprocessor directive [-Werror] ``` Also adds flang and flang-new to the list of known Fortran compilers. Signed-off-by: Joseph Schuchart <[email protected]>
2a81c9f
to
07f20ca
Compare
MPI 4.1 deprecated
mpif.h
so we may want to start warning about it. Unfortunately, Fortran does not provide a standardized pre-processor so we're at the mercy of the compiler to print the warning. This patch enables the warning by default but allows it to be disabled through--disable-deprecate-mpif-h
passed toconfigure
.flang-new prints the warning correctly:
gfortran doesn't:
Unless the include file that contains the warning in the same directory as the file being compiled so that it is not found through the include path:
The file I used for testing:
So in the end gfortran spoils the fun here. Maybe the compiler wrapper could copy a file that contains the warning and is included by
mpif.h
but that is more time than I have right now. Putting this out here in case someone has a smarter idea for how to do it.Fixes #12190.