I've poked at this a bit and think I have all the combinations covered - can you try the attached patch? I don't have a way to test it right now, so I don't want to put it in the trunk.
Thanks Ralph On Mon, Oct 6, 2014 at 6:02 PM, Ralph Castain <r...@open-mpi.org> wrote: > I've looked at your patch, and it isn't quite right as it only looks for > libpmi and not libpmi2. We need to look for each of them as we could have > either or both. > > I'll poke a bit at this tonight and see if I can make this a little > simpler - the nesting is getting a little deep. > > > On Mon, Oct 6, 2014 at 5:33 PM, Timothy Brown < > timothy.brow...@colorado.edu> wrote: > >> Yes, I know. Sorry I might not have articulated myself fully earlier. >> >> Currently if I run configure as: >> >> $ ./configure --prefix=/curc/tools/x_86_64/rh6/openmpi/1.8.3/intel/13.0.0 >> \ >> --with-threads=posix --enable-mpi-thread-multiple \ >> --with-pmi=/curc/slurm/slurm/current/ --with-slurm >> >> I get the following error: >> >> --- MCA component common:pmi (m4 configuration macro) >> checking for MCA component common:pmi compile mode... dso >> checking if user requested PMI support... yes >> checking if PMI or PMI2 headers installed... Slurm PMI headers found >> checking for PMI2_Init in -lpmi2... no >> checking for PMI2_Init in -lpmi... no >> checking for PMI_Init in -lpmi... no >> checking PMI2 and/or PMI support enabled... no >> configure: WARNING: PMI support requested (via --with-pmi) but not found. >> configure: error: Aborting. >> >> As the test in config/opal_check_pmi.m4 contains: >> >> [AS_IF([test -d "$with_pmi/lib64"], >> [opal_check_pmi_$1_LDFLAGS="-L$with_pmi/lib64" >> opal_pmi_rpath="$with_pmi/lib64"], >> [opal_check_pmi_$1_LDFLAGS="-L$with_pmi/lib" >> opal_pmi_rpath="$with_pmi/lib”]) >> >> And in our SLURM installation directory: >> >> $ ls /curc/slurm/slurm/current/lib64/ >> perl5 >> $ ls /curc/slurm/slurm/current/lib/ >> libpmi.a libpmi.so.0 libslurmdb.a libslurmdb.so.27 >> libslurm.so slurm >> libpmi.la libpmi.so.0.0.0 libslurmdb.la libslurmdb.so.27.0.0 >> libslurm.so.27 >> libpmi.so libslurm.a libslurmdb.so libslurm.la >> libslurm.so.27.0.0 >> >> So the patch I am providing checks for the actual libpmi.so file, by >> 1) replacing the test -d with a test -f >> 2) appending the file we are looking for (libpmi.so) >> >> You do bring up an interesting point, I didn’t think of. If it is >> checking for libpmi2.so, that can be accounted for by adding another 2 test >> and run-if-true results to the AS_IF macro. If you deem my patch >> worthwhile, I am happy to modify it to meet this criteria. >> >> Regards >> Timothy >> >> >> On Oct 6, 2014, at 6:07 PM, Joshua Ladd <jladd.m...@gmail.com> wrote: >> >> > We only link in libpmi(2).so if specifically requested to do so via >> "--with-pmi" configure flag. It is not automatic. >> > >> > Josh >> > >> > On Mon, Oct 6, 2014 at 3:28 PM, Timothy Brown < >> timothy.brow...@colorado.edu> wrote: >> > Hi, >> > >> > I’m not too sure if this is the right list, or if I should be posting >> to the dev list. Please let me know if I’m in the wrong. >> > >> > We use SLURM (14.03.7) and have been trying to get OpenMPI (1.8.3) to >> work with `srun`. It seems that the M4 file to check for PMI doesn’t work >> in our situation. Where we have both a lib64 and lib directory within >> SLURM. The lib64 directory only contains perl modules, while the lib >> directory contains the PMI library. >> > >> > By changing the M4 AS_IF macro in config/opal_check_pmi.m4 to check for >> the library .so and to have an else if test. The configuration script finds >> the library. Which means OpenMPI builds with PMI support and now we have >> > - srun >> > - mpirun >> > - mpiexec >> > all working properly. >> > >> > I have created a patch against the git master and it’s attached. >> > >> > Regards >> > Timothy >> > >> > >> > >> > _______________________________________________ >> > users mailing list >> > us...@open-mpi.org >> > Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users >> > Link to this post: >> http://www.open-mpi.org/community/lists/users/2014/10/25467.php >> > >> > _______________________________________________ >> > users mailing list >> > us...@open-mpi.org >> > Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users >> > Link to this post: >> http://www.open-mpi.org/community/lists/users/2014/10/25469.php >> >> _______________________________________________ >> users mailing list >> us...@open-mpi.org >> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users >> Link to this post: >> http://www.open-mpi.org/community/lists/users/2014/10/25470.php >> > >
diff --git a/config/opal_check_pmi.m4 b/config/opal_check_pmi.m4 index e71202c..af60dbe 100644 --- a/config/opal_check_pmi.m4 +++ b/config/opal_check_pmi.m4 @@ -50,6 +50,11 @@ AC_DEFUN([OPAL_CHECK_PMI],[ opal_pmi_rpath= opal_have_pmi2=0 opal_have_pmi1=0 + opal_check_pmi_incdir= + opal_check_pmi_libdir= + opal_default_loc=0 + opal_pmi_added_cppflag=no + opal_pmi_added_ldflag=no # save flags opal_check_pmi_$1_save_CPPFLAGS="$CPPFLAGS" @@ -66,73 +71,78 @@ AC_DEFUN([OPAL_CHECK_PMI],[ [AC_MSG_RESULT([no]) $3], [AC_MSG_RESULT([yes]) - AC_MSG_CHECKING([if PMI or PMI2 headers installed]) + AC_MSG_CHECKING([if PMI installed]) # cannot use OPAL_CHECK_PACKAGE as its backend header # support appends "include" to the path, which won't # work with slurm :-( AS_IF([test ! -z "$with_pmi" -a "$with_pmi" != "yes"], - [AS_IF([test -d "$with_pmi/lib64"], - [opal_check_pmi_$1_LDFLAGS="-L$with_pmi/lib64" - opal_pmi_rpath="$with_pmi/lib64"], - [opal_check_pmi_$1_LDFLAGS="-L$with_pmi/lib" - opal_pmi_rpath="$with_pmi/lib"]) - # look for required headers - both pmi.h AND/OR pmi2.h - # may be present - AS_IF([test -f "$with_pmi/include/pmi2.h" -o -f "$with_pmi/include/pmi.h"], - [opal_check_pmi_$1_CPPFLAGS="-I$with_pmi/include" - AS_IF([test -f "$with_pmi/include/pmi2.h"], - [AC_MSG_RESULT([PMI2 header found])], - [AC_MSG_RESULT([PMI header found])])], - [AS_IF([test -f "$with_pmi/include/slurm/pmi2.h" -o -f "$with_pmi/include/slurm/pmi.h"], - [opal_check_pmi_$1_CPPFLAGS="-I$with_pmi/include/slurm" - AS_IF([test -f "$with_pmi/include/slurm/pmi2.h"], - [AC_MSG_RESULT([Slurm PMI2 headers found])], - [AC_MSG_RESULT([Slurm PMI headers found])])], - [AC_MSG_RESULT([not found]) - AC_MSG_WARN([PMI support requested (via --with-pmi) but neither pmi.h]) - AC_MSG_WARN([nor pmi2.h were found under locations:]) - AC_MSG_WARN([ $with_pmi/include]) - AC_MSG_WARN([ $with_pmi/include/slurm]) - AC_MSG_WARN([Specified path: $with_pmi]) - AC_MSG_ERROR([Aborting]) - $3])])], - [AS_IF([test -f "/usr/include/slurm/pmi2.h" -o -f "/usr/include/slurm/pmi.h"], - [opal_check_pmi_$1_CPPFLAGS="-I/usr/include/slurm"]) - AC_MSG_RESULT([in default locations])]) + [opal_check_pmi_incdir=$with_pmi + opal_check_pmi_libdir=$with_pmi + opal_default_loc="no"], + [opal_check_pmi_incdir="/usr/include" + opal_check_pmi_libdir="/usr" + opal_default_loc="yes"]) + # check for pmi-1 lib */ + AS_IF([test -f "$opal_check_pmi_libdir/lib64/libpmi.so"], + [opal_have_pmi1=1 + AS_IF([test "$opal_default_loc" == "no"], + [opal_check_pmi_$1_LDFLAGS="-L$opal_check_pmi_libdir/lib64" + opal_pmi_rpath="$opal_check_pmi_libdir/lib64" + opal_pmi_added_ldflag=yes]) + opal_check_pmi_$1_LIBS="-lpmi"], + [AS_IF([test -f "$opal_check_pmi_libdir/lib/libpmi.so"], + [opal_have_pmi1=1 + AS_IF([test "$opal_default_loc" == "no"], + [opal_check_pmi_$1_LDFLAGS="-L$opal_check_pmi_libdir/lib" + opal_pmi_rpath="$opal_check_pmi_libdir/lib" + opal_pmi_added_ldflag=yes]) + opal_check_pmi_$1_LIBS="-lpmi"])]) + # check for pmi.h + AS_IF([test -f "$opal_check_pmi_incdir/include/pmi.h"], + [AS_IF([test "$opal_default_loc" == "no"], + [opal_check_pmi_$1_CPPFLAGS="-I$opal_check_pmi_incdir/include" + opal_pmi_added_cppflag=yes])], + # this could be SLURM, which puts things in a different location + [AS_IF([test -f "$opal_check_pmi_incdir/include/slurm/pmi.h"], + # even if this was the default loc, we still need to add it in + # because of the slurm path addition + [opal_check_pmi_$1_CPPFLAGS="-I$opal_check_pmi_incdir/include/slurm" + opal_pmi_added_cppflag=yes])]) - # setup to check libraries - LDFLAGS="$LDFLAGS $opal_check_pmi_$1_LDFLAGS" - CPPFLAGS="$CPPFLAGS $opal_check_pmi_$1_CPPFLAGS" - # reset the included libs so we only link in the - # ones we successfully check - opal_check_pmi_$1_LIBS= - # check the PMI libs - both -lpmi and -lpmi2 may - # be present. If both are present, then we need - # to link against both - LIBS="$opal_check_pmi_$1_save_LIBS -lpmi2" - AC_CHECK_LIB([pmi2], [PMI2_Init], - [opal_have_pmi_support=yes - opal_have_pmi2=1 - opal_check_pmi_$1_LIBS="$opal_check_pmi_$1_LIBS -lpmi2"]) - # if the pmi2 functions aren't in -lpmi2, they might - # be in -lpmi. Nobody follows a convention here, so - # all we can do is check both - AS_IF([test "$opal_have_pmi2" = "0"], - [LIBS="$opal_check_pmi_$1_save_LIBS -lpmi" - AC_CHECK_LIB([pmi], [PMI2_Init], - [opal_have_pmi_support=yes - opal_have_pmi2=1 - opal_have_pmi1=1 - opal_check_pmi_$1_LIBS="$opal_check_pmi_$1_LIBS -lpmi"])]) - # if we haven't already added -lpmi, look for the pmi1 functions - AS_IF([test "$opal_have_pmi1" = "0"], - [LIBS="$opal_check_pmi_$1_save_LIBS -lpmi" - AC_CHECK_LIB([pmi], [PMI_Init], - [opal_have_pmi_support=yes - opal_check_pmi_$1_LIBS="$opal_check_pmi_$1_LIBS -lpmi"])]) + # check for pmi2 lib */ + AS_IF([test -f "$opal_check_pmi_libdir/lib64/libpmi2.so"], + [opal_have_pmi2=1 + AS_IF([test "$opal_pmi_added_ldflag" != "yes" && "$opal_default_loc" == "no"], + [opal_check_pmi_$1_LDFLAGS="$-L$opal_check_pmi_libdir/lib64" + opal_pmi_rpath="$opal_check_pmi_libdir/lib64"]) + opal_check_pmi_$1_LIBS="$opal_check_pmi_$1_LIBS -lpmi2"], + [AS_IF([test -f "$opal_check_pmi_libdir/lib/libpmi2.so"], + [opal_have_pmi2=1 + AS_IF([test "$opal_pmi_added_ldflag" != "yes" && "$opal_default_loc" == "no"], + [opal_check_pmi_$1_LDFLAGS="$-L$opal_check_pmi_libdir/lib" + opal_pmi_rpath="$opal_check_pmi_libdir/lib"]) + opal_check_pmi_$1_LIBS="$opal_check_pmi_$1_LIBS -lpmi2"])]) + # check for pmi2.h + AS_IF([test -f "$opal_check_pmi_incdir/include/pmi2.h"], + [AS_IF([test "$opal_pmi_added_cppflag" != "yes" && "$opal_default_loc" == "no"], + [opal_check_pmi_$1_CPPFLAGS="-I$opal_check_pmi_incdir/include"])], + # this could be SLURM, which puts things in a different location + [AS_IF([test -f "$opal_check_pmi_incdir/include/slurm/pmi2.h"], + # even if this was the default loc, we still need to add it in + # because of the slurm path addition + [opal_check_pmi_$1_CPPFLAGS="-I$opal_check_pmi_incdir/include/slurm"])]) - AC_MSG_CHECKING([PMI2 and/or PMI support enabled]) - AS_IF([test "$opal_have_pmi_support" = "yes"], + # since support was explicitly requested, then we should error out + # if we didn't find the required support + AS_IF([test $opal_have_pmi1 != 1 && $opal_have_pmi2 != 1], + [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([ $opal_check_pmi_libdir/lib]) + AC_MSG_WARN([ $opal_check_pmi_libdir/lib64]) + AC_MSG_WARN([Specified path: $with_pmi]) + AC_MSG_ERROR([Aborting]) + $3], [AC_MSG_RESULT([yes]) opal_enable_pmi=1 $1_LDFLAGS="$opal_check_pmi_$1_LDFLAGS" @@ -140,12 +150,7 @@ AC_DEFUN([OPAL_CHECK_PMI],[ $1_LIBS="$opal_check_pmi_$1_LIBS -Wl,-rpath=$opal_pmi_rpath" AC_MSG_CHECKING([final added libraries]) AC_MSG_RESULT([$opal_check_pmi_$1_LIBS]) - - $2], - [AC_MSG_RESULT([no]) - AC_MSG_WARN([PMI support requested (via --with-pmi) but not found.]) - AC_MSG_ERROR([Aborting.]) - $3]) + $2]) ]) # restore flags