added some mpi code for awk
This commit is contained in:
320
qse/configure
vendored
320
qse/configure
vendored
@ -635,6 +635,11 @@ ENABLE_CXX_FALSE
|
||||
ENABLE_CXX_TRUE
|
||||
BUILD_MODE
|
||||
CHAR_MODE
|
||||
HAVE_C_MPI_FALSE
|
||||
HAVE_C_MPI_TRUE
|
||||
MPI_CLDFLAGS
|
||||
MPI_CFLAGS
|
||||
MPICC
|
||||
UNICOWS_LIBS
|
||||
SENDFILE_LIBS
|
||||
SOCKET_LIBS
|
||||
@ -16665,6 +16670,317 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if [ ! -z "$MPICC" ]; then
|
||||
|
||||
# Try to find a working MPI compiler from the supplied names
|
||||
for ac_prog in $MPICC
|
||||
do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if ${ac_cv_path_MPICC+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
case $MPICC in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_MPICC="$MPICC" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
ac_cv_path_MPICC="$as_dir/$ac_word$ac_exec_ext"
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
MPICC=$ac_cv_path_MPICC
|
||||
if test -n "$MPICC"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MPICC" >&5
|
||||
$as_echo "$MPICC" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
test -n "$MPICC" && break
|
||||
done
|
||||
test -n "$MPICC" || MPICC="not-found"
|
||||
|
||||
|
||||
# Figure out what the compiler responds to to get it to show us the compile
|
||||
# and link lines. After this part of the macro, we'll have a valid
|
||||
# lx_mpi_command_line
|
||||
echo -n "Checking whether $MPICC responds to '-showme:compile'... "
|
||||
lx_mpi_compile_line=`$MPICC -showme:compile 2>/dev/null`
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo yes
|
||||
lx_mpi_link_line=`$MPICC -showme:link 2>/dev/null`
|
||||
else
|
||||
echo no
|
||||
echo -n "Checking whether $MPICC responds to '-showme'... "
|
||||
lx_mpi_command_line=`$MPICC -showme 2>/dev/null`
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo no
|
||||
echo -n "Checking whether $MPICC responds to '-compile-info'... "
|
||||
lx_mpi_compile_line=`$MPICC -compile-info 2>/dev/null`
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo yes
|
||||
lx_mpi_link_line=`$MPICC -link-info 2>/dev/null`
|
||||
else
|
||||
echo no
|
||||
echo -n "Checking whether $MPICC responds to '-show'... "
|
||||
lx_mpi_command_line=`$MPICC -show 2>/dev/null`
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo yes
|
||||
else
|
||||
echo no
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -z "$lx_mpi_compile_line" -a ! -z "$lx_mpi_link_line" ]; then
|
||||
lx_mpi_command_line="$lx_mpi_compile_line $lx_mpi_link_line"
|
||||
fi
|
||||
|
||||
if [ ! -z "$lx_mpi_command_line" ]; then
|
||||
# Now extract the different parts of the MPI command line. Do these separately in case we need to
|
||||
# parse them all out in future versions of this macro.
|
||||
lx_mpi_defines=` echo "$lx_mpi_command_line" | grep -o -- '\(^\| \)-D\([^\"[:space:]]\+\|\"[^\"[:space:]]\+\"\)'`
|
||||
lx_mpi_includes=` echo "$lx_mpi_command_line" | grep -o -- '\(^\| \)-I\([^\"[:space:]]\+\|\"[^\"[:space:]]\+\"\)'`
|
||||
lx_mpi_link_paths=` echo "$lx_mpi_command_line" | grep -o -- '\(^\| \)-L\([^\"[:space:]]\+\|\"[^\"[:space:]]\+\"\)'`
|
||||
lx_mpi_libs=` echo "$lx_mpi_command_line" | grep -o -- '\(^\| \)-l\([^\"[:space:]]\+\|\"[^\"[:space:]]\+\"\)'`
|
||||
lx_mpi_link_args=` echo "$lx_mpi_command_line" | grep -o -- '\(^\| \)-Wl,\([^\"[:space:]]\+\|\"[^\"[:space:]]\+\"\)'`
|
||||
|
||||
# Create variables and clean up newlines and multiple spaces
|
||||
MPI_CFLAGS="$lx_mpi_defines $lx_mpi_includes"
|
||||
MPI_CLDFLAGS="$lx_mpi_link_paths $lx_mpi_libs $lx_mpi_link_args"
|
||||
MPI_CFLAGS=` echo "$MPI_CFLAGS" | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//' | sed 's/ +/ /g'`
|
||||
MPI_CLDFLAGS=`echo "$MPI_CLDFLAGS" | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//' | sed 's/ +/ /g'`
|
||||
|
||||
OLD_CPPFLAGS=$CPPFLAGS
|
||||
OLD_LIBS=$LIBS
|
||||
CPPFLAGS=$MPI_CFLAGS
|
||||
LIBS=$MPI_CLDFLAGS
|
||||
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <mpi.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int rank, size;
|
||||
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
|
||||
MPI_Comm_size(MPI_COMM_WORLD, &size);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
# Add a define for testing at compile time.
|
||||
|
||||
$as_echo "#define HAVE_MPI 1" >>confdefs.h
|
||||
|
||||
have_C_mpi='yes'
|
||||
else
|
||||
# zero out mpi flags so we don't link against the faulty library.
|
||||
MPI_CFLAGS=""
|
||||
MPI_CLDFLAGS=""
|
||||
have_C_mpi='no'
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
|
||||
# AC_SUBST everything.
|
||||
|
||||
|
||||
|
||||
|
||||
LIBS=$OLD_LIBS
|
||||
CPPFLAGS=$OLD_CPPFLAGS
|
||||
else
|
||||
Echo Unable to find suitable MPI Compiler. Try setting MPICC.
|
||||
have_C_mpi='no'
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
# Try to find a working MPI compiler from the supplied names
|
||||
for ac_prog in mpicc mpiicc mpixlc mpipgcc
|
||||
do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if ${ac_cv_path_MPICC+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
case $MPICC in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_MPICC="$MPICC" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
ac_cv_path_MPICC="$as_dir/$ac_word$ac_exec_ext"
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
MPICC=$ac_cv_path_MPICC
|
||||
if test -n "$MPICC"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MPICC" >&5
|
||||
$as_echo "$MPICC" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
test -n "$MPICC" && break
|
||||
done
|
||||
test -n "$MPICC" || MPICC="not-found"
|
||||
|
||||
|
||||
# Figure out what the compiler responds to to get it to show us the compile
|
||||
# and link lines. After this part of the macro, we'll have a valid
|
||||
# lx_mpi_command_line
|
||||
echo -n "Checking whether $MPICC responds to '-showme:compile'... "
|
||||
lx_mpi_compile_line=`$MPICC -showme:compile 2>/dev/null`
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo yes
|
||||
lx_mpi_link_line=`$MPICC -showme:link 2>/dev/null`
|
||||
else
|
||||
echo no
|
||||
echo -n "Checking whether $MPICC responds to '-showme'... "
|
||||
lx_mpi_command_line=`$MPICC -showme 2>/dev/null`
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo no
|
||||
echo -n "Checking whether $MPICC responds to '-compile-info'... "
|
||||
lx_mpi_compile_line=`$MPICC -compile-info 2>/dev/null`
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo yes
|
||||
lx_mpi_link_line=`$MPICC -link-info 2>/dev/null`
|
||||
else
|
||||
echo no
|
||||
echo -n "Checking whether $MPICC responds to '-show'... "
|
||||
lx_mpi_command_line=`$MPICC -show 2>/dev/null`
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo yes
|
||||
else
|
||||
echo no
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -z "$lx_mpi_compile_line" -a ! -z "$lx_mpi_link_line" ]; then
|
||||
lx_mpi_command_line="$lx_mpi_compile_line $lx_mpi_link_line"
|
||||
fi
|
||||
|
||||
if [ ! -z "$lx_mpi_command_line" ]; then
|
||||
# Now extract the different parts of the MPI command line. Do these separately in case we need to
|
||||
# parse them all out in future versions of this macro.
|
||||
lx_mpi_defines=` echo "$lx_mpi_command_line" | grep -o -- '\(^\| \)-D\([^\"[:space:]]\+\|\"[^\"[:space:]]\+\"\)'`
|
||||
lx_mpi_includes=` echo "$lx_mpi_command_line" | grep -o -- '\(^\| \)-I\([^\"[:space:]]\+\|\"[^\"[:space:]]\+\"\)'`
|
||||
lx_mpi_link_paths=` echo "$lx_mpi_command_line" | grep -o -- '\(^\| \)-L\([^\"[:space:]]\+\|\"[^\"[:space:]]\+\"\)'`
|
||||
lx_mpi_libs=` echo "$lx_mpi_command_line" | grep -o -- '\(^\| \)-l\([^\"[:space:]]\+\|\"[^\"[:space:]]\+\"\)'`
|
||||
lx_mpi_link_args=` echo "$lx_mpi_command_line" | grep -o -- '\(^\| \)-Wl,\([^\"[:space:]]\+\|\"[^\"[:space:]]\+\"\)'`
|
||||
|
||||
# Create variables and clean up newlines and multiple spaces
|
||||
MPI_CFLAGS="$lx_mpi_defines $lx_mpi_includes"
|
||||
MPI_CLDFLAGS="$lx_mpi_link_paths $lx_mpi_libs $lx_mpi_link_args"
|
||||
MPI_CFLAGS=` echo "$MPI_CFLAGS" | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//' | sed 's/ +/ /g'`
|
||||
MPI_CLDFLAGS=`echo "$MPI_CLDFLAGS" | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//' | sed 's/ +/ /g'`
|
||||
|
||||
OLD_CPPFLAGS=$CPPFLAGS
|
||||
OLD_LIBS=$LIBS
|
||||
CPPFLAGS=$MPI_CFLAGS
|
||||
LIBS=$MPI_CLDFLAGS
|
||||
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <mpi.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int rank, size;
|
||||
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
|
||||
MPI_Comm_size(MPI_COMM_WORLD, &size);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
# Add a define for testing at compile time.
|
||||
|
||||
$as_echo "#define HAVE_MPI 1" >>confdefs.h
|
||||
|
||||
have_C_mpi='yes'
|
||||
else
|
||||
# zero out mpi flags so we don't link against the faulty library.
|
||||
MPI_CFLAGS=""
|
||||
MPI_CLDFLAGS=""
|
||||
have_C_mpi='no'
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
|
||||
# AC_SUBST everything.
|
||||
|
||||
|
||||
|
||||
|
||||
LIBS=$OLD_LIBS
|
||||
CPPFLAGS=$OLD_CPPFLAGS
|
||||
else
|
||||
Echo Unable to find suitable MPI Compiler. Try setting MPICC.
|
||||
have_C_mpi='no'
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
|
||||
if test "${have_C_mpi}" = "yes" ; then
|
||||
HAVE_C_MPI_TRUE=
|
||||
HAVE_C_MPI_FALSE='#'
|
||||
else
|
||||
HAVE_C_MPI_TRUE='#'
|
||||
HAVE_C_MPI_FALSE=
|
||||
fi
|
||||
|
||||
|
||||
ac_header_dirent=no
|
||||
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
|
||||
as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
|
||||
@ -18787,6 +19103,10 @@ if test -z "${WIN32_TRUE}" && test -z "${WIN32_FALSE}"; then
|
||||
as_fn_error $? "conditional \"WIN32\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
fi
|
||||
if test -z "${HAVE_C_MPI_TRUE}" && test -z "${HAVE_C_MPI_FALSE}"; then
|
||||
as_fn_error $? "conditional \"HAVE_C_MPI\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
fi
|
||||
|
||||
if test -z "${ENABLE_CXX_TRUE}" && test -z "${ENABLE_CXX_FALSE}"; then
|
||||
as_fn_error $? "conditional \"ENABLE_CXX\" was never defined.
|
||||
|
Reference in New Issue
Block a user