diff --git a/config/ompi_setup_cc.m4 b/config/ompi_setup_cc.m4 index cace63c866..e771126b78 100644 --- a/config/ompi_setup_cc.m4 +++ b/config/ompi_setup_cc.m4 @@ -36,6 +36,8 @@ AC_PROG_CC BASECC="`basename $CC`" CFLAGS="$ompi_cflags_save" AC_DEFINE_UNQUOTED(OMPI_CC, "$CC", [OMPI underlying C compiler]) +OMPI_CC_ABSOLUTE="`which $CC`" +AC_SUBST(OMPI_CC_ABSOLUTE) # Check for compilers that impersonate gcc diff --git a/config/ompi_setup_cxx.m4 b/config/ompi_setup_cxx.m4 index d47e8962b0..29a82344ad 100644 --- a/config/ompi_setup_cxx.m4 +++ b/config/ompi_setup_cxx.m4 @@ -28,6 +28,8 @@ AC_PROG_CXXCPP BASECXX="`basename $CXX`" CXXFLAGS="$ompi_cxxflags_save" AC_DEFINE_UNQUOTED(OMPI_CXX, "$CXX", [OMPI underlying C++ compiler]) +OMPI_CXX_ABSOLUTE="`which $CXX`" +AC_SUBST(OMPI_CXX_ABSOLUTE) # Check for compilers that impersonate g++ diff --git a/config/ompi_setup_f77.m4 b/config/ompi_setup_f77.m4 index f7e172f38c..0b9732233d 100644 --- a/config/ompi_setup_f77.m4 +++ b/config/ompi_setup_f77.m4 @@ -53,16 +53,17 @@ if test -z "$F77"; then OMPI_WANT_F77_BINDINGS=0 OMPI_F77="none" BASEF77="none" + OMPI_F77_ABSOLUTE="none" else + OMPI_F77="$F77" + BASEF77="`basename $OMPI_F77`" + OMPI_F77_ABSOLUTE="`which $F77`" + if test "$OMPI_WANT_F77_BINDINGS" = "0" ; then AC_MSG_WARN([*** Fortran 77 bindings disabled by user]) OMPI_WANT_F77_BINDINGS=0 - OMPI_F77="$F77" - BASEF77="`basename $OMPI_F77`" else OMPI_WANT_F77_BINDINGS=1 - OMPI_F77="$F77" - BASEF77="`basename $OMPI_F77`" fi fi @@ -70,4 +71,5 @@ AC_DEFINE_UNQUOTED(OMPI_WANT_F77_BINDINGS, $OMPI_WANT_F77_BINDINGS, [Whether we want the MPI f77 bindings or not]) AC_DEFINE_UNQUOTED(OMPI_F77, "$OMPI_F77", [OMPI underlying F77 compiler]) AM_CONDITIONAL(OMPI_WANT_F77_BINDINGS, test "$OMPI_WANT_F77_BINDINGS" = "1") +AC_SUBST(OMPI_F77_ABSOLUTE) ]) diff --git a/config/ompi_setup_f90.m4 b/config/ompi_setup_f90.m4 index 3e0acc61f5..c544e8f271 100644 --- a/config/ompi_setup_f90.m4 +++ b/config/ompi_setup_f90.m4 @@ -43,6 +43,7 @@ if test "$OMPI_WANT_F77_BINDINGS" = "0" ; then OMPI_WANT_F90_BINDINGS=0 OMPI_F90="none" BASEF90="none" + OMPI_F90_ABSOLUTE="none" if test "$enable_f90" = "yes"; then AC_MSG_WARN([*** but --enable-f90 was explicitly specified]) AC_MSG_ERROR([Cannot continue]) @@ -52,6 +53,7 @@ elif test "$OMPI_WANT_F90_BINDINGS" = "0" ; then OMPI_WANT_F90_BINDINGS=0 OMPI_F90="none" BASEF90="none" + OMPI_F90_ABSOLUTE="none" else # @@ -79,9 +81,11 @@ else OMPI_WANT_F90_BINDINGS=0 OMPI_F90="none" BASEF90="none" + OMPI_F90_ABSOLUTE="none" else OMPI_F90="$FC" BASEF90="`basename $FC`" + OMPI_F90_ABSOLUTE="`which $FC`" AC_LANG_PUSH(Fortran) AC_FC_SRCEXT(f) @@ -107,6 +111,7 @@ AC_DEFINE_UNQUOTED(OMPI_WANT_F90_BINDINGS, $OMPI_WANT_F90_BINDINGS, [Whether we want the MPI f90 bindings or not]) AC_DEFINE_UNQUOTED(OMPI_F90, "$OMPI_F90", [OMPI underlying F90 compiler]) AM_CONDITIONAL(OMPI_WANT_F90_BINDINGS, test "$OMPI_WANT_F90_BINDINGS" = "1") +AC_SUBST(OMPI_F90_ABSOLUTE) unset fortran_goodness ]) diff --git a/src/tools/ompi_info/Makefile.am b/src/tools/ompi_info/Makefile.am index 51bbaaf968..74b1fefe8e 100644 --- a/src/tools/ompi_info/Makefile.am +++ b/src/tools/ompi_info/Makefile.am @@ -37,9 +37,15 @@ AM_CPPFLAGS = \ -DOMPI_BUILD_FCFLAGS="\"@FCFLAGS@\"" \ -DOMPI_BUILD_LDFLAGS="\"@LDFLAGS@\"" \ -DOMPI_BUILD_LIBS="\"@LIBS@\"" \ + -DOMPI_CC_ABSOLUTE="\"@OMPI_CC_ABSOLUTE@\"" \ + -DOMPI_CXX_ABSOLUTE="\"@OMPI_CXX_ABSOLUTE@\"" \ + -DOMPI_F77_ABSOLUTE="\"@OMPI_F77_ABSOLUTE@\"" \ + -DOMPI_F90_ABSOLUTE="\"@OMPI_F90_ABSOLUTE@\"" \ -DOMPI_WANT_SVN=\"@OMPI_WANT_SVN@\" \ -DOMPI_SVN_R=\"@OMPI_SVN_R@\" +pkgdata_DATA = help-ompi_info.txt + libs = $(top_builddir)/src/libmpi.la bin_PROGRAMS = ompi_info diff --git a/src/tools/ompi_info/help-ompi_info.txt b/src/tools/ompi_info/help-ompi_info.txt new file mode 100644 index 0000000000..ed4fb3f551 --- /dev/null +++ b/src/tools/ompi_info/help-ompi_info.txt @@ -0,0 +1,33 @@ +# -*- text -*- +# +# Copyright (c) 2004-2005 The Trustees of Indiana University. +# All rights reserved. +# Copyright (c) 2004-2005 The Trustees of the University of Tennessee. +# All rights reserved. +# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, +# University of Stuttgart. All rights reserved. +# Copyright (c) 2004-2005 The Regents of the University of California. +# All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# +# This is the US/English help file for Open MPI ompi_info error +# messages. +# +[usage] +The ompi_info command can be used to provide detailed information on +your Open MPI installation. Syntax: + +%s +[lib-call-fail] +A library call unexpectedly failed. This is a terminal error; please +show this message to an Open MPI wizard: + + Library call: %s + Source file: %s + Source line number: %d + +Aborting... diff --git a/src/tools/ompi_info/ompi_info.cc b/src/tools/ompi_info/ompi_info.cc index 9ccd7f81cc..4822bc5a9c 100644 --- a/src/tools/ompi_info/ompi_info.cc +++ b/src/tools/ompi_info/ompi_info.cc @@ -39,6 +39,7 @@ #include "util/output.h" #include "util/cmd_line.h" #include "util/argv.h" +#include "util/show_help.h" #include "communicator/communicator.h" #include "mca/base/base.h" #include "tools/ompi_info/ompi_info.h" @@ -64,6 +65,8 @@ ompi_info::type_vector_t ompi_info::mca_types; int main(int argc, char *argv[]) { int ret = 0; + bool want_help = false; + bool cmd_error = false; bool acted = false; bool want_all = false; char **env = NULL; @@ -74,9 +77,8 @@ int main(int argc, char *argv[]) cmd_line = OBJ_NEW(ompi_cmd_line_t); if (NULL == cmd_line) { ret = errno; -#if 0 - show_help(NULL, "lib-call-fail", "ompi_cmd_line_create", NULL); -#endif + ompi_show_help("help-ompi_info.txt", "lib-call-fail", true, + "ompi_cmd_line_create", __FILE__, __LINE__, NULL); exit(ret); } @@ -85,7 +87,7 @@ int main(int argc, char *argv[]) ompi_cmd_line_make_opt(cmd_line, '\0', "param", 2, "Show MCA parameters"); ompi_cmd_line_make_opt(cmd_line, '\0', "internal", 0, - "Show internal MCA parameters (not meant to be modified by users"); + "Show internal MCA parameters (not meant to be modified by users)"); ompi_cmd_line_make_opt(cmd_line, '\0', "path", 1, "Show paths that Open MPI was configured with"); ompi_cmd_line_make_opt(cmd_line, '\0', "arch", 0, @@ -98,6 +100,8 @@ int main(int argc, char *argv[]) "Display output in 'prettyprint' format (default)"); ompi_cmd_line_make_opt(cmd_line, '\0', "parsable", 0, "Display output in parsable format"); + ompi_cmd_line_make_opt(cmd_line, '\0', "parseable", 0, + "Synonym for --parsable"); ompi_cmd_line_make_opt(cmd_line, '\0', "hostname", 0, "Show the hostname that Open MPI was configured " "and built on"); @@ -125,15 +129,18 @@ int main(int argc, char *argv[]) // Do the parsing - if (OMPI_SUCCESS != ompi_cmd_line_parse(cmd_line, false, argc, argv) || - ompi_cmd_line_is_taken(cmd_line, "help") || + if (OMPI_SUCCESS != ompi_cmd_line_parse(cmd_line, false, argc, argv)) { + cmd_error = true; + } + if (!cmd_error && ompi_cmd_line_is_taken(cmd_line, "help") || ompi_cmd_line_is_taken(cmd_line, "h")) { -#if 1 - printf("...showing ompi_info help message...\n"); -#else - show_help("ompi_info", "usage", NULL); -#endif - exit(1); + want_help = true; + } + if (cmd_error || want_help) { + char *usage = ompi_cmd_line_get_usage_msg(cmd_line); + ompi_show_help("help-ompi_info.txt", "usage", true, usage); + free(usage); + exit(cmd_error ? 1 : 0); } mca_base_cmd_line_process_args(cmd_line, &env); diff --git a/src/tools/ompi_info/param.cc b/src/tools/ompi_info/param.cc index 58c2f90761..e1082c8928 100644 --- a/src/tools/ompi_info/param.cc +++ b/src/tools/ompi_info/param.cc @@ -32,6 +32,7 @@ #include "class/ompi_value_array.h" #include "util/printf.h" +#include "util/show_help.h" #include "mca/base/mca_base_param.h" #include "tools/ompi_info/ompi_info.h" @@ -103,10 +104,10 @@ void ompi_info::do_params(bool want_all, bool want_internal) } if (!found) { -#if 0 - show_help("ompi_info", "usage"); -#endif - exit(1); + char *usage = ompi_cmd_line_get_usage_msg(cmd_line); + ompi_show_help("help-ompi_info.txt", "usage", true, usage); + free(usage); + exit(1); } show_mca_params(type, component, param_all, want_internal); @@ -251,10 +252,10 @@ void ompi_info::do_path(bool want_all, ompi_cmd_line_t *cmd_line) else if (path_sysconfdir == scope) show_path(path_sysconfdir, OMPI_SYSCONFDIR); else { -#if 0 - show_help("ompi_info", "usage"); -#endif - exit(1); + char *usage = ompi_cmd_line_get_usage_msg(cmd_line); + ompi_show_help("help-ompi_info.txt", "usage", true, usage); + free(usage); + exit(1); } } } @@ -346,6 +347,7 @@ void ompi_info::do_config(bool want_all) out("Fortran90 bindings", "bindings:f90", f90); out("C compiler", "compiler:c:command", OMPI_CC); + out("C compiler absolute", "compiler:c:absolute", OMPI_CC_ABSOLUTE); if (want_all) { out("C char size", "compiler:c:sizeof:char", sizeof(char)); @@ -364,9 +366,14 @@ void ompi_info::do_config(bool want_all) } out("C++ compiler", "compiler:cxx:command", OMPI_CXX); + out("C++ compiler absolute", "compiler:cxx:absolute", OMPI_CXX_ABSOLUTE); out("Fortran77 compiler", "compiler:f77:command", OMPI_F77); + out("Fortran77 compiler absolute", "compiler:f77:absolute", + OMPI_F77_ABSOLUTE); out("Fortran90 compiler", "compiler:f90:command", OMPI_F90); + out("Fortran90 compiler absolute", "compiler:f90:absolute", + OMPI_F90_ABSOLUTE); if (want_all) {