Browse Source

Fix build with simgrid without declaration of smpi_process_set_user_data

Samuel Thibault 9 years ago
parent
commit
5ca875c059
2 changed files with 7 additions and 0 deletions
  1. 1 0
      configure.ac
  2. 6 0
      mpi/src/starpu_mpi.c

+ 1 - 0
configure.ac

@@ -1061,6 +1061,7 @@ if test x$enable_simgrid = xyes ; then
 	AC_CHECK_HEADERS([simgrid/msg.h], [AC_DEFINE([STARPU_HAVE_SIMGRID_MSG_H], [1], [Define to 1 if you have msg.h in simgrid/.])])
    	AC_CHECK_FUNCS([MSG_process_join MSG_get_as_by_name MSG_environment_get_routing_root xbt_mutex_try_acquire smpi_process_set_user_data])
 	AC_CHECK_FUNCS([xbt_barrier_init], [AC_DEFINE([STARPU_SIMGRID_HAVE_XBT_BARRIER_INIT], [1], [Define to 1 if you have the `xbt_barrier_init' function.])])
+	AC_CHECK_DECLS([smpi_process_set_user_data], [], [], [[#include <smpi/smpi.h>]])
 	AC_CHECK_FUNCS([SIMIX_process_get_code], [AC_DEFINE([STARPU_SIMGRID_HAVE_SIMIX_PROCESS_GET_CODE], [1], [Define to 1 if you have the `SIMIX_process_get_code' function.])])
 	AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
 		    		[[

+ 6 - 0
mpi/src/starpu_mpi.c

@@ -83,6 +83,12 @@ static int posted_requests = 0, newer_requests, barrier_running = 0;
 #pragma weak smpi_simulated_main_
 extern int smpi_simulated_main_(int argc, char *argv[]);
 
+#ifdef HAVE_SMPI_PROCESS_SET_USER_DATA
+#if !HAVE_DECL_SMPI_PROCESS_SET_USER_DATA
+extern void smpi_process_set_user_data(void *);
+#endif
+#endif
+
 static void _starpu_mpi_request_init(struct _starpu_mpi_req **req)
 {
 	*req = calloc(1, sizeof(struct _starpu_mpi_req));