1
1
openmpi/config/opal_search_libs.m4

76 строки
2.6 KiB
Plaintext
Исходник Обычный вид История

configury: ensure wrapper static LIBS is filled properly In core library portions of the configury (e.g., top-level configure.ac itself), we were calling AC_CHECK_LIB and OPAL_CHECK_FUNC_LIB to check for various libraries. '''SIDENOTE:''' It turns out that modern Autoconf has AC_SEARCH_LIBS, which does just about exactly what OPAL_CHECK_FUNC_LIB does. So this commit effectively replaces OPAL_CHECK_FUNC_LIB with AC_SEARCH_LIBS. However, we never bothered to add these found libraries to the wrapper compiler list of libraries used for static linking (doh!). We've been getting lucky for quite a while that components were adding the same libraries to their wrapper compiler LIBS list. This is problematic, however, if we don't build some of these components. For example, Paul Hargrove noticed that if he configured with --disable-shared --enable-static --disable-io-romio, ROMIO was no longer adding some libraries to the wrapper LIBS list -- libraries that just happened to also be needed by core OPAL/ORTE/OMPI layers. The solution is not to use AC_CHECK_LIB or OPAL_CHECK_FUNC_LIB, but use a pair of new macros: * OPAL_SEARCH_LIBS_CORE: a wrapper around AC_SEARCH_LIBS. If we add something to $LIBS, then also add it to the wrapper list of static libraries. This is the main piece of functionality that was wrong/missing. * OPAL_SEARCH_LIBS_COMPONENT: similar to OPAL_SEARCH_LIBS_CORE, but instead of directly adding it to the wrapper list of static libaries, add it to <framework>_<component>_LIBS (which eventually gets slurped up into the wrapper list of static libraries. See the lengthy comment in config/opal_setup_wrappers.m4 near the beginning of OPAL_SETUP_WRAPPER_INIT() for a more detailed explanation). Most components did this correctly already, but one or two weren't right, so I implemented this second macro quite similar to the first and put it everywhere we already used AC_SEARCH_LIBS or OPAL_CHECK_FUNC_LIB. This needs to soak for a day or two on the trunk before moving to the v1.8 branch. Refs trac:4834 cmr=v1.8.2:reviewer=ggouaillardet This commit was SVN r32447. The following Trac tickets were found above: Ticket 4834 --> https://svn.open-mpi.org/trac/ompi/ticket/4834
2014-08-08 03:54:45 +04:00
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2013-2014 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2014 Intel, Inc. All rights reserved.
configury: ensure wrapper static LIBS is filled properly In core library portions of the configury (e.g., top-level configure.ac itself), we were calling AC_CHECK_LIB and OPAL_CHECK_FUNC_LIB to check for various libraries. '''SIDENOTE:''' It turns out that modern Autoconf has AC_SEARCH_LIBS, which does just about exactly what OPAL_CHECK_FUNC_LIB does. So this commit effectively replaces OPAL_CHECK_FUNC_LIB with AC_SEARCH_LIBS. However, we never bothered to add these found libraries to the wrapper compiler list of libraries used for static linking (doh!). We've been getting lucky for quite a while that components were adding the same libraries to their wrapper compiler LIBS list. This is problematic, however, if we don't build some of these components. For example, Paul Hargrove noticed that if he configured with --disable-shared --enable-static --disable-io-romio, ROMIO was no longer adding some libraries to the wrapper LIBS list -- libraries that just happened to also be needed by core OPAL/ORTE/OMPI layers. The solution is not to use AC_CHECK_LIB or OPAL_CHECK_FUNC_LIB, but use a pair of new macros: * OPAL_SEARCH_LIBS_CORE: a wrapper around AC_SEARCH_LIBS. If we add something to $LIBS, then also add it to the wrapper list of static libraries. This is the main piece of functionality that was wrong/missing. * OPAL_SEARCH_LIBS_COMPONENT: similar to OPAL_SEARCH_LIBS_CORE, but instead of directly adding it to the wrapper list of static libaries, add it to <framework>_<component>_LIBS (which eventually gets slurped up into the wrapper list of static libraries. See the lengthy comment in config/opal_setup_wrappers.m4 near the beginning of OPAL_SETUP_WRAPPER_INIT() for a more detailed explanation). Most components did this correctly already, but one or two weren't right, so I implemented this second macro quite similar to the first and put it everywhere we already used AC_SEARCH_LIBS or OPAL_CHECK_FUNC_LIB. This needs to soak for a day or two on the trunk before moving to the v1.8 branch. Refs trac:4834 cmr=v1.8.2:reviewer=ggouaillardet This commit was SVN r32447. The following Trac tickets were found above: Ticket 4834 --> https://svn.open-mpi.org/trac/ompi/ticket/4834
2014-08-08 03:54:45 +04:00
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
dnl
dnl $HEADER$
dnl
# OPAL SEARCH_LIBS_CORE(func, list-of-libraries,
# action-if-found, action-if-not-found,
# other-libraries)
#
# Wrapper around AC SEARCH_LIBS. If a library ends up being added to
# $LIBS, then also add it to the wrapper LIBS list (so that it is
# added to the link command line for the static link case).
#
# NOTE: COMPONENTS SHOULD NOT USE THIS MACRO! Components should use
# OPAL_SEARCH_LIBS_COMPONENT. The reason why is because this macro
# calls OPAL_WRAPPER_FLAGS_ADD -- see big comment in
# opal_setup_wrappers.m4 for an explanation of why this is bad).
AC_DEFUN([OPAL_SEARCH_LIBS_CORE],[
m4_ifdef([mca_component_configure_active],
[m4_fatal([*** OPAL_SEARCH_LIBS_CORE cannot be called from a component configure.m4])])
OPAL_VAR_SCOPE_PUSH([LIBS_save add])
configury: ensure wrapper static LIBS is filled properly In core library portions of the configury (e.g., top-level configure.ac itself), we were calling AC_CHECK_LIB and OPAL_CHECK_FUNC_LIB to check for various libraries. '''SIDENOTE:''' It turns out that modern Autoconf has AC_SEARCH_LIBS, which does just about exactly what OPAL_CHECK_FUNC_LIB does. So this commit effectively replaces OPAL_CHECK_FUNC_LIB with AC_SEARCH_LIBS. However, we never bothered to add these found libraries to the wrapper compiler list of libraries used for static linking (doh!). We've been getting lucky for quite a while that components were adding the same libraries to their wrapper compiler LIBS list. This is problematic, however, if we don't build some of these components. For example, Paul Hargrove noticed that if he configured with --disable-shared --enable-static --disable-io-romio, ROMIO was no longer adding some libraries to the wrapper LIBS list -- libraries that just happened to also be needed by core OPAL/ORTE/OMPI layers. The solution is not to use AC_CHECK_LIB or OPAL_CHECK_FUNC_LIB, but use a pair of new macros: * OPAL_SEARCH_LIBS_CORE: a wrapper around AC_SEARCH_LIBS. If we add something to $LIBS, then also add it to the wrapper list of static libraries. This is the main piece of functionality that was wrong/missing. * OPAL_SEARCH_LIBS_COMPONENT: similar to OPAL_SEARCH_LIBS_CORE, but instead of directly adding it to the wrapper list of static libaries, add it to <framework>_<component>_LIBS (which eventually gets slurped up into the wrapper list of static libraries. See the lengthy comment in config/opal_setup_wrappers.m4 near the beginning of OPAL_SETUP_WRAPPER_INIT() for a more detailed explanation). Most components did this correctly already, but one or two weren't right, so I implemented this second macro quite similar to the first and put it everywhere we already used AC_SEARCH_LIBS or OPAL_CHECK_FUNC_LIB. This needs to soak for a day or two on the trunk before moving to the v1.8 branch. Refs trac:4834 cmr=v1.8.2:reviewer=ggouaillardet This commit was SVN r32447. The following Trac tickets were found above: Ticket 4834 --> https://svn.open-mpi.org/trac/ompi/ticket/4834
2014-08-08 03:54:45 +04:00
LIBS_save=$LIBS
AC_SEARCH_LIBS([$1], [$2],
[ # Found it! See if anything was added to LIBS
add=`printf '%s\n' "$LIBS" | sed -e "s/$LIBS_save$//"`
AS_IF([test -n "$add"],
[OPAL_WRAPPER_FLAGS_ADD([LIBS], [$add])])
opal_have_$1=1
configury: ensure wrapper static LIBS is filled properly In core library portions of the configury (e.g., top-level configure.ac itself), we were calling AC_CHECK_LIB and OPAL_CHECK_FUNC_LIB to check for various libraries. '''SIDENOTE:''' It turns out that modern Autoconf has AC_SEARCH_LIBS, which does just about exactly what OPAL_CHECK_FUNC_LIB does. So this commit effectively replaces OPAL_CHECK_FUNC_LIB with AC_SEARCH_LIBS. However, we never bothered to add these found libraries to the wrapper compiler list of libraries used for static linking (doh!). We've been getting lucky for quite a while that components were adding the same libraries to their wrapper compiler LIBS list. This is problematic, however, if we don't build some of these components. For example, Paul Hargrove noticed that if he configured with --disable-shared --enable-static --disable-io-romio, ROMIO was no longer adding some libraries to the wrapper LIBS list -- libraries that just happened to also be needed by core OPAL/ORTE/OMPI layers. The solution is not to use AC_CHECK_LIB or OPAL_CHECK_FUNC_LIB, but use a pair of new macros: * OPAL_SEARCH_LIBS_CORE: a wrapper around AC_SEARCH_LIBS. If we add something to $LIBS, then also add it to the wrapper list of static libraries. This is the main piece of functionality that was wrong/missing. * OPAL_SEARCH_LIBS_COMPONENT: similar to OPAL_SEARCH_LIBS_CORE, but instead of directly adding it to the wrapper list of static libaries, add it to <framework>_<component>_LIBS (which eventually gets slurped up into the wrapper list of static libraries. See the lengthy comment in config/opal_setup_wrappers.m4 near the beginning of OPAL_SETUP_WRAPPER_INIT() for a more detailed explanation). Most components did this correctly already, but one or two weren't right, so I implemented this second macro quite similar to the first and put it everywhere we already used AC_SEARCH_LIBS or OPAL_CHECK_FUNC_LIB. This needs to soak for a day or two on the trunk before moving to the v1.8 branch. Refs trac:4834 cmr=v1.8.2:reviewer=ggouaillardet This commit was SVN r32447. The following Trac tickets were found above: Ticket 4834 --> https://svn.open-mpi.org/trac/ompi/ticket/4834
2014-08-08 03:54:45 +04:00
$3],
[opal_have_$1=0
$4], [$5])
AC_DEFINE_UNQUOTED([OPAL_HAVE_]m4_toupper($1), [$opal_have_$1],
[whether $1 is found and available])
configury: ensure wrapper static LIBS is filled properly In core library portions of the configury (e.g., top-level configure.ac itself), we were calling AC_CHECK_LIB and OPAL_CHECK_FUNC_LIB to check for various libraries. '''SIDENOTE:''' It turns out that modern Autoconf has AC_SEARCH_LIBS, which does just about exactly what OPAL_CHECK_FUNC_LIB does. So this commit effectively replaces OPAL_CHECK_FUNC_LIB with AC_SEARCH_LIBS. However, we never bothered to add these found libraries to the wrapper compiler list of libraries used for static linking (doh!). We've been getting lucky for quite a while that components were adding the same libraries to their wrapper compiler LIBS list. This is problematic, however, if we don't build some of these components. For example, Paul Hargrove noticed that if he configured with --disable-shared --enable-static --disable-io-romio, ROMIO was no longer adding some libraries to the wrapper LIBS list -- libraries that just happened to also be needed by core OPAL/ORTE/OMPI layers. The solution is not to use AC_CHECK_LIB or OPAL_CHECK_FUNC_LIB, but use a pair of new macros: * OPAL_SEARCH_LIBS_CORE: a wrapper around AC_SEARCH_LIBS. If we add something to $LIBS, then also add it to the wrapper list of static libraries. This is the main piece of functionality that was wrong/missing. * OPAL_SEARCH_LIBS_COMPONENT: similar to OPAL_SEARCH_LIBS_CORE, but instead of directly adding it to the wrapper list of static libaries, add it to <framework>_<component>_LIBS (which eventually gets slurped up into the wrapper list of static libraries. See the lengthy comment in config/opal_setup_wrappers.m4 near the beginning of OPAL_SETUP_WRAPPER_INIT() for a more detailed explanation). Most components did this correctly already, but one or two weren't right, so I implemented this second macro quite similar to the first and put it everywhere we already used AC_SEARCH_LIBS or OPAL_CHECK_FUNC_LIB. This needs to soak for a day or two on the trunk before moving to the v1.8 branch. Refs trac:4834 cmr=v1.8.2:reviewer=ggouaillardet This commit was SVN r32447. The following Trac tickets were found above: Ticket 4834 --> https://svn.open-mpi.org/trac/ompi/ticket/4834
2014-08-08 03:54:45 +04:00
OPAL_VAR_SCOPE_POP
])dnl
# OPAL SEARCH_LIBS_COMPONENT(prefix, func, list-of-libraries,
# action-if-found, action-if-not-found,
# other-libraries)
#
# Same as OPAL SEARCH_LIBS_CORE, above, except that we don't call OPAL
# WRAPPER_FLAGS_ADD. Instead, we add it to the ${prefix}_LIBS
# variable (i.e., $prefix is usually "framework_component", such as
# "fbtl_posix").
AC_DEFUN([OPAL_SEARCH_LIBS_COMPONENT],[
m4_ifndef([mca_component_configure_active],
[m4_fatal([*** OPAL_SEARCH_LIBS_COMPONENT can only be called from a component configure.m4])])
OPAL_VAR_SCOPE_PUSH([LIBS_save add])
configury: ensure wrapper static LIBS is filled properly In core library portions of the configury (e.g., top-level configure.ac itself), we were calling AC_CHECK_LIB and OPAL_CHECK_FUNC_LIB to check for various libraries. '''SIDENOTE:''' It turns out that modern Autoconf has AC_SEARCH_LIBS, which does just about exactly what OPAL_CHECK_FUNC_LIB does. So this commit effectively replaces OPAL_CHECK_FUNC_LIB with AC_SEARCH_LIBS. However, we never bothered to add these found libraries to the wrapper compiler list of libraries used for static linking (doh!). We've been getting lucky for quite a while that components were adding the same libraries to their wrapper compiler LIBS list. This is problematic, however, if we don't build some of these components. For example, Paul Hargrove noticed that if he configured with --disable-shared --enable-static --disable-io-romio, ROMIO was no longer adding some libraries to the wrapper LIBS list -- libraries that just happened to also be needed by core OPAL/ORTE/OMPI layers. The solution is not to use AC_CHECK_LIB or OPAL_CHECK_FUNC_LIB, but use a pair of new macros: * OPAL_SEARCH_LIBS_CORE: a wrapper around AC_SEARCH_LIBS. If we add something to $LIBS, then also add it to the wrapper list of static libraries. This is the main piece of functionality that was wrong/missing. * OPAL_SEARCH_LIBS_COMPONENT: similar to OPAL_SEARCH_LIBS_CORE, but instead of directly adding it to the wrapper list of static libaries, add it to <framework>_<component>_LIBS (which eventually gets slurped up into the wrapper list of static libraries. See the lengthy comment in config/opal_setup_wrappers.m4 near the beginning of OPAL_SETUP_WRAPPER_INIT() for a more detailed explanation). Most components did this correctly already, but one or two weren't right, so I implemented this second macro quite similar to the first and put it everywhere we already used AC_SEARCH_LIBS or OPAL_CHECK_FUNC_LIB. This needs to soak for a day or two on the trunk before moving to the v1.8 branch. Refs trac:4834 cmr=v1.8.2:reviewer=ggouaillardet This commit was SVN r32447. The following Trac tickets were found above: Ticket 4834 --> https://svn.open-mpi.org/trac/ompi/ticket/4834
2014-08-08 03:54:45 +04:00
LIBS_save=$LIBS
AC_SEARCH_LIBS([$2], [$3],
[ # Found it! See if anything was added to LIBS
add=`printf '%s\n' "$LIBS" | sed -e "s/$LIBS_save$//"`
AS_IF([test -n "$add"],
[OPAL_FLAGS_APPEND_UNIQ($1_LIBS, [$add])])
$1_have_$2=1
configury: ensure wrapper static LIBS is filled properly In core library portions of the configury (e.g., top-level configure.ac itself), we were calling AC_CHECK_LIB and OPAL_CHECK_FUNC_LIB to check for various libraries. '''SIDENOTE:''' It turns out that modern Autoconf has AC_SEARCH_LIBS, which does just about exactly what OPAL_CHECK_FUNC_LIB does. So this commit effectively replaces OPAL_CHECK_FUNC_LIB with AC_SEARCH_LIBS. However, we never bothered to add these found libraries to the wrapper compiler list of libraries used for static linking (doh!). We've been getting lucky for quite a while that components were adding the same libraries to their wrapper compiler LIBS list. This is problematic, however, if we don't build some of these components. For example, Paul Hargrove noticed that if he configured with --disable-shared --enable-static --disable-io-romio, ROMIO was no longer adding some libraries to the wrapper LIBS list -- libraries that just happened to also be needed by core OPAL/ORTE/OMPI layers. The solution is not to use AC_CHECK_LIB or OPAL_CHECK_FUNC_LIB, but use a pair of new macros: * OPAL_SEARCH_LIBS_CORE: a wrapper around AC_SEARCH_LIBS. If we add something to $LIBS, then also add it to the wrapper list of static libraries. This is the main piece of functionality that was wrong/missing. * OPAL_SEARCH_LIBS_COMPONENT: similar to OPAL_SEARCH_LIBS_CORE, but instead of directly adding it to the wrapper list of static libaries, add it to <framework>_<component>_LIBS (which eventually gets slurped up into the wrapper list of static libraries. See the lengthy comment in config/opal_setup_wrappers.m4 near the beginning of OPAL_SETUP_WRAPPER_INIT() for a more detailed explanation). Most components did this correctly already, but one or two weren't right, so I implemented this second macro quite similar to the first and put it everywhere we already used AC_SEARCH_LIBS or OPAL_CHECK_FUNC_LIB. This needs to soak for a day or two on the trunk before moving to the v1.8 branch. Refs trac:4834 cmr=v1.8.2:reviewer=ggouaillardet This commit was SVN r32447. The following Trac tickets were found above: Ticket 4834 --> https://svn.open-mpi.org/trac/ompi/ticket/4834
2014-08-08 03:54:45 +04:00
$4],
[$1_have_$2=0
$5], [$6])
configury: ensure wrapper static LIBS is filled properly In core library portions of the configury (e.g., top-level configure.ac itself), we were calling AC_CHECK_LIB and OPAL_CHECK_FUNC_LIB to check for various libraries. '''SIDENOTE:''' It turns out that modern Autoconf has AC_SEARCH_LIBS, which does just about exactly what OPAL_CHECK_FUNC_LIB does. So this commit effectively replaces OPAL_CHECK_FUNC_LIB with AC_SEARCH_LIBS. However, we never bothered to add these found libraries to the wrapper compiler list of libraries used for static linking (doh!). We've been getting lucky for quite a while that components were adding the same libraries to their wrapper compiler LIBS list. This is problematic, however, if we don't build some of these components. For example, Paul Hargrove noticed that if he configured with --disable-shared --enable-static --disable-io-romio, ROMIO was no longer adding some libraries to the wrapper LIBS list -- libraries that just happened to also be needed by core OPAL/ORTE/OMPI layers. The solution is not to use AC_CHECK_LIB or OPAL_CHECK_FUNC_LIB, but use a pair of new macros: * OPAL_SEARCH_LIBS_CORE: a wrapper around AC_SEARCH_LIBS. If we add something to $LIBS, then also add it to the wrapper list of static libraries. This is the main piece of functionality that was wrong/missing. * OPAL_SEARCH_LIBS_COMPONENT: similar to OPAL_SEARCH_LIBS_CORE, but instead of directly adding it to the wrapper list of static libaries, add it to <framework>_<component>_LIBS (which eventually gets slurped up into the wrapper list of static libraries. See the lengthy comment in config/opal_setup_wrappers.m4 near the beginning of OPAL_SETUP_WRAPPER_INIT() for a more detailed explanation). Most components did this correctly already, but one or two weren't right, so I implemented this second macro quite similar to the first and put it everywhere we already used AC_SEARCH_LIBS or OPAL_CHECK_FUNC_LIB. This needs to soak for a day or two on the trunk before moving to the v1.8 branch. Refs trac:4834 cmr=v1.8.2:reviewer=ggouaillardet This commit was SVN r32447. The following Trac tickets were found above: Ticket 4834 --> https://svn.open-mpi.org/trac/ompi/ticket/4834
2014-08-08 03:54:45 +04:00
AC_DEFINE_UNQUOTED([OPAL_HAVE_]m4_toupper($1), [$$1_have_$2],
[whether $1 is found and available])
configury: ensure wrapper static LIBS is filled properly In core library portions of the configury (e.g., top-level configure.ac itself), we were calling AC_CHECK_LIB and OPAL_CHECK_FUNC_LIB to check for various libraries. '''SIDENOTE:''' It turns out that modern Autoconf has AC_SEARCH_LIBS, which does just about exactly what OPAL_CHECK_FUNC_LIB does. So this commit effectively replaces OPAL_CHECK_FUNC_LIB with AC_SEARCH_LIBS. However, we never bothered to add these found libraries to the wrapper compiler list of libraries used for static linking (doh!). We've been getting lucky for quite a while that components were adding the same libraries to their wrapper compiler LIBS list. This is problematic, however, if we don't build some of these components. For example, Paul Hargrove noticed that if he configured with --disable-shared --enable-static --disable-io-romio, ROMIO was no longer adding some libraries to the wrapper LIBS list -- libraries that just happened to also be needed by core OPAL/ORTE/OMPI layers. The solution is not to use AC_CHECK_LIB or OPAL_CHECK_FUNC_LIB, but use a pair of new macros: * OPAL_SEARCH_LIBS_CORE: a wrapper around AC_SEARCH_LIBS. If we add something to $LIBS, then also add it to the wrapper list of static libraries. This is the main piece of functionality that was wrong/missing. * OPAL_SEARCH_LIBS_COMPONENT: similar to OPAL_SEARCH_LIBS_CORE, but instead of directly adding it to the wrapper list of static libaries, add it to <framework>_<component>_LIBS (which eventually gets slurped up into the wrapper list of static libraries. See the lengthy comment in config/opal_setup_wrappers.m4 near the beginning of OPAL_SETUP_WRAPPER_INIT() for a more detailed explanation). Most components did this correctly already, but one or two weren't right, so I implemented this second macro quite similar to the first and put it everywhere we already used AC_SEARCH_LIBS or OPAL_CHECK_FUNC_LIB. This needs to soak for a day or two on the trunk before moving to the v1.8 branch. Refs trac:4834 cmr=v1.8.2:reviewer=ggouaillardet This commit was SVN r32447. The following Trac tickets were found above: Ticket 4834 --> https://svn.open-mpi.org/trac/ompi/ticket/4834
2014-08-08 03:54:45 +04:00
OPAL_VAR_SCOPE_POP
])dnl