Skip to content

Commit 05c1108

Browse files
committed
MPI C++ Datatypes: don't declare/define if no C++ support
Per MPI-3.1 A.1.1 p674, only define the C++ datatypes if we're actually building C++ support. Signed-off-by: Jeff Squyres <[email protected]>
1 parent 7b73c86 commit 05c1108

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

ompi/include/mpi.h.in

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* University of Stuttgart. All rights reserved.
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
12-
* Copyright (c) 2007-2014 Cisco Systems, Inc. All rights reserved.
12+
* Copyright (c) 2007-2016 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
1414
* Copyright (c) 2009-2012 Oak Rigde National Laboratory. All rights reserved.
1515
* Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
@@ -941,13 +941,17 @@ OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_long_double;
941941
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_wchar;
942942
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_packed;
943943

944+
/* Per MPI-3.1 A.1.1 p674, only define the C++ datatypes if we're
945+
actually building C++ support */
946+
#if defined(OMPI_BUILD_CXX_BINDINGS) && OMPI_BUILD_CXX_BINDINGS
944947
/*
945948
* Following are the C++/C99 datatypes
946949
*/
947950
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_cxx_bool;
948951
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_cxx_cplex;
949952
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_cxx_dblcplex;
950953
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_cxx_ldblcplex;
954+
#endif
951955

952956
/*
953957
* Following are the Fortran datatypes
@@ -1162,10 +1166,15 @@ OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUSES_IGNORE;
11621166
#if HAVE_LONG_DOUBLE__COMPLEX
11631167
#define MPI_C_LONG_DOUBLE_COMPLEX OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_c_long_double_complex)
11641168
#endif
1169+
1170+
/* Per MPI-3.1 A.1.1 p674, only define the C++ datatypes if we're
1171+
actually building C++ support */
1172+
#if defined(OMPI_BUILD_CXX_BINDINGS) && OMPI_BUILD_CXX_BINDINGS
11651173
#define MPI_CXX_BOOL OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_cxx_bool)
11661174
#define MPI_CXX_FLOAT_COMPLEX OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_cxx_cplex)
11671175
#define MPI_CXX_DOUBLE_COMPLEX OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_cxx_dblcplex)
11681176
#define MPI_CXX_LONG_DOUBLE_COMPLEX OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_cxx_ldblcplex)
1177+
#endif
11691178

11701179
/* New datatypes from the 3.0 standard */
11711180
#define MPI_COUNT OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_count)

0 commit comments

Comments
 (0)