diff --git a/config/pac.m4 b/config/pac.m4 index 896847b8..40a83c4f 100644 --- a/config/pac.m4 +++ b/config/pac.m4 @@ -417,27 +417,30 @@ dnl ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.$ac ac_link='${MPIFC-$FC} -o conftest${ac_exeext} $FCFLAGS conftest.$ac_ext $LDFLAGS $LIBS 1>&5' dnl Warning : square brackets are EVIL! -AC_LINK_IFELSE([ +AC_LINK_IFELSE( + [AC_LANG_SOURCE([[ program test use psb_base_mod, only : psb_version_major_ print *,psb_version_major_ - end program test], + end program test]])], [pac_cv_psblas_major=`./conftest${ac_exeext} | sed 's/^ *//'`], [pac_cv_psblas_major="unknown"]) -AC_LINK_IFELSE([ +AC_LINK_IFELSE( + [AC_LANG_SOURCE([[ program test use psb_base_mod, only : psb_version_minor_ print *,psb_version_minor_ - end program test], + end program test]])], [pac_cv_psblas_minor=`./conftest${ac_exeext} | sed 's/^ *//'`], [pac_cv_psblas_minor="unknown"]) -AC_LINK_IFELSE([ +AC_LINK_IFELSE( + [AC_LANG_SOURCE([[ program test use psb_base_mod, only : psb_patchlevel_ print *,psb_patchlevel_ - end program test], + end program test]])], [pac_cv_psblas_patchlevel=`./conftest${ac_exeext} | sed 's/^ *//'`], [pac_cv_psblas_patchlevel="unknown"]) LDFLAGS="$save_LDFLAGS"; @@ -692,9 +695,19 @@ AC_CHECK_HEADERS([slu_ddefs.h], [pac_slu_header_ok=yes], [pac_slu_header_ok=no; SLU_INCLUDES=""]) if test "x$pac_slu_header_ok" == "xno" ; then -dnl Maybe Include or include subdirs? +dnl Maybe include subdirs? + unset ac_cv_header_slu_ddefs_h + SLU_INCLUDES="-I$mld2p4_cv_superludir/include " + CPPFLAGS="$SLU_INCLUDES $save_CPPFLAGS" + + AC_CHECK_HEADERS([slu_ddefs.h], + [pac_slu_header_ok=yes], + [pac_slu_header_ok=no; SLU_INCLUDES=""]) +fi +if test "x$pac_slu_header_ok" == "xno" ; then +dnl Maybe Include subdirs? unset ac_cv_header_slu_ddefs_h - SLU_INCLUDES="-I$mld2p4_cv_superludir/include -I$mld2p4_cv_superludir/Include " + SLU_INCLUDES="-I$mld2p4_cv_superludir/Include " CPPFLAGS="$SLU_INCLUDES $save_CPPFLAGS" AC_CHECK_HEADERS([slu_ddefs.h], @@ -715,7 +728,7 @@ if test "x$pac_slu_header_ok" == "xyes" ; then LIBS="$SLU_LIBS -lm $save_LIBS"; AC_TRY_LINK_FUNC(superlu_malloc, [mld2p4_cv_have_superlu=yes;pac_slu_lib_ok=yes;], - [mld2p4_cv_have_superlu=no;pac_slu_lib_ok=no; SLU_LIBS="";]) + [mld2p4_cv_have_superlu=no;pac_slu_lib_ok=no; SLU_LIBS=""; ]) fi if test "x$pac_slu_lib_ok" == "xno" ; then dnl Maybe lib64? @@ -807,9 +820,19 @@ AC_CHECK_HEADERS([superlu_ddefs.h], [pac_sludist_header_ok=yes], [pac_sludist_header_ok=no; SLUDIST_INCLUDES=""]) if test "x$pac_sludist_header_ok" == "xno" ; then -dnl Maybe Include or include subdirs? +dnl Maybe include subdirs? unset ac_cv_header_superlu_ddefs_h - SLUDIST_INCLUDES="-I$mld2p4_cv_superludistdir/include -I$mld2p4_cv_superludistdir/Include" + SLUDIST_INCLUDES="-I$mld2p4_cv_superludistdir/include" + CPPFLAGS="$SLUDIST_INCLUDES $save_CPPFLAGS" + + AC_CHECK_HEADERS([superlu_ddefs.h], + [pac_sludist_header_ok=yes], + [pac_sludist_header_ok=no; SLUDIST_INCLUDES=""; SLUDIST_LIBS=""; ]) +fi +if test "x$pac_sludist_header_ok" == "xno" ; then +dnl Maybe Include subdirs? + unset ac_cv_header_superlu_ddefs_h + SLUDIST_INCLUDES="-I$mld2p4_cv_superludistdir/Include" CPPFLAGS="$SLUDIST_INCLUDES $save_CPPFLAGS" AC_CHECK_HEADERS([superlu_ddefs.h], @@ -829,52 +852,91 @@ if test "x$pac_sludist_header_ok" == "xyes" ; then dnl Maybe lib? SLUDIST_LIBS="$mld2p4_cv_superludist -L$mld2p4_cv_superludistdir/lib"; LIBS="$SLUDIST_LIBS -lm $save_LIBS"; + AC_TRY_LINK_FUNC(superlu_malloc_dist, + [mld2p4_cv_have_superludist=yes;pac_sludist_lib_ok=yes;], + [mld2p4_cv_have_superludist=no;pac_sludist_lib_ok=no; + SLUDIST_LIBS="";]) + fi + if test "x$pac_sludist_lib_ok" == "xno" ; then + dnl Maybe lib64? + SLUDIST_LIBS="$mld2p4_cv_superludist -L$mld2p4_cv_superludistdir/lib64"; + LIBS="$SLUDIST_LIBS -lm $save_LIBS"; AC_TRY_LINK_FUNC(superlu_malloc_dist, [mld2p4_cv_have_superludist=yes;pac_sludist_lib_ok=yes;], [mld2p4_cv_have_superludist=no;pac_sludist_lib_ok=no; SLUDIST_LIBS="";SLUDIST_INCLUDES=""]) - fi - AC_MSG_RESULT($pac_sludist_lib_ok) - if test "x$pac_sludist_lib_ok" == "xyes" ; then - AC_MSG_CHECKING([for superlu_dist version 4]) - AC_LANG_PUSH([C]) - ac_cc=${MPICC-$CC} - AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([[ #include "superlu_ddefs.h" + fi + AC_MSG_RESULT($pac_sludist_lib_ok) +fi + +if test "x$pac_sludist_lib_ok" == "xyes" ; then + + AC_LANG_PUSH([C]) + ac_cc=${MPICC-$CC} + ac_exeext=""; + CPPFLAGS="$SLUDIST_INCLUDES $save_CPPFLAGS" + LIBS="$SLUDIST_LIBS -lm $save_LIBS"; + AC_LINK_IFELSE( + [AC_LANG_SOURCE([[#include + #include + + void main() + { int i=SUPERLU_DIST_MAJOR_VERSION; + printf("%d\n",i); + } ]])], + [mld2p4_cv_superludist_major=`./conftest${ac_exeext} | sed 's/^ *//'`], + [mld2p4_cv_superludist_major="unknown"]) + AC_LINK_IFELSE( + [AC_LANG_SOURCE([[#include + #include + + void main() + { int i=SUPERLU_DIST_MINOR_VERSION; + printf("%d\n",i); + }]])], + [mld2p4_cv_superludist_minor=`./conftest${ac_exeext} | sed 's/^ *//'`], + [mld2p4_cv_superludist_minor="unknown"]) + AC_LANG_POP([C]) + if test "x$mld2p4_cv_superludist_major" == "xunknown" ; then + AC_MSG_CHECKING([for superlu_dist version 4]) + AC_LANG_PUSH([C]) + ac_cc=${MPICC-$CC} + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([[ #include "superlu_ddefs.h" int testdslud() { LUstruct_t *LUstruct; int n; LUstructInit(n, LUstruct); }]])], - [ AC_MSG_RESULT([yes]); pac_sludist_version="4";], - [ AC_MSG_RESULT([no]); pac_sludist_version="3";]) - AC_LANG_POP([C]) - if test "x$pac_sludist_version" == "x4" ; then - AC_MSG_CHECKING([for superlu_dist version 5]) - AC_LANG_PUSH([C]) - ac_cc=${MPICC-$CC} - AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([[ #include "superlu_ddefs.h" - int testdslud() - { superlu_dist_options_t options; - int n; - set_default_options_dist(&options); - }]])], - [ AC_MSG_RESULT([yes]); pac_sludist_version="5";], - [ AC_MSG_RESULT([no]); pac_sludist_version="4";]) - AC_LANG_POP([C]) - + [ AC_MSG_RESULT([yes]); mld2p4_cv_superludist_major="4"; mld2p4_cv_superludist_minor="";], + [ AC_MSG_RESULT([no]); mld2p4_cv_superludist_major="3"; mld2p4_cv_superludist_minor="";]) + AC_LANG_POP([C]) + if test "x$mld2p4_cv_superludist_major" == "x4" ; then + AC_MSG_CHECKING([for superlu_dist version 5]) + AC_LANG_PUSH([C]) + ac_cc=${MPICC-$CC} + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([[ #include "superlu_ddefs.h" + int testdslud() + { superlu_dist_options_t options; + int n; + set_default_options_dist(&options); + }]])], + [ AC_MSG_RESULT([yes]); mld2p4_cv_superludist_major="5"; mld2p4_cv_superludist_minor="";], + [ AC_MSG_RESULT([no]); mld2p4_cv_superludist_major="4"; mld2p4_cv_superludist_minor="";]) + AC_LANG_POP([C]) + fi fi - else - SLUDIST_LIBS=""; - SLUDIST_INCLUDES=""; - fi - fi - + AC_MSG_NOTICE([SuperLU_dist version $mld2p4_cv_superludist_major.$mld2p4_cv_superludist_minor.]) + + else + SLUDIST_LIBS=""; + SLUDIST_INCLUDES=""; + fi LIBS="$save_LIBS"; CPPFLAGS="$save_CPPFLAGS"; CC="$save_CC"; -AC_LANG_POP([C]) + AC_LANG_POP([C]) ])dnl dnl @synopsis PAC_CHECK_MUMPS diff --git a/configure b/configure index 7f9f0b05..151ec7dd 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for MLD2P4 2.1.1. +# Generated by GNU Autoconf 2.69 for MLD2P4 2.3.1. # # Report bugs to . # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='MLD2P4' PACKAGE_TARNAME='mld2p4' -PACKAGE_VERSION='2.1.1' -PACKAGE_STRING='MLD2P4 2.1.1' +PACKAGE_VERSION='2.3.1' +PACKAGE_STRING='MLD2P4 2.3.1' PACKAGE_BUGREPORT='https://github.com/sfilippone/mld2p4-2/issues' PACKAGE_URL='' @@ -666,7 +666,6 @@ am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE -am__quote am__include DEPDIR ac_ct_CC @@ -743,7 +742,8 @@ PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR -SHELL' +SHELL +am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking @@ -1337,7 +1337,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures MLD2P4 2.1.1 to adapt to many kinds of systems. +\`configure' configures MLD2P4 2.3.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1403,7 +1403,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of MLD2P4 2.1.1:";; + short | recursive ) echo "Configuration of MLD2P4 2.3.1:";; esac cat <<\_ACEOF @@ -1572,7 +1572,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -MLD2P4 configure 2.1.1 +MLD2P4 configure 2.3.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2208,7 +2208,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by MLD2P4 $as_me 2.1.1, which was +It was created by MLD2P4 $as_me 2.3.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2559,7 +2559,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # VERSION is the file containing the PSBLAS version code # FIXME -mld2p4_cv_version="2.1.1" +mld2p4_cv_version="2.3.1" # A sample source file @@ -2665,7 +2665,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: Loaded $pac_cv_status_file $FC $MPIFC $BLACS_LIBS" >&5 $as_echo "$as_me: Loaded $pac_cv_status_file $FC $MPIFC $BLACS_LIBS" >&6;} -am__api_version='1.13' +am__api_version='1.16' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -2866,8 +2866,8 @@ test "$program_suffix" != NONE && ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in @@ -2886,7 +2886,7 @@ else $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -3180,7 +3180,7 @@ fi # Define the identity of the package. PACKAGE='mld2p4' - VERSION='2.1.1' + VERSION='2.3.1' cat >>confdefs.h <<_ACEOF @@ -3210,12 +3210,12 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# mkdir_p='$(MKDIR_P)' -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' @@ -3231,6 +3231,48 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + # # Installation. @@ -4056,49 +4098,108 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" - -am_make=${MAKE-make} -cat > confinc << 'END' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +$as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : @@ -8637,7 +8738,27 @@ done if test "x$pac_slu_header_ok" == "xno" ; then unset ac_cv_header_slu_ddefs_h - SLU_INCLUDES="-I$mld2p4_cv_superludir/include -I$mld2p4_cv_superludir/Include " + SLU_INCLUDES="-I$mld2p4_cv_superludir/include " + CPPFLAGS="$SLU_INCLUDES $save_CPPFLAGS" + + for ac_header in slu_ddefs.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "slu_ddefs.h" "ac_cv_header_slu_ddefs_h" "$ac_includes_default" +if test "x$ac_cv_header_slu_ddefs_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SLU_DDEFS_H 1 +_ACEOF + pac_slu_header_ok=yes +else + pac_slu_header_ok=no; SLU_INCLUDES="" +fi + +done + +fi +if test "x$pac_slu_header_ok" == "xno" ; then + unset ac_cv_header_slu_ddefs_h + SLU_INCLUDES="-I$mld2p4_cv_superludir/Include " CPPFLAGS="$SLU_INCLUDES $save_CPPFLAGS" for ac_header in slu_ddefs.h @@ -8881,7 +9002,27 @@ done if test "x$pac_sludist_header_ok" == "xno" ; then unset ac_cv_header_superlu_ddefs_h - SLUDIST_INCLUDES="-I$mld2p4_cv_superludistdir/include -I$mld2p4_cv_superludistdir/Include" + SLUDIST_INCLUDES="-I$mld2p4_cv_superludistdir/include" + CPPFLAGS="$SLUDIST_INCLUDES $save_CPPFLAGS" + + for ac_header in superlu_ddefs.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "superlu_ddefs.h" "ac_cv_header_superlu_ddefs_h" "$ac_includes_default" +if test "x$ac_cv_header_superlu_ddefs_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SUPERLU_DDEFS_H 1 +_ACEOF + pac_sludist_header_ok=yes +else + pac_sludist_header_ok=no; SLUDIST_INCLUDES=""; SLUDIST_LIBS=""; +fi + +done + +fi +if test "x$pac_sludist_header_ok" == "xno" ; then + unset ac_cv_header_superlu_ddefs_h + SLUDIST_INCLUDES="-I$mld2p4_cv_superludistdir/Include" CPPFLAGS="$SLUDIST_INCLUDES $save_CPPFLAGS" for ac_header in superlu_ddefs.h @@ -8937,6 +9078,36 @@ rm -f core conftest.err conftest.$ac_objext \ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char superlu_malloc_dist (); +int +main () +{ +return superlu_malloc_dist (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + mld2p4_cv_have_superludist=yes;pac_sludist_lib_ok=yes; +else + mld2p4_cv_have_superludist=no;pac_sludist_lib_ok=no; + SLUDIST_LIBS=""; +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi + if test "x$pac_sludist_lib_ok" == "xno" ; then + SLUDIST_LIBS="$mld2p4_cv_superludist -L$mld2p4_cv_superludistdir/lib64"; + LIBS="$SLUDIST_LIBS -lm $save_LIBS"; + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ @@ -8960,20 +9131,74 @@ else fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pac_sludist_lib_ok" >&5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pac_sludist_lib_ok" >&5 $as_echo "$pac_sludist_lib_ok" >&6; } - if test "x$pac_sludist_lib_ok" == "xyes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for superlu_dist version 4" >&5 +fi + +if test "x$pac_sludist_lib_ok" == "xyes" ; then + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_cc=${MPICC-$CC} + ac_exeext=""; + CPPFLAGS="$SLUDIST_INCLUDES $save_CPPFLAGS" + LIBS="$SLUDIST_LIBS -lm $save_LIBS"; + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + + void main() + { int i=SUPERLU_DIST_MAJOR_VERSION; + printf("%d\n",i); + } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + mld2p4_cv_superludist_major=`./conftest${ac_exeext} | sed 's/^ *//'` +else + mld2p4_cv_superludist_major="unknown" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + + void main() + { int i=SUPERLU_DIST_MINOR_VERSION; + printf("%d\n",i); + } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + mld2p4_cv_superludist_minor=`./conftest${ac_exeext} | sed 's/^ *//'` +else + mld2p4_cv_superludist_minor="unknown" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + if test "x$mld2p4_cv_superludist_major" == "xunknown" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for superlu_dist version 4" >&5 $as_echo_n "checking for superlu_dist version 4... " >&6; } - ac_ext=c + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - ac_cc=${MPICC-$CC} - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_cc=${MPICC-$CC} + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "superlu_ddefs.h" int testdslud() @@ -8984,70 +9209,78 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; }; pac_sludist_version="4"; +$as_echo "yes" >&6; }; mld2p4_cv_superludist_major="4"; mld2p4_cv_superludist_minor=""; else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; }; pac_sludist_version="3"; +$as_echo "no" >&6; }; mld2p4_cv_superludist_major="3"; mld2p4_cv_superludist_minor=""; fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - if test "x$pac_sludist_version" == "x4" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for superlu_dist version 5" >&5 + if test "x$mld2p4_cv_superludist_major" == "x4" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for superlu_dist version 5" >&5 $as_echo_n "checking for superlu_dist version 5... " >&6; } - ac_ext=c + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - ac_cc=${MPICC-$CC} - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_cc=${MPICC-$CC} + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "superlu_ddefs.h" - int testdslud() - { superlu_dist_options_t options; - int n; - set_default_options_dist(&options); - } + int testdslud() + { superlu_dist_options_t options; + int n; + set_default_options_dist(&options); + } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; }; pac_sludist_version="5"; +$as_echo "yes" >&6; }; mld2p4_cv_superludist_major="5"; mld2p4_cv_superludist_minor=""; else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; }; pac_sludist_version="4"; +$as_echo "no" >&6; }; mld2p4_cv_superludist_major="4"; mld2p4_cv_superludist_minor=""; fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - + fi fi - else - SLUDIST_LIBS=""; - SLUDIST_INCLUDES=""; - fi - fi + { $as_echo "$as_me:${as_lineno-$LINENO}: SuperLU_dist version $mld2p4_cv_superludist_major.$mld2p4_cv_superludist_minor." >&5 +$as_echo "$as_me: SuperLU_dist version $mld2p4_cv_superludist_major.$mld2p4_cv_superludist_minor." >&6;} + else + SLUDIST_LIBS=""; + SLUDIST_INCLUDES=""; + fi LIBS="$save_LIBS"; CPPFLAGS="$save_CPPFLAGS"; CC="$save_CC"; -ac_ext=c + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test "x$mld2p4_cv_have_superludist" == "xyes" ; then + pac_sludist_version="$mld2p4_cv_superludist_major"; + if (($mld2p4_cv_superludist_major==6)); then + if (($mld2p4_cv_superludist_minor>=3)); then + pac_sludist_version="63"; + fi + fi SLUDIST_FLAGS="" SLUDIST_FLAGS="-DHave_SLUDist_ -DSLUD_VERSION_$pac_sludist_version $SLUDIST_INCLUDES" FDEFINES="$mld_cv_define_prepend-DHAVE_SLUDIST_ $FDEFINES" @@ -9713,7 +9946,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by MLD2P4 $as_me 2.1.1, which was +This file was extended by MLD2P4 $as_me 2.3.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9770,7 +10003,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -MLD2P4 config.status 2.1.1 +MLD2P4 config.status 2.3.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -9878,7 +10111,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" _ACEOF @@ -10323,29 +10556,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -10363,53 +10602,48 @@ $as_echo X"$mf" | q } s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } - /^X\(\/\/\)$/{ + /^X\/\(\/\/\)$/{ s//\1/ q } - /^X\(\/\).*/{ + /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? done + if test $am_rc -ne 0; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk } ;; @@ -10457,10 +10691,10 @@ fi ${PACKAGE_NAME} ${mld2p4_cv_version} has been configured as follows: PSBLAS library : ${PSBLAS_DIR} - MUMPS : ${mld2p4_cv_have_mumps} - SuperLU : ${mld2p4_cv_have_superlu} - SuperLU_Dist : ${mld2p4_cv_have_superludist} - UMFPack : ${mld2p4_cv_have_umfpack} + MUMPS detected : ${mld2p4_cv_have_mumps} + SuperLU detected : ${mld2p4_cv_have_superlu} + SuperLU_Dist detected : ${mld2p4_cv_have_superludist} + UMFPack detected : ${mld2p4_cv_have_umfpack} If you are satisfied, run 'make' to build ${PACKAGE_NAME} and its documentation; otherwise type ./configure --help=short for a complete list of configure options specific to ${PACKAGE_NAME}. @@ -10469,10 +10703,10 @@ $as_echo "$as_me: ${PACKAGE_NAME} ${mld2p4_cv_version} has been configured as follows: PSBLAS library : ${PSBLAS_DIR} - MUMPS : ${mld2p4_cv_have_mumps} - SuperLU : ${mld2p4_cv_have_superlu} - SuperLU_Dist : ${mld2p4_cv_have_superludist} - UMFPack : ${mld2p4_cv_have_umfpack} + MUMPS detected : ${mld2p4_cv_have_mumps} + SuperLU detected : ${mld2p4_cv_have_superlu} + SuperLU_Dist detected : ${mld2p4_cv_have_superludist} + UMFPack detected : ${mld2p4_cv_have_umfpack} If you are satisfied, run 'make' to build ${PACKAGE_NAME} and its documentation; otherwise type ./configure --help=short for a complete list of configure options specific to ${PACKAGE_NAME}. diff --git a/configure.ac b/configure.ac index 969daaa3..5fbf3480 100755 --- a/configure.ac +++ b/configure.ac @@ -34,11 +34,11 @@ dnl NOTE : odd configurations like ifc + gcc still await in the mist of the unkn ############################################################################### # NOTE: the literal for version (the second argument to AC_INIT should be a literal!) -AC_INIT([MLD2P4],2.1.1, [https://github.com/sfilippone/mld2p4-2/issues]) +AC_INIT([MLD2P4],2.3.1, [https://github.com/sfilippone/mld2p4-2/issues]) # VERSION is the file containing the PSBLAS version code # FIXME -mld2p4_cv_version="2.1.1" +mld2p4_cv_version="2.3.1" # A sample source file AC_CONFIG_SRCDIR([mlprec/mld_prec_type.f90]) @@ -680,8 +680,15 @@ else SLU_FLAGS="" fi -PAC_CHECK_SUPERLUDIST -if test "x$mld2p4_cv_have_superludist" == "xyes" ; then +PAC_CHECK_SUPERLUDIST() + +if test "x$mld2p4_cv_have_superludist" == "xyes" ; then + pac_sludist_version="$mld2p4_cv_superludist_major"; + if (($mld2p4_cv_superludist_major==6)); then + if (($mld2p4_cv_superludist_minor>=3)); then + pac_sludist_version="63"; + fi + fi SLUDIST_FLAGS="" SLUDIST_FLAGS="-DHave_SLUDist_ -DSLUD_VERSION_$pac_sludist_version $SLUDIST_INCLUDES" FDEFINES="$mld_cv_define_prepend-DHAVE_SLUDIST_ $FDEFINES" @@ -789,10 +796,10 @@ AC_MSG_NOTICE([ ${PACKAGE_NAME} ${mld2p4_cv_version} has been configured as follows: PSBLAS library : ${PSBLAS_DIR} - MUMPS : ${mld2p4_cv_have_mumps} - SuperLU : ${mld2p4_cv_have_superlu} - SuperLU_Dist : ${mld2p4_cv_have_superludist} - UMFPack : ${mld2p4_cv_have_umfpack} + MUMPS detected : ${mld2p4_cv_have_mumps} + SuperLU detected : ${mld2p4_cv_have_superlu} + SuperLU_Dist detected : ${mld2p4_cv_have_superludist} + UMFPack detected : ${mld2p4_cv_have_umfpack} If you are satisfied, run 'make' to build ${PACKAGE_NAME} and its documentation; otherwise type ./configure --help=short for a complete list of configure options specific to ${PACKAGE_NAME}. diff --git a/mlprec/impl/mld_dslud_interface.c b/mlprec/impl/mld_dslud_interface.c index 8c784ebf..754cd521 100644 --- a/mlprec/impl/mld_dslud_interface.c +++ b/mlprec/impl/mld_dslud_interface.c @@ -94,13 +94,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define HANDLE_SIZE 8 +#if defined(SLUD_VERSION_63) +typedef struct { + SuperMatrix *A; + dLUstruct_t *LUstruct; + gridinfo_t *grid; + dScalePermstruct_t *ScalePermstruct; +} factors_t; +#else typedef struct { SuperMatrix *A; LUstruct_t *LUstruct; gridinfo_t *grid; ScalePermstruct_t *ScalePermstruct; } factors_t; - +#endif #else @@ -127,14 +135,20 @@ int mld_dsludist_fact(int n, int nl, int nnzl, int ffstr, SuperMatrix *A; NRformat_loc *Astore; +#if defined(SLUD_VERSION_63) + dScalePermstruct_t *ScalePermstruct; + dLUstruct_t *LUstruct; + dSOLVEstruct_t SOLVEstruct; +#else ScalePermstruct_t *ScalePermstruct; LUstruct_t *LUstruct; SOLVEstruct_t SOLVEstruct; +#endif gridinfo_t *grid; int i, panel_size, permc_spec, relax, info; trans_t trans; double drop_tol = 0.0, b[1], berr[1]; -#if defined(SLUD_VERSION_5) +#if defined(SLUD_VERSION_63) || defined(SLUD_VERSION_6)||defined(SLUD_VERSION_5) superlu_dist_options_t options; #elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3) superlu_options_t options; @@ -160,10 +174,18 @@ int mld_dsludist_fact(int n, int nl, int nnzl, int ffstr, SLU_NR_loc, SLU_D, SLU_GE); /* Initialize ScalePermstruct and LUstruct. */ +#if defined(SLUD_VERSION_63) + ScalePermstruct = (dScalePermstruct_t *) SUPERLU_MALLOC(sizeof(dScalePermstruct_t)); + LUstruct = (dLUstruct_t *) SUPERLU_MALLOC(sizeof(dLUstruct_t)); + dScalePermstructInit(n,n, ScalePermstruct); +#else ScalePermstruct = (ScalePermstruct_t *) SUPERLU_MALLOC(sizeof(ScalePermstruct_t)); LUstruct = (LUstruct_t *) SUPERLU_MALLOC(sizeof(LUstruct_t)); ScalePermstructInit(n,n, ScalePermstruct); -#if defined(SLUD_VERSION_4) || defined(SLUD_VERSION_5) +#endif +#if defined(SLUD_VERSION_63) + dLUstructInit(n, LUstruct); +#elif defined(SLUD_VERSION_4) || defined(SLUD_VERSION_5) || defined(SLUD_VERSION_6) LUstructInit(n, LUstruct); #elif defined(SLUD_VERSION_3) LUstructInit(n,n, LUstruct); @@ -223,17 +245,23 @@ int mld_dsludist_solve(int itrans, int n, int nrhs, */ #ifdef Have_SLUDist_ SuperMatrix *A; +#if defined(SLUD_VERSION_63) + dScalePermstruct_t *ScalePermstruct; + dLUstruct_t *LUstruct; + dSOLVEstruct_t SOLVEstruct; +#else ScalePermstruct_t *ScalePermstruct; LUstruct_t *LUstruct; SOLVEstruct_t SOLVEstruct; +#endif gridinfo_t *grid; int i, panel_size, permc_spec, relax, info; trans_t trans; double drop_tol = 0.0; double *berr; -#if defined(SLUD_VERSION_5) +#if defined(SLUD_VERSION_63) || defined(SLUD_VERSION_6) ||defined(SLUD_VERSION_5) superlu_dist_options_t options; -#elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3) +#elif defined(SLUD_VERSION_4)|| defined(SLUD_VERSION_3) superlu_options_t options; #else choke_on_me; @@ -303,15 +331,21 @@ int mld_dsludist_free(void *f_factors) */ #ifdef Have_SLUDist_ SuperMatrix *A; +#if defined(SLUD_VERSION_63) + dScalePermstruct_t *ScalePermstruct; + dLUstruct_t *LUstruct; + dSOLVEstruct_t SOLVEstruct; +#else ScalePermstruct_t *ScalePermstruct; LUstruct_t *LUstruct; SOLVEstruct_t SOLVEstruct; +#endif gridinfo_t *grid; int i, panel_size, permc_spec, relax; trans_t trans; double drop_tol = 0.0; double *berr; -#if defined(SLUD_VERSION_5) +#if defined(SLUD_VERSION_63)||defined(SLUD_VERSION_6)||defined(SLUD_VERSION_5) superlu_dist_options_t options; #elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3) superlu_options_t options; @@ -334,8 +368,13 @@ int mld_dsludist_free(void *f_factors) // we either have a leak or a segfault here. // To be investigated further. //Destroy_CompRowLoc_Matrix_dist(A); +#if defined(SLUD_VERSION_63) + dScalePermstructFree(ScalePermstruct); + dLUstructFree(LUstruct); +#else ScalePermstructFree(ScalePermstruct); LUstructFree(LUstruct); +#endif superlu_gridexit(grid); free(grid); diff --git a/mlprec/impl/mld_zslud_interface.c b/mlprec/impl/mld_zslud_interface.c index ca2ae963..8db9d899 100644 --- a/mlprec/impl/mld_zslud_interface.c +++ b/mlprec/impl/mld_zslud_interface.c @@ -5,8 +5,10 @@ * based on PSBLAS (Parallel Sparse BLAS version 3.5) * * (C) Copyright 2008-2018 - * - * Salvatore Filippone + * + * Salvatore Filippone + * Ambra Abdullahi Hassan + * Alfredo Buttari CNRS-IRIT, Toulouse, FR * Pasqua D'Ambra * Daniela di Serafino * @@ -92,13 +94,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define HANDLE_SIZE 8 +#if defined(SLUD_VERSION_63) +typedef struct { + SuperMatrix *A; + zLUstruct_t *LUstruct; + gridinfo_t *grid; + zScalePermstruct_t *ScalePermstruct; +} factors_t; +#else typedef struct { SuperMatrix *A; LUstruct_t *LUstruct; gridinfo_t *grid; ScalePermstruct_t *ScalePermstruct; } factors_t; - +#endif #else @@ -132,14 +142,20 @@ int mld_zsludist_fact(int n, int nl, int nnzl, int ffstr, SuperMatrix *A; NRformat_loc *Astore; +#if defined(SLUD_VERSION_63) + zScalePermstruct_t *ScalePermstruct; + zLUstruct_t *LUstruct; + zSOLVEstruct_t SOLVEstruct; +#else ScalePermstruct_t *ScalePermstruct; LUstruct_t *LUstruct; SOLVEstruct_t SOLVEstruct; +#endif gridinfo_t *grid; int i, panel_size, permc_spec, relax, info; trans_t trans; double drop_tol = 0.0,berr[1]; -#if defined(SLUD_VERSION_5) +#if defined(SLUD_VERSION_63) || defined(SLUD_VERSION_6)||defined(SLUD_VERSION_5) superlu_dist_options_t options; #elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3) superlu_options_t options; @@ -165,10 +181,18 @@ int mld_zsludist_fact(int n, int nl, int nnzl, int ffstr, SLU_NR_loc, SLU_Z, SLU_GE); /* Initialize ScalePermstruct and LUstruct. */ +#if defined(SLUD_VERSION_63) + ScalePermstruct = (zScalePermstruct_t *) SUPERLU_MALLOC(sizeof(zScalePermstruct_t)); + LUstruct = (zLUstruct_t *) SUPERLU_MALLOC(sizeof(zLUstruct_t)); + zScalePermstructInit(n,n, ScalePermstruct); +#else ScalePermstruct = (ScalePermstruct_t *) SUPERLU_MALLOC(sizeof(ScalePermstruct_t)); LUstruct = (LUstruct_t *) SUPERLU_MALLOC(sizeof(LUstruct_t)); ScalePermstructInit(n,n, ScalePermstruct); -#if defined(SLUD_VERSION_4) || defined(SLUD_VERSION_5) +#endif +#if defined(SLUD_VERSION_63) + zLUstructInit(n, LUstruct); +#elif defined(SLUD_VERSION_4) || defined(SLUD_VERSION_5) || defined(SLUD_VERSION_6) LUstructInit(n, LUstruct); #elif defined(SLUD_VERSION_3) LUstructInit(n,n, LUstruct); @@ -233,17 +257,23 @@ int mld_zsludist_solve(int itrans, int n, int nrhs, */ #ifdef Have_SLUDist_ SuperMatrix *A; +#if defined(SLUD_VERSION_63) + zScalePermstruct_t *ScalePermstruct; + zLUstruct_t *LUstruct; + zSOLVEstruct_t SOLVEstruct; +#else ScalePermstruct_t *ScalePermstruct; LUstruct_t *LUstruct; SOLVEstruct_t SOLVEstruct; +#endif gridinfo_t *grid; int i, panel_size, permc_spec, relax, info; trans_t trans; double drop_tol = 0.0; double *berr; -#if defined(SLUD_VERSION_5) +#if defined(SLUD_VERSION_63) || defined(SLUD_VERSION_6) ||defined(SLUD_VERSION_5) superlu_dist_options_t options; -#elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3) +#elif defined(SLUD_VERSION_4)|| defined(SLUD_VERSION_3) superlu_options_t options; #else choke_on_me; @@ -313,15 +343,21 @@ int mld_zsludist_free(void *f_factors) */ #ifdef Have_SLUDist_ SuperMatrix *A; +#if defined(SLUD_VERSION_63) + zScalePermstruct_t *ScalePermstruct; + zLUstruct_t *LUstruct; + zSOLVEstruct_t SOLVEstruct; +#else ScalePermstruct_t *ScalePermstruct; LUstruct_t *LUstruct; SOLVEstruct_t SOLVEstruct; +#endif gridinfo_t *grid; int i, panel_size, permc_spec, relax; trans_t trans; double drop_tol = 0.0; double *berr; -#if defined(SLUD_VERSION_5) +#if defined(SLUD_VERSION_63)||defined(SLUD_VERSION_6)||defined(SLUD_VERSION_5) superlu_dist_options_t options; #elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3) superlu_options_t options; @@ -344,8 +380,13 @@ int mld_zsludist_free(void *f_factors) // we either have a leak or a segfault here. // To be investigated further. //Destroy_CompRowLoc_Matrix_dist(A); +#if defined(SLUD_VERSION_63) + zScalePermstructFree(ScalePermstruct); + zLUstructFree(LUstruct); +#else ScalePermstructFree(ScalePermstruct); LUstructFree(LUstruct); +#endif superlu_gridexit(grid); free(grid);