diff --git a/NEWS b/NEWS index 4f38815b47..43d0866a57 100644 --- a/NEWS +++ b/NEWS @@ -29,6 +29,8 @@ version 1.0. Trunk (not on release branches yet) ----------------------------------- +- No longer require extra include flag for the C++ bindings. + --> Expected 1.2.3 - Fix problem with optional Fortran types to be correctly initialized. --> Expected ?1.2.x? - Release tarballs now use Autoconf 2.61 and Automake 1.10. diff --git a/config/ompi_setup_wrappers.m4 b/config/ompi_setup_wrappers.m4 index 99a69e8236..2e4f61c6d8 100644 --- a/config/ompi_setup_wrappers.m4 +++ b/config/ompi_setup_wrappers.m4 @@ -226,12 +226,7 @@ AC_DEFUN([OMPI_SETUP_WRAPPER_FINAL],[ AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_LIBS]) AC_MSG_CHECKING([for OMPI extra include dirs]) - if test "$WANT_INSTALL_HEADERS" = "1" ; then - # Always include openmpi in case C++ bindings get installed - OMPI_WRAPPER_EXTRA_INCLUDES="$ORTE_WRAPPER_EXTRA_INCLUDES" - else - OMPI_WRAPPER_EXTRA_INCLUDES="$ORTE_WRAPPER_EXTRA_INCLUDES openmpi" - fi + OMPI_WRAPPER_EXTRA_INCLUDES="$ORTE_WRAPPER_EXTRA_INCLUDES" AC_SUBST([OMPI_WRAPPER_EXTRA_INCLUDES]) AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_INCLUDES]) diff --git a/ompi/mpi/cxx/Makefile.am b/ompi/mpi/cxx/Makefile.am index f69466a0a0..e26e93cbe0 100644 --- a/ompi/mpi/cxx/Makefile.am +++ b/ompi/mpi/cxx/Makefile.am @@ -18,10 +18,12 @@ # $HEADER$ # -# *_DATA files are not automatically included in the tarball. Need to -# ensure that README.txt is picked up so that people who disable the -# C++ MPI bindings can still build properly. -EXTRA_DIST = README.txt +# Need the first so that we can get the path names correct inside the +# MPI C++ library. The second is necessary so that mpi.h doesn't +# include mpicxx.h through the incorrect pathname in any of the C++ +# bindings .c files. Just use the define for this purpose from user +# code. +AM_CPPFLAGS = -DOMPI_BUILDING_CXX_BINDINGS_LIBRARY=1 -DOMPI_SKIP_MPICXX=1 if WANT_MPI_CXX_BINDINGS @@ -72,10 +74,4 @@ headers = \ ompidir = $(includedir)/openmpi/ompi/mpi/cxx ompi_HEADERS = \ $(headers) -else -# If the C++ bindings were disabled, still ensure that this directory -# is created so that the default -I flags in the wrapper compilers -# point to a directory that exists. -ompidir = $(includedir)/openmpi -ompi_DATA = README.txt endif diff --git a/ompi/mpi/cxx/README.txt b/ompi/mpi/cxx/README.txt deleted file mode 100644 index 8f54f63867..0000000000 --- a/ompi/mpi/cxx/README.txt +++ /dev/null @@ -1,4 +0,0 @@ -This file is here solely as a placeholder so that Open MPI's -Automake-based installer creates the installation directory -$(installdir)/openmpi (you must have disabled the MPI C++ bindings, -because they would normally create this directory automatically). diff --git a/ompi/mpi/cxx/mpicxx.h b/ompi/mpi/cxx/mpicxx.h index ba928a0512..2228397ad0 100644 --- a/ompi/mpi/cxx/mpicxx.h +++ b/ompi/mpi/cxx/mpicxx.h @@ -166,6 +166,10 @@ namespace MPI { typedef void User_function(const void* invec, void* inoutvec, int len, const Datatype& datatype); + /* Prevent needing a -I${prefix}/include/openmpi, as it seems to + really annoy peope that don't use the wrapper compilers and is + no longer worth the fight of getting right... */ +#ifdef OMPI_BUILDING_CXX_BINDINGS_LIBRARY #include "ompi/mpi/cxx/exception.h" #include "ompi/mpi/cxx/op.h" #include "ompi/mpi/cxx/status.h" @@ -179,6 +183,21 @@ namespace MPI { #include "ompi/mpi/cxx/topology.h" //includes Cartcomm and Graphcomm #include "ompi/mpi/cxx/intercomm.h" #include "ompi/mpi/cxx/info.h" +#else +#include "openmpi/ompi/mpi/cxx/exception.h" +#include "openmpi/ompi/mpi/cxx/op.h" +#include "openmpi/ompi/mpi/cxx/status.h" +#include "openmpi/ompi/mpi/cxx/request.h" //includes class Prequest +#include "openmpi/ompi/mpi/cxx/group.h" +#include "openmpi/ompi/mpi/cxx/comm.h" +#include "openmpi/ompi/mpi/cxx/win.h" +#include "openmpi/ompi/mpi/cxx/file.h" +#include "openmpi/ompi/mpi/cxx/errhandler.h" +#include "openmpi/ompi/mpi/cxx/intracomm.h" +#include "openmpi/ompi/mpi/cxx/topology.h" //includes Cartcomm and Graphcomm +#include "openmpi/ompi/mpi/cxx/intercomm.h" +#include "openmpi/ompi/mpi/cxx/info.h" +#endif extern opal_mutex_t *mpi_map_mutex; } @@ -199,6 +218,8 @@ namespace MPI { // PMPI functions, and this top layer is in the XXX.cc files. // +/* see note above... */ +#ifdef OMPI_BUILDING_CXX_BINDINGS_LIBRARY #include "ompi/mpi/cxx/datatype_inln.h" #include "ompi/mpi/cxx/functions_inln.h" #include "ompi/mpi/cxx/request_inln.h" @@ -213,6 +234,22 @@ namespace MPI { #include "ompi/mpi/cxx/info_inln.h" #include "ompi/mpi/cxx/win_inln.h" #include "ompi/mpi/cxx/file_inln.h" +#else +#include "openmpi/ompi/mpi/cxx/datatype_inln.h" +#include "openmpi/ompi/mpi/cxx/functions_inln.h" +#include "openmpi/ompi/mpi/cxx/request_inln.h" +#include "openmpi/ompi/mpi/cxx/comm_inln.h" +#include "openmpi/ompi/mpi/cxx/intracomm_inln.h" +#include "openmpi/ompi/mpi/cxx/topology_inln.h" +#include "openmpi/ompi/mpi/cxx/intercomm_inln.h" +#include "openmpi/ompi/mpi/cxx/group_inln.h" +#include "openmpi/ompi/mpi/cxx/op_inln.h" +#include "openmpi/ompi/mpi/cxx/errhandler_inln.h" +#include "openmpi/ompi/mpi/cxx/status_inln.h" +#include "openmpi/ompi/mpi/cxx/info_inln.h" +#include "openmpi/ompi/mpi/cxx/win_inln.h" +#include "openmpi/ompi/mpi/cxx/file_inln.h" +#endif #endif // #if defined(__cplusplus) || defined(c_plusplus) #endif // #ifndef MPIPP_H_