1
1

* 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.
Этот коммит содержится в:
Brian Barrett 2013-02-13 00:33:05 +00:00
родитель 312f37706e
Коммит 504a6d036f
15 изменённых файлов: 72 добавлений и 169 удалений

Просмотреть файл

@ -128,7 +128,10 @@ AC_DEFUN([OPAL_SETUP_WRAPPER_INIT],[
AC_DEFUN([OPAL_SETUP_WRAPPER_FINAL],[ AC_DEFUN([OPAL_SETUP_WRAPPER_FINAL],[
m4_ifdef([project_opal], [ m4_ifdef([project_opal], [
AC_MSG_CHECKING([for OPAL CPPFLAGS]) 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_SUBST([OPAL_WRAPPER_EXTRA_CPPFLAGS])
AC_MSG_RESULT([$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" OPAL_WRAPPER_EXTRA_LIBS="$OPAL_WRAPPER_EXTRA_LIBS $with_wrapper_libs"
AC_SUBST([OPAL_WRAPPER_EXTRA_LIBS]) AC_SUBST([OPAL_WRAPPER_EXTRA_LIBS])
AC_MSG_RESULT([$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], [ m4_ifdef([project_orte], [
AC_MSG_CHECKING([for ORTE CPPFLAGS]) 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_SUBST([ORTE_WRAPPER_EXTRA_CPPFLAGS])
AC_MSG_RESULT([$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_SUBST([ORTE_WRAPPER_EXTRA_LIBS])
AC_MSG_RESULT([$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], [], [ 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", AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CFLAGS, "$ORTE_WRAPPER_EXTRA_CFLAGS",
[Additional CFLAGS to pass through the wrapper compilers]) [Additional CFLAGS to pass through the wrapper compilers])
AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_CFLAGS_PREFIX, "$ORTE_WRAPPER_EXTRA_CFLAGS_PREFIX", 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], [ m4_ifdef([project_ompi], [
AC_MSG_CHECKING([for OMPI CPPFLAGS]) 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_SUBST([OMPI_WRAPPER_EXTRA_CPPFLAGS])
AC_MSG_RESULT([$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]) AC_MSG_CHECKING([for OMPI FCFLAGS])
OMPI_WRAPPER_EXTRA_FCFLAGS="$wrapper_extra_fcflags $with_wrapper_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_SUBST([OMPI_WRAPPER_EXTRA_FCFLAGS])
AC_MSG_RESULT([$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_SUBST([OMPI_WRAPPER_EXTRA_LIBS])
AC_MSG_RESULT([$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 # language binding support. C++ is a bit different, as the
# compiler should work even if there is no MPI C++ bindings # compiler should work even if there is no MPI C++ bindings
# support. However, we do want it to fail if there is no C++ # support. However, we do want it to fail if there is no C++

Просмотреть файл

@ -12,7 +12,6 @@ language=C++
compiler_env=CXX compiler_env=CXX
compiler_flags_env=CXXFLAGS compiler_flags_env=CXXFLAGS
compiler=@CXX@ compiler=@CXX@
extra_includes=@OMPI_WRAPPER_EXTRA_INCLUDES@
preprocessor_flags=@OMPI_WRAPPER_EXTRA_CPPFLAGS@ preprocessor_flags=@OMPI_WRAPPER_EXTRA_CPPFLAGS@
compiler_flags_prefix=@OMPI_WRAPPER_EXTRA_CXXFLAGS_PREFIX@ compiler_flags_prefix=@OMPI_WRAPPER_EXTRA_CXXFLAGS_PREFIX@
compiler_flags=@OMPI_WRAPPER_EXTRA_CXXFLAGS@ compiler_flags=@OMPI_WRAPPER_EXTRA_CXXFLAGS@

Просмотреть файл

@ -12,7 +12,6 @@ language=C
compiler_env=CC compiler_env=CC
compiler_flags_env=CFLAGS compiler_flags_env=CFLAGS
compiler=@WRAPPER_CC@ compiler=@WRAPPER_CC@
extra_includes=@OMPI_WRAPPER_EXTRA_INCLUDES@
preprocessor_flags=@OMPI_WRAPPER_EXTRA_CPPFLAGS@ preprocessor_flags=@OMPI_WRAPPER_EXTRA_CPPFLAGS@
compiler_flags_prefix=@OMPI_WRAPPER_EXTRA_CFLAGS_PREFIX@ compiler_flags_prefix=@OMPI_WRAPPER_EXTRA_CFLAGS_PREFIX@
compiler_flags=@OMPI_WRAPPER_EXTRA_CFLAGS@ compiler_flags=@OMPI_WRAPPER_EXTRA_CFLAGS@

Просмотреть файл

@ -12,8 +12,6 @@ language=Fortran
compiler_env=FC compiler_env=FC
compiler_flags_env=FCFLAGS compiler_flags_env=FCFLAGS
compiler=@FC@ compiler=@FC@
module_option=@OMPI_FC_MODULE_FLAG@
extra_includes=
preprocessor_flags= preprocessor_flags=
compiler_flags=@OMPI_WRAPPER_EXTRA_FCFLAGS@ compiler_flags=@OMPI_WRAPPER_EXTRA_FCFLAGS@
linker_flags=@OMPI_WRAPPER_EXTRA_LDFLAGS@ linker_flags=@OMPI_WRAPPER_EXTRA_LDFLAGS@

Просмотреть файл

@ -17,9 +17,4 @@ libdir=@libdir@
Libs: -L${libdir} @OMPI_WRAPPER_EXTRA_LDFLAGS@ -lmpi Libs: -L${libdir} @OMPI_WRAPPER_EXTRA_LDFLAGS@ -lmpi
Libs.private: @OMPI_WRAPPER_EXTRA_LIBS@ Libs.private: @OMPI_WRAPPER_EXTRA_LIBS@
# #
# It is safe to hard-wire the -I before the EXTRA_INCLUDES because it Cflags: -I${includedir} @OMPI_WRAPPER_EXTRA_CPPFLAGS@ @OMPI_WRAPPER_EXTRA_CFLAGS@
# 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@

Просмотреть файл

@ -17,8 +17,4 @@ libdir=@libdir@
Libs: -L${libdir} @OMPI_WRAPPER_EXTRA_LDFLAGS@ @OMPI_WRAPPER_CXX_LIB@ -lmpi Libs: -L${libdir} @OMPI_WRAPPER_EXTRA_LDFLAGS@ @OMPI_WRAPPER_CXX_LIB@ -lmpi
Libs.private: @OMPI_WRAPPER_EXTRA_LIBS@ Libs.private: @OMPI_WRAPPER_EXTRA_LIBS@
# #
# It is safe to hard-wire the -I before the EXTRA_INCLUDES because we Cflags: -I${includedir} @OMPI_WRAPPER_EXTRA_CPPFLAGS@ @OMPI_WRAPPER_EXTRA_CXXFLAGS@
# 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@

Просмотреть файл

@ -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: -L${libdir} @OMPI_WRAPPER_EXTRA_LDFLAGS@ @OMPI_FORTRAN_USEMPIF08_LIB@ @OMPI_FORTRAN_USEMPI_LIB@ -lmpi_mpifh -lmpi
Libs.private: @OMPI_WRAPPER_EXTRA_LIBS@ 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@

Просмотреть файл

@ -17,9 +17,4 @@ libdir=@libdir@
Libs: -L${libdir} @OMPI_WRAPPER_EXTRA_LDFLAGS@ -lmpi Libs: -L${libdir} @OMPI_WRAPPER_EXTRA_LDFLAGS@ -lmpi
Libs.private: @OMPI_WRAPPER_EXTRA_LIBS@ Libs.private: @OMPI_WRAPPER_EXTRA_LIBS@
# #
# It is safe to hard-wire the -I before the EXTRA_INCLUDES because it Cflags: -I${includedir} @OMPI_WRAPPER_EXTRA_CPPFLAGS@ @OMPI_WRAPPER_EXTRA_CFLAGS@
# 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@

Просмотреть файл

@ -6,6 +6,7 @@
# #
# Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013 Sandia National Laboratories. All rights reserved.
# $COPYRIGHT$ # $COPYRIGHT$
# #
# Additional copyrights may follow # Additional copyrights may follow
@ -32,18 +33,19 @@ if (exists($ENV{'OPAL_DESTDIR'})
my $CC = "@WRAPPER_CC@"; my $CC = "@WRAPPER_CC@";
my $CXX = "@CXX@"; my $CXX = "@CXX@";
my $FC = "@FC@"; my $FC = "@FC@";
my $extra_includes = "@OMPI_WRAPPER_EXTRA_INCLUDES@";
my $extra_cppflags = "@OMPI_WRAPPER_EXTRA_CPPFLAGS@"; my $extra_cppflags = "@OMPI_WRAPPER_EXTRA_CPPFLAGS@";
my $extra_cflags = "@OMPI_WRAPPER_EXTRA_CFLAGS@"; 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 = "@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 = "@OMPI_WRAPPER_EXTRA_FCFLAGS@";
my $extra_fcflags_prefix = "@OMPI_WRAPPER_EXTRA_FCFLAGS_PREFIX@"; my $extra_fcflags_prefix = "@OMPI_WRAPPER_EXTRA_FCFLAGS_PREFIX@";
my $extra_ldflags = "@OMPI_WRAPPER_EXTRA_LDFLAGS@"; my $extra_ldflags = "@OMPI_WRAPPER_EXTRA_LDFLAGS@";
my $extra_libs = "@OMPI_WRAPPER_EXTRA_LIBS@"; my $extra_libs = "@OMPI_WRAPPER_EXTRA_LIBS@";
my $cxx_lib = "@OMPI_WRAPPER_CXX_LIB@"; my $cxx_lib = "@OMPI_WRAPPER_CXX_LIB@";
my $fc_module_flag = "@OMPI_FC_MODULE_FLAG@"; 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 # Someone might want to fix for windows
my $include_flag = "-I"; 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 # pulled in implicitly) because we intend MPI applications to only use
# the MPI API. # the MPI API.
my $libs = "-lmpi " . $extra_libs; 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 { sub check_env {
my $envvar = shift; my $envvar = shift;
@ -77,28 +99,18 @@ sub check_env {
return $str; 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") { if (basename($0) eq "mpicc") {
$lang = "C"; $lang = "C";
$comp = check_env("CC", $CC); $comp = check_env("CC", $CC);
$preproc_flags .= " " . add_extra_includes(); $preproc_flags .= " " . $extra_cppflags;
$comp_flags = $extra_cflags; $comp_flags = $extra_cflags;
$comp_flags_prefix = $extra_cflags_prefix; $comp_flags_prefix = $extra_cflags_prefix;
# no special libs for C # no special libs for C
} elsif (basename($0) eq "mpic++" || basename($0) eq "mpiCC" || basename($0) eq "mpicxx") { } elsif (basename($0) eq "mpic++" || basename($0) eq "mpiCC" || basename($0) eq "mpicxx") {
$lang = "C++"; $lang = "C++";
$comp = check_env("CXX", $CXX); $comp = check_env("CXX", $CXX);
$preproc_flags .= " " . add_extra_includes(); $preproc_flags .= " " . $extra_cppflags;
$comp_flags = $extra_cxxflags; $comp_flags = $extra_cxxflags;
$comp_flags_prefix = $extra_cxxflags_prefix; $comp_flags_prefix = $extra_cxxflags_prefix;
$libs = $cxx_lib . " " . $libs; $libs = $cxx_lib . " " . $libs;
@ -111,7 +123,7 @@ elsif (basename($0) eq "mpifort" ||
# no extra includes for Fortran. # no extra includes for Fortran.
$comp_flags = $extra_fcflags; $comp_flags = $extra_fcflags;
$comp_flags_prefix = $extra_fcflags_prefix; $comp_flags_prefix = $extra_fcflags_prefix;
$libs = "-lmpi_mpifh " . $libs; $libs = $fortran_libs . " -lmpi_mpifh " . $libs;
} }
if ($lang eq "none") { if ($lang eq "none") {
@ -134,6 +146,7 @@ my $dry_run = 0;
my $disable_flags = 1; my $disable_flags = 1;
my $real_flag = 0; my $real_flag = 0;
my @appargs = (); my @appargs = ();
my $want_static = 0;
while (scalar(@args) > 0) { while (scalar(@args) > 0) {
my $arg = shift(@args); my $arg = shift(@args);
@ -143,7 +156,7 @@ while (scalar(@args) > 0) {
} elsif ($arg eq "-lpmpi") { } elsif ($arg eq "-lpmpi") {
$want_pmpi = 1; $want_pmpi = 1;
} elsif ($arg eq "--openmpi:linkall") { } elsif ($arg eq "--openmpi:linkall") {
$libs = "-lmpi -lopen-rte -lopen-pal" . $extra_libs; $libs = $libs_static;
} else { } else {
if ($arg eq "-c") { if ($arg eq "-c") {
$want_link = 0; $want_link = 0;
@ -155,6 +168,22 @@ while (scalar(@args) > 0) {
} elsif ($arg eq "-S") { } elsif ($arg eq "-S") {
$want_link = 0; $want_link = 0;
$real_flag = 1; $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 =~ /^-.*/) { } elsif ($arg =~ /^-.*/) {
$real_flag = 1; $real_flag = 1;
} else { } else {
@ -169,6 +198,10 @@ if ($disable_flags == 1 && !($dry_run == 1 && $real_flag == 0)) {
$want_preproc = $want_compile = $want_link = 0; $want_preproc = $want_compile = $want_link = 0;
} }
if ($want_static == 1 || $have_dynamic == 0) {
$libs = $libs_static;
}
my @exec_argv = (); my @exec_argv = ();
# assemble command # assemble command

Просмотреть файл

@ -73,7 +73,6 @@ struct options_data_t {
char *compiler_env; char *compiler_env;
char *compiler_flags_env; char *compiler_flags_env;
char *compiler; char *compiler;
char *module_option;
char **preproc_flags; char **preproc_flags;
char **comp_flags; char **comp_flags;
char **comp_flags_prefix; char **comp_flags_prefix;
@ -85,7 +84,6 @@ struct options_data_t {
char *req_file; char *req_file;
char *path_includedir; char *path_includedir;
char *path_libdir; char *path_libdir;
char *extra_includes;
}; };
static struct options_data_t *options_data = NULL; static struct options_data_t *options_data = NULL;
@ -118,7 +116,6 @@ options_data_init(struct options_data_t *data)
data->version = NULL; data->version = NULL;
data->compiler_env = NULL; data->compiler_env = NULL;
data->compiler_flags_env = NULL; data->compiler_flags_env = NULL;
data->module_option = NULL;
data->preproc_flags = (char **) malloc(sizeof(char*)); data->preproc_flags = (char **) malloc(sizeof(char*));
data->preproc_flags[0] = NULL; data->preproc_flags[0] = NULL;
data->comp_flags = (char **) malloc(sizeof(char*)); data->comp_flags = (char **) malloc(sizeof(char*));
@ -136,7 +133,6 @@ options_data_init(struct options_data_t *data)
data->req_file = NULL; data->req_file = NULL;
data->path_includedir = NULL; data->path_includedir = NULL;
data->path_libdir = NULL; data->path_libdir = NULL;
data->extra_includes = NULL;
} }
static void static void
@ -152,7 +148,6 @@ options_data_free(struct options_data_t *data)
if (NULL != data->version) free(data->version); if (NULL != data->version) free(data->version);
if (NULL != data->compiler_env) free(data->compiler_env); if (NULL != data->compiler_env) free(data->compiler_env);
if (NULL != data->compiler_flags_env) free(data->compiler_flags_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->preproc_flags);
opal_argv_free(data->comp_flags); opal_argv_free(data->comp_flags);
opal_argv_free(data->comp_flags_prefix); 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->req_file) free(data->req_file);
if (NULL != data->path_includedir) free(data->path_includedir); if (NULL != data->path_includedir) free(data->path_includedir);
if (NULL != data->path_libdir) free(data->path_libdir); if (NULL != data->path_libdir) free(data->path_libdir);
if (NULL != data->extra_includes) free(data->extra_includes);
} }
static void 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 static void
expand_flags(char **argv) 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); if (NULL != value) options_data[parse_options_idx].project = strdup(value);
} else if (0 == strcmp(key, "version")) { } else if (0 == strcmp(key, "version")) {
if (NULL != value) options_data[parse_options_idx].version = strdup(value); 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")) { } else if (0 == strcmp(key, "preprocessor_flags")) {
char **values = opal_argv_split(value, ' '); char **values = opal_argv_split(value, ' ');
opal_argv_insert(&options_data[parse_options_idx].preproc_flags, 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); opal_argv_append_nosize(&options_data[parse_options_idx].preproc_flags, line);
free(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")) { } else if (0 == strcmp(key, "libdir")) {
if (NULL != value) options_data[parse_options_idx].path_libdir = if (NULL != value) options_data[parse_options_idx].path_libdir =
@ -839,14 +794,6 @@ main(int argc, char *argv[])
/* compiler flags */ /* compiler flags */
if (flags & COMP_WANT_COMPILE) { if (flags & COMP_WANT_COMPILE) {
opal_argv_insert(&exec_argv, exec_argc, options_data[user_data_idx].comp_flags); 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); exec_argc = opal_argv_count(exec_argv);
} }

Просмотреть файл

@ -12,7 +12,6 @@ language=C++
compiler_env=CXX compiler_env=CXX
compiler_flags_env=CXXFLAGS compiler_flags_env=CXXFLAGS
compiler=@CXX@ compiler=@CXX@
extra_includes=@OPAL_WRAPPER_EXTRA_INCLUDES@
preprocessor_flags=@OPAL_WRAPPER_EXTRA_CPPFLAGS@ preprocessor_flags=@OPAL_WRAPPER_EXTRA_CPPFLAGS@
compiler_flags_prefix=@OPAL_WRAPPER_EXTRA_CXXFLAGS_PREFIX@ compiler_flags_prefix=@OPAL_WRAPPER_EXTRA_CXXFLAGS_PREFIX@
compiler_flags=@OPAL_WRAPPER_EXTRA_CXXFLAGS@ compiler_flags=@OPAL_WRAPPER_EXTRA_CXXFLAGS@

Просмотреть файл

@ -12,7 +12,6 @@ language=C
compiler_env=CC compiler_env=CC
compiler_flags_env=CFLAGS compiler_flags_env=CFLAGS
compiler=@WRAPPER_CC@ compiler=@WRAPPER_CC@
extra_includes=@OPAL_WRAPPER_EXTRA_INCLUDES@
preprocessor_flags=@OPAL_WRAPPER_EXTRA_CPPFLAGS@ preprocessor_flags=@OPAL_WRAPPER_EXTRA_CPPFLAGS@
compiler_flags_prefix=@OPAL_WRAPPER_EXTRA_CFLAGS_PREFIX@ compiler_flags_prefix=@OPAL_WRAPPER_EXTRA_CFLAGS_PREFIX@
compiler_flags=@OPAL_WRAPPER_EXTRA_CFLAGS@ compiler_flags=@OPAL_WRAPPER_EXTRA_CFLAGS@

Просмотреть файл

@ -20,38 +20,13 @@
#man_pages = ortecc.1 ortec++.1 #man_pages = ortecc.1 ortec++.1
if !ORTE_DISABLE_FULL_SUPPORT if !ORTE_DISABLE_FULL_SUPPORT
if !OPAL_WANT_SCRIPT_WRAPPER_COMPILERS
if OMPI_INSTALL_BINARIES
nodist_pkgdata_DATA = \ nodist_pkgdata_DATA = \
ortecc-wrapper-data.txt \ ortecc-wrapper-data.txt \
ortec++-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 pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = orte.pc pkgconfig_DATA = orte.pc

Просмотреть файл

@ -12,7 +12,6 @@ language=C++
compiler_env=CXX compiler_env=CXX
compiler_flags_env=CXXFLAGS compiler_flags_env=CXXFLAGS
compiler=@CXX@ compiler=@CXX@
extra_includes=@ORTE_WRAPPER_EXTRA_INCLUDES@
preprocessor_flags=@ORTE_WRAPPER_EXTRA_CPPFLAGS@ preprocessor_flags=@ORTE_WRAPPER_EXTRA_CPPFLAGS@
compiler_flags_prefix=@ORTE_WRAPPER_EXTRA_CXXFLAGS_PREFIX@ compiler_flags_prefix=@ORTE_WRAPPER_EXTRA_CXXFLAGS_PREFIX@
compiler_flags=@ORTE_WRAPPER_EXTRA_CXXFLAGS@ compiler_flags=@ORTE_WRAPPER_EXTRA_CXXFLAGS@

Просмотреть файл

@ -12,7 +12,6 @@ language=C
compiler_env=CC compiler_env=CC
compiler_flags_env=CFLAGS compiler_flags_env=CFLAGS
compiler=@WRAPPER_CC@ compiler=@WRAPPER_CC@
extra_includes=@ORTE_WRAPPER_EXTRA_INCLUDES@
preprocessor_flags=@ORTE_WRAPPER_EXTRA_CPPFLAGS@ preprocessor_flags=@ORTE_WRAPPER_EXTRA_CPPFLAGS@
compiler_flags_prefix=@ORTE_WRAPPER_EXTRA_CFLAGS_PREFIX@ compiler_flags_prefix=@ORTE_WRAPPER_EXTRA_CFLAGS_PREFIX@
compiler_flags=@ORTE_WRAPPER_EXTRA_CFLAGS@ compiler_flags=@ORTE_WRAPPER_EXTRA_CFLAGS@