Explorar el Código

starpu-top: rename binary to starpu_top and generate its man page

Nathalie Furmento hace 13 años
padre
commit
41b240d5a1
Se han modificado 5 ficheros con 93 adiciones y 13 borrados
  1. 9 1
      Makefile.am
  2. 1 1
      configure.ac
  3. 1 1
      starpu-top/StarPU-Top-common.pri
  4. 29 0
      starpu-top/config.h.in
  5. 53 10
      starpu-top/main.cpp

+ 9 - 1
Makefile.am

@@ -72,14 +72,22 @@ all-local:
 	cd starpu-top ; $(QMAKE) ; $(MAKE)
 clean-local:
 	cd starpu-top ; $(QMAKE) ; $(MAKE) clean ; $(RM) Makefile
+	$(RM) starpu_top.1
 # TODO: resources
 install-exec-local:
 	$(MKDIR_P) $(DESTDIR)$(bindir)
-	$(INSTALL_STRIP_PROGRAM) starpu-top/StarPU-Top $(DESTDIR)$(bindir)
+	$(INSTALL_STRIP_PROGRAM) starpu-top/starpu_top $(DESTDIR)$(bindir)
 uninstall-local:
 	$(RM) $(DESTDIR)$(bindir)/StarPU-Top
 	$(RM) starpu-top/StarPU-Top
 	$(RM) starpu-top/Makefile
+
+if STARPU_HAVE_HELP2MAN
+starpu_top.1: starpu-top/starpu_top$(EXEEXT)
+	help2man --no-discard-stderr -N --output=$@ starpu-top/starpu_top$(EXEEXT)
+dist_man1_MANS =\
+	starpu_top.1
+endif
 endif
 
 if STARPU_HAVE_WINDOWS

+ 1 - 1
configure.ac

@@ -1575,7 +1575,7 @@ AC_CONFIG_COMMANDS([executable-scripts], [
 ])
 
 AC_CONFIG_FILES(tests/regression/regression.sh tests/regression/profiles tests/regression/profiles.build.only)
-AC_CONFIG_HEADER(src/common/config.h include/starpu_config.h gcc-plugin/src/starpu-gcc-config.h)
+AC_CONFIG_HEADER(src/common/config.h include/starpu_config.h gcc-plugin/src/starpu-gcc-config.h starpu-top/config.h)
 
 AC_OUTPUT([
 	Makefile

+ 1 - 1
starpu-top/StarPU-Top-common.pri

@@ -5,7 +5,7 @@ QT += network
 QT += opengl
 QT += sql
 
-TARGET = StarPU-Top
+TARGET = starpu_top
 TEMPLATE = app
 SOURCES += $$SRCDIR/main.cpp \
 #STARPU-TOP

+ 29 - 0
starpu-top/config.h.in

@@ -0,0 +1,29 @@
+/* StarPU --- Runtime system for heterogeneous multicore architectures.
+ *
+ * Copyright (C) 2012  Centre National de la Recherche Scientifique
+ *
+ * StarPU is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or (at
+ * your option) any later version.
+ *
+ * StarPU is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * See the GNU Lesser General Public License in COPYING.LGPL for more details.
+ */
+
+#ifndef __STARPU_TOP_CONFIG_H__
+#define __STARPU_TOP_CONFIG_H__
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Major version number of StarPU. */
+#undef STARPU_MAJOR_VERSION
+
+/* Minor version number of StarPU. */
+#undef STARPU_MINOR_VERSION
+
+#endif /* __STARPU_TOP_CONFIG_H__ */

+ 53 - 10
starpu-top/main.cpp

@@ -1,7 +1,7 @@
 /*
 = StarPU-Top for StarPU =
 
-Copyright (C) 2011 
+Copyright (C) 2011
 William Braik
 Yann Courtois
 Jean-Marie Couteyen
@@ -25,19 +25,62 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
 #include <QtGui/QApplication>
 #include "mainwindow.h"
+#include <string.h>
+#include <config.h>
+
+#define PROGNAME "starpu_top"
+
+static void parse_args(int argc, char **argv)
+{
+	if (argc == 1)
+		return;
+
+	if (argc > 2 || /* Argc should be either 1 or 2 */
+	    strncmp(argv[1], "--help", 6) == 0 ||
+	    strncmp(argv[1], "-h", 2) == 0)
+	{
+		(void) fprintf(stderr, "\
+starpu-top is an interface which remotely displays the        \n\
+on-line state of a StarPU application and permits the user    \n\
+to change parameters on the fly.                              \n\
+                                                              \n\
+Usage: %s [OPTION]                                            \n\
+                                                              \n\
+Options:                                                      \n\
+	-h, --help       display this help and exit           \n\
+	-v, --version    output version information and exit  \n\
+                                                              \n\
+Report bugs to <" PACKAGE_BUGREPORT ">.",
+PROGNAME);
+	}
+	else if (strncmp(argv[1], "--version", 9) == 0 ||
+		 strncmp(argv[1], "-v", 2) == 0)
+	{
+		(void) fprintf(stderr, "%s %d.%d\n",
+			PROGNAME, STARPU_MAJOR_VERSION, STARPU_MINOR_VERSION);
+	}
+	else
+	{
+		fprintf(stderr, "Unknown arg %s\n", argv[1]);
+	}
+
+	exit(EXIT_FAILURE);
+}
 
 int main(int argc, char *argv[])
 {
-    QApplication a(argc, argv);
+	parse_args(argc, argv);
+
+	QApplication a(argc, argv);
 
-    // Application description
-    QCoreApplication::setOrganizationName("INRIA-Bordeaux");
-    QCoreApplication::setOrganizationDomain("runtime.bordeaux.inria.fr");
-    QCoreApplication::setApplicationName("StarPU-Top");
-    QCoreApplication::setApplicationVersion("0.1");
+	// Application description
+	QCoreApplication::setOrganizationName("INRIA Bordeaux Sud-Ouest");
+	QCoreApplication::setOrganizationDomain("runtime.bordeaux.inria.fr");
+	QCoreApplication::setApplicationName("StarPU-Top");
+	QCoreApplication::setApplicationVersion("0.1");
 
-    MainWindow w;
-    w.show();
+	MainWindow w;
+	w.show();
 
-    return a.exec();
+	return a.exec();
 }