Commit ee5e30e4 authored by Antonio J. Pena's avatar Antonio J. Pena
Browse files

Fix --program-suffix/--program-prefix support



Added support to handle --program-suffix and --program-prefix options.

Fixes #1967.
Signed-off-by: Kenneth Raffenetti's avatarKen Raffenetti <raffenet@mcs.anl.gov>
parent ea660293
......@@ -161,8 +161,8 @@ install-exec-hook:
rm -f $${e}.tmp ; \
fi ; \
done ; \
if test -e ${DESTDIR}${bindir}/mpicxx ; then \
cd ${DESTDIR}${bindir} && ln -f -s mpicxx mpic++ ; fi
if test -e ${DESTDIR}${bindir}/@MPICXX_NAME@ ; then \
cd ${DESTDIR}${bindir} && ln -f -s @MPICXX_NAME@ @MPICPP_NAME@ ; fi
# the configure step checks for the 'lib' dir to decide whether a source
# directory has been previously used for an in-path build before allowing a
......@@ -179,7 +179,7 @@ DISTCLEANFILES += config.system
# we can only have one clean-local, so we hook into it via conditionally
# defined variables in the dependencies section
clean-local: $(CLEAN_LOCAL_TARGETS)
rm -f ${DESTDIR}${bindir}/mpic++
rm -f ${DESTDIR}${bindir}/@MPICPP_NAME@
# --------------------------------------------------------------------------
# coverage rules
......
......@@ -165,6 +165,8 @@ dnl MPI_FIND_COMPILER_SCRIPTS
dnl which can fail (i.e., not find a script), and
dnl MPI_FIND_COMPILERS
dnl which runs the various PROC_xx for the compilers.
dnl WARNING: this function ignores --program-suffix and --program-prefix.
dnl However, this function is not currently used at all.
AC_DEFUN([PAC_MPI_FIND_COMPILER_SCRIPTS],[
# Set defaults
MPIRUN_NP="-np "
......
......@@ -199,3 +199,17 @@ dnl I think that printf like this will be sufficiently portable, but I don't
dnl have any guarantee of it. If not, we can fall back to AS_VAR_ARITH
dnl and/or AC_COMPUTE_INT (the latter will probably be slow)
AC_DEFUN([PAC_CONV_HEX_TO_DEC],[AS_VAR_SET([$2],[`printf "%d" $1`])])
dnl PAC_GET_EXENAME(exe_name, out_exe_name)
dnl
dnl Prepends and appends program prefix and suffix as supplied by --program_prefix
dnl and --program-sufix
AC_DEFUN([PAC_GET_EXENAME],[
$2=$1
if test "$program_prefix" != "NONE" ; then
$2="${program_prefix}$$2"
fi
if test "$program_suffix" != "NONE" ; then
$2="$$2$program_suffix"
fi
])
......@@ -5925,6 +5925,12 @@ export MPI_NO_SPAWN
MPI_NO_RMA=$MPID_NO_RMA
export MPI_NO_RMA
# Attach program prefix and suffix to executable names for Makefile
AC_SUBST(MPICXX_NAME)
AC_SUBST(MPICPP_NAME)
PAC_GET_EXENAME("mpicxx", MPICXX_NAME)
PAC_GET_EXENAME("mpic++", MPICPP_NAME)
AC_CONFIG_SUBDIRS([test/mpi])
dnl
dnl Generate the Makefiles from Makefile.in
......
......@@ -38,9 +38,9 @@ DIST_SUBDIRS = ${external_dist_subdirs}
# Provide an alias for mpirun to support tools that assume that
# mpiexec is called mpirun
install-exec-hook:
if [ -x ${DESTDIR}${bindir}/mpiexec.hydra ] ; then \
cd ${DESTDIR}${bindir} && ln -f -s mpiexec.hydra mpiexec ; \
cd ${DESTDIR}${bindir} && ln -f -s mpiexec.hydra mpirun ; \
if [ -x ${DESTDIR}${bindir}/@MPIEXEC_HYDRA_NAME@ ] ; then \
cd ${DESTDIR}${bindir} && ln -f -s @MPIEXEC_HYDRA_NAME@ @MPIEXEC_NAME@ ; \
cd ${DESTDIR}${bindir} && ln -f -s @MPIEXEC_HYDRA_NAME@ @MPIRUN_NAME@ ; \
fi
# A special alternate installation target when using multiple process
......@@ -50,7 +50,7 @@ install-alt: $(bin_PROGRAMS)
@for foo in $? ; do $(MAKE) install $$foo ; done
uninstall-local:
rm -f ${DESTDIR}${bindir}/mpirun ${DESTDIR}${bindir}/mpiexec
rm -f ${DESTDIR}${bindir}/@MPIRUN_NAME@ ${DESTDIR}${bindir}/@MPIEXEC_NAME@
htmldoc:
if test "@DOXYGEN@" != "" ; then @DOXYGEN@ hydra-doxygen.cfg ; fi
......
......@@ -82,6 +82,18 @@ AC_SUBST(HYDRA_VERSION)
AC_DEFINE_UNQUOTED(HYDRA_VERSION,"$HYDRA_VERSION",[Hydra version information])
AC_DEFINE_UNQUOTED(HYDRA_RELEASE_DATE,"$HYDRA_RELEASE_DATE",[Hydra release date information])
AC_SUBST(HYDRA_PMI_PROXY)
PAC_GET_EXENAME("hydra_pmi_proxy", HYDRA_PMI_PROXY)
AC_DEFINE_UNQUOTED(HYDRA_PMI_PROXY,"$HYDRA_PMI_PROXY",[Hydra PMI proxy executable])
# These substitutions are needed in the Makefile
AC_SUBST(MPIEXEC_NAME)
AC_SUBST(MPIEXEC_HYDRA_NAME)
AC_SUBST(MPIRUN_NAME)
PAC_GET_EXENAME("mpiexec", MPIEXEC_NAME)
PAC_GET_EXENAME("mpiexec.hydra", MPIEXEC_HYDRA_NAME)
PAC_GET_EXENAME("mpirun", MPIRUN_NAME)
PAC_PUSH_ALL_FLAGS
PAC_RESET_ALL_FLAGS
if test "$CC" != "" ; then
......
......@@ -48,7 +48,7 @@ HYD_status HYD_pmcd_pmi_fill_in_proxy_args(struct HYD_string_stash *proxy_stash,
HYD_STRING_STASH_INIT(stash);
HYD_STRING_STASH(stash, HYDU_strdup(HYD_server_info.base_path), status);
HYD_STRING_STASH(stash, HYDU_strdup("hydra_pmi_proxy"), status);
HYD_STRING_STASH(stash, HYDU_strdup(HYDRA_PMI_PROXY), status);
HYD_STRING_SPIT(stash, str, status);
HYD_STRING_STASH(*proxy_stash, str, status);
......
......@@ -448,6 +448,13 @@ AC_ARG_VAR([WRAPPER_FFLAGS],[])
AC_ARG_VAR([WRAPPER_FCFLAGS],[])
AC_ARG_VAR([WRAPPER_CXXFLAGS],[])
# Attach program prefix and suffix to executable names
PAC_GET_EXENAME("mpicc", MPICC_NAME)
PAC_GET_EXENAME("mpif77", MPIF77_NAME)
PAC_GET_EXENAME("mpif90", MPIF90_NAME)
PAC_GET_EXENAME("mpicxx", MPICXX_NAME)
PAC_GET_EXENAME("mpiexec", MPIEXEC_NAME)
if test "$FROM_MPICH" = "yes" ; then
# perform configure tests with the normal compilers ($CC/$F77/etc), but use
# the WRAPPER_xFLAGS computed by MPICH as our flags instead. Then at the
......@@ -467,44 +474,44 @@ if test "$FROM_MPICH" = "yes" ; then
elif test -n "$with_mpi" ; then
if test -z "$MPICC" ; then
CC=$with_mpi/bin/mpicc
CC=$with_mpi/bin/$MPICC_NAME
else
CC=$MPICC
fi
if test -z "$MPIF77" ; then
F77=$with_mpi/bin/mpif77
F77=$with_mpi/bin/$MPIF77_NAME
else
F77=$MPIF77
fi
if test -z "$MPIFC" ; then
FC=$with_mpi/bin/mpif90
FC=$with_mpi/bin/$MPIF90_NAME
else
FC=$MPIFC
fi
if test -z "$MPICXX" ; then
CXX=$with_mpi/bin/mpicxx
CXX=$with_mpi/bin/$MPICXX_NAME
else
CXX=$MPICXX
fi
if test -z "$MPIEXEC" ; then
MPIEXEC=$with_mpi/bin/mpiexec
MPIEXEC=$with_mpi/bin/$MPIEXEC_NAME
fi
else
# Try to use mpicc etc names
if test -z "$MPICC" ; then
AC_PATH_PROG(MPICC,mpicc mpcc)
AC_PATH_PROG(MPICC,$MPICC_NAME mpcc)
fi
if test "x$MPICC" != "x" ; then
CC=$MPICC
fi
if test -z "$MPIF77" ; then
AC_PATH_PROG(MPIF77,mpif77 mpf77)
AC_PATH_PROG(MPIF77,$MPIF77_NAME mpf77)
fi
if test "x$MPIF77" != "x" ; then
F77=$MPIF77
fi
if test -z "$MPIFC" ; then
AC_PATH_PROG(MPIFC,mpif90 mpftn)
AC_PATH_PROG(MPIFC,$MPIF90_NAME mpftn)
fi
if test "x$MPIFC" != "x" ; then
FC=$MPIFC
......@@ -512,13 +519,13 @@ else
if test -z "$MPICXX" ; then
# We left mpiCC off of this list because mpicc and mpiCC are the
# same on Mac OSX systems.
AC_PATH_PROG(MPICXX,mpicxx mpCC)
AC_PATH_PROG(MPICXX,$MPICXX_NAME mpCC)
fi
if test "x$MPICXX" != "x" ; then
CXX=$MPICXX
fi
if test -z "$MPIEXEC" ; then
AC_PATH_PROG(MPIEXEC,mpiexec)
AC_PATH_PROG(MPIEXEC,$MPIEXEC_NAME)
fi
fi
......@@ -1396,11 +1403,11 @@ if test "$FROM_MPICH" = yes ; then
# we did our tests with the base compilers, now point the make system at the
# installed compiler wrappers for actually building the tests
CC=$mpibindir/mpicc
F77=$mpibindir/mpif77
FC=$mpibindir/mpif90
CXX=$mpibindir/mpicxx
MPIEXEC=$mpibindir/mpiexec
CC=$mpibindir/$MPICC_NAME
F77=$mpibindir/$MPIF77_NAME
FC=$mpibindir/$MPIF90_NAME
CXX=$mpibindir/$MPICXX_NAME
MPIEXEC=$mpibindir/$MPIEXEC_NAME
# Zero out the flags, since they are already contained in the compiler
# wrapper scripts. Note that this will kill any flags that have been added
......@@ -1422,7 +1429,7 @@ if test "$FROM_MPICH" = yes ; then
else
# We need either mpiexec or mpirun. If we don't find them,
# the user will need to determine how to run a program
AC_PATH_PROG(MPIEXEC,mpiexec)
AC_PATH_PROG(MPIEXEC,$MPIEXEC_NAME)
fi
AC_OUTPUT_COMMANDS([chmod a+x maint/testmerge])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment