diff --git a/src/STUBS/Makefile b/src/STUBS/Makefile index 38d013cbb8..491e2e75c6 100644 --- a/src/STUBS/Makefile +++ b/src/STUBS/Makefile @@ -15,8 +15,8 @@ OBJ = $(SRC:.c=.o) # System-specific settings -CC = g++ -CCFLAGS = -O +CC = cc +CCFLAGS = -O # -fPIC ARCHIVE = ar ARCHFLAG = rs @@ -32,7 +32,7 @@ clean: # Compilation rules -.cpp.o: +.c.o: $(CC) $(CCFLAGS) -c $< # Individual dependencies diff --git a/src/STUBS/mpi.cpp b/src/STUBS/mpi.c similarity index 98% rename from src/STUBS/mpi.cpp rename to src/STUBS/mpi.c index 82288fff35..ea383ef722 100644 --- a/src/STUBS/mpi.cpp +++ b/src/STUBS/mpi.c @@ -20,20 +20,13 @@ #include #include "mpi.h" -/* lo-level function prototypes */ - -void mpi_copy_int(void *, void *, int); -void mpi_copy_float(void *, void *, int); -void mpi_copy_double(void *, void *, int); -void mpi_copy_char(void *, void *, int); -void mpi_copy_byte(void *, void *, int); - /* lo-level data structure */ -struct { +struct _mpi_double_int { double value; int proc; -} double_int; +}; +typedef struct _mpi_double_int double_int; /* ---------------------------------------------------------------------- */ /* MPI Functions */ diff --git a/src/STUBS/mpi.h b/src/STUBS/mpi.h index bebf65316a..7f2c5d931c 100644 --- a/src/STUBS/mpi.h +++ b/src/STUBS/mpi.h @@ -14,6 +14,12 @@ #ifndef MPI_STUBS #define MPI_STUBS +/* use C bindings for MPI interface */ + +#ifdef __cplusplus +extern "C" { +#endif + /* Dummy defs for MPI stubs */ #define MPI_COMM_WORLD 0 @@ -46,9 +52,10 @@ /* MPI data structs */ -struct MPI_Status { +struct _MPI_Status { int MPI_SOURCE; }; +typedef struct _MPI_Status MPI_Status; /* Function prototypes for MPI stubs */ @@ -121,4 +128,8 @@ int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); +#ifdef __cplusplus +} +#endif + #endif