From 504a6d036f90571eaa00a8bff70c425026a9d9d6 Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Wed, 13 Feb 2013 00:33:05 +0000 Subject: [PATCH] * Rather than use the extra_includes directive, add the extra includes (which is really just -I${includedir}/openmpi/ for devel headers) to CPPFLAGS, since all the other necessary -Is for devel headers (like libevent and hwloc) are added to CPPFLAGS. * Clean up ${includedir} and ${libdir} for script wrapper compilers * Update script wrapper compilers to work like the C wrapper compilers w.r.t static and dynamic linking * Remove the ORTE script wrapper compilers since they didn't support the ${includedir} stuff and Ralph said they weren't used anymore. This commit was SVN r28052. --- config/opal_setup_wrappers.m4 | 62 +++++------------ .../tools/wrappers/mpic++-wrapper-data.txt.in | 1 - ompi/tools/wrappers/mpicc-wrapper-data.txt.in | 1 - .../wrappers/mpifort-wrapper-data.txt.in | 2 - ompi/tools/wrappers/ompi-c.pc.in | 7 +- ompi/tools/wrappers/ompi-cxx.pc.in | 6 +- ompi/tools/wrappers/ompi-fort.pc.in | 2 +- ompi/tools/wrappers/ompi.pc.in | 7 +- ompi/tools/wrappers/ompi_wrapper_script.in | 67 ++++++++++++++----- opal/tools/wrappers/opal_wrapper.c | 53 --------------- .../wrappers/opalc++-wrapper-data.txt.in | 1 - .../tools/wrappers/opalcc-wrapper-data.txt.in | 1 - orte/tools/wrappers/Makefile.am | 29 +------- .../wrappers/ortec++-wrapper-data.txt.in | 1 - .../tools/wrappers/ortecc-wrapper-data.txt.in | 1 - 15 files changed, 72 insertions(+), 169 deletions(-) diff --git a/config/opal_setup_wrappers.m4 b/config/opal_setup_wrappers.m4 index 09c0b92d2a..ef9483f3de 100644 --- a/config/opal_setup_wrappers.m4 +++ b/config/opal_setup_wrappers.m4 @@ -128,7 +128,10 @@ AC_DEFUN([OPAL_SETUP_WRAPPER_INIT],[ AC_DEFUN([OPAL_SETUP_WRAPPER_FINAL],[ m4_ifdef([project_opal], [ AC_MSG_CHECKING([for OPAL CPPFLAGS]) - OPAL_WRAPPER_EXTRA_CPPFLAGS="$opal_mca_wrapper_extra_cppflags $wrapper_extra_cppflags $with_wrapper_cppflags" + if test "$WANT_INSTALL_HEADERS" = "1" ; then + OPAL_WRAPPER_EXTRA_CPPFLAGS='-I${includedir}/openmpi' + fi + OPAL_WRAPPER_EXTRA_CPPFLAGS="$OPAL_WRAPPER_EXTRA_CPPFLAGS $opal_mca_wrapper_extra_cppflags $wrapper_extra_cppflags $with_wrapper_cppflags" AC_SUBST([OPAL_WRAPPER_EXTRA_CPPFLAGS]) AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_CPPFLAGS]) @@ -168,20 +171,14 @@ AC_DEFUN([OPAL_SETUP_WRAPPER_FINAL],[ OPAL_WRAPPER_EXTRA_LIBS="$OPAL_WRAPPER_EXTRA_LIBS $with_wrapper_libs" AC_SUBST([OPAL_WRAPPER_EXTRA_LIBS]) AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_LIBS]) - - AC_MSG_CHECKING([for OPAL extra include dirs]) - if test "$WANT_INSTALL_HEADERS" = "1" ; then - OPAL_WRAPPER_EXTRA_INCLUDES="openmpi" - else - OPAL_WRAPPER_EXTRA_INCLUDES= - fi - AC_SUBST([OPAL_WRAPPER_EXTRA_INCLUDES]) - AC_MSG_RESULT([$OPAL_WRAPPER_EXTRA_INCLUDES]) ]) m4_ifdef([project_orte], [ AC_MSG_CHECKING([for ORTE CPPFLAGS]) - ORTE_WRAPPER_EXTRA_CPPFLAGS="$orte_mca_wrapper_extra_cppflags $wrapper_extra_cppflags $with_wrapper_cppflags" + if test "$WANT_INSTALL_HEADERS" = "1" ; then + ORTE_WRAPPER_EXTRA_CPPFLAGS='-I${includedir}/openmpi' + fi + ORTE_WRAPPER_EXTRA_CPPFLAGS="$ORTE_WRAPPER_EXTRA_CPPFLAGS $orte_mca_wrapper_extra_cppflags $wrapper_extra_cppflags $with_wrapper_cppflags" AC_SUBST([ORTE_WRAPPER_EXTRA_CPPFLAGS]) AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_CPPFLAGS]) @@ -217,32 +214,8 @@ AC_DEFUN([OPAL_SETUP_WRAPPER_FINAL],[ AC_SUBST([ORTE_WRAPPER_EXTRA_LIBS]) AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_LIBS]) - AC_MSG_CHECKING([for ORTE extra include dirs]) - if test "$WANT_INSTALL_HEADERS" = "1" ; then - ORTE_WRAPPER_EXTRA_INCLUDES="openmpi" - else - ORTE_WRAPPER_EXTRA_INCLUDES= - fi - AC_SUBST([ORTE_WRAPPER_EXTRA_INCLUDES]) - AC_MSG_RESULT([$ORTE_WRAPPER_EXTRA_INCLUDES]) - - # For script-based wrappers that don't do relocatable binaries. - # Don't use if you don't have to. - exec_prefix_save="${exec_prefix}" - test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" - eval "ORTE_WRAPPER_INCLUDEDIR=\"${includedir}\"" - eval "ORTE_WRAPPER_LIBDIR=\"${libdir}\"" - exec_prefix="${exec_prefix_save}" - AC_SUBST([ORTE_WRAPPER_INCLUDEDIR]) - AC_SUBST([ORTE_WRAPPER_LIBDIR]) - - # if wrapper compilers were requested, set the orte one up - if test "$WANT_SCRIPT_WRAPPER_COMPILERS" = "1" ; then - AC_CONFIG_FILES([orte/tools/wrappers/orte_wrapper_script], - [chmod +x orte/tools/wrappers/orte_wrapper_script]) - fi - m4_ifdef([project_ompi], [], [ + # these are used by orte_info/ompi_info (yes, they are named poorly) AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CFLAGS, "$ORTE_WRAPPER_EXTRA_CFLAGS", [Additional CFLAGS to pass through the wrapper compilers]) AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CFLAGS_PREFIX, "$ORTE_WRAPPER_EXTRA_CFLAGS_PREFIX", @@ -260,7 +233,10 @@ AC_DEFUN([OPAL_SETUP_WRAPPER_FINAL],[ m4_ifdef([project_ompi], [ AC_MSG_CHECKING([for OMPI CPPFLAGS]) - OMPI_WRAPPER_EXTRA_CPPFLAGS="$ompi_mca_wrapper_extra_cppflags $wrapper_extra_cppflags $with_wrapper_cppflags" + if test "$WANT_INSTALL_HEADERS" = "1" ; then + OMPI_WRAPPER_EXTRA_CPPFLAGS='-I${includedir}/openmpi' + fi + OMPI_WRAPPER_EXTRA_CPPFLAGS="$OMPI_WRAPPER_EXTRA_CPPFLAGS $ompi_mca_wrapper_extra_cppflags $wrapper_extra_cppflags $with_wrapper_cppflags" AC_SUBST([OMPI_WRAPPER_EXTRA_CPPFLAGS]) AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_CPPFLAGS]) @@ -286,6 +262,9 @@ AC_DEFUN([OPAL_SETUP_WRAPPER_FINAL],[ AC_MSG_CHECKING([for OMPI FCFLAGS]) OMPI_WRAPPER_EXTRA_FCFLAGS="$wrapper_extra_fcflags $with_wrapper_fcflags" + if test "$OMPI_FC_MODULE_FLAG" != "" ; then + OMPI_WRAPPER_EXTRA_FCFLAGS="$OMPI_WRAPPER_EXTRA_FCFLAGS $OMPI_FC_MODULE_FLAG"'${libdir}' + fi AC_SUBST([OMPI_WRAPPER_EXTRA_FCFLAGS]) AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_FCFLAGS]) @@ -306,15 +285,6 @@ AC_DEFUN([OPAL_SETUP_WRAPPER_FINAL],[ AC_SUBST([OMPI_WRAPPER_EXTRA_LIBS]) AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_LIBS]) - AC_MSG_CHECKING([for OMPI extra include dirs]) - if test "$WANT_INSTALL_HEADERS" = "1" ; then - OMPI_WRAPPER_EXTRA_INCLUDES="openmpi" - else - OMPI_WRAPPER_EXTRA_INCLUDES= - fi - AC_SUBST([OMPI_WRAPPER_EXTRA_INCLUDES]) - AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_INCLUDES]) - # language binding support. C++ is a bit different, as the # compiler should work even if there is no MPI C++ bindings # support. However, we do want it to fail if there is no C++ diff --git a/ompi/tools/wrappers/mpic++-wrapper-data.txt.in b/ompi/tools/wrappers/mpic++-wrapper-data.txt.in index bf71c31b3a..ddeae4e73d 100644 --- a/ompi/tools/wrappers/mpic++-wrapper-data.txt.in +++ b/ompi/tools/wrappers/mpic++-wrapper-data.txt.in @@ -12,7 +12,6 @@ language=C++ compiler_env=CXX compiler_flags_env=CXXFLAGS compiler=@CXX@ -extra_includes=@OMPI_WRAPPER_EXTRA_INCLUDES@ preprocessor_flags=@OMPI_WRAPPER_EXTRA_CPPFLAGS@ compiler_flags_prefix=@OMPI_WRAPPER_EXTRA_CXXFLAGS_PREFIX@ compiler_flags=@OMPI_WRAPPER_EXTRA_CXXFLAGS@ diff --git a/ompi/tools/wrappers/mpicc-wrapper-data.txt.in b/ompi/tools/wrappers/mpicc-wrapper-data.txt.in index af7fdc445c..e2bae058da 100644 --- a/ompi/tools/wrappers/mpicc-wrapper-data.txt.in +++ b/ompi/tools/wrappers/mpicc-wrapper-data.txt.in @@ -12,7 +12,6 @@ language=C compiler_env=CC compiler_flags_env=CFLAGS compiler=@WRAPPER_CC@ -extra_includes=@OMPI_WRAPPER_EXTRA_INCLUDES@ preprocessor_flags=@OMPI_WRAPPER_EXTRA_CPPFLAGS@ compiler_flags_prefix=@OMPI_WRAPPER_EXTRA_CFLAGS_PREFIX@ compiler_flags=@OMPI_WRAPPER_EXTRA_CFLAGS@ diff --git a/ompi/tools/wrappers/mpifort-wrapper-data.txt.in b/ompi/tools/wrappers/mpifort-wrapper-data.txt.in index b1b86a42bb..0aa728a735 100644 --- a/ompi/tools/wrappers/mpifort-wrapper-data.txt.in +++ b/ompi/tools/wrappers/mpifort-wrapper-data.txt.in @@ -12,8 +12,6 @@ language=Fortran compiler_env=FC compiler_flags_env=FCFLAGS compiler=@FC@ -module_option=@OMPI_FC_MODULE_FLAG@ -extra_includes= preprocessor_flags= compiler_flags=@OMPI_WRAPPER_EXTRA_FCFLAGS@ linker_flags=@OMPI_WRAPPER_EXTRA_LDFLAGS@ diff --git a/ompi/tools/wrappers/ompi-c.pc.in b/ompi/tools/wrappers/ompi-c.pc.in index 34fe36fe67..6931a53be2 100644 --- a/ompi/tools/wrappers/ompi-c.pc.in +++ b/ompi/tools/wrappers/ompi-c.pc.in @@ -17,9 +17,4 @@ libdir=@libdir@ Libs: -L${libdir} @OMPI_WRAPPER_EXTRA_LDFLAGS@ -lmpi Libs.private: @OMPI_WRAPPER_EXTRA_LIBS@ # -# It is safe to hard-wire the -I before the EXTRA_INCLUDES because it -# will either contain "openmpi" or be blank. Hence, it'll either -# resolve to ${includedir} or ${includedir}/something. The former is -# redundant (ick), but safe. -# -Cflags: -I${includedir} -I${includedir}/@OMPI_WRAPPER_EXTRA_INCLUDES@ @OMPI_WRAPPER_EXTRA_CPPFLAGS@ @OMPI_WRAPPER_EXTRA_CFLAGS@ +Cflags: -I${includedir} @OMPI_WRAPPER_EXTRA_CPPFLAGS@ @OMPI_WRAPPER_EXTRA_CFLAGS@ diff --git a/ompi/tools/wrappers/ompi-cxx.pc.in b/ompi/tools/wrappers/ompi-cxx.pc.in index 0b45c09a05..1fd94204ff 100644 --- a/ompi/tools/wrappers/ompi-cxx.pc.in +++ b/ompi/tools/wrappers/ompi-cxx.pc.in @@ -17,8 +17,4 @@ libdir=@libdir@ Libs: -L${libdir} @OMPI_WRAPPER_EXTRA_LDFLAGS@ @OMPI_WRAPPER_CXX_LIB@ -lmpi Libs.private: @OMPI_WRAPPER_EXTRA_LIBS@ # -# It is safe to hard-wire the -I before the EXTRA_INCLUDES because we -# will not be installing this .pc file unless --enable-devel-headers is -# selected, meaning that there will definitely be a value in EXTRA_INCLUDES. -# -Cflags: -I${includedir} -I${includedir}/@OMPI_WRAPPER_EXTRA_INCLUDES@ @OMPI_WRAPPER_EXTRA_CPPFLAGS@ @OMPI_WRAPPER_EXTRA_CXXFLAGS@ +Cflags: -I${includedir} @OMPI_WRAPPER_EXTRA_CPPFLAGS@ @OMPI_WRAPPER_EXTRA_CXXFLAGS@ diff --git a/ompi/tools/wrappers/ompi-fort.pc.in b/ompi/tools/wrappers/ompi-fort.pc.in index bee815249c..759d005f70 100644 --- a/ompi/tools/wrappers/ompi-fort.pc.in +++ b/ompi/tools/wrappers/ompi-fort.pc.in @@ -16,4 +16,4 @@ libdir=@libdir@ # Libs: -L${libdir} @OMPI_WRAPPER_EXTRA_LDFLAGS@ @OMPI_FORTRAN_USEMPIF08_LIB@ @OMPI_FORTRAN_USEMPI_LIB@ -lmpi_mpifh -lmpi Libs.private: @OMPI_WRAPPER_EXTRA_LIBS@ -Cflags: @OMPI_FC_MODULE_FLAG@${libdir} -I${includedir} @OMPI_WRAPPER_EXTRA_CPPFLAGS@ @OMPI_WRAPPER_EXTRA_FCFLAGS@ +Cflags: -I${includedir} @OMPI_WRAPPER_EXTRA_CPPFLAGS@ @OMPI_WRAPPER_EXTRA_FCFLAGS@ diff --git a/ompi/tools/wrappers/ompi.pc.in b/ompi/tools/wrappers/ompi.pc.in index 34fe36fe67..6931a53be2 100644 --- a/ompi/tools/wrappers/ompi.pc.in +++ b/ompi/tools/wrappers/ompi.pc.in @@ -17,9 +17,4 @@ libdir=@libdir@ Libs: -L${libdir} @OMPI_WRAPPER_EXTRA_LDFLAGS@ -lmpi Libs.private: @OMPI_WRAPPER_EXTRA_LIBS@ # -# It is safe to hard-wire the -I before the EXTRA_INCLUDES because it -# will either contain "openmpi" or be blank. Hence, it'll either -# resolve to ${includedir} or ${includedir}/something. The former is -# redundant (ick), but safe. -# -Cflags: -I${includedir} -I${includedir}/@OMPI_WRAPPER_EXTRA_INCLUDES@ @OMPI_WRAPPER_EXTRA_CPPFLAGS@ @OMPI_WRAPPER_EXTRA_CFLAGS@ +Cflags: -I${includedir} @OMPI_WRAPPER_EXTRA_CPPFLAGS@ @OMPI_WRAPPER_EXTRA_CFLAGS@ diff --git a/ompi/tools/wrappers/ompi_wrapper_script.in b/ompi/tools/wrappers/ompi_wrapper_script.in index d87649fbb9..47f59027fa 100644 --- a/ompi/tools/wrappers/ompi_wrapper_script.in +++ b/ompi/tools/wrappers/ompi_wrapper_script.in @@ -6,6 +6,7 @@ # # Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013 Sandia National Laboratories. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -32,18 +33,19 @@ if (exists($ENV{'OPAL_DESTDIR'}) my $CC = "@WRAPPER_CC@"; my $CXX = "@CXX@"; my $FC = "@FC@"; -my $extra_includes = "@OMPI_WRAPPER_EXTRA_INCLUDES@"; my $extra_cppflags = "@OMPI_WRAPPER_EXTRA_CPPFLAGS@"; my $extra_cflags = "@OMPI_WRAPPER_EXTRA_CFLAGS@"; -my $extra_cflags_prefix = "@ORTE_WRAPPER_EXTRA_CFLAGS_PREFIX@"; +my $extra_cflags_prefix = "@OMPI_WRAPPER_EXTRA_CFLAGS_PREFIX@"; my $extra_cxxflags = "@OMPI_WRAPPER_EXTRA_CXXFLAGS@"; -my $extra_cxxflags_prefix = "@ORTE_WRAPPER_EXTRA_CXXFLAGS_PREFIX@"; +my $extra_cxxflags_prefix = "@OMPI_WRAPPER_EXTRA_CXXFLAGS_PREFIX@"; my $extra_fcflags = "@OMPI_WRAPPER_EXTRA_FCFLAGS@"; my $extra_fcflags_prefix = "@OMPI_WRAPPER_EXTRA_FCFLAGS_PREFIX@"; my $extra_ldflags = "@OMPI_WRAPPER_EXTRA_LDFLAGS@"; my $extra_libs = "@OMPI_WRAPPER_EXTRA_LIBS@"; my $cxx_lib = "@OMPI_WRAPPER_CXX_LIB@"; my $fc_module_flag = "@OMPI_FC_MODULE_FLAG@"; +my $dynamic_lib_suffix = "@OPAL_DYN_LIB_SUFFIX@"; +my $fortran_libs = "@OMPI_FORTRAN_USEMPIF08_LIB@ @OMPI_FORTRAN_USEMPI_LIB@"; # Someone might want to fix for windows my $include_flag = "-I"; @@ -60,7 +62,27 @@ my $linker_flags = $libdir_flag . $libdir . " " . $extra_ldflags; # pulled in implicitly) because we intend MPI applications to only use # the MPI API. my $libs = "-lmpi " . $extra_libs; +my $libs_static = "-lmpi -lopen-rte -lopen-pal " . $extra_libs; +my $have_dynamic = 0; +if (-e $libdir . "/libmpi." . $dynamic_lib_suffix) { + $have_dynamic = 1; +} +my $have_static = 0; +if (-e $libdir . "/libmpi.a") { + $have_static = 1; +} + +# run flags through regex to fix directories... +$extra_cppflags =~ s/\$\{includedir\}/$includedir/g; +$extra_cflags =~ s/\$\{includedir\}/$includedir/g; +$extra_cflags_prefix =~ s/\$\{includedir\}/$includedir/g; +$extra_cxxflags =~ s/\$\{includedir\}/$includedir/g; +$extra_cxxflags_prefix =~ s/\$\{includedir\}/$includedir/g; +$extra_fcflags =~ s/\$\{includedir\}/$includedir/g; +$extra_fcflags_prefix =~ s/\$\{includedir\}/$includedir/g; +$extra_ldflags =~ s/\$\{libdir\}/$libdir/g; +$extra_libs =~ s/\$\{libdir\}/$libdir/g; sub check_env { my $envvar = shift; @@ -77,28 +99,18 @@ sub check_env { return $str; } -sub add_extra_includes { - my $str = ""; - my @includes = split(' ', $extra_includes); - for my $include (@includes) { - $str .= $include_flag . catdir($includedir, $include) . " "; - } - - return $str; -} - if (basename($0) eq "mpicc") { $lang = "C"; $comp = check_env("CC", $CC); - $preproc_flags .= " " . add_extra_includes(); + $preproc_flags .= " " . $extra_cppflags; $comp_flags = $extra_cflags; $comp_flags_prefix = $extra_cflags_prefix; # no special libs for C } elsif (basename($0) eq "mpic++" || basename($0) eq "mpiCC" || basename($0) eq "mpicxx") { $lang = "C++"; $comp = check_env("CXX", $CXX); - $preproc_flags .= " " . add_extra_includes(); + $preproc_flags .= " " . $extra_cppflags; $comp_flags = $extra_cxxflags; $comp_flags_prefix = $extra_cxxflags_prefix; $libs = $cxx_lib . " " . $libs; @@ -111,7 +123,7 @@ elsif (basename($0) eq "mpifort" || # no extra includes for Fortran. $comp_flags = $extra_fcflags; $comp_flags_prefix = $extra_fcflags_prefix; - $libs = "-lmpi_mpifh " . $libs; + $libs = $fortran_libs . " -lmpi_mpifh " . $libs; } if ($lang eq "none") { @@ -134,6 +146,7 @@ my $dry_run = 0; my $disable_flags = 1; my $real_flag = 0; my @appargs = (); +my $want_static = 0; while (scalar(@args) > 0) { my $arg = shift(@args); @@ -143,7 +156,7 @@ while (scalar(@args) > 0) { } elsif ($arg eq "-lpmpi") { $want_pmpi = 1; } elsif ($arg eq "--openmpi:linkall") { - $libs = "-lmpi -lopen-rte -lopen-pal" . $extra_libs; + $libs = $libs_static; } else { if ($arg eq "-c") { $want_link = 0; @@ -155,6 +168,22 @@ while (scalar(@args) > 0) { } elsif ($arg eq "-S") { $want_link = 0; $real_flag = 1; + } elsif ($arg eq "-static" || + $arg eq "--static" || + $arg eq "-Bstatic" || + $arg eq "-Wl,-static" || + $arg eq "-Wl,--static" || + $arg eq "-Wl,-Bstatic") { + $want_static = 1; + $real_flag = 1; + } elsif ($arg eq "-dynamic" || + $arg eq "--dynamic" || + $arg eq "-Bdynamic" || + $arg eq "-Wl,-dynamic" || + $arg eq "-Wl,--dynamic" || + $arg eq "-Wl,-Bdynamic") { + $want_static = 0; + $real_flag = 1; } elsif ($arg =~ /^-.*/) { $real_flag = 1; } else { @@ -169,6 +198,10 @@ if ($disable_flags == 1 && !($dry_run == 1 && $real_flag == 0)) { $want_preproc = $want_compile = $want_link = 0; } +if ($want_static == 1 || $have_dynamic == 0) { + $libs = $libs_static; +} + my @exec_argv = (); # assemble command diff --git a/opal/tools/wrappers/opal_wrapper.c b/opal/tools/wrappers/opal_wrapper.c index 90aee58f51..ce039e61a5 100644 --- a/opal/tools/wrappers/opal_wrapper.c +++ b/opal/tools/wrappers/opal_wrapper.c @@ -73,7 +73,6 @@ struct options_data_t { char *compiler_env; char *compiler_flags_env; char *compiler; - char *module_option; char **preproc_flags; char **comp_flags; char **comp_flags_prefix; @@ -85,7 +84,6 @@ struct options_data_t { char *req_file; char *path_includedir; char *path_libdir; - char *extra_includes; }; static struct options_data_t *options_data = NULL; @@ -118,7 +116,6 @@ options_data_init(struct options_data_t *data) data->version = NULL; data->compiler_env = NULL; data->compiler_flags_env = NULL; - data->module_option = NULL; data->preproc_flags = (char **) malloc(sizeof(char*)); data->preproc_flags[0] = NULL; data->comp_flags = (char **) malloc(sizeof(char*)); @@ -136,7 +133,6 @@ options_data_init(struct options_data_t *data) data->req_file = NULL; data->path_includedir = NULL; data->path_libdir = NULL; - data->extra_includes = NULL; } static void @@ -152,7 +148,6 @@ options_data_free(struct options_data_t *data) if (NULL != data->version) free(data->version); if (NULL != data->compiler_env) free(data->compiler_env); if (NULL != data->compiler_flags_env) free(data->compiler_flags_env); - if (NULL != data->module_option) free(data->module_option); opal_argv_free(data->preproc_flags); opal_argv_free(data->comp_flags); opal_argv_free(data->comp_flags_prefix); @@ -164,7 +159,6 @@ options_data_free(struct options_data_t *data) if (NULL != data->req_file) free(data->req_file); if (NULL != data->path_includedir) free(data->path_includedir); if (NULL != data->path_libdir) free(data->path_libdir); - if (NULL != data->extra_includes) free(data->extra_includes); } static void @@ -233,30 +227,6 @@ find_options_index(const char *arg) } -static void -add_extra_includes(const char *includes, const char* includedir) -{ - int i; - char **values = opal_argv_split(includes, ' '); - - for (i = 0 ; i < opal_argv_count(values) ; ++i) { - char *line, *include_directory; - - include_directory = opal_os_path(false, includedir, values[i], NULL); - -#if defined(__WINDOWS__) - asprintf(&line, OPAL_INCLUDE_FLAG"\"%s\"", include_directory); -#else - asprintf(&line, OPAL_INCLUDE_FLAG"%s", include_directory); -#endif /* defined(__WINDOWS__) */ - - opal_argv_append_nosize(&options_data[parse_options_idx].preproc_flags, line); - free(include_directory); - free(line); - } -} - - static void expand_flags(char **argv) { @@ -292,15 +262,6 @@ data_callback(const char *key, const char *value) if (NULL != value) options_data[parse_options_idx].project = strdup(value); } else if (0 == strcmp(key, "version")) { if (NULL != value) options_data[parse_options_idx].version = strdup(value); - } else if (0 == strcmp(key, "module_option")) { - if (NULL != value) options_data[parse_options_idx].module_option = strdup(value); - } else if (0 == strcmp(key, "extra_includes")) { - if (NULL != value) options_data[parse_options_idx].extra_includes = strdup(value); - if (NULL != value && NULL != options_data[parse_options_idx].path_includedir) { - /* includedir already found -- we now have both pieces of information, and the - includedir code didn't do this because it didn't have the extra includes */ - add_extra_includes(value, options_data[parse_options_idx].path_includedir); - } } else if (0 == strcmp(key, "preprocessor_flags")) { char **values = opal_argv_split(value, ' '); opal_argv_insert(&options_data[parse_options_idx].preproc_flags, @@ -370,12 +331,6 @@ data_callback(const char *key, const char *value) opal_argv_append_nosize(&options_data[parse_options_idx].preproc_flags, line); free(line); } - /* Now that we have an include dir, see if we already have - the extra includes, so that we can post them as well */ - if (NULL != options_data[parse_options_idx].extra_includes) { - add_extra_includes(options_data[parse_options_idx].extra_includes, - options_data[parse_options_idx].path_includedir); - } } } else if (0 == strcmp(key, "libdir")) { if (NULL != value) options_data[parse_options_idx].path_libdir = @@ -839,14 +794,6 @@ main(int argc, char *argv[]) /* compiler flags */ if (flags & COMP_WANT_COMPILE) { opal_argv_insert(&exec_argv, exec_argc, options_data[user_data_idx].comp_flags); - /* Deal with languages like Fortran 90 that have special - places and flags for modules or whatever */ - if (options_data[user_data_idx].module_option != NULL) { - char *line; - asprintf(&line, "%s%s", options_data[user_data_idx].module_option, options_data[user_data_idx].path_libdir); - opal_argv_append_nosize(&exec_argv, line); - free(line); - } exec_argc = opal_argv_count(exec_argv); } diff --git a/opal/tools/wrappers/opalc++-wrapper-data.txt.in b/opal/tools/wrappers/opalc++-wrapper-data.txt.in index 5c75ea85df..aa3b8b7ec9 100644 --- a/opal/tools/wrappers/opalc++-wrapper-data.txt.in +++ b/opal/tools/wrappers/opalc++-wrapper-data.txt.in @@ -12,7 +12,6 @@ language=C++ compiler_env=CXX compiler_flags_env=CXXFLAGS compiler=@CXX@ -extra_includes=@OPAL_WRAPPER_EXTRA_INCLUDES@ preprocessor_flags=@OPAL_WRAPPER_EXTRA_CPPFLAGS@ compiler_flags_prefix=@OPAL_WRAPPER_EXTRA_CXXFLAGS_PREFIX@ compiler_flags=@OPAL_WRAPPER_EXTRA_CXXFLAGS@ diff --git a/opal/tools/wrappers/opalcc-wrapper-data.txt.in b/opal/tools/wrappers/opalcc-wrapper-data.txt.in index 2f58de3f47..5efcb00db4 100644 --- a/opal/tools/wrappers/opalcc-wrapper-data.txt.in +++ b/opal/tools/wrappers/opalcc-wrapper-data.txt.in @@ -12,7 +12,6 @@ language=C compiler_env=CC compiler_flags_env=CFLAGS compiler=@WRAPPER_CC@ -extra_includes=@OPAL_WRAPPER_EXTRA_INCLUDES@ preprocessor_flags=@OPAL_WRAPPER_EXTRA_CPPFLAGS@ compiler_flags_prefix=@OPAL_WRAPPER_EXTRA_CFLAGS_PREFIX@ compiler_flags=@OPAL_WRAPPER_EXTRA_CFLAGS@ diff --git a/orte/tools/wrappers/Makefile.am b/orte/tools/wrappers/Makefile.am index de837e0410..64e34041ad 100644 --- a/orte/tools/wrappers/Makefile.am +++ b/orte/tools/wrappers/Makefile.am @@ -20,38 +20,13 @@ #man_pages = ortecc.1 ortec++.1 if !ORTE_DISABLE_FULL_SUPPORT +if !OPAL_WANT_SCRIPT_WRAPPER_COMPILERS +if OMPI_INSTALL_BINARIES nodist_pkgdata_DATA = \ ortecc-wrapper-data.txt \ ortec++-wrapper-data.txt -if OPAL_WANT_SCRIPT_WRAPPER_COMPILERS - -bin_SCRIPTS = orte_wrapper_script -CLEANFILES += $(bin_SCRIPTS) - -install-exec-hook-always: - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - (cd $(DESTDIR)$(bindir); rm -f ortecc; $(LN_S) orte_wrapper_script ortecc) - (cd $(DESTDIR)$(bindir); rm -f ortec++; $(LN_S) orte_wrapper_script ortec++) - -uninstall-local-always: - rm -f $(DESTDIR)$(bindir)/ortecc \ - $(DESTDIR)$(bindir)/ortec++ -if CASE_SENSITIVE_FS -install-exec-hook: install-exec-hook-always - (cd $(DESTDIR)$(bindir); rm -f orteCC; $(LN_S) orte_wrapper_script orteCC) -uninstall-local: uninstall-local-always - rm -f $(DESTDIR)$(bindir)/orteCC -else # CASE_SENSITIVE_FS -install-exec-hook: install-exec-hook-always -uninstall-local: uninstall-local-always -endif # CASE_SENSITIVE_FS - -else # OPAL_WANT_SCRIPT_WRAPPER_COMPILERS - -if OMPI_INSTALL_BINARIES - pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = orte.pc diff --git a/orte/tools/wrappers/ortec++-wrapper-data.txt.in b/orte/tools/wrappers/ortec++-wrapper-data.txt.in index 944cc641d8..688ecd9d25 100644 --- a/orte/tools/wrappers/ortec++-wrapper-data.txt.in +++ b/orte/tools/wrappers/ortec++-wrapper-data.txt.in @@ -12,7 +12,6 @@ language=C++ compiler_env=CXX compiler_flags_env=CXXFLAGS compiler=@CXX@ -extra_includes=@ORTE_WRAPPER_EXTRA_INCLUDES@ preprocessor_flags=@ORTE_WRAPPER_EXTRA_CPPFLAGS@ compiler_flags_prefix=@ORTE_WRAPPER_EXTRA_CXXFLAGS_PREFIX@ compiler_flags=@ORTE_WRAPPER_EXTRA_CXXFLAGS@ diff --git a/orte/tools/wrappers/ortecc-wrapper-data.txt.in b/orte/tools/wrappers/ortecc-wrapper-data.txt.in index 27ec3c70fc..5fd71f030f 100644 --- a/orte/tools/wrappers/ortecc-wrapper-data.txt.in +++ b/orte/tools/wrappers/ortecc-wrapper-data.txt.in @@ -12,7 +12,6 @@ language=C compiler_env=CC compiler_flags_env=CFLAGS compiler=@WRAPPER_CC@ -extra_includes=@ORTE_WRAPPER_EXTRA_INCLUDES@ preprocessor_flags=@ORTE_WRAPPER_EXTRA_CPPFLAGS@ compiler_flags_prefix=@ORTE_WRAPPER_EXTRA_CFLAGS_PREFIX@ compiler_flags=@ORTE_WRAPPER_EXTRA_CFLAGS@