Browse Source

Fix msg.h inclusion according to new location

Samuel Thibault 10 years ago
parent
commit
1683d35a0d

+ 8 - 1
configure.ac

@@ -1044,10 +1044,17 @@ if test x$enable_simgrid = xyes ; then
 			AC_MSG_ERROR(Simgrid support needs simgrid installed)
 		]
 	)
+	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])
 	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_COMPILE_IFELSE([AC_LANG_PROGRAM(
-		    		[[#include <msg/msg.h>]],
+		    		[[
+#ifdef STARPU_HAVE_SIMGRID_MSG_H
+#include <simgrid/msg.h>
+#else
+#include <msg/msg.h>
+#endif
+				 ]],
 				[[msg_host_t foo; ]]
 			    )],
 	                 [],

+ 1 - 0
include/starpu_config.h.in

@@ -40,6 +40,7 @@
 
 #undef STARPU_SIMGRID
 #undef STARPU_SIMGRID_HAVE_XBT_BARRIER_INIT
+#undef STARPU_HAVE_SIMGRID_MSG_H
 
 #undef STARPU_HAVE_ICC
 

+ 4 - 0
include/starpu_thread.h

@@ -27,7 +27,11 @@ extern "C"
 #include <starpu_util.h>
 #ifdef STARPU_SIMGRID
 #include <xbt/synchro_core.h>
+#ifdef STARPU_HAVE_SIMGRID_MSG_H
+#include <simgrid/msg.h>
+#else
 #include <msg/msg.h>
+#endif
 #elif !defined(_MSC_VER) || defined(BUILDING_STARPU)
 #include <pthread.h>
 #endif

+ 2 - 2
src/common/timing.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2012, 2014  Université de Bordeaux
+ * Copyright (C) 2009-2012, 2014-2015  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -23,7 +23,7 @@
 #include <math.h>
 
 #ifdef STARPU_SIMGRID
-#include <msg/msg.h>
+#include <core/simgrid.h>
 #endif
 
 #if defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)

+ 0 - 1
src/core/simgrid.c

@@ -25,7 +25,6 @@
 #include <core/simgrid.h>
 
 #ifdef STARPU_SIMGRID
-#include <msg/msg.h>
 #include <sys/resource.h>
 
 #pragma weak starpu_main

+ 6 - 2
src/core/simgrid.h

@@ -17,10 +17,14 @@
 #ifndef __SIMGRID_H__
 #define __SIMGRID_H__
 
-#include <datawizard/data_request.h>
-
 #ifdef STARPU_SIMGRID
+#ifdef STARPU_HAVE_SIMGRID_MSG_H
+#include <simgrid/msg.h>
+#else
 #include <msg/msg.h>
+#endif
+
+#include <datawizard/data_request.h>
 
 struct _starpu_pthread_args
 {

+ 0 - 1
src/core/topology.c

@@ -43,7 +43,6 @@
 #endif
 
 #ifdef STARPU_SIMGRID
-#include <msg/msg.h>
 #include <core/simgrid.h>
 #endif
 

+ 0 - 1
src/core/workers.c

@@ -40,7 +40,6 @@
 #include <drivers/opencl/driver_opencl.h>
 
 #ifdef STARPU_SIMGRID
-#include <msg/msg.h>
 #include <core/simgrid.h>
 #endif
 

+ 0 - 1
src/datawizard/coherency.c

@@ -29,7 +29,6 @@
 #include <core/workers.h>
 
 #ifdef STARPU_SIMGRID
-#include <msg/msg.h>
 #include <core/simgrid.h>
 #endif
 

+ 0 - 1
src/datawizard/copy_driver.c

@@ -32,7 +32,6 @@
 
 #ifdef STARPU_SIMGRID
 #include <core/simgrid.h>
-#include <msg/msg.h>
 #endif
 
 void _starpu_wake_all_blocked_workers_on_node(unsigned nodeid)

+ 1 - 1
src/datawizard/datawizard.c

@@ -22,7 +22,7 @@
 #include <core/workers.h>
 #include <core/progress_hook.h>
 #ifdef STARPU_SIMGRID
-#include <msg/msg.h>
+#include <core/simgrid.h>
 #endif
 
 int __starpu_datawizard_progress(unsigned memory_node, unsigned may_alloc, unsigned push_requests)

+ 2 - 2
src/datawizard/memory_nodes.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2012, 2014  Université de Bordeaux
+ * Copyright (C) 2009-2012, 2014-2015  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2013  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -25,7 +25,7 @@
 #include <common/utils.h>
 
 #ifdef STARPU_SIMGRID
-#include <msg/msg.h>
+#include <core/simgrid.h>
 #endif
 
 #define _STARPU_MEMORY_NODE_TUPLE(node1,node2) (node1 | (node2 << 4))