Browse Source

do not build aio on windows

Samuel Thibault 12 years ago
parent
commit
fab007f4cf

+ 2 - 0
configure.ac

@@ -258,6 +258,8 @@ AC_CHECK_HEADERS([malloc.h], [AC_DEFINE([STARPU_HAVE_MALLOC_H], [1], [Define to
 AC_CHECK_HEADERS([valgrind/valgrind.h], [AC_DEFINE([STARPU_HAVE_VALGRIND_H], [1], [Define to 1 if you have the <valgrind/valgrind.h> header file.])])
 AC_CHECK_HEADERS([valgrind/helgrind.h], [AC_DEFINE([STARPU_HAVE_HELGRIND_H], [1], [Define to 1 if you have the <valgrind/helgrind.h> header file.])])
 
+AC_CHECK_HEADERS([aio.h])
+
 # This defines HAVE_SYNC_VAL_COMPARE_AND_SWAP
 STARPU_CHECK_SYNC_VAL_COMPARE_AND_SWAP
 

+ 12 - 0
src/core/disk_ops/disk_stdio.c

@@ -209,6 +209,7 @@ starpu_stdio_read (void *base STARPU_ATTRIBUTE_UNUSED, void *obj, void *buf, off
 	return 0;
 }
 
+#ifdef HAVE_AIO_H
 static int
 starpu_stdio_async_read (void *base STARPU_ATTRIBUTE_UNUSED, void *obj, void *buf, off_t offset, size_t size, void * async_channel)
 {
@@ -228,6 +229,7 @@ starpu_stdio_async_read (void *base STARPU_ATTRIBUTE_UNUSED, void *obj, void *bu
 
 	return aio_read(aiocb);
 }
+#endif
 
 static int
 starpu_stdio_full_read(unsigned node, void *base STARPU_ATTRIBUTE_UNUSED, void * obj, void ** ptr, size_t * size)
@@ -257,6 +259,7 @@ starpu_stdio_write (void *base STARPU_ATTRIBUTE_UNUSED, void *obj, const void *b
 	return nb;
 }
 
+#ifdef HAVE_AIO_H
 static int
 starpu_stdio_async_write (void *base STARPU_ATTRIBUTE_UNUSED, void *obj, void *buf, off_t offset, size_t size, void * async_channel)
 {
@@ -275,6 +278,7 @@ starpu_stdio_async_write (void *base STARPU_ATTRIBUTE_UNUSED, void *obj, void *b
 
         return aio_write(aiocb);
 }
+#endif
 
 static int
 starpu_stdio_full_write (unsigned node, void * base STARPU_ATTRIBUTE_UNUSED, void * obj, void * ptr, size_t size)
@@ -397,6 +401,7 @@ get_stdio_bandwidth_between_disk_and_main_ram(unsigned node)
 	return 1;
 }
 
+#ifdef HAVE_AIO_H
 static void 
 starpu_stdio_wait_request(void * async_channel)
 {
@@ -440,6 +445,7 @@ starpu_stdio_test_request(void * async_channel)
 	/* an error occured */
 	STARPU_ABORT();	
 }
+#endif
 
 struct starpu_disk_ops starpu_disk_stdio_ops = {
 	.alloc = starpu_stdio_alloc,
@@ -447,15 +453,21 @@ struct starpu_disk_ops starpu_disk_stdio_ops = {
 	.open = starpu_stdio_open,
 	.close = starpu_stdio_close,
 	.read = starpu_stdio_read,
+#ifdef HAVE_AIO_H
 	.async_read = starpu_stdio_async_read,
+#endif
 	.write = starpu_stdio_write,
+#ifdef HAVE_AIO_H
 	.async_write = starpu_stdio_async_write,
+#endif
 	.plug = starpu_stdio_plug,
 	.unplug = starpu_stdio_unplug,
 	.copy = NULL,
 	.bandwidth = get_stdio_bandwidth_between_disk_and_main_ram,
+#ifdef HAVE_AIO_H
 	.wait_request = starpu_stdio_wait_request,
 	.test_request = starpu_stdio_test_request,
+#endif
 	.full_read = starpu_stdio_full_read,
 	.full_write = starpu_stdio_full_write
 };

+ 2 - 0
src/core/disk_ops/disk_unistd.c

@@ -62,10 +62,12 @@ struct starpu_disk_ops starpu_disk_unistd_ops = {
 	.unplug = starpu_unistd_global_unplug,
 	.copy = NULL,
 	.bandwidth = get_unistd_global_bandwidth_between_disk_and_main_ram,
+#ifdef HAVE_AIO_H
 	.async_read = starpu_unistd_global_async_read,
 	.async_write = starpu_unistd_global_async_write,
 	.wait_request = starpu_unistd_global_wait_request,
 	.test_request = starpu_unistd_global_test_request,
+#endif
         .full_read = starpu_unistd_global_full_read,
         .full_write = starpu_unistd_global_full_write
 };

+ 2 - 0
src/core/disk_ops/disk_unistd_o_direct.c

@@ -96,10 +96,12 @@ struct starpu_disk_ops starpu_disk_unistd_o_direct_ops = {
 	.unplug = starpu_unistd_global_unplug,
 	.copy = NULL,
 	.bandwidth = get_unistd_global_bandwidth_between_disk_and_main_ram,
+#ifdef HAVE_AIO_H
         .async_read = starpu_unistd_global_async_read,
         .async_write = starpu_unistd_global_async_write,
         .wait_request = starpu_unistd_global_wait_request,
         .test_request = starpu_unistd_global_test_request,
+#endif
 	.full_read = starpu_unistd_global_full_read,
 	.full_write = starpu_unistd_global_full_write
 };

+ 8 - 0
src/core/disk_ops/unistd/disk_unistd_global.c

@@ -20,7 +20,9 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <stdint.h>
+#ifdef HAVE_AIO_H
 #include <aio.h>
+#endif
 #include <errno.h>
 
 #include <starpu.h>
@@ -182,6 +184,7 @@ starpu_unistd_global_read (void *base STARPU_ATTRIBUTE_UNUSED, void *obj, void *
 }
 
 
+#ifdef HAVE_AIO_H
 int
 starpu_unistd_global_async_read (void *base STARPU_ATTRIBUTE_UNUSED, void *obj, void *buf, off_t offset, size_t size, void * async_channel)
 {
@@ -201,6 +204,7 @@ starpu_unistd_global_async_read (void *base STARPU_ATTRIBUTE_UNUSED, void *obj,
 
         return aio_read(aiocb);
 }
+#endif
 
 int
 starpu_unistd_global_full_read(unsigned node, void *base STARPU_ATTRIBUTE_UNUSED, void * obj, void ** ptr, size_t * size)
@@ -233,6 +237,7 @@ starpu_unistd_global_write (void *base STARPU_ATTRIBUTE_UNUSED, void *obj, const
 }
 
 
+#ifdef HAVE_AIO_H
 int
 starpu_unistd_global_async_write (void *base STARPU_ATTRIBUTE_UNUSED, void *obj, void *buf, off_t offset, size_t size, void * async_channel)
 {
@@ -251,6 +256,7 @@ starpu_unistd_global_async_write (void *base STARPU_ATTRIBUTE_UNUSED, void *obj,
 
         return aio_write(aiocb);
 }
+#endif
 
 int
 starpu_unistd_global_full_write (unsigned node, void * base STARPU_ATTRIBUTE_UNUSED, void * obj, void * ptr, size_t size)
@@ -374,6 +380,7 @@ get_unistd_global_bandwidth_between_disk_and_main_ram(unsigned node)
 	return 1;
 }
 
+#ifdef HAVE_AIO_H
 void
 starpu_unistd_global_wait_request(void * async_channel)
 {
@@ -417,3 +424,4 @@ starpu_unistd_global_test_request(void * async_channel)
         /* an error occured */
         STARPU_ABORT();
 }
+#endif

+ 5 - 1
src/datawizard/copy_driver.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010, 2012  Université de Bordeaux 1
+ * Copyright (C) 2010, 2012-2013  Université de Bordeaux 1
  * Copyright (C) 2010, 2011, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -18,7 +18,9 @@
 #ifndef __COPY_DRIVER_H__
 #define __COPY_DRIVER_H__
 
+#ifdef HAVE_AIO_H
 #include <aio.h>
+#endif
 
 #include <common/config.h>
 #include <datawizard/memory_nodes.h>
@@ -52,7 +54,9 @@ struct _starpu_mic_async_event
 
 struct _starpu_disk_async_event
 {
+#ifdef HAVE_AIO_H
         struct aiocb _starpu_aiocb_disk;
+#endif
 	unsigned memory_node;
 };