Skip to content

Fix DIR, DIR/include search for --with-pmix #4683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions config/opal_check_package.m4
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ AC_DEFUN([_OPAL_CHECK_PACKAGE_HEADER], [
[# no go on the as is - reset the cache and try again
unset opal_Header])])

AS_IF([test "$opal_check_package_header_happy" = "no"],
[AS_IF([test "$dir_prefix" != ""],
[$1_CPPFLAGS="$$1_CPPFLAGS -I$dir_prefix"
CPPFLAGS="$CPPFLAGS -I$dir_prefix"])
AC_CHECK_HEADERS([$2], [opal_check_package_header_happy="yes"], [], [$6])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pkovacs @jsquyres @rhc54 @ggouaillardet @yosefe @jladd-mlnx This check is wrong when the package headers are installed in /usr/include but configure was called with the specific package dir. The check will pickup h file from the /usr/include and add -I$dir_prefix to the CPPFLAGS which is wrong.

Copy link
Contributor Author

@pkovacs pkovacs Jan 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so we can add /usr/include and /usr/local/include filters to the to code block above that (lines 44, 45) which will handle the --with-foo=/usr/include and --with-foo='/usr/include/local cases without adding unnecessary CPPFLAGS

    AS_IF([test "$dir_prefix" = "/usr" || \
           test "$dir_prefix" = "/usr/local || \
           test "$dir_prefix" = "/usr/include || \
           test "$dir_prefix" = "/usr/local/include"],

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added #4722 to correct the concern above.

AS_IF([test "$opal_check_package_header_happy" = "no"],
[# no go on the as is - reset the cache and try again
unset opal_Header])])

AS_IF([test "$opal_check_package_header_happy" = "no"],
[AS_IF([test "$dir_prefix" != ""],
[$1_CPPFLAGS="$$1_CPPFLAGS -I$dir_prefix/include"
Expand Down
62 changes: 20 additions & 42 deletions config/opal_check_pmi.m4
Original file line number Diff line number Diff line change
Expand Up @@ -257,36 +257,18 @@ AC_DEFUN([OPAL_CHECK_PMIX],[
[pmix_ext_install_dir=/usr],
[pmix_ext_install_dir=$with_pmix])

# Make sure we have the headers and libs in the correct location
OPAL_CHECK_WITHDIR([external-pmix], [$pmix_ext_install_dir/include], [pmix.h])

AS_IF([test -n "$with_pmix_libdir"],
[AC_MSG_CHECKING([libpmix.* in $with_pmix_libdir])
files=`ls $with_pmix_libdir/libpmix.* 2> /dev/null | wc -l`
AS_IF([test "$files" -gt 0],
[pmix_ext_install_libdir=$with_pmix_libdir],
[AC_MSG_CHECKING([libpmix.* in $with_pmix_libdir/lib64])
files=`ls $with_pmix_libdir/lib64/libpmix.* 2> /dev/null | wc -l`
AS_IF([test "$files" -gt 0],
[pmix_ext_install_libdir=$with_pmix_libdir/lib64],
[AC_MSG_CHECKING([libpmix.* in $with_pmix_libdir/lib])
files=`ls $with_pmix_libdir/lib/libpmix.* 2> /dev/null | wc -l`
AS_IF([test "$files" -gt 0],
[pmix_ext_install_libdir=$with_pmix_libdir/lib],
[AC_MSG_RESULT([not found])
AC_MSG_ERROR([Cannot continue])])])])],
[# check for presence of lib64 directory - if found, see if the
# desired library is present and matches our build requirements
AC_MSG_CHECKING([libpmix.* in $pmix_ext_install_dir/lib64])
files=`ls $pmix_ext_install_dir/lib64/libpmix.* 2> /dev/null | wc -l`
AS_IF([test "$files" -gt 0],
[pmix_ext_install_libdir=$pmix_ext_install_dir/lib64],
[AC_MSG_CHECKING([libpmix.* in $pmix_ext_install_dir/lib])
files=`ls $pmix_ext_install_dir/lib/libpmix.* 2> /dev/null | wc -l`
AS_IF([test "$files" -gt 0],
[pmix_ext_install_libdir=$pmix_ext_install_dir/lib],
[AC_MSG_RESULT([not found])
AC_MSG_ERROR([Cannot continue])])])])
AS_IF([test ! -z "$with_pmix_libdir" && test "$with_pmix_libdir" != "yes"],
[pmix_ext_install_libdir="$with_pmix_libdir"])

OPAL_CHECK_PACKAGE([opal_external_pmix],
[pmix.h],
[pmix],
[PMIx_Init],
[],
[$pmix_ext_install_dir],
[$pmix_ext_install_libdir],
[],
[AC_MSG_ERROR([external pmix not found])])

# check the version
opal_external_pmix_save_CPPFLAGS=$CPPFLAGS
Expand All @@ -296,14 +278,14 @@ AC_DEFUN([OPAL_CHECK_PMIX],[
# if the pmix_version.h file does not exist, then
# this must be from a pre-1.1.5 version
AC_MSG_CHECKING([PMIx version])
CPPFLAGS="-I$pmix_ext_install_dir/include $CPPFLAGS"
AS_IF([test "x`ls $pmix_ext_install_dir/include/pmix_version.h 2> /dev/null`" = "x"],
[AC_MSG_RESULT([version file not found - assuming v1.1.4])
opal_external_pmix_version_found=1
opal_external_pmix_version=114
opal_external_have_pmix1=1],
[AC_MSG_RESULT([version file found])
opal_external_pmix_version_found=0])
CPPFLAGS=$opal_external_pmix_CPPFLAGS
AC_CHECK_HEADER([pmix_version.h],
[AC_MSG_RESULT([version file found])
opal_external_pmix_version_found=0],
[AC_MSG_RESULT([version file not found - assuming v1.1.4])
opal_external_pmix_version_found=1
opal_external_pmix_version=114
opal_external_have_pmix1=1])

# if it does exist, then we need to parse it to find
# the actual release series
Expand Down Expand Up @@ -358,10 +340,6 @@ AC_DEFUN([OPAL_CHECK_PMIX],[
LDFLAGS=$opal_external_pmix_save_LDFLAGS
LIBS=$opal_external_pmix_save_LIBS

AS_IF([test "$pmix_ext_install_dir" != "/usr"],
[opal_external_pmix_CPPFLAGS="-I$pmix_ext_install_dir/include"
opal_external_pmix_LDFLAGS=-L$pmix_ext_install_libdir])
opal_external_pmix_LIBS=-lpmix
opal_external_pmix_happy=yes])

AC_DEFINE_UNQUOTED([OPAL_PMIX_V1],[$opal_external_have_pmix1],
Expand Down