Continue cleanup of the PMI config code. Eliminate the multiple calls to check for pmi1 and pmi2 - we must check it only once to get the pmix components to build only in the correct situations. Ensure we set the wrapper flags so we handle static builds correctly.
Этот коммит содержится в:
родитель
b4e445afb5
Коммит
4f0c1ae8d9
@ -26,42 +26,41 @@
|
||||
# define an internal function for checking the existence
|
||||
# and validity of a PMI library
|
||||
#
|
||||
# OPAL_CHECK_PMI_LIB(installdir, pmi, function, [action-if-valid], [action-if-not-valid])
|
||||
# OPAL_CHECK_PMI_LIB(installdir, pmi, function, [action-if-slurm], [action-if-valid], [action-if-not-valid])
|
||||
# --------------------------------------------------------
|
||||
AC_DEFUN([OPAL_CHECK_PMI_LIB],
|
||||
[
|
||||
OPAL_VAR_SCOPE_PUSH([save_LDFLAGS save_CPPFLAGS save_LIBS hdr_happy lib_happy files mycppflags])
|
||||
|
||||
# save flags
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
save_LDFLAGS="$LDFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
hdr_happy=
|
||||
mycppflags=
|
||||
opal_check_$2_save_CPPFLAGS=$CPPFLAGS
|
||||
opal_check_$2_save_LDFLAGS=$LDFLAGS
|
||||
opal_check_$2_save_LIBS=$LIBS
|
||||
opal_check_$2_hdr_happy=
|
||||
opal_check_$2_mycppflags=
|
||||
|
||||
# check for the header
|
||||
AC_MSG_CHECKING([for $2.h in $1/include])
|
||||
AS_IF([test -f $1/include/$2.h],
|
||||
[AC_MSG_RESULT([found])
|
||||
mycppflags="-I$1/include"],
|
||||
opal_check_$2_mycppflags="-I$1/include"],
|
||||
[AC_MSG_RESULT([not found])
|
||||
AC_MSG_CHECKING([for $2.h in $1/include/slurm])
|
||||
AS_IF([test -f $1/include/slurm/$2.h],
|
||||
[AC_MSG_RESULT([found])
|
||||
mycppflags="-I$1/include/slurm"],
|
||||
opal_check_$2_mycppflags="-I$1/include/slurm"
|
||||
$4],
|
||||
[AC_MSG_RESULT([not found])
|
||||
hdr_happy=no])])
|
||||
opal_check_$2_hdr_happy=no])])
|
||||
|
||||
AS_IF([test "$hdr_happy" != "no"],
|
||||
[CPPFLAGS="$CPPFLAGS $mycppflags"
|
||||
AS_IF([test "$opal_check_$2_hdr_happy" != "no"],
|
||||
[CPPFLAGS="$CPPFLAGS $opal_check_$2_mycppflags"
|
||||
AC_CHECK_HEADER([$2.h],
|
||||
[hdr_happy=yes
|
||||
$2_CPPFLAGS="$mycppflags"],
|
||||
[hdr_happy=no])])
|
||||
[opal_check_$2_hdr_happy=yes
|
||||
$2_CPPFLAGS="$opal_check_$2_mycppflags"],
|
||||
[opal_check_$2_hdr_happy=no])])
|
||||
|
||||
# check for presence of lib64 directory - if found, see if the
|
||||
# desired library is present and matches our build requirements
|
||||
lib_happy=
|
||||
opal_check_$2_lib_happy=
|
||||
LIBS="$LIBS -l$2"
|
||||
AC_MSG_CHECKING([for lib$2 in $1/lib64])
|
||||
files=`ls $1/lib64/lib$2.* 2> /dev/null | wc -l`
|
||||
@ -69,60 +68,52 @@ AC_DEFUN([OPAL_CHECK_PMI_LIB],
|
||||
[AC_MSG_RESULT([found])
|
||||
LDFLAGS="$LDFLAGS -L$1/lib64"
|
||||
AC_CHECK_LIB([$2], [$3],
|
||||
[lib_happy=yes
|
||||
$2_LDFLAGS="-L$1/lib64"
|
||||
$2_rpath="$1/lib64"],
|
||||
[lib_happy=no])],
|
||||
[opal_check_$2_lib_happy=yes
|
||||
$2_LDFLAGS=-L$1/lib64
|
||||
$2_rpath=$1/lib64],
|
||||
[opal_check_$2_lib_happy=no])],
|
||||
[AC_MSG_RESULT([not found])])
|
||||
|
||||
|
||||
# if we didn't find lib64, or the library wasn't present or correct,
|
||||
# then try a lib directory if present
|
||||
files=`ls $1/lib/lib$2.* 2> /dev/null | wc -l`
|
||||
AS_IF([test "$lib_happy" != "yes"],
|
||||
AS_IF([test "$opal_check_$2_lib_happy" != "yes"],
|
||||
[AC_MSG_CHECKING([for lib$2 in $1/lib])
|
||||
AS_IF([test "$files" -gt "0"],
|
||||
[AC_MSG_RESULT([found])
|
||||
LDFLAGS="$LDFLAGS -L$1/lib"
|
||||
AC_CHECK_LIB([$2], [$3],
|
||||
[lib_happy=yes
|
||||
$2_LDFLAGS="-L$1/lib"
|
||||
$2_rpath="$1/lib"],
|
||||
[lib_happy=no])],
|
||||
[lib_happy=no
|
||||
[opal_check_$2_lib_happy=yes
|
||||
$2_LDFLAGS=-L$1/lib
|
||||
$2_rpath=$1/lib],
|
||||
[opal_check_$2_lib_happy=no])],
|
||||
[opal_check_$2_lib_happy=no
|
||||
AC_MSG_RESULT([not found])])])
|
||||
|
||||
# restore flags
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
LDFLAGS="$save_LDFLAGS"
|
||||
LIBS="$save_LIBS"
|
||||
CPPFLAGS=$opal_check_$2_save_CPPFLAGS
|
||||
LDFLAGS=$opal_check_$2_save_LDFLAGS
|
||||
LIBS=$opal_check_$2_save_LIBS
|
||||
|
||||
AS_IF([test "$hdr_happy" = "yes" && test "$lib_happy" = "yes"],
|
||||
[$4], [$5])
|
||||
AS_IF([test "$opal_check_$2_hdr_happy" = "yes" && test "$opal_check_$2_lib_happy" = "yes"],
|
||||
[$5], [$6])
|
||||
|
||||
OPAL_VAR_SCOPE_POP
|
||||
])
|
||||
|
||||
# OPAL_CHECK_PMI(prefix, [action-if-found], [action-if-not-found])
|
||||
# OPAL_CHECK_PMI()
|
||||
# --------------------------------------------------------
|
||||
AC_DEFUN([OPAL_CHECK_PMI],[
|
||||
|
||||
OPAL_VAR_SCOPE_PUSH([check_install_dir have_pmi1 have_pmi2 added_flags default_loc have_rpath local_libs])
|
||||
|
||||
AC_ARG_WITH([pmi],
|
||||
[AC_HELP_STRING([--with-pmi(=DIR)],
|
||||
[Build PMI support, optionally adding DIR to the search path (default: no)])],
|
||||
[], with_pmi=no)
|
||||
|
||||
opal_enable_pmi=0
|
||||
have_pmi2=no
|
||||
have_pmi1=no
|
||||
check_install_dir=
|
||||
added_flags=no
|
||||
$1_LIBS=
|
||||
have_rpath=
|
||||
local_libs=
|
||||
|
||||
check_pmi_install_dir=
|
||||
default_pmi_loc=
|
||||
slurm_pmi_found=
|
||||
|
||||
AC_MSG_CHECKING([if user requested PMI support])
|
||||
AS_IF([test "$with_pmi" = "no"],
|
||||
[AC_MSG_RESULT([no])
|
||||
@ -132,55 +123,61 @@ AC_DEFUN([OPAL_CHECK_PMI],[
|
||||
# support appends "include" to the path, which won't
|
||||
# work with slurm :-(
|
||||
AS_IF([test ! -z "$with_pmi" && test "$with_pmi" != "yes"],
|
||||
[check_install_dir=$with_pmi
|
||||
default_loc="no"],
|
||||
[check_install_dir="/usr"
|
||||
default_loc="yes"])
|
||||
[check_pmi_install_dir=$with_pmi
|
||||
default_pmi_loc=no],
|
||||
[check_pmi_install_dir=/usr
|
||||
default_pmi_loc=yes])
|
||||
|
||||
# check for pmi-1 lib */
|
||||
OPAL_CHECK_PMI_LIB([$check_install_dir],
|
||||
slurm_pmi_found=no
|
||||
OPAL_CHECK_PMI_LIB([$check_pmi_install_dir],
|
||||
[pmi], [PMI_Init],
|
||||
[have_pmi1=yes
|
||||
AS_IF([test "$default_loc" = "no"],
|
||||
[$1_CPPFLAGS="$pmi_CPPFLAGS"
|
||||
$1_LDFLAGS="$pmi_LDFLAGS"
|
||||
have_rpath="$pmi_rpath"
|
||||
added_flags=yes])
|
||||
local_libs="$pmi_LIBS"],
|
||||
[have_pmi1=no])
|
||||
[slurm_pmi_found=yes],
|
||||
[opal_enable_pmi1=yes
|
||||
opal_pmi1_LIBS="-lpmi"
|
||||
AC_SUBST(opal_pmi1_LIBS)],
|
||||
[opal_enable_pmi1=no])
|
||||
|
||||
AS_IF([test "$opal_enable_pmi1" = "yes"],
|
||||
[AS_IF([test "$default_pmi_loc" = "no" || test "$slurm_pmi_found" = "yes"],
|
||||
[opal_pmi1_CPPFLAGS="$pmi_CPPFLAGS"
|
||||
AC_SUBST(opal_pmi1_CPPFLAGS)
|
||||
opal_pmi1_LDFLAGS="$pmi_LDFLAGS"
|
||||
AC_SUBST(opal_pmi1_LDFLAGS)
|
||||
opal_pmi1_rpath="$pmi_rpath"
|
||||
AC_SUBST(opal_pmi1_rpath)])])
|
||||
|
||||
# check for pmi2 lib */
|
||||
OPAL_CHECK_PMI_LIB([$check_install_dir],
|
||||
slurm_pmi_found=no
|
||||
OPAL_CHECK_PMI_LIB([$check_pmi_install_dir],
|
||||
[pmi2], [PMI2_Init],
|
||||
[have_pmi2=yes
|
||||
opal_have_pmi2=1
|
||||
AS_IF([test "$default_loc" = "no" && test "$added_flags" = "no"],
|
||||
[$1_CPPFLAGS="$pmi2_CPPFLAGS"
|
||||
$1_LDFLAGS="$pmi2_LDFLAGS"
|
||||
have_rpath="$pmi2_rpath"])
|
||||
local_libs="local_libs $pmi2_LIBS"],
|
||||
[have_pmi2=no])
|
||||
[slurm_pmi_found=yes],
|
||||
[opal_enable_pmi2=yes
|
||||
opal_pmi2_LIBS="-lpmi2"
|
||||
AC_SUBST(opal_pmi2_LIBS)],
|
||||
[opal_enable_pmi2=no])
|
||||
|
||||
AS_IF([test "$opal_enable_pmi2" = "yes"],
|
||||
[AS_IF([test "$default_pmi_loc" = "no" || test "$slurm_pmi_found" = "yes"],
|
||||
[opal_pmi2_CPPFLAGS="$pmi2_CPPFLAGS"
|
||||
AC_SUBST(opal_pmi2_CPPFLAGS)
|
||||
opal_pmi2_LDFLAGS="$pmi2_LDFLAGS"
|
||||
AC_SUBST(opal_pmi2_LDFLAGS)
|
||||
opal_pmi2_rpath="$pmi2_rpath"
|
||||
AC_SUBST(opal_pmi2_rpath)])])
|
||||
|
||||
# since support was explicitly requested, then we should error out
|
||||
# if we didn't find the required support
|
||||
AS_IF([test "$have_pmi1" != "yes" && test "$have_pmi2" != "yes"],
|
||||
AS_IF([test "$opal_enable_pmi1" != "yes" && test "$opal_enable_pmi2" != "yes"],
|
||||
[AC_MSG_RESULT([not found])
|
||||
AC_MSG_WARN([PMI support requested (via --with-pmi) but neither libpmi])
|
||||
AC_MSG_WARN([nor libpmi2 were found under locations:])
|
||||
AC_MSG_WARN([ $check_install_dir/lib])
|
||||
AC_MSG_WARN([ $check_install_dir/lib64])
|
||||
AC_MSG_WARN([Specified path: $with_pmi])
|
||||
AC_MSG_ERROR([Aborting])
|
||||
$3],
|
||||
[AC_MSG_RESULT([yes])
|
||||
opal_enable_pmi=1
|
||||
$1_LIBS="$local_libs -Wl,-rpath=$have_rpath"
|
||||
AC_MSG_CHECKING([final added libraries])
|
||||
AC_MSG_RESULT([$local_libs])
|
||||
$2])
|
||||
AC_MSG_ERROR([Aborting])],
|
||||
[AC_MSG_RESULT([yes])])
|
||||
])
|
||||
|
||||
OPAL_VAR_SCOPE_POP
|
||||
])
|
||||
|
||||
#
|
||||
|
@ -1,28 +0,0 @@
|
||||
dnl -*- shell-script -*-
|
||||
dnl
|
||||
dnl Copyright (c) 2014 Intel, Inc. All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
AC_DEFUN([MCA_opal_pmix_CONFIG],[
|
||||
|
||||
# configure all the components first
|
||||
MCA_CONFIGURE_FRAMEWORK($1, $2, 1)
|
||||
|
||||
# Get the CPPFLAGS for the PMI headers
|
||||
AC_MSG_CHECKING([for PMI headers])
|
||||
OPAL_CHECK_PMI([pmix], [opal_pmix_happy=1], [opal_pmix_happy=0])
|
||||
OPAL_CHECK_CRAY_PMI([pmix], [opal_pmix_cray_happy=1], [opal_pmix_cray_happy=0])
|
||||
AS_IF([test $opal_pmix_happy = 1 -o $opal_pmix_cray_happy = 1],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])])
|
||||
|
||||
# add the required make directives - we only care about the CPPFLAGS
|
||||
AC_MSG_CHECKING([for PMIX CPPFLAGS])
|
||||
AC_SUBST([pmix_CPPFLAGS])
|
||||
AC_MSG_RESULT([$pmix_CPPFLAGS])
|
||||
])dnl
|
@ -20,7 +20,10 @@ AC_DEFUN([MCA_opal_pmix_cray_CONFIG], [
|
||||
|
||||
# Evaluate succeed / fail
|
||||
AS_IF([test "$pmix_cray_good" = 1],
|
||||
[$1],
|
||||
[$1
|
||||
# need to set the wrapper flags for static builds
|
||||
pmix_cray_WRAPPER_EXTRA_LDFLAGS="$pmix_cray_LDFLAGS"
|
||||
pmix_cray_WRAPPER_EXTRA_LIBS="$pmix_cray_LIBS"],
|
||||
[$2])
|
||||
|
||||
# set build flags to use in makefile
|
||||
|
@ -27,12 +27,12 @@ endif
|
||||
mcacomponentdir = $(opallibdir)
|
||||
mcacomponent_LTLIBRARIES = $(component_install)
|
||||
mca_pmix_s1_la_SOURCES = $(sources)
|
||||
mca_pmix_s1_la_CPPFLAGS = $(pmix_s1_CPPFLAGS)
|
||||
mca_pmix_s1_la_LDFLAGS = -module -avoid-version $(pmix_s1_LDFLAGS)
|
||||
mca_pmix_s1_la_LIBADD = $(pmix_s1_LIBS)
|
||||
mca_pmix_s1_la_CPPFLAGS = $(opal_pmi1_CPPFLAGS)
|
||||
mca_pmix_s1_la_LDFLAGS = -module -avoid-version $(opal_pmi1_LDFLAGS)
|
||||
mca_pmix_s1_la_LIBADD = $(opal_pmi1_LIBS)
|
||||
|
||||
noinst_LTLIBRARIES = $(component_noinst)
|
||||
libmca_pmix_s1_la_SOURCES =$(sources)
|
||||
libmca_pmix_s1_la_CPPFLAGS = $(pmix_s1_CPPFLAGS)
|
||||
libmca_pmix_s1_la_LDFLAGS = -module -avoid-version $(pmix_s1_LDFLAGS)
|
||||
libmca_pmix_s1_la_LIBADD = $(pmix_s1_LIBS)
|
||||
libmca_pmix_s1_la_CPPFLAGS = $(opal_pmi1_CPPFLAGS)
|
||||
libmca_pmix_s1_la_LDFLAGS = -module -avoid-version $(opal_pmi1_LDFLAGS)
|
||||
libmca_pmix_s1_la_LIBADD = $(opal_pmi1_LIBS)
|
||||
|
@ -14,15 +14,14 @@ AC_DEFUN([MCA_opal_pmix_s1_CONFIG], [
|
||||
AC_CONFIG_FILES([opal/mca/pmix/s1/Makefile])
|
||||
|
||||
AC_REQUIRE([OPAL_CHECK_UGNI])
|
||||
OPAL_CHECK_PMI([pmix_s1], [pmix_s1_good=1], [pmix_s1_good=0])
|
||||
AC_REQUIRE([OPAL_CHECK_PMI])
|
||||
|
||||
# Evaluate succeed / fail
|
||||
AS_IF([test "$pmix_s1_good" = 1 -a "$opal_check_ugni_happy" = "no"],
|
||||
[$1],
|
||||
AS_IF([test "$opal_enable_pmi1" = "yes" && test "$opal_check_ugni_happy" = "no"],
|
||||
[$1
|
||||
# need to set the wrapper flags for static builds
|
||||
pmix_s1_WRAPPER_EXTRA_LDFLAGS="$opal_pmi1_LDFLAGS"
|
||||
pmix_s1_WRAPPER_EXTRA_LIBS="$opal_pmi1_LIBS"],
|
||||
[$2])
|
||||
|
||||
# set build flags to use in makefile
|
||||
AC_SUBST([pmix_s1_CPPFLAGS])
|
||||
AC_SUBST([pmix_s1_LDFLAGS])
|
||||
AC_SUBST([pmix_s1_LIBS])
|
||||
])
|
||||
|
@ -11,8 +11,8 @@ sources = \
|
||||
pmix_s2.h \
|
||||
pmix_s2_component.c \
|
||||
pmix_s2.c \
|
||||
pmi2_pmap_parser.h \
|
||||
pmi2_pmap_parser.c
|
||||
pmi2_pmap_parser.h \
|
||||
pmi2_pmap_parser.c
|
||||
|
||||
# Make the output library in this directory, and name it either
|
||||
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
|
||||
@ -29,12 +29,12 @@ endif
|
||||
mcacomponentdir = $(opallibdir)
|
||||
mcacomponent_LTLIBRARIES = $(component_install)
|
||||
mca_pmix_s2_la_SOURCES = $(sources)
|
||||
mca_pmix_s2_la_CPPFLAGS = $(pmix_s2_CPPFLAGS)
|
||||
mca_pmix_s2_la_LDFLAGS = -module -avoid-version $(pmix_s2_LDFLAGS)
|
||||
mca_pmix_s2_la_LIBADD = $(pmix_s2_LIBS)
|
||||
mca_pmix_s2_la_CPPFLAGS = $(opal_pmi2_CPPFLAGS)
|
||||
mca_pmix_s2_la_LDFLAGS = -module -avoid-version $(opal_pmi2_LDFLAGS)
|
||||
mca_pmix_s2_la_LIBADD = $(opal_pmi2_LIBS)
|
||||
|
||||
noinst_LTLIBRARIES = $(component_noinst)
|
||||
libmca_pmix_s2_la_SOURCES =$(sources)
|
||||
libmca_pmix_s2_la_CPPFLAGS = $(pmix_s2_CPPFLAGS)
|
||||
libmca_pmix_s2_la_LDFLAGS = -module -avoid-version $(pmix_s2_LDFLAGS)
|
||||
libmca_pmix_s2_la_LIBADD = $(pmix_s2_LIBS)
|
||||
libmca_pmix_s2_la_CPPFLAGS = $(opal_pmi2_CPPFLAGS)
|
||||
libmca_pmix_s2_la_LDFLAGS = -module -avoid-version $(opal_pmi2_LDFLAGS)
|
||||
libmca_pmix_s2_la_LIBADD = $(opal_pmi2_LIBS)
|
||||
|
@ -14,16 +14,14 @@ AC_DEFUN([MCA_opal_pmix_s2_CONFIG], [
|
||||
AC_CONFIG_FILES([opal/mca/pmix/s2/Makefile])
|
||||
|
||||
AC_REQUIRE([OPAL_CHECK_UGNI])
|
||||
OPAL_CHECK_PMI([pmix_s2], [pmix_s2_good=1], [pmix_s2_good=0])
|
||||
AC_REQUIRE([OPAL_CHECK_PMI])
|
||||
|
||||
# Evaluate succeed / fail
|
||||
AS_IF([test "$pmix_s2_good" = 1 -a "$opal_have_pmi2" = 1 -a "$opal_check_ugni_happy" = "no"],
|
||||
[$1],
|
||||
AS_IF([test "$opal_enable_pmi2" = "yes" && test "$opal_check_ugni_happy" = "no"],
|
||||
[$1
|
||||
# need to set the wrapper flags for static builds
|
||||
pmix_s2_WRAPPER_EXTRA_LDFLAGS="$opal_pmi2_LDFLAGS"
|
||||
pmix_s2_WRAPPER_EXTRA_LIBS="$opal_pmi2_LIBS"],
|
||||
[$2])
|
||||
|
||||
# set build flags to use in makefile
|
||||
AC_SUBST([pmix_s2_CPPFLAGS])
|
||||
AC_SUBST([pmix_s2_LDFLAGS])
|
||||
AC_SUBST([pmix_s2_LIBS])
|
||||
|
||||
])
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user