Selaa lähdekoodia

disable use of wsock32 to get gethostname for now

Samuel Thibault 15 vuotta sitten
vanhempi
commit
6558cfb735

+ 1 - 1
configure.ac

@@ -76,7 +76,7 @@ AC_COMPILE_IFELSE(
   ]], [[ pthread_t t; pthread_create(&t, NULL, NULL, NULL); ]]),,
   AC_MSG_ERROR([pthread_create unavailable]))
 AC_SEARCH_LIBS([sqrt],[m],,AC_MSG_ERROR([math library unavailable]))
-AC_HAVE_LIBRARY([wsock32])
+#AC_HAVE_LIBRARY([wsock32])
 AC_CHECK_FUNCS([sysconf])
 
 AC_CHECK_FUNC([pthread_spin_lock], have_pthread_spin_lock=yes, have_pthread_spin_lock=no)

+ 1 - 1
src/Makefile.am

@@ -23,7 +23,7 @@ EXTRA_DIST = dolib.c
 ldflags =
 
 if STARPU_HAVE_WINDOWS
-ldflags += -Xlinker --output-def .Xlinker .libs/libstarpu.def
+ldflags += -Xlinker --output-def -Xlinker .libs/libstarpu.def
 
 if STARPU_HAVE_MS_LIB
 .libs/libstarpu.lib: libstarpu.la dolib

+ 4 - 0
src/core/perfmodel/perfmodel_bus.c

@@ -447,7 +447,11 @@ static void get_bus_path(const char *type, char *path, size_t maxlen)
 	strncat(path, type, maxlen);
 
 	char hostname[32];
+#ifndef __MINGW32__
 	gethostname(hostname, 32);
+#else
+	snprintf(hostname, sizeof(hostname), "localhost");
+#endif
 	strncat(path, ".", maxlen);
 	strncat(path, hostname, maxlen);
 }

+ 8 - 0
src/core/perfmodel/perfmodel_history.c

@@ -200,7 +200,11 @@ static void get_model_debug_path(struct starpu_perfmodel_t *model, const char *a
 	strncat(path, model->symbol, maxlen);
 	
 	char hostname[32];
+#ifndef __MINGW32__
 	gethostname(hostname, 32);
+#else
+	snprintf(hostname, sizeof(hostname), "localhost");
+#endif
 	strncat(path, ".", maxlen);
 	strncat(path, hostname, maxlen);
 	strncat(path, ".", maxlen);
@@ -242,7 +246,11 @@ static void get_model_path(struct starpu_perfmodel_t *model, char *path, size_t
 	strncat(path, model->symbol, maxlen);
 	
 	char hostname[32];
+#ifndef __MINGW32__
 	gethostname(hostname, 32);
+#else
+	snprintf(hostname, sizeof(hostname), "localhost");
+#endif
 	strncat(path, ".", maxlen);
 	strncat(path, hostname, maxlen);
 }

+ 1 - 1
src/core/workers.c

@@ -254,7 +254,7 @@ int starpu_init(struct starpu_conf *user_conf)
 	initialized = CHANGING;
 	PTHREAD_MUTEX_UNLOCK(&init_mutex);
 
-#ifdef __MINGW32__
+#ifdef __MINGW32__DISABLED
 	WSADATA wsadata;
 	WSAStartup(MAKEWORD(1,0), &wsadata);
 #endif