This patch looks for LIBMPI_* kinds of flags in the post_configure.sh
script in components and distributes them as appropriate throughout the tree (previously, we only did WRAPPERS_* flags). These flags are *only* used when libmpi is being build statically (--disable-shared --enable-static). I also added another classification of flags -- LIBMPI_ALWAYS_* and WRAPPERS_ALWAYS_* for flags that should always be added to the libmpi / wrapper linker lines, not just when compiling libmpi statically. This commit was SVN r4322.
Этот коммит содержится в:
родитель
7b0d5c58c3
Коммит
e5ff6d7146
@ -498,23 +498,48 @@ if test "$HAPPY" = "1"; then
|
||||
AC_MSG_ERROR([cannot continue])
|
||||
fi
|
||||
|
||||
# Now check for LIBMPI tags
|
||||
# If we're not compiling statically, then only take the
|
||||
# "ALWAYS" tags (a uniq will be performed at the end -- no
|
||||
# need to worry about duplicate flags here)
|
||||
|
||||
for flags in CFLAGS CXXFLAGS FFLAGS LDFLAGS LIBS; do
|
||||
var="LIBMPI_EXTRA_${flags}"
|
||||
line="`grep $var= $infile | cut -d= -f2-`"
|
||||
eval "line=$line"
|
||||
for flags in LDFLAGS LIBS; do
|
||||
var_in="LIBMPI_ALWAYS_EXTRA_${flags}"
|
||||
var_out="LIBMPI_EXTRA_${flags}"
|
||||
line="`grep $var_in= $infile | cut -d= -f2-`"
|
||||
eval "line=$line"
|
||||
if test -n "$line"; then
|
||||
str="$var="'"$'"$var $line"'"'
|
||||
str="$var_out="'"$'"$var_out $var_in $line"'"'
|
||||
eval $str
|
||||
fi
|
||||
done
|
||||
|
||||
# Finally check for WRAPPER flags, but only if this component
|
||||
# is compiling statically
|
||||
for flags in CFLAGS CXXFLAGS FFLAGS FCFLAGS LDFLAGS LIBS; do
|
||||
var_in="WRAPPER_ALWAYS_EXTRA_${flags}"
|
||||
var_out="WRAPPER_EXTRA_${flags}"
|
||||
line="`grep $var_in= $infile | cut -d= -f2-`"
|
||||
eval "line=$line"
|
||||
if test -n "$line"; then
|
||||
str="$var_out="'"$'"$var_out $var_in $line"'"'
|
||||
eval $str
|
||||
fi
|
||||
done
|
||||
|
||||
# Check for flags passed up from the component. If we're
|
||||
# compiling statically, then take all flags passed up from the
|
||||
# component.
|
||||
|
||||
if test "$compile_mode" = "static"; then
|
||||
for flags in LDFLAGS LIBS; do
|
||||
var="LIBMPI_EXTRA_${flags}"
|
||||
line="`grep $var= $infile | cut -d= -f2-`"
|
||||
eval "line=$line"
|
||||
if test -n "$line"; then
|
||||
str="$var="'"$'"$var $line"'"'
|
||||
eval $str
|
||||
fi
|
||||
done
|
||||
|
||||
for flags in CFLAGS CXXFLAGS FFLAGS FCFLAGS LDFLAGS LIBS; do
|
||||
var="WRAPPER_EXTRA_${flags}"
|
||||
line="`grep $var= $infile | cut -d= -f2-`"
|
||||
eval "line=$line"
|
||||
|
22
configure.ac
22
configure.ac
@ -1432,6 +1432,28 @@ AC_DEFINE_UNQUOTED(WRAPPER_EXTRA_LIBS, "$WRAPPER_EXTRA_LIBS",
|
||||
[Additional LIBS to pass through the wrapper compilers])
|
||||
AC_MSG_RESULT([$WRAPPER_EXTRA_LIBS])
|
||||
|
||||
#
|
||||
# Adding LIBMPI_* flags from the components that are necessary to
|
||||
# compile with libmpi
|
||||
#
|
||||
# LIBMPI_EXTRA_LDFLAGS
|
||||
#
|
||||
AC_MSG_CHECKING([for libmpi additional LDFLAGS])
|
||||
OMPI_UNIQ(LIBMPI_EXTRA_LDFLAGS)
|
||||
AC_SUBST(LIBMPI_EXTRA_LDFLAGS)
|
||||
AC_DEFINE_UNQUOTED(LIBMPI_EXTRA_LDFLAGS, "$LIBMPI_EXTRA_LDFLAGS",
|
||||
[Additional LDFLAGS to compile against libmpi])
|
||||
AC_MSG_RESULT([$LIBMPI_EXTRA_LDFLAGS])
|
||||
|
||||
#
|
||||
# LIBMPI_EXTRA_LIBS
|
||||
#
|
||||
AC_MSG_CHECKING([for libmpi additional LIBS])
|
||||
AC_SUBST(LIBMPI_EXTRA_LIBS)
|
||||
AC_DEFINE_UNQUOTED(LIBMPI_EXTRA_LIBS, "$LIBMPI_EXTRA_LIBS",
|
||||
[Additional LIBS to compile against libmpi])
|
||||
AC_MSG_RESULT([$LIBMPI_EXTRA_LIBS])
|
||||
|
||||
#
|
||||
# Delayed the substitution of CFLAGS and CXXFLAGS until now because
|
||||
# they may have been modified throughout the course of this script.
|
||||
|
@ -23,16 +23,8 @@ pkgdata_DATA = help-bootproxy.txt
|
||||
|
||||
bin_PROGRAMS = mca_pcm_rsh_bootproxy
|
||||
|
||||
mca_pcm_rsh_bootproxy_SOURCES = \
|
||||
bootproxy.c
|
||||
mca_pcm_rsh_bootproxy_LDADD = \
|
||||
$(libs) \
|
||||
$(LIBMPI_EXTRA_LIBS) \
|
||||
$(LIBOMPI_EXTRA_LIBS) \
|
||||
-lm
|
||||
mca_pcm_rsh_bootproxy_LDFLAGS = \
|
||||
$(LIBMPI_EXTRA_LDFLAGS) \
|
||||
$(LIBOMPI_EXTRA_LDFLAGS)
|
||||
mca_pcm_rsh_bootproxy_DEPENDENCIES = \
|
||||
$(libs)
|
||||
mca_pcm_rsh_bootproxy_SOURCES = bootproxy.c
|
||||
mca_pcm_rsh_bootproxy_LDADD = $(libs) $(LIBMPI_EXTRA_LIBS) -lm
|
||||
mca_pcm_rsh_bootproxy_LDFLAGS = $(LIBMPI_EXTRA_LDFLAGS)
|
||||
mca_pcm_rsh_bootproxy_DEPENDENCIES = $(libs)
|
||||
|
||||
|
@ -50,8 +50,8 @@ ompi_info_SOURCES = \
|
||||
output.cc \
|
||||
param.cc \
|
||||
version.cc
|
||||
ompi_info_LDADD = $(libs) $(LIBMPI_EXTRA_LIBS) $(LIBOMPI_EXTRA_LIBS)
|
||||
ompi_info_LDFLAGS = $(LIBMPI_EXTRA_LDFLAGS) $(LIBOMPI_EXTRA_LDFLAGS)
|
||||
ompi_info_LDADD = $(libs) $(LIBMPI_EXTRA_LIBS)
|
||||
ompi_info_LDFLAGS = $(LIBMPI_EXTRA_LDFLAGS)
|
||||
ompi_info_DEPENDENCIES = $(libs)
|
||||
|
||||
clean-local:
|
||||
|
@ -40,8 +40,8 @@ ompid_SOURCES = \
|
||||
ompid.h \
|
||||
ompid.c
|
||||
|
||||
ompid_LDADD = $(libs) $(LIBMPI_EXTRA_LIBS) $(LIBOMPI_EXTRA_LIBS)
|
||||
ompid_LDFLAGS = $(LIBMPI_EXTRA_LDFLAGS) $(LIBOMPI_EXTRA_LDFLAGS)
|
||||
ompid_LDADD = $(libs) $(LIBMPI_EXTRA_LIBS)
|
||||
ompid_LDFLAGS = $(LIBMPI_EXTRA_LDFLAGS)
|
||||
ompid_DEPENDENCIES = $(libs)
|
||||
|
||||
clean-local:
|
||||
|
@ -28,22 +28,12 @@ AM_CPPFLAGS = \
|
||||
|
||||
libs = $(top_builddir)/src/libmpi.la
|
||||
|
||||
bin_PROGRAMS = \
|
||||
openmpi
|
||||
bin_PROGRAMS = openmpi
|
||||
|
||||
openmpi_SOURCES = \
|
||||
openmpi.h \
|
||||
openmpi.c
|
||||
|
||||
openmpi_LDADD = \
|
||||
$(libs) \
|
||||
$(LIBMPI_EXTRA_LIBS) \
|
||||
$(LIBOMPI_EXTRA_LIBS) \
|
||||
$(top_builddir)/src/libmpi.la
|
||||
|
||||
openmpi_DFLAGS = $(LIBMPI_EXTRA_LDFLAGS) $(LIBOMPI_EXTRA_LDFLAGS)
|
||||
openmpi_DEPENDENCIES = $(libs) \
|
||||
$(openmpi_LDADD)
|
||||
openmpi_SOURCES = openmpi.h openmpi.c
|
||||
openmpi_LDADD = $(libs) $(LIBMPI_EXTRA_LIBS) $(top_builddir)/src/libmpi.la
|
||||
openmpi_DFLAGS = $(LIBMPI_EXTRA_LDFLAGS)
|
||||
openmpi_DEPENDENCIES = $(libs) $(openmpi_LDADD)
|
||||
|
||||
clean-local:
|
||||
test -z "$(OMPI_CXX_TEMPLATE_REPOSITORY)" || $(RM) -rf $(OMPI_CXX_TEMPLATE_REPOSITORY)
|
||||
|
@ -34,23 +34,23 @@ libs = $(top_builddir)/src/libmpi.la
|
||||
wrap_sources = wrap.cc wrap_engine.cc ompi_wrap.h
|
||||
|
||||
mpicc_SOURCES = mpicc.cc ompi_wrap.h $(wrap_sources)
|
||||
mpicc_LDADD = $(libs) $(LIBOMPI_EXTRA_LIBS)
|
||||
mpicc_LDFLAGS = $(LIBOMPI_EXTRA_LDFLAGS)
|
||||
mpicc_LDADD = $(libs) $(LIBMPI_EXTRA_LIBS)
|
||||
mpicc_LDFLAGS = $(LIBMPI_EXTRA_LDFLAGS)
|
||||
mpicc_DEPENDENCIES = $(libs)
|
||||
|
||||
mpic___SOURCES = mpicxx.cc ompi_wrap.h $(wrap_sources)
|
||||
mpic___LDADD = $(libs) $(LIBOMPI_EXTRA_LIBS)
|
||||
mpic___LDFLAGS = $(LIBOMPI_EXTRA_LDFLAGS)
|
||||
mpic___LDADD = $(libs) $(LIBMPI_EXTRA_LIBS)
|
||||
mpic___LDFLAGS = $(LIBMPI_EXTRA_LDFLAGS)
|
||||
mpic___DEPENDENCIES = $(libs)
|
||||
|
||||
mpif77_SOURCES = mpif77.cc ompi_wrap.h $(wrap_sources)
|
||||
mpif77_LDADD = $(libs) $(LIBOMPI_EXTRA_LIBS)
|
||||
mpif77_LDFLAGS = $(LIBOMPI_EXTRA_LDFLAGS)
|
||||
mpif77_LDADD = $(libs) $(LIBMPI_EXTRA_LIBS)
|
||||
mpif77_LDFLAGS = $(LIBMPI_EXTRA_LDFLAGS)
|
||||
mpif77_DEPENDENCIES = $(libs)
|
||||
|
||||
mpif90_SOURCES = mpif90.cc ompi_wrap.h $(wrap_sources)
|
||||
mpif90_LDADD = $(libs) $(LIBOMPI_EXTRA_LIBS)
|
||||
mpif90_LDFLAGS = $(LIBOMPI_EXTRA_LDFLAGS)
|
||||
mpif90_LDADD = $(libs) $(LIBMPI_EXTRA_LIBS)
|
||||
mpif90_LDFLAGS = $(LIBMPI_EXTRA_LDFLAGS)
|
||||
mpif90_DEPENDENCIES = $(libs)
|
||||
|
||||
# Since this is C++ and we use templates (the STL), also ditch the
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user