From b934c90cf1e2c6b26aaf7e01dbfba49c7e4bd577 Mon Sep 17 00:00:00 2001 From: Bert Wesarg Date: Thu, 7 Mar 2019 09:53:21 +0100 Subject: [PATCH] Allow user to overwrite `OMPI_ENABLE_MPI1_COMPAT` Follow-up to #6120. As mentioned in [1], it may be desirable to nevertheless get the hidden MPI 1 prototypes, for users who know what they are doing, i.e., the tools guys. @ggouaillardet mentioned in [2], that `-DOMPI_OMIT_MPI1_COMPAT_DECLS=0` should work, but it does not, as than we only get redefinition warnings. See [3]. [1] https://github.com/open-mpi/ompi/pull/6120#issuecomment-443104700 [2] https://github.com/open-mpi/ompi/pull/6120#issuecomment-443117892 [3] https://github.com/open-mpi/ompi/pull/6120#issuecomment-468962596 BWB Note: This patch was originally applied directly to v4.0.x in 73134ab9, but now needs to be added to master, as we are keeping the 4.x mpi1-compat behavior. Signed-off-by: Bert Wesarg Signed-off-by: Brian Barrett --- ompi/include/mpi.h.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ompi/include/mpi.h.in b/ompi/include/mpi.h.in index cdb11d6faa9..6fc6a1efc10 100644 --- a/ompi/include/mpi.h.in +++ b/ompi/include/mpi.h.in @@ -330,7 +330,9 @@ * Don't do MACRO magic for building Profiling library as it * interferes with the above. */ -# if (OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING) +# if defined(OMPI_OMIT_MPI1_COMPAT_DECLS) + /* The user set OMPI_OMIT_MPI1_COMPAT_DECLS, do what he commands */ +# elif (OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING) # define OMPI_OMIT_MPI1_COMPAT_DECLS 0 # define OMPI_REMOVED_USE_STATIC_ASSERT 0 # define __mpi_interface_removed__(func, newfunc) __mpi_interface_deprecated__(#func " was removed in MPI-3.0. Use " #newfunc " instead. continuing...")