#! /bin/sh
# From configure.ac Autotools support for ABINIT 9.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for ABINIT 10.0.9.
#
# Report bugs to <https://bugs.launchpad.net/abinit/>.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##

# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
  emulate sh
  NULLCMD=:
  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '${1+"$@"}'='"$@"'
  setopt NO_GLOB_SUBST
else
  case `(set -o) 2>/dev/null` in #(
  *posix*) :
    set -o posix ;; #(
  *) :
     ;;
esac
fi


as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
  as_echo='print -r --'
  as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
  as_echo='printf %s\n'
  as_echo_n='printf %s'
else
  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
    as_echo_n='/usr/ucb/echo -n'
  else
    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
    as_echo_n_body='eval
      arg=$1;
      case $arg in #(
      *"$as_nl"*)
	expr "X$arg" : "X\\(.*\\)$as_nl";
	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
      esac;
      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
    '
    export as_echo_n_body
    as_echo_n='sh -c $as_echo_n_body as_echo'
  fi
  export as_echo_body
  as_echo='sh -c $as_echo_body as_echo'
fi

# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
  PATH_SEPARATOR=:
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
      PATH_SEPARATOR=';'
  }
fi


# IFS
# We need space, tab and new line, in precisely that order.  Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" ""	$as_nl"

# Find who we are.  Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
  *[\\/]* ) as_myself=$0 ;;
  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
  done
IFS=$as_save_IFS

     ;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
  as_myself=$0
fi
if test ! -f "$as_myself"; then
  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
  exit 1
fi

# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there.  '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '

# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE

# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH

# Use a proper internal environment variable to ensure we don't fall
  # into an infinite loop, continuously re-executing ourselves.
  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
    _as_can_reexec=no; export _as_can_reexec;
    # We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
  *v*x* | *x*v* ) as_opts=-vx ;;
  *v* ) as_opts=-v ;;
  *x* ) as_opts=-x ;;
  * ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
as_fn_exit 255
  fi
  # We don't want this to propagate to other subprocesses.
          { _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
  emulate sh
  NULLCMD=:
  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '\${1+\"\$@\"}'='\"\$@\"'
  setopt NO_GLOB_SUBST
else
  case \`(set -o) 2>/dev/null\` in #(
  *posix*) :
    set -o posix ;; #(
  *) :
     ;;
esac
fi
"
  as_required="as_fn_return () { (exit \$1); }
as_fn_success () { as_fn_return 0; }
as_fn_failure () { as_fn_return 1; }
as_fn_ret_success () { return 0; }
as_fn_ret_failure () { return 1; }

exitcode=0
as_fn_success || { exitcode=1; echo as_fn_success failed.; }
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :

else
  exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1
test -x / || exit 1"
  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
test \$(( 1 + 1 )) = 2 || exit 1"
  if (eval "$as_required") 2>/dev/null; then :
  as_have_required=yes
else
  as_have_required=no
fi
  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :

else
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  as_found=:
  case $as_dir in #(
	 /*)
	   for as_base in sh bash ksh sh5; do
	     # Try only shells that exist, to save several forks.
	     as_shell=$as_dir/$as_base
	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
  CONFIG_SHELL=$as_shell as_have_required=yes
		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
  break 2
fi
fi
	   done;;
       esac
  as_found=false
done
$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
  CONFIG_SHELL=$SHELL as_have_required=yes
fi; }
IFS=$as_save_IFS


      if test "x$CONFIG_SHELL" != x; then :
  export CONFIG_SHELL
             # We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
  *v*x* | *x*v* ) as_opts=-vx ;;
  *v* ) as_opts=-v ;;
  *x* ) as_opts=-x ;;
  * ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi

    if test x$as_have_required = xno; then :
  $as_echo "$0: This script requires a shell more modern than all"
  $as_echo "$0: the shells that I found on your system."
  if test x${ZSH_VERSION+set} = xset ; then
    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
  else
    $as_echo "$0: Please tell bug-autoconf@gnu.org and
$0: https://bugs.launchpad.net/abinit/ about your system,
$0: including any error possibly output before this
$0: message. Then install a modern shell, or manually run
$0: the script under such a shell if you do have one."
  fi
  exit 1
fi
fi
fi
SHELL=${CONFIG_SHELL-/bin/sh}
export SHELL
# Unset more variables known to interfere with behavior of common tools.
CLICOLOR_FORCE= GREP_OPTIONS=
unset CLICOLOR_FORCE GREP_OPTIONS

## --------------------- ##
## M4sh Shell Functions. ##
## --------------------- ##
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
  { eval $1=; unset $1;}
}
as_unset=as_fn_unset

# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
  return $1
} # as_fn_set_status

# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
  set +e
  as_fn_set_status $1
  exit $1
} # as_fn_exit

# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{

  case $as_dir in #(
  -*) as_dir=./$as_dir;;
  esac
  test -d "$as_dir" || eval $as_mkdir_p || {
    as_dirs=
    while :; do
      case $as_dir in #(
      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
      *) as_qdir=$as_dir;;
      esac
      as_dirs="'$as_qdir' $as_dirs"
      as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$as_dir" : 'X\(//\)[^/]' \| \
	 X"$as_dir" : 'X\(//\)$' \| \
	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_dir" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
      test -d "$as_dir" && break
    done
    test -z "$as_dirs" || eval "mkdir $as_dirs"
  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"


} # as_fn_mkdir_p

# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
  test -f "$1" && test -x "$1"
} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
  eval 'as_fn_append ()
  {
    eval $1+=\$2
  }'
else
  as_fn_append ()
  {
    eval $1=\$$1\$2
  }
fi # as_fn_append

# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
  eval 'as_fn_arith ()
  {
    as_val=$(( $* ))
  }'
else
  as_fn_arith ()
  {
    as_val=`expr "$@" || test $? -eq 1`
  }
fi # as_fn_arith


# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
  as_status=$1; test $as_status -eq 0 && as_status=1
  if test "$4"; then
    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
  fi
  $as_echo "$as_me: error: $2" >&2
  as_fn_exit $as_status
} # as_fn_error

if expr a : '\(a\)' >/dev/null 2>&1 &&
   test "X`expr 00001 : '.*\(...\)'`" = X001; then
  as_expr=expr
else
  as_expr=false
fi

if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
  as_basename=basename
else
  as_basename=false
fi

if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
  as_dirname=dirname
else
  as_dirname=false
fi

as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
	 X"$0" : 'X\(//\)$' \| \
	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
    sed '/^.*\/\([^/][^/]*\)\/*$/{
	    s//\1/
	    q
	  }
	  /^X\/\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\/\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`

# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits


  as_lineno_1=$LINENO as_lineno_1a=$LINENO
  as_lineno_2=$LINENO as_lineno_2a=$LINENO
  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
  sed -n '
    p
    /[$]LINENO/=
  ' <$as_myself |
    sed '
      s/[$]LINENO.*/&-/
      t lineno
      b
      :lineno
      N
      :loop
      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
      t loop
      s/-\n.*//
    ' >$as_me.lineno &&
  chmod +x "$as_me.lineno" ||
    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }

  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
  # already done that, so ensure we don't try to do so again and fall
  # in an infinite loop.  This has already happened in practice.
  _as_can_reexec=no; export _as_can_reexec
  # Don't try to exec as it changes $[0], causing all sort of problems
  # (the dirname of $[0] is not the place where we might find the
  # original and so on.  Autoconf is especially sensitive to this).
  . "./$as_me.lineno"
  # Exit status is that of the last command.
  exit
}

ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
  case `echo 'xy\c'` in
  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
  xy)  ECHO_C='\c';;
  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
       ECHO_T='	';;
  esac;;
*)
  ECHO_N='-n';;
esac

rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
  rm -f conf$$.dir/conf$$.file
else
  rm -f conf$$.dir
  mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
  if ln -s conf$$.file conf$$ 2>/dev/null; then
    as_ln_s='ln -s'
    # ... but there are two gotchas:
    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
    # In both cases, we have to default to `cp -pR'.
    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
      as_ln_s='cp -pR'
  elif ln conf$$.file conf$$ 2>/dev/null; then
    as_ln_s=ln
  else
    as_ln_s='cp -pR'
  fi
else
  as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null

if mkdir -p . 2>/dev/null; then
  as_mkdir_p='mkdir -p "$as_dir"'
else
  test -d ./-p && rmdir ./-p
  as_mkdir_p=false
fi

as_test_x='test -x'
as_executable_p=as_fn_executable_p

# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"

# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"


test -n "$DJDIR" || exec 7<&0 </dev/null
exec 6>&1

# Name of the host.
# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`

#
# Initializations.
#
ac_default_prefix=/usr/local
ac_clean_files=
ac_config_libobj_dir=.
LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=

# Identity of this package.
PACKAGE_NAME='ABINIT'
PACKAGE_TARNAME='abinit'
PACKAGE_VERSION='10.0.9'
PACKAGE_STRING='ABINIT 10.0.9'
PACKAGE_BUGREPORT='https://bugs.launchpad.net/abinit/'
PACKAGE_URL=''

ac_unique_file="src/98_main/abinit.F90"
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
# ifdef HAVE_STDLIB_H
#  include <stdlib.h>
# endif
#endif
#ifdef HAVE_STRING_H
# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
#  include <memory.h>
# endif
# include <string.h>
#endif
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif"

ac_subst_vars='FFLAGS
F77
FC_NOWRAP
DO_BUILD_67_PYTHON_INVOCATION_EXT_FALSE
DO_BUILD_67_PYTHON_INVOCATION_EXT_TRUE
DO_BUILD_68_LOTF_FALSE
DO_BUILD_68_LOTF_TRUE
DO_BUILD_65_LOTF_BASE_FALSE
DO_BUILD_65_LOTF_BASE_TRUE
am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
DO_BUILD_SHARED_LIBPAW_FALSE
DO_BUILD_SHARED_LIBPAW_TRUE
DO_BUILD_SHARED_COMMON_FALSE
DO_BUILD_SHARED_COMMON_TRUE
with_bigdft
sd_bigdft_libs
sd_bigdft_ldflags
sd_bigdft_fcflags
sd_bigdft_cppflags
sd_bigdft_ok
sd_bigdft_init
sd_bigdft_enable
sd_bigdft_status
sd_bigdft_policy
sd_bigdft_enable_def
sd_bigdft_options
BIGDFT_LIBS
BIGDFT_LDFLAGS
BIGDFT_FFLAGS
BIGDFT_FCFLAGS
BIGDFT_CPPFLAGS
with_libpaw
sd_libpaw_libs
sd_libpaw_ldflags
sd_libpaw_fcflags
sd_libpaw_cppflags
sd_libpaw_ok
sd_libpaw_init
sd_libpaw_enable
sd_libpaw_status
sd_libpaw_policy
sd_libpaw_enable_def
sd_libpaw_options
LIBPAW_LIBS
LIBPAW_LDFLAGS
LIBPAW_FFLAGS
LIBPAW_FCFLAGS
LIBPAW_CPPFLAGS
with_abinit_common
sd_abinit_common_libs
sd_abinit_common_ldflags
sd_abinit_common_fcflags
sd_abinit_common_cppflags
sd_abinit_common_ok
sd_abinit_common_init
sd_abinit_common_enable
sd_abinit_common_status
sd_abinit_common_policy
sd_abinit_common_enable_def
sd_abinit_common_options
ABINIT_COMMON_LIBS
ABINIT_COMMON_LDFLAGS
ABINIT_COMMON_FFLAGS
ABINIT_COMMON_FCFLAGS
ABINIT_COMMON_CPPFLAGS
GRAPHATOM_BIN
ATOMPAW_BIN
DO_BUILD_67_TRIQS_EXT_FALSE
DO_BUILD_67_TRIQS_EXT_TRUE
DO_BUILD_01_LIBXC_EXT_FALSE
DO_BUILD_01_LIBXC_EXT_TRUE
DO_BUILD_PSML_FALSE
DO_BUILD_PSML_TRUE
with_fft_flavor
sd_fft_ok
sd_fft_init
sd_fft_flavor
sd_fft_enable
sd_fft_choices
sd_fft_libs
sd_fft_ldflags
sd_fft_fcflags
sd_fft_cxxflags
sd_fft_cflags
sd_fft_cppflags
abi_linalg_ok
sd_linalg_has_scalapack
sd_linalg_has_elpa
with_linalg_flavor
sd_linalg_flavor
sd_linalg_ok
sd_linalg_init
sd_linalg_enable
sd_linalg_choices
sd_linalg_libs
sd_linalg_ldflags
sd_linalg_fcflags
sd_linalg_cxxflags
sd_linalg_cflags
sd_linalg_cppflags
LINALG_LIBS
LINALG_LDFLAGS
LINALG_FFLAGS
LINALG_FCFLAGS
LINALG_CXXFLAGS
LINALG_CFLAGS
LINALG_CPPFLAGS
with_yakl
sd_yakl_libs
sd_yakl_ldflags
sd_yakl_fcflags
sd_yakl_cppflags
sd_yakl_ok
sd_yakl_init
sd_yakl_enable
sd_yakl_status
sd_yakl_policy
sd_yakl_enable_def
sd_yakl_options
YAKL_LIBS
YAKL_LDFLAGS
YAKL_FFLAGS
YAKL_FCFLAGS
YAKL_CPPFLAGS
with_kokkos
sd_kokkos_libs
sd_kokkos_ldflags
sd_kokkos_cxxflags
sd_kokkos_cppflags
sd_kokkos_ok
sd_kokkos_init
sd_kokkos_enable
sd_kokkos_status
sd_kokkos_policy
sd_kokkos_enable_def
sd_kokkos_options
DO_BUILD_44_MANAGE_KOKKOS_FALSE
DO_BUILD_44_MANAGE_KOKKOS_TRUE
DO_BUILD_16_KOKKOS_TOOLBOX_FALSE
DO_BUILD_16_KOKKOS_TOOLBOX_TRUE
KOKKOS_LIBS
KOKKOS_LDFLAGS
KOKKOS_CXXFLAGS
KOKKOS_CPPFLAGS
with_xmlf90
sd_xmlf90_libs
sd_xmlf90_ldflags
sd_xmlf90_fcflags
sd_xmlf90_cppflags
sd_xmlf90_ok
sd_xmlf90_init
sd_xmlf90_enable
sd_xmlf90_status
sd_xmlf90_policy
sd_xmlf90_enable_def
sd_xmlf90_options
XMLF90_LIBS
XMLF90_LDFLAGS
XMLF90_FFLAGS
XMLF90_FCFLAGS
XMLF90_CPPFLAGS
with_wannier90
sd_wannier90_libs
sd_wannier90_ldflags
sd_wannier90_fcflags
sd_wannier90_cppflags
sd_wannier90_ok
sd_wannier90_init
sd_wannier90_enable
sd_wannier90_status
sd_wannier90_policy
sd_wannier90_enable_def
sd_wannier90_options
WANNIER90_LIBS
WANNIER90_LDFLAGS
WANNIER90_FFLAGS
WANNIER90_FCFLAGS
WANNIER90_CPPFLAGS
with_triqs
sd_triqs_libs
sd_triqs_ldflags
sd_triqs_fcflags
sd_triqs_cxxflags
sd_triqs_cflags
sd_triqs_cppflags
sd_triqs_ok
sd_triqs_init
sd_triqs_enable
sd_triqs_status
sd_triqs_policy
sd_triqs_enable_def
sd_triqs_options
TRIQS_LIBS
TRIQS_LDFLAGS
TRIQS_CXXFLAGS
TRIQS_CFLAGS
TRIQS_CPPFLAGS
with_pfft
sd_pfft_libs
sd_pfft_ldflags
sd_pfft_cflags
sd_pfft_cppflags
sd_pfft_ok
sd_pfft_init
sd_pfft_enable
sd_pfft_status
sd_pfft_policy
sd_pfft_enable_def
sd_pfft_options
PFFT_LIBS
PFFT_LDFLAGS
PFFT_CFLAGS
PFFT_CPPFLAGS
with_papi
sd_papi_libs
sd_papi_ldflags
sd_papi_sd_papi_fcflags
sd_papi_cflags
sd_papi_cppflags
sd_papi_ok
sd_papi_init
sd_papi_enable
sd_papi_status
sd_papi_policy
sd_papi_enable_def
sd_papi_options
PAPI_LIBS
PAPI_LDFLAGS
PAPI_CFLAGS
PAPI_CPPFLAGS
sd_netcdf_fortran_libs
sd_netcdf_fortran_ldflags
sd_netcdf_fortran_fcflags
sd_netcdf_fortran_cflags
sd_netcdf_fortran_cppflags
sd_netcdf_fortran_ok
sd_netcdf_fortran_init
sd_netcdf_fortran_enable
sd_netcdf_fortran_status
sd_netcdf_fortran_policy
sd_netcdf_fortran_enable_def
sd_netcdf_fortran_options
NETCDF_FORTRAN_LIBS
NETCDF_FORTRAN_LDFLAGS
NETCDF_FORTRAN_FFLAGS
NETCDF_FORTRAN_FCFLAGS
NETCDF_FORTRAN_CXXFLAGS
NETCDF_FORTRAN_CFLAGS
NETCDF_FORTRAN_CPPFLAGS
with_netcdf
sd_netcdf_libs
sd_netcdf_ldflags
sd_netcdf_fcflags
sd_netcdf_cflags
sd_netcdf_cppflags
sd_netcdf_ok
sd_netcdf_init
sd_netcdf_enable
sd_netcdf_status
sd_netcdf_policy
sd_netcdf_enable_def
sd_netcdf_options
NETCDF_LIBS
NETCDF_LDFLAGS
NETCDF_FFFLAGS
NETCDF_FCFLAGS
NETCDF_CXXFLAGS
NETCDF_CFLAGS
NETCDF_CPPFLAGS
with_libxc
sd_libxc_libs
sd_libxc_ldflags
sd_libxc_fcflags
sd_libxc_cflags
sd_libxc_cppflags
sd_libxc_ok
sd_libxc_init
sd_libxc_enable
sd_libxc_status
sd_libxc_policy
sd_libxc_enable_fc
sd_libxc_enable_def
sd_libxc_options
LIBXC_LIBS
LIBXC_LDFLAGS
LIBXC_FFLAGS
LIBXC_FCFLAGS
LIBXC_CFLAGS
LIBXC_CPPFLAGS
with_libpsml
sd_libpsml_libs
sd_libpsml_ldflags
sd_libpsml_fcflags
sd_libpsml_cppflags
sd_libpsml_ok
sd_libpsml_init
sd_libpsml_enable
sd_libpsml_status
sd_libpsml_policy
sd_libpsml_enable_def
sd_libpsml_options
LIBPSML_LIBS
LIBPSML_LDFLAGS
LIBPSML_FFLAGS
LIBPSML_FCFLAGS
LIBPSML_CPPFLAGS
with_levmar
sd_levmar_libs
sd_levmar_ldflags
sd_levmar_cflags
sd_levmar_cppflags
sd_levmar_ok
sd_levmar_init
sd_levmar_enable
sd_levmar_status
sd_levmar_policy
sd_levmar_enable_def
sd_levmar_options
LEVMAR_LIBS
LEVMAR_LDFLAGS
LEVMAR_CFLAGS
LEVMAR_CPPFLAGS
with_fftw3
sd_fftw3_libs
sd_fftw3_ldflags
sd_fftw3_fcflags
sd_fftw3_cflags
sd_fftw3_cppflags
sd_fftw3_ok
sd_fftw3_init
sd_fftw3_enable
sd_fftw3_status
sd_fftw3_policy
sd_fftw3_enable_def
sd_fftw3_options
FFTW3_LIBS
FFTW3_LDFLAGS
FFTW3_FFLAGS
FFTW3_FCFLAGS
FFTW3_CFLAGS
FFTW3_CPPFLAGS
with_hdf5
sd_hdf5_libs
sd_hdf5_ldflags
sd_hdf5_fcflags
sd_hdf5_cxxflags
sd_hdf5_cflags
sd_hdf5_cppflags
sd_hdf5_h5fc
sd_hdf5_h5cc
sd_hdf5_ok
sd_hdf5_init
sd_hdf5_enable
sd_hdf5_status
sd_hdf5_policy
sd_hdf5_enable_fc
sd_hdf5_enable_def
sd_hdf5_options
HDF5_LIBS
HDF5_LDFLAGS
HDF5_FFLAGS
HDF5_FCFLAGS
HDF5_CXXFLAGS
HDF5_CFLAGS
HDF5_CPPFLAGS
H5CC
DO_BUILD_NVTX_FALSE
DO_BUILD_NVTX_TRUE
DO_BUILD_46_MANAGE_CUDA_FALSE
DO_BUILD_46_MANAGE_CUDA_TRUE
DO_BUILD_17_GPU_TOOLBOX_FALSE
DO_BUILD_17_GPU_TOOLBOX_TRUE
abi_openmp_libs
abi_openmp_incs
abi_openmp_level
abi_openmp_ldflags
abi_openmp_fcflags
abi_openmp_cxxflags
abi_openmp_cflags
abi_openmp_cppflags
abi_openmp_flavor
sd_openmp_libs
sd_openmp_ldflags
sd_openmp_fcflags
sd_openmp_cxxflags
sd_openmp_cflags
sd_openmp_cppflags
sd_openmp_fc_ok
sd_openmp_cxx_ok
sd_openmp_cc_ok
sd_openmp_ok
sd_openmp_init
sd_openmp_enable
sd_openmp_status
sd_openmp_policy
sd_openmp_enable_fc
sd_openmp_enable_cxx
sd_openmp_enable_cc
sd_openmp_enable_def
sd_openmp_options
fc_timing
DO_BUILD_CCLOCK_FALSE
DO_BUILD_CCLOCK_TRUE
XML_LIBS
XML_CPPFLAGS
XML2_CONFIG
FCLIBS
with_gnu_ld
enable_static
enable_shared
ARFLAGS
RANLIB
AR
ABINIT_BINARY_PACKAGE
ABINIT_TARGET
fcflags_opt_98_main
fcflags_opt_95_drive
fcflags_opt_94_scfcv
fcflags_opt_80_tdep
fcflags_opt_80_rttddft
fcflags_opt_79_seqpar_mpi
fcflags_opt_78_eph
fcflags_opt_78_effpot
fcflags_opt_77_suscep
fcflags_opt_77_ddb
fcflags_opt_72_response
fcflags_opt_71_wannier
fcflags_opt_71_bse
fcflags_opt_70_gw
fcflags_opt_69_wfdesc
fcflags_opt_68_rsprc
fcflags_opt_68_recursion
fcflags_opt_68_lotf
fcflags_opt_68_dmft
fcflags_opt_67_triqs_ext
fcflags_opt_67_python_invocation_ext
fcflags_opt_67_common
fcflags_opt_66_wfs
fcflags_opt_66_vdwxc
fcflags_opt_66_nonlocal
fcflags_opt_65_paw
fcflags_opt_65_lotf_base
fcflags_opt_64_psp
fcflags_opt_62_wvl_wfs
fcflags_opt_62_poisson
fcflags_opt_62_iowfdenpot
fcflags_opt_62_ctqmc
fcflags_opt_62_cg_noabirule
fcflags_opt_61_occeig
fcflags_opt_57_iovars
fcflags_opt_57_iopsp_parser
fcflags_opt_56_xc
fcflags_opt_56_recipspace
fcflags_opt_56_mixing
fcflags_opt_56_io_mpi
fcflags_opt_55_abiutil
fcflags_opt_54_spacepar
fcflags_opt_53_ffts
fcflags_opt_52_fft_mpi_noabirule
fcflags_opt_51_manage_mpi
fcflags_opt_49_gw_toolbox_oop
fcflags_opt_48_diago
fcflags_opt_46_manage_cuda
fcflags_opt_46_ghc_omp
fcflags_opt_45_xgTools
fcflags_opt_45_geomoptim
fcflags_opt_44_manage_kokkos
fcflags_opt_44_abitypes_defs
fcflags_opt_44_abitools
fcflags_opt_43_wvl_wrappers
fcflags_opt_43_ptgroups
fcflags_opt_42_parser
fcflags_opt_42_nlstrain
fcflags_opt_41_geometry
fcflags_opt_39_libpaw
fcflags_opt_33_xc_lowlevel
fcflags_opt_32_util
fcflags_opt_29_kpoints
fcflags_opt_28_numeric_noabirule
fcflags_opt_27_toolbox_oop
fcflags_opt_21_hashfuncs
fcflags_opt_18_timing
fcflags_opt_17_yaml_out
fcflags_opt_17_minimax
fcflags_opt_17_libtetra_ext
fcflags_opt_17_gpu_toolbox
fcflags_opt_16_kokkos_toolbox
fcflags_opt_16_hideleave
fcflags_opt_14_hidewrite
fcflags_opt_12_hide_mpi
fcflags_opt_11_memory_mpi
fcflags_opt_10_defs
fcflags_opt_02_clib
fcflags_opt_xmlf90
fcflags_opt_wannier90
fcflags_opt_triqs
fcflags_opt_papi
fcflags_opt_netcdf_fortran
fcflags_opt_netcdf
fcflags_opt_linalg
fcflags_opt_libxml2
fcflags_opt_libxc
fcflags_opt_libpsml
fcflags_opt_levmar
fcflags_opt_hdf5
fcflags_opt_bigdft
fcflags_opt_default
abi_optim_flavor
DO_BUILD_32_CONTRACT_FALSE
DO_BUILD_32_CONTRACT_TRUE
abi_debug_flavor
CPPFLAGS_HINTS_EXT
TRUE_CPP
fc_mod_fcflags
FCFLAGS_F90
fc_info_string
abi_fc_wrap
abi_fc_version
abi_fc_vendor
abi_fpp_path
ac_ct_FC
FC
abi_fc_path
cxx_info_string
abi_cxx_version
abi_cxx_vendor
am__fastdepCXX_FALSE
am__fastdepCXX_TRUE
CXXDEPMODE
ac_ct_CXX
CXXFLAGS
CXX
abi_cxx_path
cc_info_string
abi_cc_version
abi_cc_vendor
CPP
abi_cpp_path
am__fastdepCC_FALSE
am__fastdepCC_TRUE
CCDEPMODE
am__nodep
AMDEPBACKSLASH
AMDEP_FALSE
AMDEP_TRUE
am__quote
am__include
DEPDIR
OBJEXT
EXEEXT
ac_ct_CC
CPPFLAGS
LDFLAGS
CFLAGS
CC
abi_cc_path
abi_fbk_yakl_ok
abi_fbk_xmlf90_ok
abi_fbk_wannier90_ok
abi_fbk_triqs_ok
abi_fbk_pfft_ok
abi_fbk_papi_ok
abi_fbk_netcdf_fortran_ok
abi_fbk_netcdf_ok
abi_fbk_mpi_ok
abi_fbk_linalg_ok
abi_fbk_libxml2_ok
abi_libxml2_prefix
abi_libxml2_libs
abi_libxml2_ldflags
abi_libxml2_fcflags
abi_libxml2_cppflags
abi_libxml2_ok
abi_libxml2_init
abi_libxml2_enable
LIBXML2_LIBS
LIBXML2_FCFLAGS
LIBXML2_CPPFLAGS
abi_fbk_libxc_ok
abi_fbk_libpsml_ok
abi_fbk_libpaw_ok
abi_fbk_levmar_ok
abi_fbk_kokkos_ok
abi_fbk_hdf5_ok
abi_fbk_gpu_ok
abi_fbk_fftw3_ok
abi_fbk_fft_ok
abi_fbk_bigdft_ok
abi_fbk_abinit_common_ok
abi_gpu_arch
abi_gpu_libs
abi_gpu_incs
abi_gpu_flavor
abi_gpu_ldflags
abi_gpu_fcflags
abi_gpu_hip_libdir
abi_gpu_roctx
abi_gpu_nvtx_v3
with_gpu
sd_gpu_libs
sd_gpu_ldflags
sd_gpu_fcflags
sd_gpu_cxxflags
sd_gpu_cflags
sd_gpu_cppflags
sd_gpu_ok
sd_gpu_init
sd_gpu_markers_enable
sd_gpu_enable
sd_gpu_status
sd_gpu_prefix
sd_gpu_policy
sd_gpu_enable_def
sd_gpu_options
GPU_LIBS
GPU_LDFLAGS
GPU_FFLAGS
GPU_FCFLAGS
GPU_CXXFLAGS
GPU_CFLAGS
GPU_CPPFLAGS
abi_mpi_libs
abi_mpi_incs
abi_mpi_level
abi_mpi_ldflags
abi_mpi_fcflags
abi_mpi_cxxflags
abi_mpi_cflags
abi_mpi_cppflags
abi_mpi_flavor
abi_mpi_enable
with_mpi
sd_mpi_libs
sd_mpi_ldflags
sd_mpi_fcflags
sd_mpi_cflags
sd_mpi_cppflags
sd_mpi_ok
sd_mpi_init
sd_mpi_enable
sd_mpi_status
sd_mpi_policy
sd_mpi_enable_fc
sd_mpi_enable_cxx
sd_mpi_enable_def
sd_mpi_options
sd_mpi_fc
sd_mpi_cxx
sd_mpi_cc
MPI_LIBS
MPI_LDFLAGS
MPI_FFLAGS
MPI_FCFLAGS
MPI_CXXFLAGS
MPI_CFLAGS
MPI_CPPFLAGS
abi_fbk_required
abi_fbk_prefix
abi_fbk_list
abi_fbk_init
abi_fbk_enable
abi_fbk_config
sd_sys_fcflags
abi_lt_version
abi_am_version
abi_ac_version
abi_m4_version
src_95_drive_fcflags
src_94_scfcv_fcflags
src_80_tdep_fcflags
src_80_rttddft_fcflags
src_79_seqpar_mpi_fcflags
src_78_eph_fcflags
src_78_effpot_fcflags
src_77_suscep_fcflags
src_77_ddb_fcflags
src_72_response_fcflags
src_71_wannier_fcflags
src_71_bse_fcflags
src_70_gw_fcflags
src_69_wfdesc_fcflags
src_68_rsprc_fcflags
src_68_recursion_fcflags
src_68_lotf_fcflags
src_68_dmft_fcflags
src_67_triqs_ext_fcflags
src_67_python_invocation_ext_fcflags
src_67_common_fcflags
src_66_wfs_fcflags
src_66_vdwxc_fcflags
src_66_nonlocal_fcflags
src_65_paw_fcflags
src_65_lotf_base_fcflags
src_64_psp_fcflags
src_62_wvl_wfs_fcflags
src_62_poisson_fcflags
src_62_iowfdenpot_fcflags
src_62_ctqmc_fcflags
src_62_cg_noabirule_fcflags
src_61_occeig_fcflags
src_57_iovars_fcflags
src_57_iopsp_parser_fcflags
src_56_xc_fcflags
src_56_recipspace_fcflags
src_56_mixing_fcflags
src_56_io_mpi_fcflags
src_55_abiutil_fcflags
src_54_spacepar_fcflags
src_53_ffts_fcflags
src_52_fft_mpi_noabirule_fcflags
src_51_manage_mpi_fcflags
src_49_gw_toolbox_oop_fcflags
src_48_diago_fcflags
src_46_manage_cuda_fcflags
src_46_ghc_omp_fcflags
src_45_xgTools_fcflags
src_45_geomoptim_fcflags
src_44_manage_kokkos_fcflags
src_44_abitypes_defs_fcflags
src_44_abitools_fcflags
src_43_wvl_wrappers_fcflags
src_43_ptgroups_fcflags
src_42_parser_fcflags
src_42_nlstrain_fcflags
src_41_geometry_fcflags
src_39_libpaw_fcflags
src_33_xc_lowlevel_fcflags
src_32_util_fcflags
src_29_kpoints_fcflags
src_28_numeric_noabirule_fcflags
src_27_toolbox_oop_fcflags
src_21_hashfuncs_fcflags
src_18_timing_fcflags
src_17_yaml_out_fcflags
src_17_minimax_fcflags
src_17_libtetra_ext_fcflags
src_17_gpu_toolbox_fcflags
src_16_kokkos_toolbox_fcflags
src_16_hideleave_fcflags
src_14_hidewrite_fcflags
src_12_hide_mpi_fcflags
src_11_memory_mpi_fcflags
src_10_defs_fcflags
src_02_clib_fcflags
src_libpaw_fcflags
src_core_fcflags
src_common_fcflags
abinit_mandir
abinit_libdir
abinit_incdir
abinit_docdir
abinit_datdir
abinit_chkdir
abinit_bindir
abinit_prefix
XPPFLAGS_OPTIM
XPPFLAGS_EXTRA
XPPFLAGS_DEBUG
XPPFLAGS
XPP
PYTHON_CPPFLAGS
PYFLAGS
NVCC_LIBS
NVCC_LDFLAGS
NVCC_CPPFLAGS
NVCC_CFLAGS
NVCC
MODEXT
GPU_ARCH
FPPFLAGS_OPTIM
FPPFLAGS_HINTS
FPPFLAGS_EXTRA
FPPFLAGS_DEBUG
FPPFLAGS
FPP
FFT_FCFLAGS
FFT_CFLAGS
FC_LIBS_OPTIM
FC_LIBS_HINTS
FC_LIBS_EXTRA
FC_LIBS_DEBUG
FC_LIBS
FC_LDFLAGS_OPTIM
FC_LDFLAGS_HINTS
FC_LDFLAGS_EXTRA
FC_LDFLAGS_DEBUG
FC_LDFLAGS
FCFLAGS_OPTIM
FCFLAGS_OPENMP_OFFLOAD
FCFLAGS_OPENMP
FCFLAGS_MODDIR
FCFLAGS_HINTS
FCFLAGS_FREEFORM
FCFLAGS_FIXEDFORM
FCFLAGS_EXTRA
FCFLAGS_DEBUG
FCFLAGS
CXX_LIBS_OPTIM
CXX_LIBS_HINTS
CXX_LIBS_GPU
CXX_LIBS_EXTRA
CXX_LIBS_DEBUG
CXX_LIBS
CXX_LDFLAGS_OPTIM
CXX_LDFLAGS_HINTS
CXX_LDFLAGS_GPU
CXX_LDFLAGS_EXTRA
CXX_LDFLAGS_DEBUG
CXX_LDFLAGS
CXXFLAGS_OPTIM
CXXFLAGS_HINTS
CXXFLAGS_GPU
CXXFLAGS_EXTRA
CXXFLAGS_DEBUG
CPPFLAGS_OPTIM
CPPFLAGS_HINTS
CPPFLAGS_GPU
CPPFLAGS_EXTRA
CPPFLAGS_DEBUG
CFLAGS_OPTIM
CFLAGS_HINTS
CFLAGS_GPU
CFLAGS_EXTRA
CFLAGS_DEBUG
CC_LIBS_OPTIM
CC_LIBS_HINTS
CC_LIBS_GPU
CC_LIBS_EXTRA
CC_LIBS_DEBUG
CC_LIBS
CC_LDFLAGS_OPTIM
CC_LDFLAGS_HINTS
CC_LDFLAGS_GPU
CC_LDFLAGS_EXTRA
CC_LDFLAGS_DEBUG
CC_LDFLAGS
ARFLAGS_OPTIM
ARFLAGS_HINTS
ARFLAGS_EXTRA
ARFLAGS_DEBUG
ARFLAGS_CMD
ABI_CPPFLAGS
abi_ac_distcheck
with_optim_flavor
with_mpi_level
with_libxml2
with_fc_version
with_fc_vendor
with_fallbacks
with_debug_flavor
with_config_file
abi_zdot_bugfix_enable
enable_zdot_bugfix
abi_triqs_v2_0_enable
enable_triqs_v2_0
abi_triqs_v1_4_enable
enable_triqs_v1_4
abi_timer_enable
enable_timer
abi_stdin_enable
enable_stdin
abi_source_debug_enable
enable_source_debug
abi_python_invocation_enable
enable_python_invocation
abi_openmp_offload_enable
enable_openmp_offload
abi_openmp_enable
enable_openmp
abi_netcdf_default_enable
enable_netcdf_default
abi_mpi_io_default_enable
enable_mpi_io_default
abi_mpi_io_enable
enable_mpi_io
abi_mpi_interfaces_bugfix_enable
enable_mpi_interfaces_bugfix
abi_mpi_inplace_enable
enable_mpi_inplace
abi_mpi_gpu_aware_enable
enable_mpi_gpu_aware
abi_memory_profiling_enable
enable_memory_profiling
abi_lotf_enable
enable_lotf
abi_libtetra_enable
enable_libtetra
abi_hints_enable
enable_hints
abi_gw_dpc_enable
enable_gw_dpc
abi_fc_wrapper_enable
enable_fc_wrapper
abi_crpa_optim_enable
enable_crpa_optim
abi_cclock_enable
enable_cclock
abi_avx_safe_mode_enable
enable_avx_safe_mode
PYTHON_CONFIG
PYTHON
REALPATH
EGREP
TAR
PATCH
RM
PERL
MV
BOURNE_SHELL
GREP
SED
LN_S
abi_sys_spec
abi_cpu_bits
abi_cpu_64bits
abi_cpu_spec
abi_cpu_model
abi_cpu_vendor
abi_cpu_platform
ABINIT_VERSION_BASE
ABINIT_VERSION_BUILD
ABINIT_VERSION_MICRO
ABINIT_VERSION_MINOR
ABINIT_VERSION_MAJOR
ABINIT_VERSION
abinit_builddir
abinit_srcdir
AM_BACKSLASH
AM_DEFAULT_VERBOSITY
AM_DEFAULT_V
AM_V
am__untar
am__tar
AMTAR
am__leading_dot
SET_MAKE
AWK
mkdir_p
MKDIR_P
INSTALL_STRIP_PROGRAM
STRIP
install_sh
MAKEINFO
AUTOHEADER
AUTOMAKE
AUTOCONF
ACLOCAL
VERSION
PACKAGE
CYGPATH_W
am__isrc
INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
target_os
target_vendor
target_cpu
target
host_os
host_vendor
host_cpu
host
build_os
build_vendor
build_cpu
build
target_alias
host_alias
build_alias
LIBS
ECHO_T
ECHO_N
ECHO_C
DEFS
mandir
localedir
libdir
psdir
pdfdir
dvidir
htmldir
infodir
docdir
oldincludedir
includedir
localstatedir
sharedstatedir
sysconfdir
datadir
datarootdir
libexecdir
sbindir
bindir
program_transform_name
prefix
exec_prefix
PACKAGE_URL
PACKAGE_BUGREPORT
PACKAGE_STRING
PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_silent_rules
enable_avx_safe_mode
enable_cclock
enable_crpa_optim
enable_fc_wrapper
enable_gw_dpc
enable_hints
enable_libtetra
enable_lotf
enable_memory_profiling
enable_mpi_gpu_aware
enable_mpi_inplace
enable_mpi_interfaces_bugfix
enable_mpi_io
enable_mpi_io_default
enable_netcdf_default
enable_openmp
enable_openmp_offload
enable_python_invocation
enable_source_debug
enable_stdin
enable_timer
enable_triqs_v1_4
enable_triqs_v2_0
enable_zdot_bugfix
with_config_file
with_debug_flavor
with_fallbacks
with_fc_vendor
with_fc_version
with_libxml2
with_mpi_level
with_optim_flavor
with_mpi
with_mpi_flavor
with_gpu
with_gpu_markers
with_gpu_flavor
enable_dependency_tracking
enable_assert
with_xml_prefix
with_xml_exec_prefix
enable_xmltest
with_hdf5
with_fftw3
with_levmar
with_libpsml
with_libxc
with_netcdf
with_netcdf_fortran
with_papi
with_pfft
with_triqs
with_wannier90
with_xmlf90
with_kokkos
with_yakl
with_linalg
with_linalg_flavor
with_fft_flavor
with_abinit_common
with_libpaw
with_bigdft
'
      ac_precious_vars='build_alias
host_alias
target_alias
ARFLAGS_DEBUG
ARFLAGS_EXTRA
ARFLAGS_OPTIM
CC_LDFLAGS
CC_LDFLAGS_DEBUG
CC_LDFLAGS_OPTIM
CC_LIBS
CC_LIBS_DEBUG
CC_LIBS_OPTIM
CFLAGS_DEBUG
CFLAGS_EXTRA
CFLAGS_OPTIM
CPPFLAGS_DEBUG
CPPFLAGS_EXTRA
CPPFLAGS_OPTIM
CXXFLAGS_DEBUG
CXXFLAGS_EXTRA
CXXFLAGS_OPTIM
CXX_LDFLAGS
CXX_LDFLAGS_DEBUG
CXX_LDFLAGS_EXTRA
CXX_LDFLAGS_OPTIM
CXX_LIBS
CXX_LIBS_DEBUG
CXX_LIBS_OPTIM
FCFLAGS_DEBUG
FCFLAGS_EXTRA
FCFLAGS_FIXEDFORM
FCFLAGS_FREEFORM
FCFLAGS_HINTS
FCFLAGS_MODDIR
FCFLAGS_OPENMP
FCFLAGS_OPENMP_OFFLOAD
FCFLAGS_OPTIM
FC_LDFLAGS
FC_LDFLAGS_DEBUG
FC_LDFLAGS_EXTRA
FC_LDFLAGS_OPTIM
FC_LIBS
FC_LIBS_DEBUG
FC_LIBS_OPTIM
FFT_CFLAGS
FFT_FCFLAGS
FPP
FPPFLAGS
FPPFLAGS_DEBUG
FPPFLAGS_EXTRA
FPPFLAGS_OPTIM
GPU_ARCH
PYFLAGS
PYTHON_CPPFLAGS
XPP
XPPFLAGS
XPPFLAGS_DEBUG
XPPFLAGS_EXTRA
XPPFLAGS_OPTIM
MPI_CPPFLAGS
MPI_CFLAGS
MPI_CXXFLAGS
MPI_FCFLAGS
MPI_FFLAGS
MPI_LDFLAGS
MPI_LIBS
GPU_CPPFLAGS
GPU_CFLAGS
GPU_CXXFLAGS
GPU_FCFLAGS
GPU_FFLAGS
GPU_LDFLAGS
GPU_LIBS
LIBXML2_CPPFLAGS
LIBXML2_FCFLAGS
LIBXML2_LIBS
CC
CFLAGS
LDFLAGS
LIBS
CPPFLAGS
CPP
CXX
CXXFLAGS
CCC
FC
FCFLAGS
H5CC
HDF5_CPPFLAGS
HDF5_CFLAGS
HDF5_CXXFLAGS
HDF5_FCFLAGS
HDF5_FFLAGS
HDF5_LDFLAGS
HDF5_LIBS
FFTW3_CPPFLAGS
FFTW3_CFLAGS
FFTW3_FCFLAGS
FFTW3_FFLAGS
FFTW3_LDFLAGS
FFTW3_LIBS
LEVMAR_CPPFLAGS
LEVMAR_CFLAGS
LEVMAR_LDFLAGS
LEVMAR_LIBS
LIBPSML_CPPFLAGS
LIBPSML_FCFLAGS
LIBPSML_FFLAGS
LIBPSML_LDFLAGS
LIBPSML_LIBS
LIBXC_CPPFLAGS
LIBXC_CFLAGS
LIBXC_FCFLAGS
LIBXC_FFLAGS
LIBXC_LDFLAGS
LIBXC_LIBS
NETCDF_CPPFLAGS
NETCDF_CFLAGS
NETCDF_CXXFLAGS
NETCDF_FCFLAGS
NETCDF_FFFLAGS
NETCDF_LDFLAGS
NETCDF_LIBS
NETCDF_FORTRAN_CPPFLAGS
NETCDF_FORTRAN_CFLAGS
NETCDF_FORTRAN_CXXFLAGS
NETCDF_FORTRAN_FCFLAGS
NETCDF_FORTRAN_FFLAGS
NETCDF_FORTRAN_LDFLAGS
NETCDF_FORTRAN_LIBS
PAPI_CPPFLAGS
PAPI_CFLAGS
PAPI_LDFLAGS
PAPI_LIBS
PFFT_CPPFLAGS
PFFT_CFLAGS
PFFT_LDFLAGS
PFFT_LIBS
TRIQS_CPPFLAGS
TRIQS_CFLAGS
TRIQS_CXXFLAGS
TRIQS_LDFLAGS
TRIQS_LIBS
WANNIER90_CPPFLAGS
WANNIER90_FCFLAGS
WANNIER90_FFLAGS
WANNIER90_LDFLAGS
WANNIER90_LIBS
XMLF90_CPPFLAGS
XMLF90_FCFLAGS
XMLF90_FFLAGS
XMLF90_LDFLAGS
XMLF90_LIBS
KOKKOS_CPPFLAGS
KOKKOS_CXXFLAGS
KOKKOS_LDFLAGS
KOKKOS_LIBS
YAKL_CPPFLAGS
YAKL_FCFLAGS
YAKL_FFLAGS
YAKL_LDFLAGS
YAKL_LIBS
LINALG_CPPFLAGS
LINALG_CFLAGS
LINALG_CXXFLAGS
LINALG_FCFLAGS
LINALG_FFLAGS
LINALG_LDFLAGS
LINALG_LIBS
ABINIT_COMMON_CPPFLAGS
ABINIT_COMMON_FCFLAGS
ABINIT_COMMON_FFLAGS
ABINIT_COMMON_LDFLAGS
ABINIT_COMMON_LIBS
LIBPAW_CPPFLAGS
LIBPAW_FCFLAGS
LIBPAW_FFLAGS
LIBPAW_LDFLAGS
LIBPAW_LIBS
BIGDFT_CPPFLAGS
BIGDFT_FCFLAGS
BIGDFT_FFLAGS
BIGDFT_LDFLAGS
BIGDFT_LIBS'


# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
ac_unrecognized_opts=
ac_unrecognized_sep=
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
exec_prefix=NONE
no_create=
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
verbose=
x_includes=NONE
x_libraries=NONE

# Installation directory options.
# These are left unexpanded so users can "make install exec_prefix=/foo"
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datarootdir='${prefix}/share'
datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
infodir='${datarootdir}/info'
htmldir='${docdir}'
dvidir='${docdir}'
pdfdir='${docdir}'
psdir='${docdir}'
libdir='${exec_prefix}/lib'
localedir='${datarootdir}/locale'
mandir='${datarootdir}/man'

ac_prev=
ac_dashdash=
for ac_option
do
  # If the previous option needs an argument, assign it.
  if test -n "$ac_prev"; then
    eval $ac_prev=\$ac_option
    ac_prev=
    continue
  fi

  case $ac_option in
  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
  *=)   ac_optarg= ;;
  *)    ac_optarg=yes ;;
  esac

  # Accept the important Cygnus configure options, so we can diagnose typos.

  case $ac_dashdash$ac_option in
  --)
    ac_dashdash=yes ;;

  -bindir | --bindir | --bindi | --bind | --bin | --bi)
    ac_prev=bindir ;;
  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
    bindir=$ac_optarg ;;

  -build | --build | --buil | --bui | --bu)
    ac_prev=build_alias ;;
  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
    build_alias=$ac_optarg ;;

  -cache-file | --cache-file | --cache-fil | --cache-fi \
  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
    ac_prev=cache_file ;;
  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
    cache_file=$ac_optarg ;;

  --config-cache | -C)
    cache_file=config.cache ;;

  -datadir | --datadir | --datadi | --datad)
    ac_prev=datadir ;;
  -datadir=* | --datadir=* | --datadi=* | --datad=*)
    datadir=$ac_optarg ;;

  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
  | --dataroo | --dataro | --datar)
    ac_prev=datarootdir ;;
  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
    datarootdir=$ac_optarg ;;

  -disable-* | --disable-*)
    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
    # Reject names that are not valid shell variable names.
    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
      as_fn_error $? "invalid feature name: $ac_useropt"
    ac_useropt_orig=$ac_useropt
    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
    case $ac_user_opts in
      *"
"enable_$ac_useropt"
"*) ;;
      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
	 ac_unrecognized_sep=', ';;
    esac
    eval enable_$ac_useropt=no ;;

  -docdir | --docdir | --docdi | --doc | --do)
    ac_prev=docdir ;;
  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
    docdir=$ac_optarg ;;

  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
    ac_prev=dvidir ;;
  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
    dvidir=$ac_optarg ;;

  -enable-* | --enable-*)
    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
    # Reject names that are not valid shell variable names.
    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
      as_fn_error $? "invalid feature name: $ac_useropt"
    ac_useropt_orig=$ac_useropt
    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
    case $ac_user_opts in
      *"
"enable_$ac_useropt"
"*) ;;
      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
	 ac_unrecognized_sep=', ';;
    esac
    eval enable_$ac_useropt=\$ac_optarg ;;

  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  | --exec | --exe | --ex)
    ac_prev=exec_prefix ;;
  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  | --exec=* | --exe=* | --ex=*)
    exec_prefix=$ac_optarg ;;

  -gas | --gas | --ga | --g)
    # Obsolete; use --with-gas.
    with_gas=yes ;;

  -help | --help | --hel | --he | -h)
    ac_init_help=long ;;
  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
    ac_init_help=recursive ;;
  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
    ac_init_help=short ;;

  -host | --host | --hos | --ho)
    ac_prev=host_alias ;;
  -host=* | --host=* | --hos=* | --ho=*)
    host_alias=$ac_optarg ;;

  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
    ac_prev=htmldir ;;
  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
  | --ht=*)
    htmldir=$ac_optarg ;;

  -includedir | --includedir | --includedi | --included | --include \
  | --includ | --inclu | --incl | --inc)
    ac_prev=includedir ;;
  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
  | --includ=* | --inclu=* | --incl=* | --inc=*)
    includedir=$ac_optarg ;;

  -infodir | --infodir | --infodi | --infod | --info | --inf)
    ac_prev=infodir ;;
  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
    infodir=$ac_optarg ;;

  -libdir | --libdir | --libdi | --libd)
    ac_prev=libdir ;;
  -libdir=* | --libdir=* | --libdi=* | --libd=*)
    libdir=$ac_optarg ;;

  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
  | --libexe | --libex | --libe)
    ac_prev=libexecdir ;;
  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
  | --libexe=* | --libex=* | --libe=*)
    libexecdir=$ac_optarg ;;

  -localedir | --localedir | --localedi | --localed | --locale)
    ac_prev=localedir ;;
  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
    localedir=$ac_optarg ;;

  -localstatedir | --localstatedir | --localstatedi | --localstated \
  | --localstate | --localstat | --localsta | --localst | --locals)
    ac_prev=localstatedir ;;
  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
    localstatedir=$ac_optarg ;;

  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
    ac_prev=mandir ;;
  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
    mandir=$ac_optarg ;;

  -nfp | --nfp | --nf)
    # Obsolete; use --without-fp.
    with_fp=no ;;

  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  | --no-cr | --no-c | -n)
    no_create=yes ;;

  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
    no_recursion=yes ;;

  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
  | --oldin | --oldi | --old | --ol | --o)
    ac_prev=oldincludedir ;;
  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
    oldincludedir=$ac_optarg ;;

  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
    ac_prev=prefix ;;
  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
    prefix=$ac_optarg ;;

  -program-prefix | --program-prefix | --program-prefi | --program-pref \
  | --program-pre | --program-pr | --program-p)
    ac_prev=program_prefix ;;
  -program-prefix=* | --program-prefix=* | --program-prefi=* \
  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
    program_prefix=$ac_optarg ;;

  -program-suffix | --program-suffix | --program-suffi | --program-suff \
  | --program-suf | --program-su | --program-s)
    ac_prev=program_suffix ;;
  -program-suffix=* | --program-suffix=* | --program-suffi=* \
  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
    program_suffix=$ac_optarg ;;

  -program-transform-name | --program-transform-name \
  | --program-transform-nam | --program-transform-na \
  | --program-transform-n | --program-transform- \
  | --program-transform | --program-transfor \
  | --program-transfo | --program-transf \
  | --program-trans | --program-tran \
  | --progr-tra | --program-tr | --program-t)
    ac_prev=program_transform_name ;;
  -program-transform-name=* | --program-transform-name=* \
  | --program-transform-nam=* | --program-transform-na=* \
  | --program-transform-n=* | --program-transform-=* \
  | --program-transform=* | --program-transfor=* \
  | --program-transfo=* | --program-transf=* \
  | --program-trans=* | --program-tran=* \
  | --progr-tra=* | --program-tr=* | --program-t=*)
    program_transform_name=$ac_optarg ;;

  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
    ac_prev=pdfdir ;;
  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
    pdfdir=$ac_optarg ;;

  -psdir | --psdir | --psdi | --psd | --ps)
    ac_prev=psdir ;;
  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
    psdir=$ac_optarg ;;

  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  | -silent | --silent | --silen | --sile | --sil)
    silent=yes ;;

  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
    ac_prev=sbindir ;;
  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
  | --sbi=* | --sb=*)
    sbindir=$ac_optarg ;;

  -sharedstatedir | --sharedstatedir | --sharedstatedi \
  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
  | --sharedst | --shareds | --shared | --share | --shar \
  | --sha | --sh)
    ac_prev=sharedstatedir ;;
  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
  | --sha=* | --sh=*)
    sharedstatedir=$ac_optarg ;;

  -site | --site | --sit)
    ac_prev=site ;;
  -site=* | --site=* | --sit=*)
    site=$ac_optarg ;;

  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
    ac_prev=srcdir ;;
  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
    srcdir=$ac_optarg ;;

  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
  | --syscon | --sysco | --sysc | --sys | --sy)
    ac_prev=sysconfdir ;;
  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
    sysconfdir=$ac_optarg ;;

  -target | --target | --targe | --targ | --tar | --ta | --t)
    ac_prev=target_alias ;;
  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
    target_alias=$ac_optarg ;;

  -v | -verbose | --verbose | --verbos | --verbo | --verb)
    verbose=yes ;;

  -version | --version | --versio | --versi | --vers | -V)
    ac_init_version=: ;;

  -with-* | --with-*)
    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
    # Reject names that are not valid shell variable names.
    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
      as_fn_error $? "invalid package name: $ac_useropt"
    ac_useropt_orig=$ac_useropt
    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
    case $ac_user_opts in
      *"
"with_$ac_useropt"
"*) ;;
      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
	 ac_unrecognized_sep=', ';;
    esac
    eval with_$ac_useropt=\$ac_optarg ;;

  -without-* | --without-*)
    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
    # Reject names that are not valid shell variable names.
    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
      as_fn_error $? "invalid package name: $ac_useropt"
    ac_useropt_orig=$ac_useropt
    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
    case $ac_user_opts in
      *"
"with_$ac_useropt"
"*) ;;
      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
	 ac_unrecognized_sep=', ';;
    esac
    eval with_$ac_useropt=no ;;

  --x)
    # Obsolete; use --with-x.
    with_x=yes ;;

  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
  | --x-incl | --x-inc | --x-in | --x-i)
    ac_prev=x_includes ;;
  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
    x_includes=$ac_optarg ;;

  -x-libraries | --x-libraries | --x-librarie | --x-librari \
  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
    ac_prev=x_libraries ;;
  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
    x_libraries=$ac_optarg ;;

  -*) as_fn_error $? "unrecognized option: \`$ac_option'
Try \`$0 --help' for more information"
    ;;

  *=*)
    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
    # Reject names that are not valid shell variable names.
    case $ac_envvar in #(
      '' | [0-9]* | *[!_$as_cr_alnum]* )
      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
    esac
    eval $ac_envvar=\$ac_optarg
    export $ac_envvar ;;

  *)
    # FIXME: should be removed in autoconf 3.0.
    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
    ;;

  esac
done

if test -n "$ac_prev"; then
  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
  as_fn_error $? "missing argument to $ac_option"
fi

if test -n "$ac_unrecognized_opts"; then
  case $enable_option_checking in
    no) ;;
    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
  esac
fi

# Check all directory arguments for consistency.
for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
		datadir sysconfdir sharedstatedir localstatedir includedir \
		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
		libdir localedir mandir
do
  eval ac_val=\$$ac_var
  # Remove trailing slashes.
  case $ac_val in
    */ )
      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
      eval $ac_var=\$ac_val;;
  esac
  # Be sure to have absolute directory names.
  case $ac_val in
    [\\/$]* | ?:[\\/]* )  continue;;
    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
  esac
  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done

# There might be people who depend on the old broken behavior: `$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
build=$build_alias
host=$host_alias
target=$target_alias

# FIXME: To remove some day.
if test "x$host_alias" != x; then
  if test "x$build_alias" = x; then
    cross_compiling=maybe
  elif test "x$build_alias" != "x$host_alias"; then
    cross_compiling=yes
  fi
fi

ac_tool_prefix=
test -n "$host_alias" && ac_tool_prefix=$host_alias-

test "$silent" = yes && exec 6>/dev/null


ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
  as_fn_error $? "working directory cannot be determined"
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
  as_fn_error $? "pwd does not report name of working directory"


# Find the source files, if location was not specified.
if test -z "$srcdir"; then
  ac_srcdir_defaulted=yes
  # Try the directory containing this script, then the parent directory.
  ac_confdir=`$as_dirname -- "$as_myself" ||
$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$as_myself" : 'X\(//\)[^/]' \| \
	 X"$as_myself" : 'X\(//\)$' \| \
	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_myself" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
  srcdir=$ac_confdir
  if test ! -r "$srcdir/$ac_unique_file"; then
    srcdir=..
  fi
else
  ac_srcdir_defaulted=no
fi
if test ! -r "$srcdir/$ac_unique_file"; then
  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
	pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
  srcdir=.
fi
# Remove unnecessary trailing slashes from srcdir.
# Double slashes in file names in object file debugging info
# mess up M-x gdb in Emacs.
case $srcdir in
*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
esac
for ac_var in $ac_precious_vars; do
  eval ac_env_${ac_var}_set=\${${ac_var}+set}
  eval ac_env_${ac_var}_value=\$${ac_var}
  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
  eval ac_cv_env_${ac_var}_value=\$${ac_var}
done

#
# Report the --help message.
#
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 ABINIT 10.0.9 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print \`checking ...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for \`--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or \`..']

Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [$ac_default_prefix]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
an installation prefix other than \`$ac_default_prefix' using \`--prefix',
for instance \`--prefix=\$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR            user executables [EPREFIX/bin]
  --sbindir=DIR           system admin executables [EPREFIX/sbin]
  --libexecdir=DIR        program executables [EPREFIX/libexec]
  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
  --libdir=DIR            object code libraries [EPREFIX/lib]
  --includedir=DIR        C header files [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
  --infodir=DIR           info documentation [DATAROOTDIR/info]
  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
  --mandir=DIR            man documentation [DATAROOTDIR/man]
  --docdir=DIR            documentation root [DATAROOTDIR/doc/abinit]
  --htmldir=DIR           html documentation [DOCDIR]
  --dvidir=DIR            dvi documentation [DOCDIR]
  --pdfdir=DIR            pdf documentation [DOCDIR]
  --psdir=DIR             ps documentation [DOCDIR]
_ACEOF

  cat <<\_ACEOF

Program names:
  --program-prefix=PREFIX            prepend PREFIX to installed program names
  --program-suffix=SUFFIX            append SUFFIX to installed program names
  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
  --target=TARGET   configure for building compilers for TARGET [HOST]
_ACEOF
fi

if test -n "$ac_init_help"; then
  case $ac_init_help in
     short | recursive ) echo "Configuration of ABINIT 10.0.9:";;
   esac
  cat <<\_ACEOF

Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-silent-rules   less verbose build output (undo: "make V=1")
  --disable-silent-rules  verbose build output (undo: "make V=0")
  --enable-avx-safe-mode  Disable vectorization in problematic procedures
                          (default: no)
  --enable-cclock         Use C clock for timings (default: no)
  --enable-crpa-optim     Enable optimize cRPA calculations for ifort <= 17.0
                          (default: no)
  --enable-fc-wrapper     Wrap Fortran compiler calls (default: no)
  --enable-gw-dpc         Activate double-precision GW calculations (default:
                          no)
  --enable-hints          Automatically adjust build flags to the current
                          configuration (default: yes)
  --enable-libtetra       Activate internal support for libtetra(hedron) in
                          ABINIT (default: yes)
  --enable-lotf           Activate LOTF functionality (UNMAINTAINED) (default:
                          no)
  --enable-memory-profiling
                          Enable memory profiling (default: no)
  --enable-mpi-gpu-aware  Assume support for passing GPU buffers to MPI
                          (default: no)
  --enable-mpi-inplace    Activate support for MPI_IN_PLACE (default: auto)
  --enable-mpi-interfaces-bugfix
                          Activate workaround for buggy MPI interfaces (not
                          having interfaces for scalars) (default: auto)
  --enable-mpi-io         Enable MPI I/O (default: auto)
  --enable-mpi-io-default Use MPI I/O as default I/O library (maintainer-only
                          option) (default: no)
  --enable-netcdf-default Use NetCDF as default I/O library (maintainer-only
                          option) (default: no)
  --enable-openmp         Activate support for OpenMP (default: no)
  --enable-openmp-offload Activate support for OpenMP GPU offload capabilities
                          (default: no)
  --enable-python-invocation
                          Activate possibility to call python scripts
                          externally by invoking a python interpreter
                          (default: no)
  --enable-source-debug   Build debugging instructions present in the source
                          code (default: no)
  --enable-stdin          Tell ABINIT to read file lists from standard input
                          (default: yes)
  --enable-timer          Activate support for the internal ABINIT timer
                          (default: yes)
  --enable-triqs-v1-4     Activate internal support for TRIQS 1.4 (default:
                          no)
  --enable-triqs-v2-0     Activate internal support for TRIQS 2.0 (This option
                          is dominant over the others versions) (default: no)
  --enable-zdot-bugfix    Activate workaround for bugged ZDOTC and ZDOTU
                          (default: auto)
  --enable-dependency-tracking
                          do not reject slow dependency extractors
  --disable-dependency-tracking
                          speeds up one-time build
  --disable-assert        turn off assertions
  --disable-xmltest       Do not try to compile and run a test LIBXML program

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-config-file      Specify config file to read options from (default:
                          '')
  --with-debug-flavor     Set debug level (default: 'basic')
  --with-fallbacks        Installation prefix of the ABINIT Fallbacks
                          (default: '')
  --with-fc-vendor        Fortran compiler vendor to be used by the build
                          system (default: '')
  --with-fc-version       Fortran compiler version to be used by the build
                          system (default: '')
  --with-libxml2          Enable support for the C XML library (default: '')
  --with-mpi-level        level of the MPI standard to use (default: '2')
  --with-optim-flavor     Set optimization level (default: 'standard')
  --with-mpi              Install prefix of MPI (e.g. /usr/local). The default
                          behaviour is to detect whether the specified
                          compilers properly support MPI and to fall back to
                          serial mode if not. You may use --with-mpi without
                          argument to force MPI detection, in which case
                          detection failures will result in errors, and
                          --without-mpi to disable MPI support completely.
  --with-mpi-flavor       Flavor of MPI to use (default: auto), see
                          ~abinit/doc/build/config-template.ac9 for details
  --with-gpu              Install prefix of a GPU SDK (e.g. /usr/local). You
                          may use --with-gpu without argument to force GPU
                          detection, in which case detection failures will
                          result in errors, and --without-gpu to disable GPU
                          support completely.
  --with-gpu-markers      Enable GPU markers such as NVTX for NVIDIA CUDA or
                          ROCTX for AMD ROCm.
  --with-gpu-flavor       GPU flavor to select. Use it without argument to get
                          a list of supported flavors.
  --with-libxml2          Install prefix to look for libxml2, or automatic
                          configuration if set to 'yes' or 'no' (default: no)
  --with-xml-prefix=PFX   Prefix where libxml is installed (optional)
  --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)
  --with-hdf5             Install prefix of the HDF5 library (e.g.
                          /usr/local).
  --with-fftw3            Install prefix of the FFTW3 library (e.g.
                          /usr/local).
  --with-levmar           Install prefix of the Levmar library (e.g.
                          /usr/local).
  --with-libpsml          Install prefix of the PSML I/O library (e.g.
                          /usr/local).
  --with-libxc            Install prefix of the LibXC library (e.g.
                          /usr/local).
  --with-netcdf           Install prefix of the NetCDF library (e.g.
                          /usr/local).
  --with-netcdf-fortran   Install prefix of the NetCDF Fortran interface
                          library (e.g. /usr/local).
  --with-papi             Install prefix of the Flexible Data Format I/O
                          library (e.g. /usr/local).
  --with-pfft             Install prefix of the PFFT library (e.g.
                          /usr/local).
  --with-triqs            Install prefix of the TRIQS library (e.g.
                          /usr/local).
  --with-wannier90        Install prefix of the PSML I/O library (e.g.
                          /usr/local).
  --with-xmlf90           Install prefix of the PSML I/O library (e.g.
                          /usr/local).
  --with-kokkos           Install prefix of the Kokkos core libraries library
                          (e.g. /usr/local).
  --with-yakl             Install prefix of the YAKL library (e.g.
                          /usr/local).
  --with-linalg           Install prefix of the linear algebra libraries (e.g.
                          /usr/local), or automatic configuration if set to
                          'yes' or 'no'.
  --with-linalg-flavor    Linear algebra flavor to select
  --with-fft-flavor       FFT flavor to select
  --with-abinit_common    Install prefix of the ABINIT Common library (e.g.
                          /usr/local).
  --with-libpaw           Install prefix of the LibPAW library (e.g.
                          /usr/local).
  --with-bigdft           Install prefix of the PSML I/O library (e.g.
                          /usr/local).

Some influential environment variables:
  ARFLAGS_DEBUG
              Library archiver flags for debugging
  ARFLAGS_EXTRA
              Additional library archiver flags
  ARFLAGS_OPTIM
              Library archiver flags for optimization
  CC_LDFLAGS  C linker flags
  CC_LDFLAGS_DEBUG
              C linker flags for debugging
  CC_LDFLAGS_OPTIM
              C linker flags for optimization
  CC_LIBS     C linker libraries
  CC_LIBS_DEBUG
              C linker additional libraries for debugging
  CC_LIBS_OPTIM
              C linker additional libraries for optimization
  CFLAGS_DEBUG
              C compiler flags for debugging
  CFLAGS_EXTRA
              Additional C compiler flags
  CFLAGS_OPTIM
              C compiler flags for optimization
  CPPFLAGS_DEBUG
              C preprocessor flags for debugging
  CPPFLAGS_EXTRA
              Additional C preprocessor flags
  CPPFLAGS_OPTIM
              C preprocessor flags for optimization
  CXXFLAGS_DEBUG
              C++ compiler flags for debugging
  CXXFLAGS_EXTRA
              Additional C++ compiler flags
  CXXFLAGS_OPTIM
              C++ compiler flags for optimization
  CXX_LDFLAGS C++ linker flags
  CXX_LDFLAGS_DEBUG
              C++ linker flags for debugging
  CXX_LDFLAGS_EXTRA
              Additional C++ linker flags
  CXX_LDFLAGS_OPTIM
              C++ linker flags for optimization
  CXX_LIBS    C++ linker additional libraries
  CXX_LIBS_DEBUG
              C++ linker additional libraries for debugging
  CXX_LIBS_OPTIM
              C++ linker additional libraries for optimization
  FCFLAGS_DEBUG
              Fortran compiler flags for debugging
  FCFLAGS_EXTRA
              Additional Fortran compiler flags
  FCFLAGS_FIXEDFORM
              Fortran flags for fixed-form source files
  FCFLAGS_FREEFORM
              Fortran flags for free-form source files
  FCFLAGS_HINTS
              Tricky Fortran compiler flags
  FCFLAGS_MODDIR
              Fortran compiler flags to use a module directory
  FCFLAGS_OPENMP
              Fortran compiler flags to enable openmp
  FCFLAGS_OPENMP_OFFLOAD
              Fortran compiler flags to enable openmp GPU offload capabilities
  FCFLAGS_OPTIM
              Fortran compiler flags for optimization
  FC_LDFLAGS  Fortran linker flags
  FC_LDFLAGS_DEBUG
              Fortran linker flags for debugging
  FC_LDFLAGS_EXTRA
              Additional Fortran linker flags
  FC_LDFLAGS_OPTIM
              Fortran linker flags for optimization
  FC_LIBS     Fortran linker additional libraries
  FC_LIBS_DEBUG
              Fortran linker additional libraries for debugging
  FC_LIBS_OPTIM
              Fortran linker additional libraries for optimization
  FFT_CFLAGS  C compiler flags for external FFT support
  FFT_FCFLAGS Fortran compiler flags for external FFT support
  FPP         Fortran preprocessor
  FPPFLAGS    Fortran preprocessor flags
  FPPFLAGS_DEBUG
              Fortran preprocessor flags for debugging
  FPPFLAGS_EXTRA
              Additional Fortran preprocessor flags
  FPPFLAGS_OPTIM
              Fortran preprocessor flags for optimization
  GPU_ARCH    ID of GPU architecture used to run ABINIT. Example : 80 (NVIDIA
              Ampere), gfx908 (AMD MI100)
  PYFLAGS     Execution flags for the Python interpreter
  PYTHON_CPPFLAGS
              C preprocessing flags for C/Python bindings
  XPP         C++ preprocessor
  XPPFLAGS    C++ preprocessor flags
  XPPFLAGS_DEBUG
              C++ preprocessor flags for debugging
  XPPFLAGS_EXTRA
              Additional C++ preprocessor flags
  XPPFLAGS_OPTIM
              C++ preprocessor flags for optimization
  MPI_CPPFLAGS
              C preprocessing flags for MPI.
  MPI_CFLAGS  C flags for MPI.
  MPI_CXXFLAGS
              C++ flags for MPI.
  MPI_FCFLAGS Fortran flags for MPI.
  MPI_FFLAGS  Fortran flags for MPI (better use MPI_FCFLAGS).
  MPI_LDFLAGS Linker flags for MPI.
  MPI_LIBS    Library flags for MPI.
  GPU_CPPFLAGS
              C preprocessing flags for GPU.
  GPU_CFLAGS  C flags for GPU.
  GPU_CXXFLAGS
              C++ flags for GPU.
  GPU_FCFLAGS Fortran flags for GPU.
  GPU_FFLAGS  Fortran flags for GPU (better use GPU_FCFLAGS).
  GPU_LDFLAGS Linker flags for GPU.
  GPU_LIBS    Library flags for GPU.
  LIBXML2_CPPFLAGS
              C preprocessing flags for libxml2 (default: empty)
  LIBXML2_FCFLAGS
              Fortran flags for libxml2 (default: empty)
  LIBXML2_LIBS
              Library flags for libxml2 (default: empty)
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CPP         C preprocessor
  CXX         C++ compiler command
  CXXFLAGS    C++ compiler flags
  FC          Fortran compiler command
  FCFLAGS     Fortran compiler flags
  H5CC        HDF5-aware C compiler.
  HDF5_CPPFLAGS
              C preprocessing flags for HDF5.
  HDF5_CFLAGS C flags for HDF5.
  HDF5_CXXFLAGS
              C flags for HDF5.
  HDF5_FCFLAGS
              Fortran flags for HDF5.
  HDF5_FFLAGS Fortran flags for HDF5 (better use HDF5_FCFLAGS).
  HDF5_LDFLAGS
              Linker flags for HDF5.
  HDF5_LIBS   Library flags for HDF5.
  FFTW3_CPPFLAGS
              C preprocessing flags for FFTW3.
  FFTW3_CFLAGS
              C flags for FFTW3.
  FFTW3_FCFLAGS
              Fortran flags for FFTW3.
  FFTW3_FFLAGS
              Fortran flags for FFTW3 (better use FFTW3_FCFLAGS).
  FFTW3_LDFLAGS
              Linker flags for FFTW3.
  FFTW3_LIBS  Library flags for FFTW3.
  LEVMAR_CPPFLAGS
              C preprocessing flags for Levmar.
  LEVMAR_CFLAGS
              C flags for Levmar.
  LEVMAR_LDFLAGS
              Linker flags for Levmar.
  LEVMAR_LIBS Library flags for Levmar.
  LIBPSML_CPPFLAGS
              C preprocessing flags for LibPSML.
  LIBPSML_FCFLAGS
              Fortran flags for LibPSML.
  LIBPSML_FFLAGS
              Fortran flags for LibPSML (better use LIBPSML_FCFLAGS).
  LIBPSML_LDFLAGS
              Linker flags for LibPSML.
  LIBPSML_LIBS
              Library flags for LibPSML.
  LIBXC_CPPFLAGS
              C preprocessing flags for LibXC.
  LIBXC_CFLAGS
              C flags for LibXC.
  LIBXC_FCFLAGS
              Fortran flags for LibXC.
  LIBXC_FFLAGS
              Fortran flags for LibXC (better use LIBXC_FCFLAGS).
  LIBXC_LDFLAGS
              Linker flags for LibXC.
  LIBXC_LIBS  Library flags for LibXC.
  NETCDF_CPPFLAGS
              C preprocessing flags for NetCDF.
  NETCDF_CFLAGS
              C flags for NetCDF.
  NETCDF_CXXFLAGS
              C++ flags for NetCDF.
  NETCDF_FCFLAGS
              Fortran flags for NetCDF.
  NETCDF_FFFLAGS
              Fortran flags for NetCDF (better use NETCDF_FCFLAGS).
  NETCDF_LDFLAGS
              Linker flags for NetCDF.
  NETCDF_LIBS Library flags for NetCDF.
  NETCDF_FORTRAN_CPPFLAGS
              C preprocessing flags for NetCDF Fortran interface.
  NETCDF_FORTRAN_CFLAGS
              C flags for NetCDF Fortran interface.
  NETCDF_FORTRAN_CXXFLAGS
              C++ flags for NetCDF Fortran interface.
  NETCDF_FORTRAN_FCFLAGS
              Fortran flags for NetCDF Fortran interface.
  NETCDF_FORTRAN_FFLAGS
              Fortran flags for NetCDF Fortran interface (better use
              NETCDF_FORTRAN_FCFLAGS).
  NETCDF_FORTRAN_LDFLAGS
              Linker flags for NetCDF Fortran interface.
  NETCDF_FORTRAN_LIBS
              Library flags for NetCDF Fortran interface.
  PAPI_CPPFLAGS
              C preprocessing flags for PAPI.
  PAPI_CFLAGS C flags for PAPI.
  PAPI_LDFLAGS
              Linker flags for PAPI.
  PAPI_LIBS   Library flags for PAPI.
  PFFT_CPPFLAGS
              C preprocessing flags for PFFT.
  PFFT_CFLAGS C flags for PFFT.
  PFFT_LDFLAGS
              Linker flags for PFFT.
  PFFT_LIBS   Library flags for PFFT.
  TRIQS_CPPFLAGS
              C preprocessing flags for TRIQS.
  TRIQS_CFLAGS
              C flags for TRIQS.
  TRIQS_CXXFLAGS
              C++ flags for TRIQS.
  TRIQS_LDFLAGS
              Linker flags for TRIQS.
  TRIQS_LIBS  Library flags for TRIQS.
  WANNIER90_CPPFLAGS
              C preprocessing flags for Wannier90.
  WANNIER90_FCFLAGS
              Fortran flags for Wannier90.
  WANNIER90_FFLAGS
              Fortran flags for Wannier90 (better use WANNIER90_FCFLAGS).
  WANNIER90_LDFLAGS
              Linker flags for Wannier90.
  WANNIER90_LIBS
              Library flags for Wannier90.
  XMLF90_CPPFLAGS
              C preprocessing flags for XMLF90.
  XMLF90_FCFLAGS
              Fortran flags for XMLF90.
  XMLF90_FFLAGS
              Fortran flags for XMLF90 (better use XMLF90_FCFLAGS).
  XMLF90_LDFLAGS
              Linker flags for XMLF90.
  XMLF90_LIBS Library flags for XMLF90.
  KOKKOS_CPPFLAGS
              C preprocessing flags for Kokkos core libraries.
  KOKKOS_CXXFLAGS
              C++ flags for Kokkos core libraries.
  KOKKOS_LDFLAGS
              Linker flags for Kokkos core libraries.
  KOKKOS_LIBS Library flags for Kokkos core libraries.
  YAKL_CPPFLAGS
              C preprocessing flags for YAKL.
  YAKL_FCFLAGS
              Fortran flags for YAKL.
  YAKL_FFLAGS Fortran flags for YAKL (better use YAKL_FCFLAGS).
  YAKL_LDFLAGS
              Linker flags for YAKL.
  YAKL_LIBS   Library flags for YAKL.
  LINALG_CPPFLAGS
              C preprocessing flags for linear algebra.
  LINALG_CFLAGS
              C flags for linear algebra.
  LINALG_CXXFLAGS
              C++ flags for linear algebra.
  LINALG_FCFLAGS
              Fortran flags for linear algebra.
  LINALG_FFLAGS
              Fortran flags for linear algebra (better use LINALG_FCFLAGS).
  LINALG_LDFLAGS
              Linker flags for linear algebra.
  LINALG_LIBS Library flags for linear algebra.
  ABINIT_COMMON_CPPFLAGS
              C preprocessing flags for ABINIT Common.
  ABINIT_COMMON_FCFLAGS
              Fortran flags for ABINIT Common.
  ABINIT_COMMON_FFLAGS
              Fortran flags for ABINIT Common (better use
              ABINIT_COMMON_FCFLAGS).
  ABINIT_COMMON_LDFLAGS
              Linker flags for ABINIT Common.
  ABINIT_COMMON_LIBS
              Library flags for ABINIT Common.
  LIBPAW_CPPFLAGS
              C preprocessing flags for LibPAW.
  LIBPAW_FCFLAGS
              Fortran flags for LibPAW.
  LIBPAW_FFLAGS
              Fortran flags for LibPAW (better use LIBPAW_FCFLAGS).
  LIBPAW_LDFLAGS
              Linker flags for LibPAW.
  LIBPAW_LIBS Library flags for LibPAW.
  BIGDFT_CPPFLAGS
              C preprocessing flags for BigDFT.
  BIGDFT_FCFLAGS
              Fortran flags for BigDFT.
  BIGDFT_FFLAGS
              Fortran flags for BigDFT (better use BIGDFT_FCFLAGS).
  BIGDFT_LDFLAGS
              Linker flags for BigDFT.
  BIGDFT_LIBS Library flags for BigDFT.

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

In order to facilitate the configuration of Abinit, you can save the options
you regularly use into a file. For full instructions, please consult the
doc/build/config-template.ac9 file in this directory tree.

A lot more documentation on how to build and run Abinit is available on the
Abinit Wiki. Please consult it at https://wiki.abinit.org/ whenever needed.
Examples of configuration files for clusters are available at
https://github.com/abinit/abiconfig.


Report bugs to <https://bugs.launchpad.net/abinit/>.
_ACEOF
ac_status=$?
fi

if test "$ac_init_help" = "recursive"; then
  # If there are subdirs, report their specific --help.
  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
    test -d "$ac_dir" ||
      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
      continue
    ac_builddir=.

case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
  # A ".." for each directory in $ac_dir_suffix.
  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
  case $ac_top_builddir_sub in
  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
  esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix

case $srcdir in
  .)  # We are building in place.
    ac_srcdir=.
    ac_top_srcdir=$ac_top_builddir_sub
    ac_abs_top_srcdir=$ac_pwd ;;
  [\\/]* | ?:[\\/]* )  # Absolute name.
    ac_srcdir=$srcdir$ac_dir_suffix;
    ac_top_srcdir=$srcdir
    ac_abs_top_srcdir=$srcdir ;;
  *) # Relative name.
    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
    ac_top_srcdir=$ac_top_build_prefix$srcdir
    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix

    cd "$ac_dir" || { ac_status=$?; continue; }
    # Check for guested configure.
    if test -f "$ac_srcdir/configure.gnu"; then
      echo &&
      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
    elif test -f "$ac_srcdir/configure"; then
      echo &&
      $SHELL "$ac_srcdir/configure" --help=recursive
    else
      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
    fi || ac_status=$?
    cd "$ac_pwd" || { ac_status=$?; break; }
  done
fi

test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
  cat <<\_ACEOF
ABINIT configure 10.0.9
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
  exit
fi

## ------------------------ ##
## Autoconf initialization. ##
## ------------------------ ##

# ac_fn_c_try_compile LINENO
# --------------------------
# Try to compile conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_compile ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  rm -f conftest.$ac_objext
  if { { ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_compile") 2>conftest.err
  ac_status=$?
  if test -s conftest.err; then
    grep -v '^ *+' conftest.err >conftest.er1
    cat conftest.er1 >&5
    mv -f conftest.er1 conftest.err
  fi
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest.$ac_objext; then :
  ac_retval=0
else
  $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_retval=1
fi
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
  as_fn_set_status $ac_retval

} # ac_fn_c_try_compile

# ac_fn_c_try_cpp LINENO
# ----------------------
# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_cpp ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  if { { ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
  ac_status=$?
  if test -s conftest.err; then
    grep -v '^ *+' conftest.err >conftest.er1
    cat conftest.er1 >&5
    mv -f conftest.er1 conftest.err
  fi
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } > conftest.i && {
	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
	 test ! -s conftest.err
       }; then :
  ac_retval=0
else
  $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

    ac_retval=1
fi
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
  as_fn_set_status $ac_retval

} # ac_fn_c_try_cpp

# ac_fn_cxx_try_compile LINENO
# ----------------------------
# Try to compile conftest.$ac_ext, and return whether this succeeded.
ac_fn_cxx_try_compile ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  rm -f conftest.$ac_objext
  if { { ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_compile") 2>conftest.err
  ac_status=$?
  if test -s conftest.err; then
    grep -v '^ *+' conftest.err >conftest.er1
    cat conftest.er1 >&5
    mv -f conftest.er1 conftest.err
  fi
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } && {
	 test -z "$ac_cxx_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest.$ac_objext; then :
  ac_retval=0
else
  $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_retval=1
fi
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
  as_fn_set_status $ac_retval

} # ac_fn_cxx_try_compile

# ac_fn_fc_try_compile LINENO
# ---------------------------
# Try to compile conftest.$ac_ext, and return whether this succeeded.
ac_fn_fc_try_compile ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  rm -f conftest.$ac_objext
  if { { ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_compile") 2>conftest.err
  ac_status=$?
  if test -s conftest.err; then
    grep -v '^ *+' conftest.err >conftest.er1
    cat conftest.er1 >&5
    mv -f conftest.er1 conftest.err
  fi
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } && {
	 test -z "$ac_fc_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest.$ac_objext; then :
  ac_retval=0
else
  $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_retval=1
fi
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
  as_fn_set_status $ac_retval

} # ac_fn_fc_try_compile

# ac_fn_c_try_link LINENO
# -----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_link ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  rm -f conftest.$ac_objext conftest$ac_exeext
  if { { ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_link") 2>conftest.err
  ac_status=$?
  if test -s conftest.err; then
    grep -v '^ *+' conftest.err >conftest.er1
    cat conftest.er1 >&5
    mv -f conftest.er1 conftest.err
  fi
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext && {
	 test "$cross_compiling" = yes ||
	 test -x conftest$ac_exeext
       }; then :
  ac_retval=0
else
  $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_retval=1
fi
  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
  # interfere with the next link command; also delete a directory that is
  # left behind by Apple's compiler.  We do this before executing the actions.
  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
  as_fn_set_status $ac_retval

} # ac_fn_c_try_link

# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists, giving a warning if it cannot be compiled using
# the include files in INCLUDES and setting the cache variable VAR
# accordingly.
ac_fn_c_check_header_mongrel ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  if eval \${$3+:} false; then :
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
  $as_echo_n "(cached) " >&6
fi
eval ac_res=\$$3
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
else
  # Is the header compilable?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
$as_echo_n "checking $2 usability... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
#include <$2>
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_header_compiler=yes
else
  ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
$as_echo "$ac_header_compiler" >&6; }

# Is the header present?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
$as_echo_n "checking $2 presence... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <$2>
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
  ac_header_preproc=yes
else
  ac_header_preproc=no
fi
rm -f conftest.err conftest.i conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
$as_echo "$ac_header_preproc" >&6; }

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
  yes:no: )
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
    ;;
  no:yes:* )
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
( $as_echo "## ------------------------------------------------- ##
## Report this to https://bugs.launchpad.net/abinit/ ##
## ------------------------------------------------- ##"
     ) | sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
  $as_echo_n "(cached) " >&6
else
  eval "$3=\$ac_header_compiler"
fi
eval ac_res=\$$3
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
fi
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno

} # ac_fn_c_check_header_mongrel

# ac_fn_c_try_run LINENO
# ----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
# that executables *can* be run.
ac_fn_c_try_run ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  if { { ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_link") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
  { { case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_try") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; }; then :
  ac_retval=0
else
  $as_echo "$as_me: program exited with status $ac_status" >&5
       $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

       ac_retval=$ac_status
fi
  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
  as_fn_set_status $ac_retval

} # ac_fn_c_try_run

# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists and can be compiled using the include files in
# INCLUDES, setting the cache variable VAR accordingly.
ac_fn_c_check_header_compile ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
#include <$2>
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  eval "$3=yes"
else
  eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$3
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno

} # ac_fn_c_check_header_compile

# ac_fn_c_check_func LINENO FUNC VAR
# ----------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
ac_fn_c_check_func ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define $2 innocuous_$2

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $2 (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef $2

/* 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 $2 ();
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined __stub_$2 || defined __stub___$2
choke me
#endif

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
return $2 ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  eval "$3=yes"
else
  eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
fi
eval ac_res=\$$3
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno

} # ac_fn_c_check_func

# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
# --------------------------------------------
# Tries to find the compile-time value of EXPR in a program that includes
# INCLUDES, setting VAR accordingly. Returns whether the value could be
# computed
ac_fn_c_compute_int ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  if test "$cross_compiling" = yes; then
    # Depending upon the size, compute the lo and hi bounds.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
static int test_array [1 - 2 * !(($2) >= 0)];
test_array [0] = 0;
return test_array [0];

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_lo=0 ac_mid=0
  while :; do
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
test_array [0] = 0;
return test_array [0];

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_hi=$ac_mid; break
else
  as_fn_arith $ac_mid + 1 && ac_lo=$as_val
			if test $ac_lo -le $ac_mid; then
			  ac_lo= ac_hi=
			  break
			fi
			as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
static int test_array [1 - 2 * !(($2) < 0)];
test_array [0] = 0;
return test_array [0];

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_hi=-1 ac_mid=-1
  while :; do
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
static int test_array [1 - 2 * !(($2) >= $ac_mid)];
test_array [0] = 0;
return test_array [0];

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_lo=$ac_mid; break
else
  as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
			if test $ac_mid -le $ac_hi; then
			  ac_lo= ac_hi=
			  break
			fi
			as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  ac_lo= ac_hi=
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
test_array [0] = 0;
return test_array [0];

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_hi=$ac_mid
else
  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in #((
?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
'') ac_retval=1 ;;
esac
  else
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
static long int longval () { return $2; }
static unsigned long int ulongval () { return $2; }
#include <stdio.h>
#include <stdlib.h>
#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    return 1;
  if (($2) < 0)
    {
      long int i = longval ();
      if (i != ($2))
	return 1;
      fprintf (f, "%ld", i);
    }
  else
    {
      unsigned long int i = ulongval ();
      if (i != ($2))
	return 1;
      fprintf (f, "%lu", i);
    }
  /* Do not output a trailing newline, as this causes \r\n confusion
     on some platforms.  */
  return ferror (f) || fclose (f) != 0;

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
  echo >>conftest.val; read $3 <conftest.val; ac_retval=0
else
  ac_retval=1
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  conftest.$ac_objext conftest.beam conftest.$ac_ext
rm -f conftest.val

  fi
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
  as_fn_set_status $ac_retval

} # ac_fn_c_compute_int

# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
# -------------------------------------------
# Tests whether TYPE exists after having included INCLUDES, setting cache
# variable VAR accordingly.
ac_fn_c_check_type ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
  $as_echo_n "(cached) " >&6
else
  eval "$3=no"
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
if (sizeof ($2))
	 return 0;
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$4
#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
if (sizeof (($2)))
	    return 0;
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :

else
  eval "$3=yes"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$3
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno

} # ac_fn_c_check_type

# ac_fn_fc_try_link LINENO
# ------------------------
# Try to link conftest.$ac_ext, and return whether this succeeded.
ac_fn_fc_try_link ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  rm -f conftest.$ac_objext conftest$ac_exeext
  if { { ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_link") 2>conftest.err
  ac_status=$?
  if test -s conftest.err; then
    grep -v '^ *+' conftest.err >conftest.er1
    cat conftest.er1 >&5
    mv -f conftest.er1 conftest.err
  fi
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } && {
	 test -z "$ac_fc_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext && {
	 test "$cross_compiling" = yes ||
	 test -x conftest$ac_exeext
       }; then :
  ac_retval=0
else
  $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_retval=1
fi
  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
  # interfere with the next link command; also delete a directory that is
  # left behind by Apple's compiler.  We do this before executing the actions.
  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
  as_fn_set_status $ac_retval

} # ac_fn_fc_try_link

# ac_fn_fc_try_run LINENO
# -----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
# that executables *can* be run.
ac_fn_fc_try_run ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  if { { ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_link") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
  { { case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_try") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; }; then :
  ac_retval=0
else
  $as_echo "$as_me: program exited with status $ac_status" >&5
       $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

       ac_retval=$ac_status
fi
  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
  as_fn_set_status $ac_retval

} # ac_fn_fc_try_run

# ac_fn_cxx_try_link LINENO
# -------------------------
# Try to link conftest.$ac_ext, and return whether this succeeded.
ac_fn_cxx_try_link ()
{
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  rm -f conftest.$ac_objext conftest$ac_exeext
  if { { ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_link") 2>conftest.err
  ac_status=$?
  if test -s conftest.err; then
    grep -v '^ *+' conftest.err >conftest.er1
    cat conftest.er1 >&5
    mv -f conftest.er1 conftest.err
  fi
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; } && {
	 test -z "$ac_cxx_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext && {
	 test "$cross_compiling" = yes ||
	 test -x conftest$ac_exeext
       }; then :
  ac_retval=0
else
  $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_retval=1
fi
  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
  # interfere with the next link command; also delete a directory that is
  # left behind by Apple's compiler.  We do this before executing the actions.
  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
  as_fn_set_status $ac_retval

} # ac_fn_cxx_try_link
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 ABINIT $as_me 10.0.9, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ $0 $@

_ACEOF
exec 5>>config.log
{
cat <<_ASUNAME
## --------- ##
## Platform. ##
## --------- ##

hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`

/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`

/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`

_ASUNAME

as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    $as_echo "PATH: $as_dir"
  done
IFS=$as_save_IFS

} >&5

cat >&5 <<_ACEOF


## ----------- ##
## Core tests. ##
## ----------- ##

_ACEOF


# Keep a trace of the command line.
# Strip out --no-create and --no-recursion so they do not pile up.
# Strip out --silent because we don't want to record it for future runs.
# Also quote any args containing shell meta-characters.
# Make two passes to allow for proper duplicate-argument suppression.
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
ac_must_keep_next=false
for ac_pass in 1 2
do
  for ac_arg
  do
    case $ac_arg in
    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
    | -silent | --silent | --silen | --sile | --sil)
      continue ;;
    *\'*)
      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
    esac
    case $ac_pass in
    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
    2)
      as_fn_append ac_configure_args1 " '$ac_arg'"
      if test $ac_must_keep_next = true; then
	ac_must_keep_next=false # Got value, back to normal.
      else
	case $ac_arg in
	  *=* | --config-cache | -C | -disable-* | --disable-* \
	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
	  | -with-* | --with-* | -without-* | --without-* | --x)
	    case "$ac_configure_args0 " in
	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
	    esac
	    ;;
	  -* ) ac_must_keep_next=true ;;
	esac
      fi
      as_fn_append ac_configure_args " '$ac_arg'"
      ;;
    esac
  done
done
{ ac_configure_args0=; unset ac_configure_args0;}
{ ac_configure_args1=; unset ac_configure_args1;}

# When interrupted or exit'd, cleanup temporary files, and complete
# config.log.  We remove comments because anyway the quotes in there
# would cause problems or look ugly.
# WARNING: Use '\'' to represent an apostrophe within the trap.
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
  # Save into config.log some information that might help in debugging.
  {
    echo

    $as_echo "## ---------------- ##
## Cache variables. ##
## ---------------- ##"
    echo
    # The following way of writing the cache mishandles newlines in values,
(
  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
    eval ac_val=\$$ac_var
    case $ac_val in #(
    *${as_nl}*)
      case $ac_var in #(
      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
      esac
      case $ac_var in #(
      _ | IFS | as_nl) ;; #(
      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
      *) { eval $ac_var=; unset $ac_var;} ;;
      esac ;;
    esac
  done
  (set) 2>&1 |
    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
    *${as_nl}ac_space=\ *)
      sed -n \
	"s/'\''/'\''\\\\'\'''\''/g;
	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
      ;; #(
    *)
      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
      ;;
    esac |
    sort
)
    echo

    $as_echo "## ----------------- ##
## Output variables. ##
## ----------------- ##"
    echo
    for ac_var in $ac_subst_vars
    do
      eval ac_val=\$$ac_var
      case $ac_val in
      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
      esac
      $as_echo "$ac_var='\''$ac_val'\''"
    done | sort
    echo

    if test -n "$ac_subst_files"; then
      $as_echo "## ------------------- ##
## File substitutions. ##
## ------------------- ##"
      echo
      for ac_var in $ac_subst_files
      do
	eval ac_val=\$$ac_var
	case $ac_val in
	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
	esac
	$as_echo "$ac_var='\''$ac_val'\''"
      done | sort
      echo
    fi

    if test -s confdefs.h; then
      $as_echo "## ----------- ##
## confdefs.h. ##
## ----------- ##"
      echo
      cat confdefs.h
      echo
    fi
    test "$ac_signal" != 0 &&
      $as_echo "$as_me: caught signal $ac_signal"
    $as_echo "$as_me: exit $exit_status"
  } >&5
  rm -f core *.core core.conftest.* &&
    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
    exit $exit_status
' 0
for ac_signal in 1 2 13 15; do
  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
done
ac_signal=0

# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h

$as_echo "/* confdefs.h */" > confdefs.h

# Predefined preprocessor variables.

cat >>confdefs.h <<_ACEOF
#define PACKAGE_NAME "$PACKAGE_NAME"
_ACEOF

cat >>confdefs.h <<_ACEOF
#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
_ACEOF

cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION "$PACKAGE_VERSION"
_ACEOF

cat >>confdefs.h <<_ACEOF
#define PACKAGE_STRING "$PACKAGE_STRING"
_ACEOF

cat >>confdefs.h <<_ACEOF
#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
_ACEOF

cat >>confdefs.h <<_ACEOF
#define PACKAGE_URL "$PACKAGE_URL"
_ACEOF


# Let the site file select an alternate cache file if it wants to.
# Prefer an explicitly selected file to automatically selected ones.
ac_site_file1=NONE
ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
  # We do not want a PATH search for config.site.
  case $CONFIG_SITE in #((
    -*)  ac_site_file1=./$CONFIG_SITE;;
    */*) ac_site_file1=$CONFIG_SITE;;
    *)   ac_site_file1=./$CONFIG_SITE;;
  esac
elif test "x$prefix" != xNONE; then
  ac_site_file1=$prefix/share/config.site
  ac_site_file2=$prefix/etc/config.site
else
  ac_site_file1=$ac_default_prefix/share/config.site
  ac_site_file2=$ac_default_prefix/etc/config.site
fi
for ac_site_file in "$ac_site_file1" "$ac_site_file2"
do
  test "x$ac_site_file" = xNONE && continue
  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
$as_echo "$as_me: loading site script $ac_site_file" >&6;}
    sed 's/^/| /' "$ac_site_file" >&5
    . "$ac_site_file" \
      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
See \`config.log' for more details" "$LINENO" 5; }
  fi
done

if test -r "$cache_file"; then
  # Some versions of bash will fail to source /dev/null (special files
  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
$as_echo "$as_me: loading cache $cache_file" >&6;}
    case $cache_file in
      [\\/]* | ?:[\\/]* ) . "$cache_file";;
      *)                      . "./$cache_file";;
    esac
  fi
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
$as_echo "$as_me: creating cache $cache_file" >&6;}
  >$cache_file
fi

# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
for ac_var in $ac_precious_vars; do
  eval ac_old_set=\$ac_cv_env_${ac_var}_set
  eval ac_new_set=\$ac_env_${ac_var}_set
  eval ac_old_val=\$ac_cv_env_${ac_var}_value
  eval ac_new_val=\$ac_env_${ac_var}_value
  case $ac_old_set,$ac_new_set in
    set,)
      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
      ac_cache_corrupted=: ;;
    ,set)
      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
      ac_cache_corrupted=: ;;
    ,);;
    *)
      if test "x$ac_old_val" != "x$ac_new_val"; then
	# differences in whitespace do not lead to failure.
	ac_old_val_w=`echo x $ac_old_val`
	ac_new_val_w=`echo x $ac_new_val`
	if test "$ac_old_val_w" != "$ac_new_val_w"; then
	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
	  ac_cache_corrupted=:
	else
	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
	  eval $ac_var=\$ac_old_val
	fi
	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
      fi;;
  esac
  # Pass precious variables to config.status.
  if test "$ac_new_set" = set; then
    case $ac_new_val in
    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
    *) ac_arg=$ac_var=$ac_new_val ;;
    esac
    case " $ac_configure_args " in
      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
    esac
  fi
done
if $ac_cache_corrupted; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
## -------------------- ##

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_aux_dir=
for ac_dir in config/gnu "$srcdir"/config/gnu; do
  if test -f "$ac_dir/install-sh"; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install-sh -c"
    break
  elif test -f "$ac_dir/install.sh"; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install.sh -c"
    break
  elif test -f "$ac_dir/shtool"; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/shtool install -c"
    break
  fi
done
if test -z "$ac_aux_dir"; then
  as_fn_error $? "cannot find install-sh, install.sh, or shtool in config/gnu \"$srcdir\"/config/gnu" "$LINENO" 5
fi

# These three variables are undocumented and unsupported,
# and are intended to be withdrawn in a future Autoconf release.
# They can cause serious problems if a builder's source tree is in a directory
# whose full name contains unusual characters.
ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.




ac_config_headers="$ac_config_headers config.h"


# ---------------------------------------------------------------------------- #

#
# Startup
#



  abi_sec_title="Basic initialization"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# Initial setup
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
$as_echo_n "checking build system type... " >&6; }
if ${ac_cv_build+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_build_alias=$build_alias
test "x$ac_build_alias" = x &&
  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
test "x$ac_build_alias" = x &&
  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
$as_echo "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
esac
build=$ac_cv_build
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_build
shift
build_cpu=$1
build_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
build_os=$*
IFS=$ac_save_IFS
case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
$as_echo_n "checking host system type... " >&6; }
if ${ac_cv_host+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test "x$host_alias" = x; then
  ac_cv_host=$ac_cv_build
else
  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
$as_echo "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
esac
host=$ac_cv_host
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_host
shift
host_cpu=$1
host_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
host_os=$*
IFS=$ac_save_IFS
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
$as_echo_n "checking target system type... " >&6; }
if ${ac_cv_target+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test "x$target_alias" = x; then
  ac_cv_target=$ac_cv_host
else
  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
$as_echo "$ac_cv_target" >&6; }
case $ac_cv_target in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
esac
target=$ac_cv_target
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_target
shift
target_cpu=$1
target_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
target_os=$*
IFS=$ac_save_IFS
case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac


# The aliases save the names the user supplied, while $host etc.
# will get canonicalized.
test -n "$target_alias" &&
  test "$program_prefix$program_suffix$program_transform_name" = \
    NONENONEs,x,x, &&
  program_prefix=${target_alias}-

# Disable pax to initialise Automake because it causes 'make dist' to fail
alias pax='/bin/false'
am__api_version='1.13'

# Find a good install program.  We prefer a C program (faster),
# so one script is as good as another.  But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AmigaOS /C/install, which installs bootblocks on floppy discs
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
# Reject install programs that cannot install multiple files.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
$as_echo_n "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
if ${ac_cv_path_install+:} false; then :
  $as_echo_n "(cached) " >&6
else
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    # Account for people who put trailing slashes in PATH elements.
case $as_dir/ in #((
  ./ | .// | /[cC]/* | \
  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
  /usr/ucb/* ) ;;
  *)
    # OSF1 and SCO ODT 3.0 have their own names for install.
    # Don't use installbsd from OSF since it installs stuff as root
    # by default.
    for ac_prog in ginstall scoinst install; do
      for ac_exec_ext in '' $ac_executable_extensions; do
	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
	  if test $ac_prog = install &&
	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
	    # AIX install.  It has an incompatible calling convention.
	    :
	  elif test $ac_prog = install &&
	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
	    # program-specific install script used by HP pwplus--don't use.
	    :
	  else
	    rm -rf conftest.one conftest.two conftest.dir
	    echo one > conftest.one
	    echo two > conftest.two
	    mkdir conftest.dir
	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
	      test -s conftest.one && test -s conftest.two &&
	      test -s conftest.dir/conftest.one &&
	      test -s conftest.dir/conftest.two
	    then
	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
	      break 3
	    fi
	  fi
	fi
      done
    done
    ;;
esac

  done
IFS=$as_save_IFS

rm -rf conftest.one conftest.two conftest.dir

fi
  if test "${ac_cv_path_install+set}" = set; then
    INSTALL=$ac_cv_path_install
  else
    # As a last resort, use the slow shell script.  Don't cache a
    # value for INSTALL within a source directory, because that will
    # break other packages using the cache if that directory is
    # removed, or if the value is a relative name.
    INSTALL=$ac_install_sh
  fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
$as_echo "$INSTALL" >&6; }

# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'

test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'

test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
$as_echo_n "checking whether build environment is sane... " >&6; }
# Reject unsafe characters in $srcdir or the absolute working directory
# name.  Accept space and tab only in the latter.
am_lf='
'
case `pwd` in
  *[\\\"\#\$\&\'\`$am_lf]*)
    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
esac
case $srcdir in
  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
esac

# Do 'set' in a subshell so we don't clobber the current shell's
# arguments.  Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
   am_has_slept=no
   for am_try in 1 2; do
     echo "timestamp, slept: $am_has_slept" > conftest.file
     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
     if test "$*" = "X"; then
	# -L didn't work.
	set X `ls -t "$srcdir/configure" conftest.file`
     fi
     if test "$*" != "X $srcdir/configure conftest.file" \
	&& test "$*" != "X conftest.file $srcdir/configure"; then

	# If neither matched, then we have a broken ls.  This can happen
	# if, for instance, CONFIG_SHELL is bash and it inherits a
	# broken ls alias from the environment.  This has actually
	# happened.  Such a system could not be considered "sane".
	as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
  alias in your environment" "$LINENO" 5
     fi
     if test "$2" = conftest.file || test $am_try -eq 2; then
       break
     fi
     # Just in case.
     sleep 1
     am_has_slept=yes
   done
   test "$2" = conftest.file
   )
then
   # Ok.
   :
else
   as_fn_error $? "newly created file is older than distributed files!
Check your system clock" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
# If we didn't sleep, we still need to ensure time stamps of config.status and
# generated files are strictly newer.
am_sleep_pid=
if grep 'slept: no' conftest.file >/dev/null 2>&1; then
  ( sleep 1 ) &
  am_sleep_pid=$!
fi

rm -f conftest.file

test "$program_prefix" != NONE &&
  program_transform_name="s&^&$program_prefix&;$program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
# Double any \ or $.
# By default was `s,x,x', remove it if useless.
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`

if test x"${MISSING+set}" != xset; then
  case $am_aux_dir in
  *\ * | *\	*)
    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
  *)
    MISSING="\${SHELL} $am_aux_dir/missing" ;;
  esac
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
  am_missing_run="$MISSING "
else
  am_missing_run=
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi

if test x"${install_sh}" != xset; then
  case $am_aux_dir in
  *\ * | *\	*)
    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
  *)
    install_sh="\${SHELL} $am_aux_dir/install-sh"
  esac
fi

# Installed binaries are usually stripped using 'strip' when the user
# run "make install-strip".  However 'strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the 'STRIP' environment variable to overrule this program.
if test "$cross_compiling" != no; then
  if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; 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_prog_STRIP+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$STRIP"; then
  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
    $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

fi
fi
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
$as_echo "$STRIP" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


fi
if test -z "$ac_cv_prog_STRIP"; then
  ac_ct_STRIP=$STRIP
  # Extract the first word of "strip", so it can be a program name with args.
set dummy strip; 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_prog_ac_ct_STRIP+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_STRIP"; then
  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_ac_ct_STRIP="strip"
    $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

fi
fi
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
$as_echo "$ac_ct_STRIP" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

  if test "x$ac_ct_STRIP" = x; then
    STRIP=":"
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    STRIP=$ac_ct_STRIP
  fi
else
  STRIP="$ac_cv_prog_STRIP"
fi

fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
if test -z "$MKDIR_P"; then
  if ${ac_cv_path_mkdir+:} false; then :
  $as_echo_n "(cached) " >&6
else
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    for ac_prog in mkdir gmkdir; do
	 for ac_exec_ext in '' $ac_executable_extensions; do
	   as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
	     'mkdir (GNU coreutils) '* | \
	     'mkdir (coreutils) '* | \
	     'mkdir (fileutils) '4.1*)
	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
	       break 3;;
	   esac
	 done
       done
  done
IFS=$as_save_IFS

fi

  test -d ./--version && rmdir ./--version
  if test "${ac_cv_path_mkdir+set}" = set; then
    MKDIR_P="$ac_cv_path_mkdir -p"
  else
    # As a last resort, use the slow shell script.  Don't cache a
    # value for MKDIR_P within a source directory, because that will
    # break other packages using the cache if that directory is
    # removed, or if the value is a relative name.
    MKDIR_P="$ac_install_sh -d"
  fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
$as_echo "$MKDIR_P" >&6; }

for ac_prog in gawk mawk nawk awk
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_prog_AWK+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$AWK"; then
  ac_cv_prog_AWK="$AWK" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_AWK="$ac_prog"
    $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

fi
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
$as_echo "$AWK" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$AWK" && break
done

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
all:
	@echo '@@@%%%=$(MAKE)=@@@%%%'
_ACEOF
# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
case `${MAKE-make} -f conftest.make 2>/dev/null` in
  *@@@%%%=?*=@@@%%%*)
    eval ac_cv_prog_make_${ac_make}_set=yes;;
  *)
    eval ac_cv_prog_make_${ac_make}_set=no;;
esac
rm -f conftest.make
fi
if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
  SET_MAKE=
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
  SET_MAKE="MAKE=${MAKE-make}"
fi

rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
  am__leading_dot=.
else
  am__leading_dot=_
fi
rmdir .tst 2>/dev/null

# Check whether --enable-silent-rules was given.
if test "${enable_silent_rules+set}" = set; then :
  enableval=$enable_silent_rules;
fi

case $enable_silent_rules in # (((
  yes) AM_DEFAULT_VERBOSITY=0;;
   no) AM_DEFAULT_VERBOSITY=1;;
    *) AM_DEFAULT_VERBOSITY=1;;
esac
am_make=${MAKE-make}
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
if ${am_cv_make_support_nested_variables+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if $as_echo 'TRUE=$(BAR$(V))
BAR0=false
BAR1=true
V=1
am__doit:
	@$(TRUE)
.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
  am_cv_make_support_nested_variables=yes
else
  am_cv_make_support_nested_variables=no
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
$as_echo "$am_cv_make_support_nested_variables" >&6; }
if test $am_cv_make_support_nested_variables = yes; then
    AM_V='$(V)'
  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
else
  AM_V=$AM_DEFAULT_VERBOSITY
  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
fi
AM_BACKSLASH='\'

if test "`cd $srcdir && pwd`" != "`pwd`"; then
  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
  # is not polluted with repeated "-I."
  am__isrc=' -I$(srcdir)'
  # test to see if srcdir already configured
  if test -f $srcdir/config.status; then
    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
  fi
fi

# test whether we have cygpath
if test -z "$CYGPATH_W"; then
  if (cygpath --version) >/dev/null 2>/dev/null; then
    CYGPATH_W='cygpath -w'
  else
    CYGPATH_W=echo
  fi
fi


# Define the identity of the package.
 PACKAGE='abinit'
 VERSION='10.0.9'


cat >>confdefs.h <<_ACEOF
#define PACKAGE "$PACKAGE"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define VERSION "$VERSION"
_ACEOF

# Some tools Automake needs.

ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}


AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}


AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}


AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}


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:
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'

# We need awk for the "check" target.  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}'


# We'll loop over all known methods to create a tar archive until one works.
_am_tools='gnutar plaintar pax cpio none'

# The POSIX 1988 'ustar' format is defined with fixed-size fields.
      # There is notably a 21 bits limit for the UID and the GID.  In fact,
      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
      # and bug#13588).
      am_max_uid=2097151 # 2^21 - 1
      am_max_gid=$am_max_uid
      # The $UID and $GID variables are not portable, so we need to resort
      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
      # below are definitely unexpected, so allow the users to see them
      # (that is, avoid stderr redirection).
      am_uid=`id -u || echo unknown`
      am_gid=`id -g || echo unknown`
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5
$as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; }
      if test $am_uid -le $am_max_uid; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
      else
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
         _am_tools=none
      fi
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5
$as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; }
      if test $am_gid -le $am_max_gid; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
        _am_tools=none
      fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5
$as_echo_n "checking how to create a ustar tar archive... " >&6; }

  # Go ahead even if we have the value already cached.  We do so because we
  # need to set the values for the 'am__tar' and 'am__untar' variables.
  _am_tools=${am_cv_prog_tar_ustar-$_am_tools}

  for _am_tool in $_am_tools; do
    case $_am_tool in
    gnutar)
      for _am_tar in tar gnutar gtar; do
        { echo "$as_me:$LINENO: $_am_tar --version" >&5
   ($_am_tar --version) >&5 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && break
      done
      am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"'
      am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"'
      am__untar="$_am_tar -xf -"
      ;;
    plaintar)
      # Must skip GNU tar: if it does not support --format= it doesn't create
      # ustar tarball either.
      (tar --version) >/dev/null 2>&1 && continue
      am__tar='tar chf - "$$tardir"'
      am__tar_='tar chf - "$tardir"'
      am__untar='tar xf -'
      ;;
    pax)
      am__tar='pax -L -x ustar -w "$$tardir"'
      am__tar_='pax -L -x ustar -w "$tardir"'
      am__untar='pax -r'
      ;;
    cpio)
      am__tar='find "$$tardir" -print | cpio -o -H ustar -L'
      am__tar_='find "$tardir" -print | cpio -o -H ustar -L'
      am__untar='cpio -i -H ustar -d'
      ;;
    none)
      am__tar=false
      am__tar_=false
      am__untar=false
      ;;
    esac

    # If the value was cached, stop now.  We just wanted to have am__tar
    # and am__untar set.
    test -n "${am_cv_prog_tar_ustar}" && break

    # tar/untar a dummy directory, and stop if the command works.
    rm -rf conftest.dir
    mkdir conftest.dir
    echo GrepMe > conftest.dir/file
    { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
   (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
    rm -rf conftest.dir
    if test -s conftest.tar; then
      { echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5
   ($am__untar <conftest.tar) >&5 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
      { echo "$as_me:$LINENO: cat conftest.dir/file" >&5
   (cat conftest.dir/file) >&5 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
    fi
  done
  rm -rf conftest.dir

  if ${am_cv_prog_tar_ustar+:} false; then :
  $as_echo_n "(cached) " >&6
else
  am_cv_prog_tar_ustar=$_am_tool
fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5
$as_echo "$am_cv_prog_tar_ustar" >&6; }






unalias pax

# Early Abinit setup - the order is important!

    ac_builddir=.

case "." in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
  ac_dir_suffix=/`$as_echo "." | sed 's|^\.[\\/]||'`
  # A ".." for each directory in $ac_dir_suffix.
  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
  case $ac_top_builddir_sub in
  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
  esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix

case $srcdir in
  .)  # We are building in place.
    ac_srcdir=.
    ac_top_srcdir=$ac_top_builddir_sub
    ac_abs_top_srcdir=$ac_pwd ;;
  [\\/]* | ?:[\\/]* )  # Absolute name.
    ac_srcdir=$srcdir$ac_dir_suffix;
    ac_top_srcdir=$srcdir
    ac_abs_top_srcdir=$srcdir ;;
  *) # Relative name.
    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
    ac_top_srcdir=$ac_top_build_prefix$srcdir
    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix

  abinit_srcdir="${ac_abs_top_srcdir}"
  abinit_builddir="${ac_abs_top_builddir}"

  export abinit_srcdir abinit_builddir





    ABINIT_VERSION="${PACKAGE_VERSION}"
  ABINIT_VERSION_MAJOR=`echo "${ABINIT_VERSION}" | cut -d. -s -f1`
  ABINIT_VERSION_MINOR=`echo "${ABINIT_VERSION}" | cut -d. -s -f2`
  ABINIT_VERSION_MICRO=`echo "${ABINIT_VERSION}" | cut -d. -s -f3`
  ABINIT_VERSION_MINOR=`echo "${ABINIT_VERSION_MINOR}" | sed -e 's/a-z//g'`
  if test "${ABINIT_VERSION_MICRO}" = ""; then
    ABINIT_VERSION_MICRO=`echo "${ABINIT_VERSION}" | cut -b4-`
  fi
  if test "${ABINIT_VERSION_MICRO}" = ""; then
    ABINIT_VERSION_MICRO="dev"
  fi
  ABINIT_VERSION_BUILD=`date '+%Y%m%d'`

  ABINIT_VERSION_BASE="${ABINIT_VERSION_MAJOR}.${ABINIT_VERSION_MINOR}"


cat >>confdefs.h <<_ACEOF
#define ABINIT_VERSION "${ABINIT_VERSION}"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define ABINIT_VERSION_MAJOR "${ABINIT_VERSION_MAJOR}"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define ABINIT_VERSION_MINOR "${ABINIT_VERSION_MINOR}"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define ABINIT_VERSION_MICRO "${ABINIT_VERSION_MICRO}"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define ABINIT_VERSION_BUILD "${ABINIT_VERSION_BUILD}"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define ABINIT_VERSION_BASE "${ABINIT_VERSION_BASE}"
_ACEOF









  abi_cpu_platform=`echo "${target}" | cut -d- -f2`
  abi_cpu_vendor=""
  abi_cpu_model=""
  abi_cpu_spec=""
  abi_cpu_bits=""
  abi_cpu_64bits=""

  case "${target}" in

    alpha*)
      abi_cpu_vendor="dec"
      abi_cpu_model="${target_cpu}"
      abi_cpu_64bits=`echo "${abi_cpu_model}" | grep '64$'`
      if test "${abi_cpu_64bits}" = ""; then
        abi_cpu_64bits="no"
        abi_cpu_bits="32"
      else
        abi_cpu_64bits="yes"
        abi_cpu_bits="64"
      fi
      ;;

    powerpc*)
      abi_cpu_vendor="ibm"
      abi_cpu_model="${target_cpu}"
      abi_cpu_64bits=`echo "${abi_cpu_model}" | grep '64$'`
      if test "${abi_cpu_64bits}" = ""; then
        abi_cpu_64bits="no"
        abi_cpu_bits="32"
      else
        abi_cpu_64bits="yes"
        abi_cpu_bits="64"
      fi
      ;;

    i686-*linux*)
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat /proc/cpuinfo | grep 'Athlon'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="amd"
          abi_cpu_model="athlon"
          abi_cpu_64bits="no"
          abi_cpu_bits="32"
        fi
      fi
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat /proc/cpuinfo | grep 'Pentium III'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="intel"
          abi_cpu_model="pentium3"
          abi_cpu_64bits="no"
          abi_cpu_bits="32"
        fi
      fi
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat /proc/cpuinfo | grep 'Intel(R) Pentium(R) 4'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="intel"
          abi_cpu_model="pentium4"
          abi_cpu_64bits="no"
          abi_cpu_bits="32"
        fi
      fi
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat /proc/cpuinfo | grep 'Intel(R) Pentium(R) M'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="intel"
          abi_cpu_model="pentium4"
          abi_cpu_64bits="no"
          abi_cpu_bits="32"
        fi
      fi
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat /proc/cpuinfo | grep 'Intel(R) CPU           T2400'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="intel"
          abi_cpu_model="centrino"
          abi_cpu_64bits="no"
          abi_cpu_bits="32"
        fi
      fi
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat /proc/cpuinfo | grep 'Intel(R) CPU           T2050'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="intel"
          abi_cpu_model="coreduo"
          abi_cpu_64bits="no"
          abi_cpu_bits="32"
        fi
      fi
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat /proc/cpuinfo | grep 'Intel(R) Core(TM)2 CPU'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="intel"
          abi_cpu_model="core2"
          abi_cpu_64bits="no"
          abi_cpu_bits="32"
        fi
      fi
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat /proc/cpuinfo | grep 'Intel(R) Core(TM)2 Quad CPU'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="intel"
          abi_cpu_model="core2"
          abi_cpu_64bits="no"
          abi_cpu_bits="32"
        fi
      fi
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_vendor="unknown"
        abi_cpu_model="unknown"
        abi_cpu_64bits="unknown"
        abi_cpu_bits="32"
      fi
      ;;

    ia64-*linux*)
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat /proc/cpuinfo | grep 'Itanium' | grep -v 'Itanium 2'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="intel"
          abi_cpu_model="itanium1"
        fi
      fi
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat /proc/cpuinfo | grep 'Itanium 2'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="intel"
          abi_cpu_model="itanium2"
        fi
      fi
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat /proc/cpuinfo | grep 'Madison'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="intel"
          abi_cpu_model="itanium2"
        fi
      fi
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_vendor="unknown"
        abi_cpu_model="unknown"
      fi
            abi_cpu_64bits="yes"
      abi_cpu_bits="64"
      ;;

    mips*irix*)
      # Get processor type
      abi_cpu_vendor="mips"
      abi_cpu_model=`hinv 2> /dev/null | grep '^CPU: MIPS '`
      if test "${abi_cpu_model}" != ""; then
        abi_cpu_model=`echo "${abi_cpu_model}" | awk '{print tolower()}'`
      fi
      abi_cpu_64bits="yes"
      abi_cpu_bits="64"
      ;;

    x86_64-*linux*|x86_64*apple*)
      case "${target}" in
      x86_64-*linux*)
         cp /proc/cpuinfo cpuinfo
         ;;
      x86_64-*apple*)
         sysctl -A | grep 'machdep.cpu.brand_string' > cpuinfo
         ;;
      esac
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat cpuinfo | grep 'Athlon'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="amd"
          abi_cpu_model="athlon64"
        fi
      fi
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat cpuinfo | grep 'Opteron'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="amd"
          abi_cpu_model="opteron"
        fi
      fi
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat cpuinfo | grep -i 'EPYC'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="amd"
          abi_cpu_model="epyc"
        fi
      fi
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat cpuinfo | grep 'Sempron'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="amd"
          abi_cpu_model="athlon64"
        fi
      fi
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat cpuinfo | grep 'Intel(R) Core(TM)2'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="intel"
          abi_cpu_model="core2"
        fi
      fi
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat cpuinfo | grep 'Intel(R) Core(TM)2 Quad'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="intel"
          abi_cpu_model="core2"
        fi
      fi
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat cpuinfo | grep 'Intel(R) Core(TM) i3'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="intel"
          abi_cpu_model="core_i3"
        fi
      fi
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat cpuinfo | grep 'Intel(R) XEON(TM)'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="intel"
          abi_cpu_model="xeon"
        fi
      fi
      if test "${abi_cpu_model}" = ""; then
        abi_cpu_model=`cat cpuinfo | grep 'Intel(R) Xeon(R)'`
        if test "${abi_cpu_model}" != ""; then
          abi_cpu_vendor="intel"
          abi_cpu_model="xeon"
        fi
      fi
            if test "${abi_cpu_model}" = ""; then
        abi_cpu_vendor="unknown"
        abi_cpu_model="unknown"
      fi
            abi_cpu_64bits="yes"
      abi_cpu_bits="64"
      rm -rf cpuinfo
      ;;

  esac

    abi_cpu_spec="${abi_cpu_vendor}_${abi_cpu_model}"

    abi_sys_spec=`echo "${target_os}" | cut -d- -f1 | sed -e 's/[0-9].*//'`
  abi_sys_spec="${abi_sys_spec}-${target_cpu}"










  case "${target_os}" in

    *linux*)

$as_echo "#define HAVE_OS_LINUX 1" >>confdefs.h

      ;;

    *apple*)

$as_echo "#define HAVE_OS_MACOSX 1" >>confdefs.h

      ;;

    *cygwin*|*mingw*)

$as_echo "#define HAVE_OS_WINDOWS 1" >>confdefs.h

      ;;

  esac







    case "${target}" in
    *apple*)
      abi_so_ext="dylib"
      ;;
    *)
      abi_so_ext="so"
      ;;
  esac


# Check for common programs
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
all:
	@echo '@@@%%%=$(MAKE)=@@@%%%'
_ACEOF
# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
case `${MAKE-make} -f conftest.make 2>/dev/null` in
  *@@@%%%=?*=@@@%%%*)
    eval ac_cv_prog_make_${ac_make}_set=yes;;
  *)
    eval ac_cv_prog_make_${ac_make}_set=no;;
esac
rm -f conftest.make
fi
if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
  SET_MAKE=
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
  SET_MAKE="MAKE=${MAKE-make}"
fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
$as_echo_n "checking whether ln -s works... " >&6; }
LN_S=$as_ln_s
if test "$LN_S" = "ln -s"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
$as_echo "no, using $LN_S" >&6; }
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
$as_echo_n "checking for a sed that does not truncate output... " >&6; }
if ${ac_cv_path_SED+:} false; then :
  $as_echo_n "(cached) " >&6
else
            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
     for ac_i in 1 2 3 4 5 6 7; do
       ac_script="$ac_script$as_nl$ac_script"
     done
     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
     { ac_script=; unset ac_script;}
     if test -z "$SED"; then
  ac_path_SED_found=false
  # Loop through the user's path and test for each of PROGNAME-LIST
  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_prog in sed gsed; do
    for ac_exec_ext in '' $ac_executable_extensions; do
      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
      as_fn_executable_p "$ac_path_SED" || continue
# Check for GNU ac_path_SED and select it if it is found.
  # Check for GNU $ac_path_SED
case `"$ac_path_SED" --version 2>&1` in
*GNU*)
  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
*)
  ac_count=0
  $as_echo_n 0123456789 >"conftest.in"
  while :
  do
    cat "conftest.in" "conftest.in" >"conftest.tmp"
    mv "conftest.tmp" "conftest.in"
    cp "conftest.in" "conftest.nl"
    $as_echo '' >> "conftest.nl"
    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
    as_fn_arith $ac_count + 1 && ac_count=$as_val
    if test $ac_count -gt ${ac_path_SED_max-0}; then
      # Best one so far, save it but keep looking for a better one
      ac_cv_path_SED="$ac_path_SED"
      ac_path_SED_max=$ac_count
    fi
    # 10*(2^10) chars as input seems more than enough
    test $ac_count -gt 10 && break
  done
  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac

      $ac_path_SED_found && break 3
    done
  done
  done
IFS=$as_save_IFS
  if test -z "$ac_cv_path_SED"; then
    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
  fi
else
  ac_cv_path_SED=$SED
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
$as_echo "$ac_cv_path_SED" >&6; }
 SED="$ac_cv_path_SED"
  rm -f conftest.sed

for ac_prog in gawk mawk nawk awk
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_prog_AWK+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$AWK"; then
  ac_cv_prog_AWK="$AWK" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_AWK="$ac_prog"
    $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

fi
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
$as_echo "$AWK" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$AWK" && break
done

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
if ${ac_cv_path_GREP+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -z "$GREP"; then
  ac_path_GREP_found=false
  # Loop through the user's path and test for each of PROGNAME-LIST
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    for ac_prog in grep ggrep; do
    for ac_exec_ext in '' $ac_executable_extensions; do
      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
      as_fn_executable_p "$ac_path_GREP" || continue
# Check for GNU ac_path_GREP and select it if it is found.
  # Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
*GNU*)
  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
*)
  ac_count=0
  $as_echo_n 0123456789 >"conftest.in"
  while :
  do
    cat "conftest.in" "conftest.in" >"conftest.tmp"
    mv "conftest.tmp" "conftest.in"
    cp "conftest.in" "conftest.nl"
    $as_echo 'GREP' >> "conftest.nl"
    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
    as_fn_arith $ac_count + 1 && ac_count=$as_val
    if test $ac_count -gt ${ac_path_GREP_max-0}; then
      # Best one so far, save it but keep looking for a better one
      ac_cv_path_GREP="$ac_path_GREP"
      ac_path_GREP_max=$ac_count
    fi
    # 10*(2^10) chars as input seems more than enough
    test $ac_count -gt 10 && break
  done
  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac

      $ac_path_GREP_found && break 3
    done
  done
  done
IFS=$as_save_IFS
  if test -z "$ac_cv_path_GREP"; then
    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
  fi
else
  ac_cv_path_GREP=$GREP
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
$as_echo "$ac_cv_path_GREP" >&6; }
 GREP="$ac_cv_path_GREP"


# Extract the first word of "sh", so it can be a program name with args.
set dummy sh; 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_BOURNE_SHELL+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $BOURNE_SHELL in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_BOURNE_SHELL="$BOURNE_SHELL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_BOURNE_SHELL="$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

  test -z "$ac_cv_path_BOURNE_SHELL" && ac_cv_path_BOURNE_SHELL="/bin/sh"
  ;;
esac
fi
BOURNE_SHELL=$ac_cv_path_BOURNE_SHELL
if test -n "$BOURNE_SHELL"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOURNE_SHELL" >&5
$as_echo "$BOURNE_SHELL" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


# Extract the first word of "mv", so it can be a program name with args.
set dummy mv; 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_MV+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $MV in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_MV="$MV" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_MV="$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

  test -z "$ac_cv_path_MV" && ac_cv_path_MV="/bin/false"
  ;;
esac
fi
MV=$ac_cv_path_MV
if test -n "$MV"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MV" >&5
$as_echo "$MV" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; 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_PERL+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $PERL in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_PERL="$PERL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_PERL="$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

  test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="/bin/false"
  ;;
esac
fi
PERL=$ac_cv_path_PERL
if test -n "$PERL"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
$as_echo "$PERL" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


# Extract the first word of "rm", so it can be a program name with args.
set dummy rm; 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_RM+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $RM in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_RM="$RM" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_RM="$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

  test -z "$ac_cv_path_RM" && ac_cv_path_RM="/bin/false"
  ;;
esac
fi
RM=$ac_cv_path_RM
if test -n "$RM"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5
$as_echo "$RM" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


for ac_prog in patch gpatch
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_prog_PATCH+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$PATCH"; then
  ac_cv_prog_PATCH="$PATCH" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_PATCH="$ac_prog"
    $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

fi
fi
PATCH=$ac_cv_prog_PATCH
if test -n "$PATCH"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATCH" >&5
$as_echo "$PATCH" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$PATCH" && break
done

for ac_prog in tar gtar star
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_prog_TAR+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$TAR"; then
  ac_cv_prog_TAR="$TAR" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_TAR="$ac_prog"
    $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

fi
fi
TAR=$ac_cv_prog_TAR
if test -n "$TAR"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5
$as_echo "$TAR" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$TAR" && break
done


# Workaround for the "grep -e" issue on Solaris systems
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
$as_echo_n "checking for egrep... " >&6; }
if ${ac_cv_path_EGREP+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
   then ac_cv_path_EGREP="$GREP -E"
   else
     if test -z "$EGREP"; then
  ac_path_EGREP_found=false
  # Loop through the user's path and test for each of PROGNAME-LIST
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    for ac_prog in egrep; do
    for ac_exec_ext in '' $ac_executable_extensions; do
      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
      as_fn_executable_p "$ac_path_EGREP" || continue
# Check for GNU ac_path_EGREP and select it if it is found.
  # Check for GNU $ac_path_EGREP
case `"$ac_path_EGREP" --version 2>&1` in
*GNU*)
  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
*)
  ac_count=0
  $as_echo_n 0123456789 >"conftest.in"
  while :
  do
    cat "conftest.in" "conftest.in" >"conftest.tmp"
    mv "conftest.tmp" "conftest.in"
    cp "conftest.in" "conftest.nl"
    $as_echo 'EGREP' >> "conftest.nl"
    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
    as_fn_arith $ac_count + 1 && ac_count=$as_val
    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
      # Best one so far, save it but keep looking for a better one
      ac_cv_path_EGREP="$ac_path_EGREP"
      ac_path_EGREP_max=$ac_count
    fi
    # 10*(2^10) chars as input seems more than enough
    test $ac_count -gt 10 && break
  done
  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac

      $ac_path_EGREP_found && break 3
    done
  done
  done
IFS=$as_save_IFS
  if test -z "$ac_cv_path_EGREP"; then
    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
  fi
else
  ac_cv_path_EGREP=$EGREP
fi

   fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
$as_echo "$ac_cv_path_EGREP" >&6; }
 EGREP="$ac_cv_path_EGREP"



# Workaround for the wrong path to install-sh on Mac systems


  abi_tmp_mkdir_p=`echo "${MKDIR_P}" | awk '{print $1}'`
  if test "${abi_tmp_mkdir_p}" = "config/gnu/install-sh"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: fixing wrong path to mkdir replacement" >&5
$as_echo "$as_me: fixing wrong path to mkdir replacement" >&6;}
    MKDIR_P="${abinit_srcdir}/${MKDIR_P}"
  fi
  unset abi_tmp_mkdir_p


# Look for a command that provide absolute paths
for ac_prog in realpath readlink
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_prog_REALPATH+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$REALPATH"; then
  ac_cv_prog_REALPATH="$REALPATH" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_REALPATH="$ac_prog"
    $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

fi
fi
REALPATH=$ac_cv_prog_REALPATH
if test -n "$REALPATH"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $REALPATH" >&5
$as_echo "$REALPATH" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$REALPATH" && break
done
test -n "$REALPATH" || REALPATH="/bin/true"

test "${REALPATH}" = "readlink" && REALPATH="${REALPATH} -f"

# We might need a Python interpreter early on

  # Look for a Python interpreter
  for ac_prog in python3.12 python3.11 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3 python2.7 python2 python
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_prog_PYTHON+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$PYTHON"; then
  ac_cv_prog_PYTHON="$PYTHON" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_PYTHON="$ac_prog"
    $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

fi
fi
PYTHON=$ac_cv_prog_PYTHON
if test -n "$PYTHON"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
$as_echo "$PYTHON" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$PYTHON" && break
done

  if test "${PYTHON}" = ""; then


    abi_msg_file="${abinit_srcdir}/config/messages/python-not-found.msg"
  abi_msg_title="Could not find any Python interpreter"
  test "${abi_msg_title}" = "" && abi_msg_title="IMPORTANT NOTE"

    abi_msg_spacer="                                                            "
  abi_msg_tmp1=`echo "${abi_msg_title}" | sed -e 's/./ /g'`
  abi_msg_tmp2=`echo "${abi_msg_tmp1}" | grep "${abi_msg_spacer}"`
  abi_msg_spacer=`echo "${abi_msg_spacer}" | sed -e "s/${abi_msg_tmp1}//"`
  test "${abi_msg_tmp2}" = "" || abi_msg_spacer=""
  abi_msg_title="${abi_msg_title}${abi_msg_spacer}"

  if test -s "${abi_msg_file}"; then

    echo ""
  echo "        +--------------------------------------------------------------+"
  echo "        | ${abi_msg_title} |"
  echo "        +--------------------------------------------------------------+"

    while read abi_msg_line; do
    abi_msg_line=`eval echo ${abi_msg_line}`
    abi_msg_spacer="                                                            "
    abi_msg_tmp1=`echo "${abi_msg_line}" | sed -e 's/./ /g'`
    abi_msg_tmp2=`echo "${abi_msg_tmp1}" | grep "${abi_msg_spacer}"`
    test "${abi_msg_tmp1}" = "" || \
      abi_msg_spacer=`echo "${abi_msg_spacer}" | sed -e "s/${abi_msg_tmp1}//"`
    test "${abi_msg_tmp2}" = "" || abi_msg_spacer=""
    echo "        | ${abi_msg_line}${abi_msg_spacer} |"
  done <"${abi_msg_file}"

    echo "        +--------------------------------------------------------------+"
  echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

    as_fn_error $? "Cannot continue without Python" "$LINENO" 5
  fi
  export PYTHON

  # Look for a Python configurator
  for ac_prog in ${PYTHON}-config
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_prog_PYTHON_CONFIG+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$PYTHON_CONFIG"; then
  ac_cv_prog_PYTHON_CONFIG="$PYTHON_CONFIG" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_PYTHON_CONFIG="$ac_prog"
    $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

fi
fi
PYTHON_CONFIG=$ac_cv_prog_PYTHON_CONFIG
if test -n "$PYTHON_CONFIG"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_CONFIG" >&5
$as_echo "$PYTHON_CONFIG" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$PYTHON_CONFIG" && break
done

  if test "${PYTHON_CONFIG}" = ""; then
    for ac_prog in python3.12-config python3.11-config python3.10-config python3.9-config python3.8-config python3.7-config python3.6-config python3.5-config python3.4-config python3-config python2.7-config python-config
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_prog_PYTHON_CONFIG+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$PYTHON_CONFIG"; then
  ac_cv_prog_PYTHON_CONFIG="$PYTHON_CONFIG" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_PYTHON_CONFIG="$ac_prog"
    $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

fi
fi
PYTHON_CONFIG=$ac_cv_prog_PYTHON_CONFIG
if test -n "$PYTHON_CONFIG"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_CONFIG" >&5
$as_echo "$PYTHON_CONFIG" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$PYTHON_CONFIG" && break
done

  fi
  if test "${PYTHON_CONFIG}" = ""; then


    abi_msg_file="${abinit_srcdir}/config/messages/python-config-not-found.msg"
  abi_msg_title="Could not find any Python configurator"
  test "${abi_msg_title}" = "" && abi_msg_title="IMPORTANT NOTE"

    abi_msg_spacer="                                                            "
  abi_msg_tmp1=`echo "${abi_msg_title}" | sed -e 's/./ /g'`
  abi_msg_tmp2=`echo "${abi_msg_tmp1}" | grep "${abi_msg_spacer}"`
  abi_msg_spacer=`echo "${abi_msg_spacer}" | sed -e "s/${abi_msg_tmp1}//"`
  test "${abi_msg_tmp2}" = "" || abi_msg_spacer=""
  abi_msg_title="${abi_msg_title}${abi_msg_spacer}"

  if test -s "${abi_msg_file}"; then

    echo ""
  echo "        +--------------------------------------------------------------+"
  echo "        | ${abi_msg_title} |"
  echo "        +--------------------------------------------------------------+"

    while read abi_msg_line; do
    abi_msg_line=`eval echo ${abi_msg_line}`
    abi_msg_spacer="                                                            "
    abi_msg_tmp1=`echo "${abi_msg_line}" | sed -e 's/./ /g'`
    abi_msg_tmp2=`echo "${abi_msg_tmp1}" | grep "${abi_msg_spacer}"`
    test "${abi_msg_tmp1}" = "" || \
      abi_msg_spacer=`echo "${abi_msg_spacer}" | sed -e "s/${abi_msg_tmp1}//"`
    test "${abi_msg_tmp2}" = "" || abi_msg_spacer=""
    echo "        | ${abi_msg_line}${abi_msg_spacer} |"
  done <"${abi_msg_file}"

    echo "        +--------------------------------------------------------------+"
  echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

  fi


# Define command-line arguments

  # Count use of deprecated options
  abi_opt_deprecated_count=0
  abi_opt_deprecated_used=""


  #
  # --enable arguments
  #

  # Check whether --enable-avx-safe-mode was given.
if test "${enable_avx_safe_mode+set}" = set; then :
  enableval=$enable_avx_safe_mode; abi_avx_safe_mode_enable="${enableval}"; abi_avx_safe_mode_init="yon"
else
  abi_avx_safe_mode_enable="no"; abi_avx_safe_mode_init="def"
fi




  # Check whether --enable-cclock was given.
if test "${enable_cclock+set}" = set; then :
  enableval=$enable_cclock; abi_cclock_enable="${enableval}"; abi_cclock_init="yon"
else
  abi_cclock_enable="no"; abi_cclock_init="def"
fi




  # Check whether --enable-crpa-optim was given.
if test "${enable_crpa_optim+set}" = set; then :
  enableval=$enable_crpa_optim; abi_crpa_optim_enable="${enableval}"; abi_crpa_optim_init="yon"
else
  abi_crpa_optim_enable="no"; abi_crpa_optim_init="def"
fi




  # Check whether --enable-fc-wrapper was given.
if test "${enable_fc_wrapper+set}" = set; then :
  enableval=$enable_fc_wrapper; abi_fc_wrapper_enable="${enableval}"; abi_fc_wrapper_init="yon"
else
  abi_fc_wrapper_enable="no"; abi_fc_wrapper_init="def"
fi




  # Check whether --enable-gw-dpc was given.
if test "${enable_gw_dpc+set}" = set; then :
  enableval=$enable_gw_dpc; abi_gw_dpc_enable="${enableval}"; abi_gw_dpc_init="yon"
else
  abi_gw_dpc_enable="no"; abi_gw_dpc_init="def"
fi




  # Check whether --enable-hints was given.
if test "${enable_hints+set}" = set; then :
  enableval=$enable_hints; abi_hints_enable="${enableval}"; abi_hints_init="yon"
else
  abi_hints_enable="yes"; abi_hints_init="def"
fi




  # Check whether --enable-libtetra was given.
if test "${enable_libtetra+set}" = set; then :
  enableval=$enable_libtetra; abi_libtetra_enable="${enableval}"; abi_libtetra_init="yon"
else
  abi_libtetra_enable="yes"; abi_libtetra_init="def"
fi




  # Check whether --enable-lotf was given.
if test "${enable_lotf+set}" = set; then :
  enableval=$enable_lotf; abi_lotf_enable="${enableval}"; abi_lotf_init="yon"
else
  abi_lotf_enable="no"; abi_lotf_init="def"
fi




  # Check whether --enable-memory-profiling was given.
if test "${enable_memory_profiling+set}" = set; then :
  enableval=$enable_memory_profiling; abi_memory_profiling_enable="${enableval}"; abi_memory_profiling_init="yon"
else
  abi_memory_profiling_enable="no"; abi_memory_profiling_init="def"
fi




  # Check whether --enable-mpi-gpu-aware was given.
if test "${enable_mpi_gpu_aware+set}" = set; then :
  enableval=$enable_mpi_gpu_aware; abi_mpi_gpu_aware_enable="${enableval}"; abi_mpi_gpu_aware_init="yon"
else
  abi_mpi_gpu_aware_enable="no"; abi_mpi_gpu_aware_init="def"
fi




  # Check whether --enable-mpi-inplace was given.
if test "${enable_mpi_inplace+set}" = set; then :
  enableval=$enable_mpi_inplace; abi_mpi_inplace_enable="${enableval}"; abi_mpi_inplace_init="yon"
else
  abi_mpi_inplace_enable="auto"; abi_mpi_inplace_init="def"
fi




  # Check whether --enable-mpi-interfaces-bugfix was given.
if test "${enable_mpi_interfaces_bugfix+set}" = set; then :
  enableval=$enable_mpi_interfaces_bugfix; abi_mpi_interfaces_bugfix_enable="${enableval}"; abi_mpi_interfaces_bugfix_init="yon"
else
  abi_mpi_interfaces_bugfix_enable="auto"; abi_mpi_interfaces_bugfix_init="def"
fi




  # Check whether --enable-mpi-io was given.
if test "${enable_mpi_io+set}" = set; then :
  enableval=$enable_mpi_io; abi_mpi_io_enable="${enableval}"; abi_mpi_io_init="yon"
else
  abi_mpi_io_enable="auto"; abi_mpi_io_init="def"
fi




  # Check whether --enable-mpi-io-default was given.
if test "${enable_mpi_io_default+set}" = set; then :
  enableval=$enable_mpi_io_default; abi_mpi_io_default_enable="${enableval}"; abi_mpi_io_default_init="yon"
else
  abi_mpi_io_default_enable="no"; abi_mpi_io_default_init="def"
fi




  # Check whether --enable-netcdf-default was given.
if test "${enable_netcdf_default+set}" = set; then :
  enableval=$enable_netcdf_default; abi_netcdf_default_enable="${enableval}"; abi_netcdf_default_init="yon"
else
  abi_netcdf_default_enable="no"; abi_netcdf_default_init="def"
fi




  # Check whether --enable-openmp was given.
if test "${enable_openmp+set}" = set; then :
  enableval=$enable_openmp; abi_openmp_enable="${enableval}"; abi_openmp_init="yon"
else
  abi_openmp_enable="no"; abi_openmp_init="def"
fi




  # Check whether --enable-openmp-offload was given.
if test "${enable_openmp_offload+set}" = set; then :
  enableval=$enable_openmp_offload; abi_openmp_offload_enable="${enableval}"; abi_openmp_offload_init="yon"
else
  abi_openmp_offload_enable="no"; abi_openmp_offload_init="def"
fi




  # Check whether --enable-python-invocation was given.
if test "${enable_python_invocation+set}" = set; then :
  enableval=$enable_python_invocation; abi_python_invocation_enable="${enableval}"; abi_python_invocation_init="yon"
else
  abi_python_invocation_enable="no"; abi_python_invocation_init="def"
fi




  # Check whether --enable-source-debug was given.
if test "${enable_source_debug+set}" = set; then :
  enableval=$enable_source_debug; abi_source_debug_enable="${enableval}"; abi_source_debug_init="yon"
else
  abi_source_debug_enable="no"; abi_source_debug_init="def"
fi




  # Check whether --enable-stdin was given.
if test "${enable_stdin+set}" = set; then :
  enableval=$enable_stdin; abi_stdin_enable="${enableval}"; abi_stdin_init="yon"
else
  abi_stdin_enable="yes"; abi_stdin_init="def"
fi




  # Check whether --enable-timer was given.
if test "${enable_timer+set}" = set; then :
  enableval=$enable_timer; abi_timer_enable="${enableval}"; abi_timer_init="yon"
else
  abi_timer_enable="yes"; abi_timer_init="def"
fi




  # Check whether --enable-triqs-v1-4 was given.
if test "${enable_triqs_v1_4+set}" = set; then :
  enableval=$enable_triqs_v1_4; abi_triqs_v1_4_enable="${enableval}"; abi_triqs_v1_4_init="yon"
else
  abi_triqs_v1_4_enable="no"; abi_triqs_v1_4_init="def"
fi




  # Check whether --enable-triqs-v2-0 was given.
if test "${enable_triqs_v2_0+set}" = set; then :
  enableval=$enable_triqs_v2_0; abi_triqs_v2_0_enable="${enableval}"; abi_triqs_v2_0_init="yon"
else
  abi_triqs_v2_0_enable="no"; abi_triqs_v2_0_init="def"
fi




  # Check whether --enable-zdot-bugfix was given.
if test "${enable_zdot_bugfix+set}" = set; then :
  enableval=$enable_zdot_bugfix; abi_zdot_bugfix_enable="${enableval}"; abi_zdot_bugfix_init="yon"
else
  abi_zdot_bugfix_enable="auto"; abi_zdot_bugfix_init="def"
fi




  #
  # --with arguments
  #


# Check whether --with-config_file was given.
if test "${with_config_file+set}" = set; then :
  withval=$with_config_file;  abi_config_file="${withval}"
      case "${withval}" in
        no|yes)
          abi_config_file_init="yon"
          ;;
        *)
          abi_config_file_init="kwd"
          ;;
      esac
else
   abi_config_file_init="def"; abi_config_file=""
fi




# Check whether --with-debug_flavor was given.
if test "${with_debug_flavor+set}" = set; then :
  withval=$with_debug_flavor;  abi_debug_flavor="${withval}"
      case "${withval}" in
        no|yes)
          abi_debug_flavor_init="yon"
          ;;
        *)
          abi_debug_flavor_init="kwd"
          ;;
      esac
else
   abi_debug_flavor_init="def"; abi_debug_flavor="basic"
fi




# Check whether --with-fallbacks was given.
if test "${with_fallbacks+set}" = set; then :
  withval=$with_fallbacks;  abi_fallbacks="${withval}"
      case "${withval}" in
        no|yes)
          abi_fallbacks_init="yon"
          ;;
        *)
          abi_fallbacks_init="dir"
          ;;
      esac
else
   abi_fallbacks_init="def"; abi_fallbacks=""
fi




# Check whether --with-fc_vendor was given.
if test "${with_fc_vendor+set}" = set; then :
  withval=$with_fc_vendor;  abi_fc_vendor="${withval}"
      case "${withval}" in
        no|yes)
          abi_fc_vendor_init="yon"
          ;;
        *)
          abi_fc_vendor_init="kwd"
          ;;
      esac
else
   abi_fc_vendor_init="def"; abi_fc_vendor=""
fi




# Check whether --with-fc_version was given.
if test "${with_fc_version+set}" = set; then :
  withval=$with_fc_version;  abi_fc_version="${withval}"
      case "${withval}" in
        no|yes)
          abi_fc_version_init="yon"
          ;;
        *)
          abi_fc_version_init="kwd"
          ;;
      esac
else
   abi_fc_version_init="def"; abi_fc_version=""
fi




# Check whether --with-libxml2 was given.
if test "${with_libxml2+set}" = set; then :
  withval=$with_libxml2;  abi_libxml2="${withval}"
      case "${withval}" in
        no|yes)
          abi_libxml2_init="yon"
          ;;
        *)
          abi_libxml2_init="dir"
          ;;
      esac
else
   abi_libxml2_init="def"; abi_libxml2=""
fi




# Check whether --with-mpi_level was given.
if test "${with_mpi_level+set}" = set; then :
  withval=$with_mpi_level;  abi_mpi_level="${withval}"
      case "${withval}" in
        no|yes)
          abi_mpi_level_init="yon"
          ;;
        *)
          abi_mpi_level_init="kwd"
          ;;
      esac
else
   abi_mpi_level_init="def"; abi_mpi_level="2"
fi




# Check whether --with-optim_flavor was given.
if test "${with_optim_flavor+set}" = set; then :
  withval=$with_optim_flavor;  abi_optim_flavor="${withval}"
      case "${withval}" in
        no|yes)
          abi_optim_flavor_init="yon"
          ;;
        *)
          abi_optim_flavor_init="kwd"
          ;;
      esac
else
   abi_optim_flavor_init="def"; abi_optim_flavor="standard"
fi




# Read config file and ensure that priorities are respected


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"




  #
  # --enable arguments
  #
  cmd_enable_avx_safe_mode="${enable_avx_safe_mode}"
  cmd_enable_cclock="${enable_cclock}"
  cmd_enable_crpa_optim="${enable_crpa_optim}"
  cmd_enable_fc_wrapper="${enable_fc_wrapper}"
  cmd_enable_gw_dpc="${enable_gw_dpc}"
  cmd_enable_hints="${enable_hints}"
  cmd_enable_libtetra="${enable_libtetra}"
  cmd_enable_lotf="${enable_lotf}"
  cmd_enable_memory_profiling="${enable_memory_profiling}"
  cmd_enable_mpi_gpu_aware="${enable_mpi_gpu_aware}"
  cmd_enable_mpi_inplace="${enable_mpi_inplace}"
  cmd_enable_mpi_interfaces_bugfix="${enable_mpi_interfaces_bugfix}"
  cmd_enable_mpi_io="${enable_mpi_io}"
  cmd_enable_mpi_io_default="${enable_mpi_io_default}"
  cmd_enable_netcdf_default="${enable_netcdf_default}"
  cmd_enable_openmp="${enable_openmp}"
  cmd_enable_openmp_offload="${enable_openmp_offload}"
  cmd_enable_python_invocation="${enable_python_invocation}"
  cmd_enable_source_debug="${enable_source_debug}"
  cmd_enable_stdin="${enable_stdin}"
  cmd_enable_timer="${enable_timer}"
  cmd_enable_triqs_v1_4="${enable_triqs_v1_4}"
  cmd_enable_triqs_v2_0="${enable_triqs_v2_0}"
  cmd_enable_zdot_bugfix="${enable_zdot_bugfix}"

  #
  # --with arguments
  #
  cmd_with_config_file="${with_config_file}"
  cmd_with_debug_flavor="${with_debug_flavor}"
  cmd_with_fallbacks="${with_fallbacks}"
  cmd_with_fc_vendor="${with_fc_vendor}"
  cmd_with_fc_version="${with_fc_version}"
  cmd_with_libxml2="${with_libxml2}"
  cmd_with_mpi_level="${with_mpi_level}"
  cmd_with_optim_flavor="${with_optim_flavor}"
  cmd_with_abinit_common="${with_abinit_common}"
  cmd_with_bigdft="${with_bigdft}"
  cmd_with_fft="${with_fft}"
  cmd_with_fft_flavor="${with_fft_flavor}"
  cmd_with_fftw3="${with_fftw3}"
  cmd_with_gpu="${with_gpu}"
  cmd_with_gpu_flavor="${with_gpu_flavor}"
  cmd_with_hdf5="${with_hdf5}"
  cmd_with_kokkos="${with_kokkos}"
  cmd_with_levmar="${with_levmar}"
  cmd_with_libpaw="${with_libpaw}"
  cmd_with_libpsml="${with_libpsml}"
  cmd_with_libxc="${with_libxc}"
  cmd_with_linalg="${with_linalg}"
  cmd_with_linalg_flavor="${with_linalg_flavor}"
  cmd_with_mpi="${with_mpi}"
  cmd_with_mpi_flavor="${with_mpi_flavor}"
  cmd_with_netcdf="${with_netcdf}"
  cmd_with_netcdf_fortran="${with_netcdf_fortran}"
  cmd_with_papi="${with_papi}"
  cmd_with_pfft="${with_pfft}"
  cmd_with_triqs="${with_triqs}"
  cmd_with_wannier90="${with_wannier90}"
  cmd_with_xmlf90="${with_xmlf90}"
  cmd_with_yakl="${with_yakl}"

  #
  # Prefix
  #
  if test "${prefix}" != "NONE"; then
    cmd_prefix="${prefix}"
  fi


  # Setup file names
  abi_hostname=`hostname | sed -e 's/\..*//'`
  abi_sys_options="/etc/abinit/build/${abi_hostname}.ac9"
  abi_per_options="${HOME}/.abinit/build/${abi_hostname}.ac9"
  abi_src_options="${abinit_srcdir}/${abi_hostname}.ac9"
  abi_loc_options="./${abi_hostname}.ac9"
  abi_cmd_options=`eval echo "${with_config_file}"`
  abi_cfg_enable=""
  abi_cfg_options=""
  abi_ac_distcheck=""

  # Check if the option is yes or no
  if test "${with_config_file}" = "no" -o "${with_config_file}" = "yes"; then
    abi_cfg_enable="${with_config_file}"
    abi_cmd_options=""
  else
    abi_cfg_enable="yes"
  fi

  # Some architectures require "./" for files in current directory
  if test "${abi_cmd_options}" != ""; then
    abi_cmd_has_path=`echo "${abi_cmd_options}" | grep '/'`
    if test "${abi_cmd_has_path}" = ""; then
      abi_cmd_options="./${abi_cmd_options}"
    fi
    unset abi_cmd_has_path
  fi

  # Select and read config file
  if test "${abi_cfg_enable}" = "yes"; then
    if test "${with_config_file}" != "" -a \
            ! -e "${with_config_file}"; then
      as_fn_error $? "config file ${with_config_file} not found" "$LINENO" 5
    fi

    for abi_options in "${abi_sys_options}" "${abi_per_options}" \
                       "${abi_src_options}" "${abi_loc_options}" \
                       "${abi_cmd_options}"; do
      if test -s "${abi_options}"; then
        abi_cfg_options="${abi_options}"
      fi
    done

    # Prevent infinite loops
    if grep "From configure.ac Autotools support for ABINIT" \
      "${abi_cfg_options}" >/dev/null 2>&1; then
      as_fn_error $? "infinite loop detected - aborting!" "$LINENO" 5
    fi

    # Source the file
    if test "${abi_cfg_options}" != ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: reading options from ${abi_cfg_options}" >&5
$as_echo "$as_me: reading options from ${abi_cfg_options}" >&6;}
      . "${abi_cfg_options}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: not loading options (no config file available)" >&5
$as_echo "$as_me: not loading options (no config file available)" >&6;}
    fi
  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: not loading options (disabled from command line)" >&5
$as_echo "$as_me: not loading options (disabled from command line)" >&6;}
  fi

  # Propagate information to "make distcheck"
  abi_ac_distcheck=`${REALPATH} "${abi_cfg_options}"`
  if test "${abi_ac_distcheck}" != ""; then
    abi_ac_distcheck="--with-config-file=\"${abi_ac_distcheck}\""
  fi





  #
  # --enable arguments
  #

  if test "${enable_avx_safe_mode}" != ""; then
    abi_avx_safe_mode_enable="${enable_avx_safe_mode}"
  fi

  if test "${enable_cclock}" != ""; then
    abi_cclock_enable="${enable_cclock}"
  fi

  if test "${enable_crpa_optim}" != ""; then
    abi_crpa_optim_enable="${enable_crpa_optim}"
  fi

  if test "${enable_fc_wrapper}" != ""; then
    abi_fc_wrapper_enable="${enable_fc_wrapper}"
  fi

  if test "${enable_gw_dpc}" != ""; then
    abi_gw_dpc_enable="${enable_gw_dpc}"
  fi

  if test "${enable_hints}" != ""; then
    abi_hints_enable="${enable_hints}"
  fi

  if test "${enable_libtetra}" != ""; then
    abi_libtetra_enable="${enable_libtetra}"
  fi

  if test "${enable_lotf}" != ""; then
    abi_lotf_enable="${enable_lotf}"
  fi

  if test "${enable_memory_profiling}" != ""; then
    abi_memory_profiling_enable="${enable_memory_profiling}"
  fi

  if test "${enable_mpi_gpu_aware}" != ""; then
    abi_mpi_gpu_aware_enable="${enable_mpi_gpu_aware}"
  fi

  if test "${enable_mpi_inplace}" != ""; then
    abi_mpi_inplace_enable="${enable_mpi_inplace}"
  fi

  if test "${enable_mpi_interfaces_bugfix}" != ""; then
    abi_mpi_interfaces_bugfix_enable="${enable_mpi_interfaces_bugfix}"
  fi

  if test "${enable_mpi_io}" != ""; then
    abi_mpi_io_enable="${enable_mpi_io}"
  fi

  if test "${enable_mpi_io_default}" != ""; then
    abi_mpi_io_default_enable="${enable_mpi_io_default}"
  fi

  if test "${enable_netcdf_default}" != ""; then
    abi_netcdf_default_enable="${enable_netcdf_default}"
  fi

  if test "${enable_openmp}" != ""; then
    abi_openmp_enable="${enable_openmp}"
  fi

  if test "${enable_openmp_offload}" != ""; then
    abi_openmp_offload_enable="${enable_openmp_offload}"
  fi

  if test "${enable_python_invocation}" != ""; then
    abi_python_invocation_enable="${enable_python_invocation}"
  fi

  if test "${enable_source_debug}" != ""; then
    abi_source_debug_enable="${enable_source_debug}"
  fi

  if test "${enable_stdin}" != ""; then
    abi_stdin_enable="${enable_stdin}"
  fi

  if test "${enable_timer}" != ""; then
    abi_timer_enable="${enable_timer}"
  fi

  if test "${enable_triqs_v1_4}" != ""; then
    abi_triqs_v1_4_enable="${enable_triqs_v1_4}"
  fi

  if test "${enable_triqs_v2_0}" != ""; then
    abi_triqs_v2_0_enable="${enable_triqs_v2_0}"
  fi

  if test "${enable_zdot_bugfix}" != ""; then
    abi_zdot_bugfix_enable="${enable_zdot_bugfix}"
  fi

  #
  # --with arguments
  #

  if test "${with_config_file}" != ""; then
    abi_config_file="${with_config_file}"
  fi

  if test "${with_debug_flavor}" != ""; then
    abi_debug_flavor="${with_debug_flavor}"
  fi

  if test "${with_fallbacks}" != ""; then
    abi_fallbacks="${with_fallbacks}"
  fi

  if test "${with_fc_vendor}" != ""; then
    abi_fc_vendor="${with_fc_vendor}"
  fi

  if test "${with_fc_version}" != ""; then
    abi_fc_version="${with_fc_version}"
  fi

  if test "${with_libxml2}" != ""; then
    abi_libxml2="${with_libxml2}"
  fi

  if test "${with_mpi_level}" != ""; then
    abi_mpi_level="${with_mpi_level}"
  fi

  if test "${with_optim_flavor}" != ""; then
    abi_optim_flavor="${with_optim_flavor}"
  fi




  #
  # --enable arguments
  #
  if test "${cmd_enable_avx_safe_mode}" != ""; then
    abi_avx_safe_mode_enable="${cmd_enable_avx_safe_mode}"
  fi
  if test "${cmd_enable_cclock}" != ""; then
    abi_cclock_enable="${cmd_enable_cclock}"
  fi
  if test "${cmd_enable_crpa_optim}" != ""; then
    abi_crpa_optim_enable="${cmd_enable_crpa_optim}"
  fi
  if test "${cmd_enable_fc_wrapper}" != ""; then
    abi_fc_wrapper_enable="${cmd_enable_fc_wrapper}"
  fi
  if test "${cmd_enable_gw_dpc}" != ""; then
    abi_gw_dpc_enable="${cmd_enable_gw_dpc}"
  fi
  if test "${cmd_enable_hints}" != ""; then
    abi_hints_enable="${cmd_enable_hints}"
  fi
  if test "${cmd_enable_libtetra}" != ""; then
    abi_libtetra_enable="${cmd_enable_libtetra}"
  fi
  if test "${cmd_enable_lotf}" != ""; then
    abi_lotf_enable="${cmd_enable_lotf}"
  fi
  if test "${cmd_enable_memory_profiling}" != ""; then
    abi_memory_profiling_enable="${cmd_enable_memory_profiling}"
  fi
  if test "${cmd_enable_mpi_gpu_aware}" != ""; then
    abi_mpi_gpu_aware_enable="${cmd_enable_mpi_gpu_aware}"
  fi
  if test "${cmd_enable_mpi_inplace}" != ""; then
    abi_mpi_inplace_enable="${cmd_enable_mpi_inplace}"
  fi
  if test "${cmd_enable_mpi_interfaces_bugfix}" != ""; then
    abi_mpi_interfaces_bugfix_enable="${cmd_enable_mpi_interfaces_bugfix}"
  fi
  if test "${cmd_enable_mpi_io}" != ""; then
    abi_mpi_io_enable="${cmd_enable_mpi_io}"
  fi
  if test "${cmd_enable_mpi_io_default}" != ""; then
    abi_mpi_io_default_enable="${cmd_enable_mpi_io_default}"
  fi
  if test "${cmd_enable_netcdf_default}" != ""; then
    abi_netcdf_default_enable="${cmd_enable_netcdf_default}"
  fi
  if test "${cmd_enable_openmp}" != ""; then
    abi_openmp_enable="${cmd_enable_openmp}"
  fi
  if test "${cmd_enable_openmp_offload}" != ""; then
    abi_openmp_offload_enable="${cmd_enable_openmp_offload}"
  fi
  if test "${cmd_enable_python_invocation}" != ""; then
    abi_python_invocation_enable="${cmd_enable_python_invocation}"
  fi
  if test "${cmd_enable_source_debug}" != ""; then
    abi_source_debug_enable="${cmd_enable_source_debug}"
  fi
  if test "${cmd_enable_stdin}" != ""; then
    abi_stdin_enable="${cmd_enable_stdin}"
  fi
  if test "${cmd_enable_timer}" != ""; then
    abi_timer_enable="${cmd_enable_timer}"
  fi
  if test "${cmd_enable_triqs_v1_4}" != ""; then
    abi_triqs_v1_4_enable="${cmd_enable_triqs_v1_4}"
  fi
  if test "${cmd_enable_triqs_v2_0}" != ""; then
    abi_triqs_v2_0_enable="${cmd_enable_triqs_v2_0}"
  fi
  if test "${cmd_enable_zdot_bugfix}" != ""; then
    abi_zdot_bugfix_enable="${cmd_enable_zdot_bugfix}"
  fi

  #
  # --with arguments
  #
  if test "${cmd_with_config_file}" != ""; then
    with_config_file="${cmd_with_config_file}"
  fi
  if test "${cmd_with_debug_flavor}" != ""; then
    with_debug_flavor="${cmd_with_debug_flavor}"
  fi
  if test "${cmd_with_fallbacks}" != ""; then
    with_fallbacks="${cmd_with_fallbacks}"
  fi
  if test "${cmd_with_fc_vendor}" != ""; then
    with_fc_vendor="${cmd_with_fc_vendor}"
  fi
  if test "${cmd_with_fc_version}" != ""; then
    with_fc_version="${cmd_with_fc_version}"
  fi
  if test "${cmd_with_libxml2}" != ""; then
    with_libxml2="${cmd_with_libxml2}"
  fi
  if test "${cmd_with_mpi_level}" != ""; then
    with_mpi_level="${cmd_with_mpi_level}"
  fi
  if test "${cmd_with_optim_flavor}" != ""; then
    with_optim_flavor="${cmd_with_optim_flavor}"
  fi
  if test "${cmd_with_abinit_common}" != ""; then
    with_abinit_common="${cmd_with_abinit_common}"
  fi
  if test "${cmd_with_bigdft}" != ""; then
    with_bigdft="${cmd_with_bigdft}"
  fi
  if test "${cmd_with_fft}" != ""; then
    with_fft="${cmd_with_fft}"
  fi
  if test "${cmd_with_fft_flavor}" != ""; then
    with_fft_flavor="${cmd_with_fft_flavor}"
  fi
  if test "${cmd_with_fftw3}" != ""; then
    with_fftw3="${cmd_with_fftw3}"
  fi
  if test "${cmd_with_gpu}" != ""; then
    with_gpu="${cmd_with_gpu}"
  fi
  if test "${cmd_with_gpu_flavor}" != ""; then
    with_gpu_flavor="${cmd_with_gpu_flavor}"
  fi
  if test "${cmd_with_hdf5}" != ""; then
    with_hdf5="${cmd_with_hdf5}"
  fi
  if test "${cmd_with_kokkos}" != ""; then
    with_kokkos="${cmd_with_kokkos}"
  fi
  if test "${cmd_with_levmar}" != ""; then
    with_levmar="${cmd_with_levmar}"
  fi
  if test "${cmd_with_libpaw}" != ""; then
    with_libpaw="${cmd_with_libpaw}"
  fi
  if test "${cmd_with_libpsml}" != ""; then
    with_libpsml="${cmd_with_libpsml}"
  fi
  if test "${cmd_with_libxc}" != ""; then
    with_libxc="${cmd_with_libxc}"
  fi
  if test "${cmd_with_linalg}" != ""; then
    with_linalg="${cmd_with_linalg}"
  fi
  if test "${cmd_with_linalg_flavor}" != ""; then
    with_linalg_flavor="${cmd_with_linalg_flavor}"
  fi
  if test "${cmd_with_mpi}" != ""; then
    with_mpi="${cmd_with_mpi}"
  fi
  if test "${cmd_with_mpi_flavor}" != ""; then
    with_mpi_flavor="${cmd_with_mpi_flavor}"
  fi
  if test "${cmd_with_netcdf}" != ""; then
    with_netcdf="${cmd_with_netcdf}"
  fi
  if test "${cmd_with_netcdf_fortran}" != ""; then
    with_netcdf_fortran="${cmd_with_netcdf_fortran}"
  fi
  if test "${cmd_with_papi}" != ""; then
    with_papi="${cmd_with_papi}"
  fi
  if test "${cmd_with_pfft}" != ""; then
    with_pfft="${cmd_with_pfft}"
  fi
  if test "${cmd_with_triqs}" != ""; then
    with_triqs="${cmd_with_triqs}"
  fi
  if test "${cmd_with_wannier90}" != ""; then
    with_wannier90="${cmd_with_wannier90}"
  fi
  if test "${cmd_with_xmlf90}" != ""; then
    with_xmlf90="${cmd_with_xmlf90}"
  fi
  if test "${cmd_with_yakl}" != ""; then
    with_yakl="${cmd_with_yakl}"
  fi

  #
  # Prefix
  #
  if test "${cmd_prefix}" != ""; then
    prefix="${cmd_prefix}"
  fi



    if test "${abi_env_ABI_CPPFLAGS}" != ""; then
    test "${ABI_CPPFLAGS}" != "${abi_env_ABI_CPPFLAGS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of ABI_CPPFLAGS from environment" >&5
$as_echo "$as_me: overriding configuration of ABI_CPPFLAGS from environment" >&6;}
    ABI_CPPFLAGS="${abi_env_ABI_CPPFLAGS}"
  fi

    if test "${abi_env_AR}" != ""; then
    test "${AR}" != "${abi_env_AR}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of AR from environment" >&5
$as_echo "$as_me: overriding configuration of AR from environment" >&6;}
    AR="${abi_env_AR}"
  fi

    if test "${abi_env_ARFLAGS}" != ""; then
    test "${ARFLAGS}" != "${abi_env_ARFLAGS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of ARFLAGS from environment" >&5
$as_echo "$as_me: overriding configuration of ARFLAGS from environment" >&6;}
    ARFLAGS="${abi_env_ARFLAGS}"
  fi

    if test "${abi_env_ARFLAGS_CMD}" != ""; then
    test "${ARFLAGS_CMD}" != "${abi_env_ARFLAGS_CMD}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of ARFLAGS_CMD from environment" >&5
$as_echo "$as_me: overriding configuration of ARFLAGS_CMD from environment" >&6;}
    ARFLAGS_CMD="${abi_env_ARFLAGS_CMD}"
  fi

    if test "${abi_env_ARFLAGS_DEBUG}" != ""; then
    test "${ARFLAGS_DEBUG}" != "${abi_env_ARFLAGS_DEBUG}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of ARFLAGS_DEBUG from environment" >&5
$as_echo "$as_me: overriding configuration of ARFLAGS_DEBUG from environment" >&6;}
    ARFLAGS_DEBUG="${abi_env_ARFLAGS_DEBUG}"
  fi

    if test "${abi_env_ARFLAGS_EXTRA}" != ""; then
    test "${ARFLAGS_EXTRA}" != "${abi_env_ARFLAGS_EXTRA}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of ARFLAGS_EXTRA from environment" >&5
$as_echo "$as_me: overriding configuration of ARFLAGS_EXTRA from environment" >&6;}
    ARFLAGS_EXTRA="${abi_env_ARFLAGS_EXTRA}"
  fi

    if test "${abi_env_ARFLAGS_HINTS}" != ""; then
    test "${ARFLAGS_HINTS}" != "${abi_env_ARFLAGS_HINTS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of ARFLAGS_HINTS from environment" >&5
$as_echo "$as_me: overriding configuration of ARFLAGS_HINTS from environment" >&6;}
    ARFLAGS_HINTS="${abi_env_ARFLAGS_HINTS}"
  fi

    if test "${abi_env_ARFLAGS_OPTIM}" != ""; then
    test "${ARFLAGS_OPTIM}" != "${abi_env_ARFLAGS_OPTIM}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of ARFLAGS_OPTIM from environment" >&5
$as_echo "$as_me: overriding configuration of ARFLAGS_OPTIM from environment" >&6;}
    ARFLAGS_OPTIM="${abi_env_ARFLAGS_OPTIM}"
  fi

    if test "${abi_env_CC}" != ""; then
    test "${CC}" != "${abi_env_CC}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CC from environment" >&5
$as_echo "$as_me: overriding configuration of CC from environment" >&6;}
    CC="${abi_env_CC}"
  fi

    if test "${abi_env_CC_LDFLAGS}" != ""; then
    test "${CC_LDFLAGS}" != "${abi_env_CC_LDFLAGS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CC_LDFLAGS from environment" >&5
$as_echo "$as_me: overriding configuration of CC_LDFLAGS from environment" >&6;}
    CC_LDFLAGS="${abi_env_CC_LDFLAGS}"
  fi

    if test "${abi_env_CC_LDFLAGS_DEBUG}" != ""; then
    test "${CC_LDFLAGS_DEBUG}" != "${abi_env_CC_LDFLAGS_DEBUG}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CC_LDFLAGS_DEBUG from environment" >&5
$as_echo "$as_me: overriding configuration of CC_LDFLAGS_DEBUG from environment" >&6;}
    CC_LDFLAGS_DEBUG="${abi_env_CC_LDFLAGS_DEBUG}"
  fi

    if test "${abi_env_CC_LDFLAGS_EXTRA}" != ""; then
    test "${CC_LDFLAGS_EXTRA}" != "${abi_env_CC_LDFLAGS_EXTRA}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CC_LDFLAGS_EXTRA from environment" >&5
$as_echo "$as_me: overriding configuration of CC_LDFLAGS_EXTRA from environment" >&6;}
    CC_LDFLAGS_EXTRA="${abi_env_CC_LDFLAGS_EXTRA}"
  fi

    if test "${abi_env_CC_LDFLAGS_GPU}" != ""; then
    test "${CC_LDFLAGS_GPU}" != "${abi_env_CC_LDFLAGS_GPU}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CC_LDFLAGS_GPU from environment" >&5
$as_echo "$as_me: overriding configuration of CC_LDFLAGS_GPU from environment" >&6;}
    CC_LDFLAGS_GPU="${abi_env_CC_LDFLAGS_GPU}"
  fi

    if test "${abi_env_CC_LDFLAGS_HINTS}" != ""; then
    test "${CC_LDFLAGS_HINTS}" != "${abi_env_CC_LDFLAGS_HINTS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CC_LDFLAGS_HINTS from environment" >&5
$as_echo "$as_me: overriding configuration of CC_LDFLAGS_HINTS from environment" >&6;}
    CC_LDFLAGS_HINTS="${abi_env_CC_LDFLAGS_HINTS}"
  fi

    if test "${abi_env_CC_LDFLAGS_OPTIM}" != ""; then
    test "${CC_LDFLAGS_OPTIM}" != "${abi_env_CC_LDFLAGS_OPTIM}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CC_LDFLAGS_OPTIM from environment" >&5
$as_echo "$as_me: overriding configuration of CC_LDFLAGS_OPTIM from environment" >&6;}
    CC_LDFLAGS_OPTIM="${abi_env_CC_LDFLAGS_OPTIM}"
  fi

    if test "${abi_env_CC_LIBS}" != ""; then
    test "${CC_LIBS}" != "${abi_env_CC_LIBS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CC_LIBS from environment" >&5
$as_echo "$as_me: overriding configuration of CC_LIBS from environment" >&6;}
    CC_LIBS="${abi_env_CC_LIBS}"
  fi

    if test "${abi_env_CC_LIBS_DEBUG}" != ""; then
    test "${CC_LIBS_DEBUG}" != "${abi_env_CC_LIBS_DEBUG}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CC_LIBS_DEBUG from environment" >&5
$as_echo "$as_me: overriding configuration of CC_LIBS_DEBUG from environment" >&6;}
    CC_LIBS_DEBUG="${abi_env_CC_LIBS_DEBUG}"
  fi

    if test "${abi_env_CC_LIBS_EXTRA}" != ""; then
    test "${CC_LIBS_EXTRA}" != "${abi_env_CC_LIBS_EXTRA}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CC_LIBS_EXTRA from environment" >&5
$as_echo "$as_me: overriding configuration of CC_LIBS_EXTRA from environment" >&6;}
    CC_LIBS_EXTRA="${abi_env_CC_LIBS_EXTRA}"
  fi

    if test "${abi_env_CC_LIBS_GPU}" != ""; then
    test "${CC_LIBS_GPU}" != "${abi_env_CC_LIBS_GPU}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CC_LIBS_GPU from environment" >&5
$as_echo "$as_me: overriding configuration of CC_LIBS_GPU from environment" >&6;}
    CC_LIBS_GPU="${abi_env_CC_LIBS_GPU}"
  fi

    if test "${abi_env_CC_LIBS_HINTS}" != ""; then
    test "${CC_LIBS_HINTS}" != "${abi_env_CC_LIBS_HINTS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CC_LIBS_HINTS from environment" >&5
$as_echo "$as_me: overriding configuration of CC_LIBS_HINTS from environment" >&6;}
    CC_LIBS_HINTS="${abi_env_CC_LIBS_HINTS}"
  fi

    if test "${abi_env_CC_LIBS_OPTIM}" != ""; then
    test "${CC_LIBS_OPTIM}" != "${abi_env_CC_LIBS_OPTIM}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CC_LIBS_OPTIM from environment" >&5
$as_echo "$as_me: overriding configuration of CC_LIBS_OPTIM from environment" >&6;}
    CC_LIBS_OPTIM="${abi_env_CC_LIBS_OPTIM}"
  fi

    if test "${abi_env_CFLAGS}" != ""; then
    test "${CFLAGS}" != "${abi_env_CFLAGS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CFLAGS from environment" >&5
$as_echo "$as_me: overriding configuration of CFLAGS from environment" >&6;}
    CFLAGS="${abi_env_CFLAGS}"
  fi

    if test "${abi_env_CFLAGS_DEBUG}" != ""; then
    test "${CFLAGS_DEBUG}" != "${abi_env_CFLAGS_DEBUG}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CFLAGS_DEBUG from environment" >&5
$as_echo "$as_me: overriding configuration of CFLAGS_DEBUG from environment" >&6;}
    CFLAGS_DEBUG="${abi_env_CFLAGS_DEBUG}"
  fi

    if test "${abi_env_CFLAGS_EXTRA}" != ""; then
    test "${CFLAGS_EXTRA}" != "${abi_env_CFLAGS_EXTRA}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CFLAGS_EXTRA from environment" >&5
$as_echo "$as_me: overriding configuration of CFLAGS_EXTRA from environment" >&6;}
    CFLAGS_EXTRA="${abi_env_CFLAGS_EXTRA}"
  fi

    if test "${abi_env_CFLAGS_GPU}" != ""; then
    test "${CFLAGS_GPU}" != "${abi_env_CFLAGS_GPU}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CFLAGS_GPU from environment" >&5
$as_echo "$as_me: overriding configuration of CFLAGS_GPU from environment" >&6;}
    CFLAGS_GPU="${abi_env_CFLAGS_GPU}"
  fi

    if test "${abi_env_CFLAGS_HINTS}" != ""; then
    test "${CFLAGS_HINTS}" != "${abi_env_CFLAGS_HINTS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CFLAGS_HINTS from environment" >&5
$as_echo "$as_me: overriding configuration of CFLAGS_HINTS from environment" >&6;}
    CFLAGS_HINTS="${abi_env_CFLAGS_HINTS}"
  fi

    if test "${abi_env_CFLAGS_OPTIM}" != ""; then
    test "${CFLAGS_OPTIM}" != "${abi_env_CFLAGS_OPTIM}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CFLAGS_OPTIM from environment" >&5
$as_echo "$as_me: overriding configuration of CFLAGS_OPTIM from environment" >&6;}
    CFLAGS_OPTIM="${abi_env_CFLAGS_OPTIM}"
  fi

    if test "${abi_env_CPP}" != ""; then
    test "${CPP}" != "${abi_env_CPP}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CPP from environment" >&5
$as_echo "$as_me: overriding configuration of CPP from environment" >&6;}
    CPP="${abi_env_CPP}"
  fi

    if test "${abi_env_CPPFLAGS}" != ""; then
    test "${CPPFLAGS}" != "${abi_env_CPPFLAGS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CPPFLAGS from environment" >&5
$as_echo "$as_me: overriding configuration of CPPFLAGS from environment" >&6;}
    CPPFLAGS="${abi_env_CPPFLAGS}"
  fi

    if test "${abi_env_CPPFLAGS_DEBUG}" != ""; then
    test "${CPPFLAGS_DEBUG}" != "${abi_env_CPPFLAGS_DEBUG}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CPPFLAGS_DEBUG from environment" >&5
$as_echo "$as_me: overriding configuration of CPPFLAGS_DEBUG from environment" >&6;}
    CPPFLAGS_DEBUG="${abi_env_CPPFLAGS_DEBUG}"
  fi

    if test "${abi_env_CPPFLAGS_EXTRA}" != ""; then
    test "${CPPFLAGS_EXTRA}" != "${abi_env_CPPFLAGS_EXTRA}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CPPFLAGS_EXTRA from environment" >&5
$as_echo "$as_me: overriding configuration of CPPFLAGS_EXTRA from environment" >&6;}
    CPPFLAGS_EXTRA="${abi_env_CPPFLAGS_EXTRA}"
  fi

    if test "${abi_env_CPPFLAGS_GPU}" != ""; then
    test "${CPPFLAGS_GPU}" != "${abi_env_CPPFLAGS_GPU}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CPPFLAGS_GPU from environment" >&5
$as_echo "$as_me: overriding configuration of CPPFLAGS_GPU from environment" >&6;}
    CPPFLAGS_GPU="${abi_env_CPPFLAGS_GPU}"
  fi

    if test "${abi_env_CPPFLAGS_HINTS}" != ""; then
    test "${CPPFLAGS_HINTS}" != "${abi_env_CPPFLAGS_HINTS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CPPFLAGS_HINTS from environment" >&5
$as_echo "$as_me: overriding configuration of CPPFLAGS_HINTS from environment" >&6;}
    CPPFLAGS_HINTS="${abi_env_CPPFLAGS_HINTS}"
  fi

    if test "${abi_env_CPPFLAGS_OPTIM}" != ""; then
    test "${CPPFLAGS_OPTIM}" != "${abi_env_CPPFLAGS_OPTIM}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CPPFLAGS_OPTIM from environment" >&5
$as_echo "$as_me: overriding configuration of CPPFLAGS_OPTIM from environment" >&6;}
    CPPFLAGS_OPTIM="${abi_env_CPPFLAGS_OPTIM}"
  fi

    if test "${abi_env_CXX}" != ""; then
    test "${CXX}" != "${abi_env_CXX}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CXX from environment" >&5
$as_echo "$as_me: overriding configuration of CXX from environment" >&6;}
    CXX="${abi_env_CXX}"
  fi

    if test "${abi_env_CXXFLAGS}" != ""; then
    test "${CXXFLAGS}" != "${abi_env_CXXFLAGS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CXXFLAGS from environment" >&5
$as_echo "$as_me: overriding configuration of CXXFLAGS from environment" >&6;}
    CXXFLAGS="${abi_env_CXXFLAGS}"
  fi

    if test "${abi_env_CXXFLAGS_DEBUG}" != ""; then
    test "${CXXFLAGS_DEBUG}" != "${abi_env_CXXFLAGS_DEBUG}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CXXFLAGS_DEBUG from environment" >&5
$as_echo "$as_me: overriding configuration of CXXFLAGS_DEBUG from environment" >&6;}
    CXXFLAGS_DEBUG="${abi_env_CXXFLAGS_DEBUG}"
  fi

    if test "${abi_env_CXXFLAGS_EXTRA}" != ""; then
    test "${CXXFLAGS_EXTRA}" != "${abi_env_CXXFLAGS_EXTRA}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CXXFLAGS_EXTRA from environment" >&5
$as_echo "$as_me: overriding configuration of CXXFLAGS_EXTRA from environment" >&6;}
    CXXFLAGS_EXTRA="${abi_env_CXXFLAGS_EXTRA}"
  fi

    if test "${abi_env_CXXFLAGS_GPU}" != ""; then
    test "${CXXFLAGS_GPU}" != "${abi_env_CXXFLAGS_GPU}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CXXFLAGS_GPU from environment" >&5
$as_echo "$as_me: overriding configuration of CXXFLAGS_GPU from environment" >&6;}
    CXXFLAGS_GPU="${abi_env_CXXFLAGS_GPU}"
  fi

    if test "${abi_env_CXXFLAGS_HINTS}" != ""; then
    test "${CXXFLAGS_HINTS}" != "${abi_env_CXXFLAGS_HINTS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CXXFLAGS_HINTS from environment" >&5
$as_echo "$as_me: overriding configuration of CXXFLAGS_HINTS from environment" >&6;}
    CXXFLAGS_HINTS="${abi_env_CXXFLAGS_HINTS}"
  fi

    if test "${abi_env_CXXFLAGS_OPTIM}" != ""; then
    test "${CXXFLAGS_OPTIM}" != "${abi_env_CXXFLAGS_OPTIM}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CXXFLAGS_OPTIM from environment" >&5
$as_echo "$as_me: overriding configuration of CXXFLAGS_OPTIM from environment" >&6;}
    CXXFLAGS_OPTIM="${abi_env_CXXFLAGS_OPTIM}"
  fi

    if test "${abi_env_CXX_LDFLAGS}" != ""; then
    test "${CXX_LDFLAGS}" != "${abi_env_CXX_LDFLAGS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CXX_LDFLAGS from environment" >&5
$as_echo "$as_me: overriding configuration of CXX_LDFLAGS from environment" >&6;}
    CXX_LDFLAGS="${abi_env_CXX_LDFLAGS}"
  fi

    if test "${abi_env_CXX_LDFLAGS_DEBUG}" != ""; then
    test "${CXX_LDFLAGS_DEBUG}" != "${abi_env_CXX_LDFLAGS_DEBUG}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CXX_LDFLAGS_DEBUG from environment" >&5
$as_echo "$as_me: overriding configuration of CXX_LDFLAGS_DEBUG from environment" >&6;}
    CXX_LDFLAGS_DEBUG="${abi_env_CXX_LDFLAGS_DEBUG}"
  fi

    if test "${abi_env_CXX_LDFLAGS_EXTRA}" != ""; then
    test "${CXX_LDFLAGS_EXTRA}" != "${abi_env_CXX_LDFLAGS_EXTRA}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CXX_LDFLAGS_EXTRA from environment" >&5
$as_echo "$as_me: overriding configuration of CXX_LDFLAGS_EXTRA from environment" >&6;}
    CXX_LDFLAGS_EXTRA="${abi_env_CXX_LDFLAGS_EXTRA}"
  fi

    if test "${abi_env_CXX_LDFLAGS_GPU}" != ""; then
    test "${CXX_LDFLAGS_GPU}" != "${abi_env_CXX_LDFLAGS_GPU}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CXX_LDFLAGS_GPU from environment" >&5
$as_echo "$as_me: overriding configuration of CXX_LDFLAGS_GPU from environment" >&6;}
    CXX_LDFLAGS_GPU="${abi_env_CXX_LDFLAGS_GPU}"
  fi

    if test "${abi_env_CXX_LDFLAGS_HINTS}" != ""; then
    test "${CXX_LDFLAGS_HINTS}" != "${abi_env_CXX_LDFLAGS_HINTS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CXX_LDFLAGS_HINTS from environment" >&5
$as_echo "$as_me: overriding configuration of CXX_LDFLAGS_HINTS from environment" >&6;}
    CXX_LDFLAGS_HINTS="${abi_env_CXX_LDFLAGS_HINTS}"
  fi

    if test "${abi_env_CXX_LDFLAGS_OPTIM}" != ""; then
    test "${CXX_LDFLAGS_OPTIM}" != "${abi_env_CXX_LDFLAGS_OPTIM}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CXX_LDFLAGS_OPTIM from environment" >&5
$as_echo "$as_me: overriding configuration of CXX_LDFLAGS_OPTIM from environment" >&6;}
    CXX_LDFLAGS_OPTIM="${abi_env_CXX_LDFLAGS_OPTIM}"
  fi

    if test "${abi_env_CXX_LIBS}" != ""; then
    test "${CXX_LIBS}" != "${abi_env_CXX_LIBS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CXX_LIBS from environment" >&5
$as_echo "$as_me: overriding configuration of CXX_LIBS from environment" >&6;}
    CXX_LIBS="${abi_env_CXX_LIBS}"
  fi

    if test "${abi_env_CXX_LIBS_DEBUG}" != ""; then
    test "${CXX_LIBS_DEBUG}" != "${abi_env_CXX_LIBS_DEBUG}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CXX_LIBS_DEBUG from environment" >&5
$as_echo "$as_me: overriding configuration of CXX_LIBS_DEBUG from environment" >&6;}
    CXX_LIBS_DEBUG="${abi_env_CXX_LIBS_DEBUG}"
  fi

    if test "${abi_env_CXX_LIBS_EXTRA}" != ""; then
    test "${CXX_LIBS_EXTRA}" != "${abi_env_CXX_LIBS_EXTRA}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CXX_LIBS_EXTRA from environment" >&5
$as_echo "$as_me: overriding configuration of CXX_LIBS_EXTRA from environment" >&6;}
    CXX_LIBS_EXTRA="${abi_env_CXX_LIBS_EXTRA}"
  fi

    if test "${abi_env_CXX_LIBS_GPU}" != ""; then
    test "${CXX_LIBS_GPU}" != "${abi_env_CXX_LIBS_GPU}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CXX_LIBS_GPU from environment" >&5
$as_echo "$as_me: overriding configuration of CXX_LIBS_GPU from environment" >&6;}
    CXX_LIBS_GPU="${abi_env_CXX_LIBS_GPU}"
  fi

    if test "${abi_env_CXX_LIBS_HINTS}" != ""; then
    test "${CXX_LIBS_HINTS}" != "${abi_env_CXX_LIBS_HINTS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CXX_LIBS_HINTS from environment" >&5
$as_echo "$as_me: overriding configuration of CXX_LIBS_HINTS from environment" >&6;}
    CXX_LIBS_HINTS="${abi_env_CXX_LIBS_HINTS}"
  fi

    if test "${abi_env_CXX_LIBS_OPTIM}" != ""; then
    test "${CXX_LIBS_OPTIM}" != "${abi_env_CXX_LIBS_OPTIM}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of CXX_LIBS_OPTIM from environment" >&5
$as_echo "$as_me: overriding configuration of CXX_LIBS_OPTIM from environment" >&6;}
    CXX_LIBS_OPTIM="${abi_env_CXX_LIBS_OPTIM}"
  fi

    if test "${abi_env_DEFS}" != ""; then
    test "${DEFS}" != "${abi_env_DEFS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of DEFS from environment" >&5
$as_echo "$as_me: overriding configuration of DEFS from environment" >&6;}
    DEFS="${abi_env_DEFS}"
  fi

    if test "${abi_env_F77}" != ""; then
    test "${F77}" != "${abi_env_F77}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of F77 from environment" >&5
$as_echo "$as_me: overriding configuration of F77 from environment" >&6;}
    F77="${abi_env_F77}"
  fi

    if test "${abi_env_FC}" != ""; then
    test "${FC}" != "${abi_env_FC}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FC from environment" >&5
$as_echo "$as_me: overriding configuration of FC from environment" >&6;}
    FC="${abi_env_FC}"
  fi

    if test "${abi_env_FCFLAGS}" != ""; then
    test "${FCFLAGS}" != "${abi_env_FCFLAGS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FCFLAGS from environment" >&5
$as_echo "$as_me: overriding configuration of FCFLAGS from environment" >&6;}
    FCFLAGS="${abi_env_FCFLAGS}"
  fi

    if test "${abi_env_FCFLAGS_DEBUG}" != ""; then
    test "${FCFLAGS_DEBUG}" != "${abi_env_FCFLAGS_DEBUG}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FCFLAGS_DEBUG from environment" >&5
$as_echo "$as_me: overriding configuration of FCFLAGS_DEBUG from environment" >&6;}
    FCFLAGS_DEBUG="${abi_env_FCFLAGS_DEBUG}"
  fi

    if test "${abi_env_FCFLAGS_EXTRA}" != ""; then
    test "${FCFLAGS_EXTRA}" != "${abi_env_FCFLAGS_EXTRA}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FCFLAGS_EXTRA from environment" >&5
$as_echo "$as_me: overriding configuration of FCFLAGS_EXTRA from environment" >&6;}
    FCFLAGS_EXTRA="${abi_env_FCFLAGS_EXTRA}"
  fi

    if test "${abi_env_FCFLAGS_FIXEDFORM}" != ""; then
    test "${FCFLAGS_FIXEDFORM}" != "${abi_env_FCFLAGS_FIXEDFORM}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FCFLAGS_FIXEDFORM from environment" >&5
$as_echo "$as_me: overriding configuration of FCFLAGS_FIXEDFORM from environment" >&6;}
    FCFLAGS_FIXEDFORM="${abi_env_FCFLAGS_FIXEDFORM}"
  fi

    if test "${abi_env_FCFLAGS_FREEFORM}" != ""; then
    test "${FCFLAGS_FREEFORM}" != "${abi_env_FCFLAGS_FREEFORM}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FCFLAGS_FREEFORM from environment" >&5
$as_echo "$as_me: overriding configuration of FCFLAGS_FREEFORM from environment" >&6;}
    FCFLAGS_FREEFORM="${abi_env_FCFLAGS_FREEFORM}"
  fi

    if test "${abi_env_FCFLAGS_HINTS}" != ""; then
    test "${FCFLAGS_HINTS}" != "${abi_env_FCFLAGS_HINTS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FCFLAGS_HINTS from environment" >&5
$as_echo "$as_me: overriding configuration of FCFLAGS_HINTS from environment" >&6;}
    FCFLAGS_HINTS="${abi_env_FCFLAGS_HINTS}"
  fi

    if test "${abi_env_FCFLAGS_MODDIR}" != ""; then
    test "${FCFLAGS_MODDIR}" != "${abi_env_FCFLAGS_MODDIR}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FCFLAGS_MODDIR from environment" >&5
$as_echo "$as_me: overriding configuration of FCFLAGS_MODDIR from environment" >&6;}
    FCFLAGS_MODDIR="${abi_env_FCFLAGS_MODDIR}"
  fi

    if test "${abi_env_FCFLAGS_OPENMP}" != ""; then
    test "${FCFLAGS_OPENMP}" != "${abi_env_FCFLAGS_OPENMP}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FCFLAGS_OPENMP from environment" >&5
$as_echo "$as_me: overriding configuration of FCFLAGS_OPENMP from environment" >&6;}
    FCFLAGS_OPENMP="${abi_env_FCFLAGS_OPENMP}"
  fi

    if test "${abi_env_FCFLAGS_OPENMP_OFFLOAD}" != ""; then
    test "${FCFLAGS_OPENMP_OFFLOAD}" != "${abi_env_FCFLAGS_OPENMP_OFFLOAD}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FCFLAGS_OPENMP_OFFLOAD from environment" >&5
$as_echo "$as_me: overriding configuration of FCFLAGS_OPENMP_OFFLOAD from environment" >&6;}
    FCFLAGS_OPENMP_OFFLOAD="${abi_env_FCFLAGS_OPENMP_OFFLOAD}"
  fi

    if test "${abi_env_FCFLAGS_OPTIM}" != ""; then
    test "${FCFLAGS_OPTIM}" != "${abi_env_FCFLAGS_OPTIM}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FCFLAGS_OPTIM from environment" >&5
$as_echo "$as_me: overriding configuration of FCFLAGS_OPTIM from environment" >&6;}
    FCFLAGS_OPTIM="${abi_env_FCFLAGS_OPTIM}"
  fi

    if test "${abi_env_FC_LDFLAGS}" != ""; then
    test "${FC_LDFLAGS}" != "${abi_env_FC_LDFLAGS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FC_LDFLAGS from environment" >&5
$as_echo "$as_me: overriding configuration of FC_LDFLAGS from environment" >&6;}
    FC_LDFLAGS="${abi_env_FC_LDFLAGS}"
  fi

    if test "${abi_env_FC_LDFLAGS_DEBUG}" != ""; then
    test "${FC_LDFLAGS_DEBUG}" != "${abi_env_FC_LDFLAGS_DEBUG}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FC_LDFLAGS_DEBUG from environment" >&5
$as_echo "$as_me: overriding configuration of FC_LDFLAGS_DEBUG from environment" >&6;}
    FC_LDFLAGS_DEBUG="${abi_env_FC_LDFLAGS_DEBUG}"
  fi

    if test "${abi_env_FC_LDFLAGS_EXTRA}" != ""; then
    test "${FC_LDFLAGS_EXTRA}" != "${abi_env_FC_LDFLAGS_EXTRA}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FC_LDFLAGS_EXTRA from environment" >&5
$as_echo "$as_me: overriding configuration of FC_LDFLAGS_EXTRA from environment" >&6;}
    FC_LDFLAGS_EXTRA="${abi_env_FC_LDFLAGS_EXTRA}"
  fi

    if test "${abi_env_FC_LDFLAGS_HINTS}" != ""; then
    test "${FC_LDFLAGS_HINTS}" != "${abi_env_FC_LDFLAGS_HINTS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FC_LDFLAGS_HINTS from environment" >&5
$as_echo "$as_me: overriding configuration of FC_LDFLAGS_HINTS from environment" >&6;}
    FC_LDFLAGS_HINTS="${abi_env_FC_LDFLAGS_HINTS}"
  fi

    if test "${abi_env_FC_LDFLAGS_OPTIM}" != ""; then
    test "${FC_LDFLAGS_OPTIM}" != "${abi_env_FC_LDFLAGS_OPTIM}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FC_LDFLAGS_OPTIM from environment" >&5
$as_echo "$as_me: overriding configuration of FC_LDFLAGS_OPTIM from environment" >&6;}
    FC_LDFLAGS_OPTIM="${abi_env_FC_LDFLAGS_OPTIM}"
  fi

    if test "${abi_env_FC_LIBS}" != ""; then
    test "${FC_LIBS}" != "${abi_env_FC_LIBS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FC_LIBS from environment" >&5
$as_echo "$as_me: overriding configuration of FC_LIBS from environment" >&6;}
    FC_LIBS="${abi_env_FC_LIBS}"
  fi

    if test "${abi_env_FC_LIBS_DEBUG}" != ""; then
    test "${FC_LIBS_DEBUG}" != "${abi_env_FC_LIBS_DEBUG}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FC_LIBS_DEBUG from environment" >&5
$as_echo "$as_me: overriding configuration of FC_LIBS_DEBUG from environment" >&6;}
    FC_LIBS_DEBUG="${abi_env_FC_LIBS_DEBUG}"
  fi

    if test "${abi_env_FC_LIBS_EXTRA}" != ""; then
    test "${FC_LIBS_EXTRA}" != "${abi_env_FC_LIBS_EXTRA}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FC_LIBS_EXTRA from environment" >&5
$as_echo "$as_me: overriding configuration of FC_LIBS_EXTRA from environment" >&6;}
    FC_LIBS_EXTRA="${abi_env_FC_LIBS_EXTRA}"
  fi

    if test "${abi_env_FC_LIBS_HINTS}" != ""; then
    test "${FC_LIBS_HINTS}" != "${abi_env_FC_LIBS_HINTS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FC_LIBS_HINTS from environment" >&5
$as_echo "$as_me: overriding configuration of FC_LIBS_HINTS from environment" >&6;}
    FC_LIBS_HINTS="${abi_env_FC_LIBS_HINTS}"
  fi

    if test "${abi_env_FC_LIBS_OPTIM}" != ""; then
    test "${FC_LIBS_OPTIM}" != "${abi_env_FC_LIBS_OPTIM}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FC_LIBS_OPTIM from environment" >&5
$as_echo "$as_me: overriding configuration of FC_LIBS_OPTIM from environment" >&6;}
    FC_LIBS_OPTIM="${abi_env_FC_LIBS_OPTIM}"
  fi

    if test "${abi_env_FFT_CFLAGS}" != ""; then
    test "${FFT_CFLAGS}" != "${abi_env_FFT_CFLAGS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FFT_CFLAGS from environment" >&5
$as_echo "$as_me: overriding configuration of FFT_CFLAGS from environment" >&6;}
    FFT_CFLAGS="${abi_env_FFT_CFLAGS}"
  fi

    if test "${abi_env_FFT_FCFLAGS}" != ""; then
    test "${FFT_FCFLAGS}" != "${abi_env_FFT_FCFLAGS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FFT_FCFLAGS from environment" >&5
$as_echo "$as_me: overriding configuration of FFT_FCFLAGS from environment" >&6;}
    FFT_FCFLAGS="${abi_env_FFT_FCFLAGS}"
  fi

    if test "${abi_env_FPP}" != ""; then
    test "${FPP}" != "${abi_env_FPP}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FPP from environment" >&5
$as_echo "$as_me: overriding configuration of FPP from environment" >&6;}
    FPP="${abi_env_FPP}"
  fi

    if test "${abi_env_FPPFLAGS}" != ""; then
    test "${FPPFLAGS}" != "${abi_env_FPPFLAGS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FPPFLAGS from environment" >&5
$as_echo "$as_me: overriding configuration of FPPFLAGS from environment" >&6;}
    FPPFLAGS="${abi_env_FPPFLAGS}"
  fi

    if test "${abi_env_FPPFLAGS_DEBUG}" != ""; then
    test "${FPPFLAGS_DEBUG}" != "${abi_env_FPPFLAGS_DEBUG}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FPPFLAGS_DEBUG from environment" >&5
$as_echo "$as_me: overriding configuration of FPPFLAGS_DEBUG from environment" >&6;}
    FPPFLAGS_DEBUG="${abi_env_FPPFLAGS_DEBUG}"
  fi

    if test "${abi_env_FPPFLAGS_EXTRA}" != ""; then
    test "${FPPFLAGS_EXTRA}" != "${abi_env_FPPFLAGS_EXTRA}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FPPFLAGS_EXTRA from environment" >&5
$as_echo "$as_me: overriding configuration of FPPFLAGS_EXTRA from environment" >&6;}
    FPPFLAGS_EXTRA="${abi_env_FPPFLAGS_EXTRA}"
  fi

    if test "${abi_env_FPPFLAGS_HINTS}" != ""; then
    test "${FPPFLAGS_HINTS}" != "${abi_env_FPPFLAGS_HINTS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FPPFLAGS_HINTS from environment" >&5
$as_echo "$as_me: overriding configuration of FPPFLAGS_HINTS from environment" >&6;}
    FPPFLAGS_HINTS="${abi_env_FPPFLAGS_HINTS}"
  fi

    if test "${abi_env_FPPFLAGS_OPTIM}" != ""; then
    test "${FPPFLAGS_OPTIM}" != "${abi_env_FPPFLAGS_OPTIM}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of FPPFLAGS_OPTIM from environment" >&5
$as_echo "$as_me: overriding configuration of FPPFLAGS_OPTIM from environment" >&6;}
    FPPFLAGS_OPTIM="${abi_env_FPPFLAGS_OPTIM}"
  fi

    if test "${abi_env_GPU_ARCH}" != ""; then
    test "${GPU_ARCH}" != "${abi_env_GPU_ARCH}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of GPU_ARCH from environment" >&5
$as_echo "$as_me: overriding configuration of GPU_ARCH from environment" >&6;}
    GPU_ARCH="${abi_env_GPU_ARCH}"
  fi

    if test "${abi_env_LD}" != ""; then
    test "${LD}" != "${abi_env_LD}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of LD from environment" >&5
$as_echo "$as_me: overriding configuration of LD from environment" >&6;}
    LD="${abi_env_LD}"
  fi

    if test "${abi_env_MODEXT}" != ""; then
    test "${MODEXT}" != "${abi_env_MODEXT}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of MODEXT from environment" >&5
$as_echo "$as_me: overriding configuration of MODEXT from environment" >&6;}
    MODEXT="${abi_env_MODEXT}"
  fi

    if test "${abi_env_NM}" != ""; then
    test "${NM}" != "${abi_env_NM}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of NM from environment" >&5
$as_echo "$as_me: overriding configuration of NM from environment" >&6;}
    NM="${abi_env_NM}"
  fi

    if test "${abi_env_NVCC}" != ""; then
    test "${NVCC}" != "${abi_env_NVCC}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of NVCC from environment" >&5
$as_echo "$as_me: overriding configuration of NVCC from environment" >&6;}
    NVCC="${abi_env_NVCC}"
  fi

    if test "${abi_env_NVCC_CFLAGS}" != ""; then
    test "${NVCC_CFLAGS}" != "${abi_env_NVCC_CFLAGS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of NVCC_CFLAGS from environment" >&5
$as_echo "$as_me: overriding configuration of NVCC_CFLAGS from environment" >&6;}
    NVCC_CFLAGS="${abi_env_NVCC_CFLAGS}"
  fi

    if test "${abi_env_NVCC_CPPFLAGS}" != ""; then
    test "${NVCC_CPPFLAGS}" != "${abi_env_NVCC_CPPFLAGS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of NVCC_CPPFLAGS from environment" >&5
$as_echo "$as_me: overriding configuration of NVCC_CPPFLAGS from environment" >&6;}
    NVCC_CPPFLAGS="${abi_env_NVCC_CPPFLAGS}"
  fi

    if test "${abi_env_NVCC_LDFLAGS}" != ""; then
    test "${NVCC_LDFLAGS}" != "${abi_env_NVCC_LDFLAGS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of NVCC_LDFLAGS from environment" >&5
$as_echo "$as_me: overriding configuration of NVCC_LDFLAGS from environment" >&6;}
    NVCC_LDFLAGS="${abi_env_NVCC_LDFLAGS}"
  fi

    if test "${abi_env_NVCC_LIBS}" != ""; then
    test "${NVCC_LIBS}" != "${abi_env_NVCC_LIBS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of NVCC_LIBS from environment" >&5
$as_echo "$as_me: overriding configuration of NVCC_LIBS from environment" >&6;}
    NVCC_LIBS="${abi_env_NVCC_LIBS}"
  fi

    if test "${abi_env_PYFLAGS}" != ""; then
    test "${PYFLAGS}" != "${abi_env_PYFLAGS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of PYFLAGS from environment" >&5
$as_echo "$as_me: overriding configuration of PYFLAGS from environment" >&6;}
    PYFLAGS="${abi_env_PYFLAGS}"
  fi

    if test "${abi_env_PYTHON_CPPFLAGS}" != ""; then
    test "${PYTHON_CPPFLAGS}" != "${abi_env_PYTHON_CPPFLAGS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of PYTHON_CPPFLAGS from environment" >&5
$as_echo "$as_me: overriding configuration of PYTHON_CPPFLAGS from environment" >&6;}
    PYTHON_CPPFLAGS="${abi_env_PYTHON_CPPFLAGS}"
  fi

    if test "${abi_env_RANLIB}" != ""; then
    test "${RANLIB}" != "${abi_env_RANLIB}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of RANLIB from environment" >&5
$as_echo "$as_me: overriding configuration of RANLIB from environment" >&6;}
    RANLIB="${abi_env_RANLIB}"
  fi

    if test "${abi_env_TRUE_CPP}" != ""; then
    test "${TRUE_CPP}" != "${abi_env_TRUE_CPP}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of TRUE_CPP from environment" >&5
$as_echo "$as_me: overriding configuration of TRUE_CPP from environment" >&6;}
    TRUE_CPP="${abi_env_TRUE_CPP}"
  fi

    if test "${abi_env_XPP}" != ""; then
    test "${XPP}" != "${abi_env_XPP}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of XPP from environment" >&5
$as_echo "$as_me: overriding configuration of XPP from environment" >&6;}
    XPP="${abi_env_XPP}"
  fi

    if test "${abi_env_XPPFLAGS}" != ""; then
    test "${XPPFLAGS}" != "${abi_env_XPPFLAGS}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of XPPFLAGS from environment" >&5
$as_echo "$as_me: overriding configuration of XPPFLAGS from environment" >&6;}
    XPPFLAGS="${abi_env_XPPFLAGS}"
  fi

    if test "${abi_env_XPPFLAGS_DEBUG}" != ""; then
    test "${XPPFLAGS_DEBUG}" != "${abi_env_XPPFLAGS_DEBUG}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of XPPFLAGS_DEBUG from environment" >&5
$as_echo "$as_me: overriding configuration of XPPFLAGS_DEBUG from environment" >&6;}
    XPPFLAGS_DEBUG="${abi_env_XPPFLAGS_DEBUG}"
  fi

    if test "${abi_env_XPPFLAGS_EXTRA}" != ""; then
    test "${XPPFLAGS_EXTRA}" != "${abi_env_XPPFLAGS_EXTRA}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of XPPFLAGS_EXTRA from environment" >&5
$as_echo "$as_me: overriding configuration of XPPFLAGS_EXTRA from environment" >&6;}
    XPPFLAGS_EXTRA="${abi_env_XPPFLAGS_EXTRA}"
  fi

    if test "${abi_env_XPPFLAGS_OPTIM}" != ""; then
    test "${XPPFLAGS_OPTIM}" != "${abi_env_XPPFLAGS_OPTIM}" && \
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding configuration of XPPFLAGS_OPTIM from environment" >&5
$as_echo "$as_me: overriding configuration of XPPFLAGS_OPTIM from environment" >&6;}
    XPPFLAGS_OPTIM="${abi_env_XPPFLAGS_OPTIM}"
  fi



# Set still undefined options


  #
  # --enable arguments
  #

  if test "${enable_avx_safe_mode}" = ""; then
    abi_avx_safe_mode_enable="no"
  fi
  if test "${enable_cclock}" = ""; then
    abi_cclock_enable="no"
  fi
  if test "${enable_crpa_optim}" = ""; then
    abi_crpa_optim_enable="no"
  fi
  if test "${enable_fc_wrapper}" = ""; then
    abi_fc_wrapper_enable="no"
  fi
  if test "${enable_gw_dpc}" = ""; then
    abi_gw_dpc_enable="no"
  fi
  if test "${enable_hints}" = ""; then
    abi_hints_enable="yes"
  fi
  if test "${enable_libtetra}" = ""; then
    abi_libtetra_enable="yes"
  fi
  if test "${enable_lotf}" = ""; then
    abi_lotf_enable="no"
  fi
  if test "${enable_memory_profiling}" = ""; then
    abi_memory_profiling_enable="no"
  fi
  if test "${enable_mpi_gpu_aware}" = ""; then
    abi_mpi_gpu_aware_enable="no"
  fi
  if test "${enable_mpi_inplace}" = ""; then
    abi_mpi_inplace_enable="auto"
  fi
  if test "${enable_mpi_interfaces_bugfix}" = ""; then
    abi_mpi_interfaces_bugfix_enable="auto"
  fi
  if test "${enable_mpi_io}" = ""; then
    abi_mpi_io_enable="auto"
  fi
  if test "${enable_mpi_io_default}" = ""; then
    abi_mpi_io_default_enable="no"
  fi
  if test "${enable_netcdf_default}" = ""; then
    abi_netcdf_default_enable="no"
  fi
  if test "${enable_openmp}" = ""; then
    abi_openmp_enable="no"
  fi
  if test "${enable_openmp_offload}" = ""; then
    abi_openmp_offload_enable="no"
  fi
  if test "${enable_python_invocation}" = ""; then
    abi_python_invocation_enable="no"
  fi
  if test "${enable_source_debug}" = ""; then
    abi_source_debug_enable="no"
  fi
  if test "${enable_stdin}" = ""; then
    abi_stdin_enable="yes"
  fi
  if test "${enable_timer}" = ""; then
    abi_timer_enable="yes"
  fi
  if test "${enable_triqs_v1_4}" = ""; then
    abi_triqs_v1_4_enable="no"
  fi
  if test "${enable_triqs_v2_0}" = ""; then
    abi_triqs_v2_0_enable="no"
  fi
  if test "${enable_zdot_bugfix}" = ""; then
    abi_zdot_bugfix_enable="auto"
  fi

  #
  # --with arguments
  #

  if test "${with_config_file}" = "no"; then
    abi_config_file=""
  fi
  if test "${with_debug_flavor}" = ""; then
    abi_debug_flavor="basic"
  fi
  if test "${with_debug_flavor}" = "no"; then
    abi_debug_flavor="none"
  fi
  if test "${with_fallbacks}" = "no"; then
    abi_fallbacks=""
  fi
  if test "${with_fc_vendor}" = "no"; then
    abi_fc_vendor="generic"
  fi
  if test "${with_fc_version}" = "no"; then
    abi_fc_version="0.0"
  fi
  if test "${with_libxml2}" = "no"; then
    abi_libxml2=""
  fi
  if test "${with_mpi_level}" = ""; then
    abi_mpi_level="2"
  fi
  if test "${with_mpi_level}" = "no"; then
    abi_mpi_level=""
  fi
  if test "${with_optim_flavor}" = ""; then
    abi_optim_flavor="standard"
  fi
  if test "${with_optim_flavor}" = "no"; then
    abi_optim_flavor="none"
  fi


# Initialize environment, taking options into account


    ABI_CPPFLAGS=''




    ARFLAGS_CMD='rc'








    ARFLAGS_HINTS=''














    CC_LDFLAGS_GPU=''


    CC_LDFLAGS_HINTS=''













    CC_LIBS_GPU=''


    CC_LIBS_HINTS=''












    CFLAGS_GPU=''


    CFLAGS_HINTS=''













    CPPFLAGS_GPU=''


    CPPFLAGS_HINTS=''













    CXXFLAGS_GPU=''


    CXXFLAGS_HINTS=''













    CXX_LDFLAGS_GPU=''


    CXX_LDFLAGS_HINTS=''













    CXX_LIBS_GPU=''


    CXX_LIBS_HINTS=''













































    FC_LDFLAGS_HINTS=''













    FC_LIBS_HINTS=''























    FPPFLAGS_HINTS=''









    MODEXT=''




















    TRUE_CPP=''

























# Initialize install dirs (requires version and config options to be set)

    if test "${prefix}" = "NONE"; then
    abinit_prefix="${ac_default_prefix}"
  else
    abinit_prefix="${prefix}"
  fi

    abinit_bindir="${abinit_prefix}/bin"
  abinit_chkdir="${abinit_prefix}/share/abinit/tests"
  abinit_datdir="${abinit_prefix}/share/abinit"
  abinit_docdir="${abinit_prefix}/doc/abinit"
  abinit_incdir="${abinit_prefix}/include"
  abinit_libdir="${abinit_prefix}/lib"
  abinit_mandir="${abinit_prefix}/share/man"











# Disable wrapping of Fortran compiler by default
abi_fc_wrap="no"

# Save user-defined CPP
abi_cpp_user="${CPP}"

# Set-up required information for core libraries

    src_common_fcflags=' -I$(top_builddir)/shared/common/src/incs -I$(top_srcdir)/shared/common/src/incs -I$(top_builddir)/shared/common/src/mods -I$(top_srcdir)/shared/common/src/mods'
  src_core_fcflags=' -I$(top_builddir)/src/incs -I$(top_srcdir)/src/incs -I$(top_builddir)/src/mods -I$(top_srcdir)/src/mods'
  src_libpaw_fcflags=' -I$(top_builddir)/shared/libpaw/incs -I$(top_srcdir)/shared/libpaw/incs -I$(top_builddir)/shared/libpaw/mods -I$(top_srcdir)/shared/libpaw/mods'
  src_02_clib_fcflags='-I$(top_builddir)/shared/common/src/02_clib -I$(top_srcdir)/shared/common/src/02_clib'
  src_10_defs_fcflags='-I$(top_builddir)/shared/common/src/10_defs -I$(top_srcdir)/shared/common/src/10_defs'
  src_11_memory_mpi_fcflags='-I$(top_builddir)/shared/common/src/11_memory_mpi -I$(top_srcdir)/shared/common/src/11_memory_mpi'
  src_12_hide_mpi_fcflags='-I$(top_builddir)/shared/common/src/12_hide_mpi -I$(top_srcdir)/shared/common/src/12_hide_mpi'
  src_14_hidewrite_fcflags='-I$(top_builddir)/shared/common/src/14_hidewrite -I$(top_srcdir)/shared/common/src/14_hidewrite'
  src_16_hideleave_fcflags='-I$(top_builddir)/shared/common/src/16_hideleave -I$(top_srcdir)/shared/common/src/16_hideleave'
  src_16_kokkos_toolbox_fcflags='-I$(top_builddir)/shared/common/src/16_kokkos_toolbox -I$(top_srcdir)/shared/common/src/16_kokkos_toolbox'
  src_17_gpu_toolbox_fcflags='-I$(top_builddir)/shared/common/src/17_gpu_toolbox -I$(top_srcdir)/shared/common/src/17_gpu_toolbox'
  src_17_libtetra_ext_fcflags='-I$(top_builddir)/shared/common/src/17_libtetra_ext -I$(top_srcdir)/shared/common/src/17_libtetra_ext'
  src_17_minimax_fcflags='-I$(top_builddir)/shared/common/src/17_minimax -I$(top_srcdir)/shared/common/src/17_minimax'
  src_17_yaml_out_fcflags='-I$(top_builddir)/shared/common/src/17_yaml_out -I$(top_srcdir)/shared/common/src/17_yaml_out'
  src_18_timing_fcflags='-I$(top_builddir)/shared/common/src/18_timing -I$(top_srcdir)/shared/common/src/18_timing'
  src_21_hashfuncs_fcflags='-I$(top_builddir)/shared/common/src/21_hashfuncs -I$(top_srcdir)/shared/common/src/21_hashfuncs'
  src_27_toolbox_oop_fcflags='-I$(top_builddir)/shared/common/src/27_toolbox_oop -I$(top_srcdir)/shared/common/src/27_toolbox_oop'
  src_28_numeric_noabirule_fcflags='-I$(top_builddir)/shared/common/src/28_numeric_noabirule -I$(top_srcdir)/shared/common/src/28_numeric_noabirule'
  src_29_kpoints_fcflags='-I$(top_builddir)/shared/common/src/29_kpoints -I$(top_srcdir)/shared/common/src/29_kpoints'
  src_32_util_fcflags='-I$(top_builddir)/shared/common/src/32_util -I$(top_srcdir)/shared/common/src/32_util'
  src_33_xc_lowlevel_fcflags='-I$(top_builddir)/shared/common/src/33_xc_lowlevel -I$(top_srcdir)/shared/common/src/33_xc_lowlevel'
  src_39_libpaw_fcflags='-I$(top_builddir)/shared/libpaw/src -I$(top_srcdir)/shared/libpaw/src'
  src_41_geometry_fcflags='-I$(top_builddir)/src/41_geometry -I$(top_srcdir)/src/41_geometry'
  src_42_nlstrain_fcflags='-I$(top_builddir)/src/42_nlstrain -I$(top_srcdir)/src/42_nlstrain'
  src_42_parser_fcflags='-I$(top_builddir)/src/42_parser -I$(top_srcdir)/src/42_parser'
  src_43_ptgroups_fcflags='-I$(top_builddir)/src/43_ptgroups -I$(top_srcdir)/src/43_ptgroups'
  src_43_wvl_wrappers_fcflags='-I$(top_builddir)/src/43_wvl_wrappers -I$(top_srcdir)/src/43_wvl_wrappers'
  src_44_abitools_fcflags='-I$(top_builddir)/src/44_abitools -I$(top_srcdir)/src/44_abitools'
  src_44_abitypes_defs_fcflags='-I$(top_builddir)/src/44_abitypes_defs -I$(top_srcdir)/src/44_abitypes_defs'
  src_44_manage_kokkos_fcflags='-I$(top_builddir)/src/44_manage_kokkos -I$(top_srcdir)/src/44_manage_kokkos'
  src_45_geomoptim_fcflags='-I$(top_builddir)/src/45_geomoptim -I$(top_srcdir)/src/45_geomoptim'
  src_45_xgTools_fcflags='-I$(top_builddir)/src/45_xgTools -I$(top_srcdir)/src/45_xgTools'
  src_46_ghc_omp_fcflags='-I$(top_builddir)/src/46_ghc_omp -I$(top_srcdir)/src/46_ghc_omp'
  src_46_manage_cuda_fcflags='-I$(top_builddir)/src/46_manage_cuda -I$(top_srcdir)/src/46_manage_cuda'
  src_48_diago_fcflags='-I$(top_builddir)/src/48_diago -I$(top_srcdir)/src/48_diago'
  src_49_gw_toolbox_oop_fcflags='-I$(top_builddir)/src/49_gw_toolbox_oop -I$(top_srcdir)/src/49_gw_toolbox_oop'
  src_51_manage_mpi_fcflags='-I$(top_builddir)/src/51_manage_mpi -I$(top_srcdir)/src/51_manage_mpi'
  src_52_fft_mpi_noabirule_fcflags='-I$(top_builddir)/src/52_fft_mpi_noabirule -I$(top_srcdir)/src/52_fft_mpi_noabirule'
  src_53_ffts_fcflags='-I$(top_builddir)/src/53_ffts -I$(top_srcdir)/src/53_ffts'
  src_54_spacepar_fcflags='-I$(top_builddir)/src/54_spacepar -I$(top_srcdir)/src/54_spacepar'
  src_55_abiutil_fcflags='-I$(top_builddir)/src/55_abiutil -I$(top_srcdir)/src/55_abiutil'
  src_56_io_mpi_fcflags='-I$(top_builddir)/src/56_io_mpi -I$(top_srcdir)/src/56_io_mpi'
  src_56_mixing_fcflags='-I$(top_builddir)/src/56_mixing -I$(top_srcdir)/src/56_mixing'
  src_56_recipspace_fcflags='-I$(top_builddir)/src/56_recipspace -I$(top_srcdir)/src/56_recipspace'
  src_56_xc_fcflags='-I$(top_builddir)/src/56_xc -I$(top_srcdir)/src/56_xc'
  src_57_iopsp_parser_fcflags='-I$(top_builddir)/src/57_iopsp_parser -I$(top_srcdir)/src/57_iopsp_parser'
  src_57_iovars_fcflags='-I$(top_builddir)/src/57_iovars -I$(top_srcdir)/src/57_iovars'
  src_61_occeig_fcflags='-I$(top_builddir)/src/61_occeig -I$(top_srcdir)/src/61_occeig'
  src_62_cg_noabirule_fcflags='-I$(top_builddir)/src/62_cg_noabirule -I$(top_srcdir)/src/62_cg_noabirule'
  src_62_ctqmc_fcflags='-I$(top_builddir)/src/62_ctqmc -I$(top_srcdir)/src/62_ctqmc'
  src_62_iowfdenpot_fcflags='-I$(top_builddir)/src/62_iowfdenpot -I$(top_srcdir)/src/62_iowfdenpot'
  src_62_poisson_fcflags='-I$(top_builddir)/src/62_poisson -I$(top_srcdir)/src/62_poisson'
  src_62_wvl_wfs_fcflags='-I$(top_builddir)/src/62_wvl_wfs -I$(top_srcdir)/src/62_wvl_wfs'
  src_64_psp_fcflags='-I$(top_builddir)/src/64_psp -I$(top_srcdir)/src/64_psp'
  src_65_lotf_base_fcflags='-I$(top_builddir)/src/65_lotf_base -I$(top_srcdir)/src/65_lotf_base'
  src_65_paw_fcflags='-I$(top_builddir)/src/65_paw -I$(top_srcdir)/src/65_paw'
  src_66_nonlocal_fcflags='-I$(top_builddir)/src/66_nonlocal -I$(top_srcdir)/src/66_nonlocal'
  src_66_vdwxc_fcflags='-I$(top_builddir)/src/66_vdwxc -I$(top_srcdir)/src/66_vdwxc'
  src_66_wfs_fcflags='-I$(top_builddir)/src/66_wfs -I$(top_srcdir)/src/66_wfs'
  src_67_common_fcflags='-I$(top_builddir)/src/67_common -I$(top_srcdir)/src/67_common'
  src_67_python_invocation_ext_fcflags='-I$(top_builddir)/src/67_python_invocation_ext -I$(top_srcdir)/src/67_python_invocation_ext'
  src_67_triqs_ext_fcflags='-I$(top_builddir)/src/67_triqs_ext -I$(top_srcdir)/src/67_triqs_ext'
  src_68_dmft_fcflags='-I$(top_builddir)/src/68_dmft -I$(top_srcdir)/src/68_dmft'
  src_68_lotf_fcflags='-I$(top_builddir)/src/68_lotf -I$(top_srcdir)/src/68_lotf'
  src_68_recursion_fcflags='-I$(top_builddir)/src/68_recursion -I$(top_srcdir)/src/68_recursion'
  src_68_rsprc_fcflags='-I$(top_builddir)/src/68_rsprc -I$(top_srcdir)/src/68_rsprc'
  src_69_wfdesc_fcflags='-I$(top_builddir)/src/69_wfdesc -I$(top_srcdir)/src/69_wfdesc'
  src_70_gw_fcflags='-I$(top_builddir)/src/70_gw -I$(top_srcdir)/src/70_gw'
  src_71_bse_fcflags='-I$(top_builddir)/src/71_bse -I$(top_srcdir)/src/71_bse'
  src_71_wannier_fcflags='-I$(top_builddir)/src/71_wannier -I$(top_srcdir)/src/71_wannier'
  src_72_response_fcflags='-I$(top_builddir)/src/72_response -I$(top_srcdir)/src/72_response'
  src_77_ddb_fcflags='-I$(top_builddir)/src/77_ddb -I$(top_srcdir)/src/77_ddb'
  src_77_suscep_fcflags='-I$(top_builddir)/src/77_suscep -I$(top_srcdir)/src/77_suscep'
  src_78_effpot_fcflags='-I$(top_builddir)/src/78_effpot -I$(top_srcdir)/src/78_effpot'
  src_78_eph_fcflags='-I$(top_builddir)/src/78_eph -I$(top_srcdir)/src/78_eph'
  src_79_seqpar_mpi_fcflags='-I$(top_builddir)/src/79_seqpar_mpi -I$(top_srcdir)/src/79_seqpar_mpi'
  src_80_rttddft_fcflags='-I$(top_builddir)/src/80_rttddft -I$(top_srcdir)/src/80_rttddft'
  src_80_tdep_fcflags='-I$(top_builddir)/src/80_tdep -I$(top_srcdir)/src/80_tdep'
  src_94_scfcv_fcflags='-I$(top_builddir)/src/94_scfcv -I$(top_srcdir)/src/94_scfcv'
  src_95_drive_fcflags='-I$(top_builddir)/src/95_drive -I$(top_srcdir)/src/95_drive'




















































































# ---------------------------------------------------------------------------- #

#
# Build-system information
#



  abi_sec_title="Build-system information"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# Display ABINIT version
{ $as_echo "$as_me:${as_lineno-$LINENO}: ABINIT version ${ABINIT_VERSION}" >&5
$as_echo "$as_me: ABINIT version ${ABINIT_VERSION}" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}

# Display Autotools version information

    abi_m4_version="010416"
  abi_ac_version="026900"
  abi_am_version="011304"
  abi_lt_version="020406"

    { $as_echo "$as_me:${as_lineno-$LINENO}: reporting Autotools information:" >&5
$as_echo "$as_me: reporting Autotools information:" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * M4       : ${abi_m4_version}" >&5
$as_echo "$as_me:   * M4       : ${abi_m4_version}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * Autoconf : ${abi_ac_version}" >&5
$as_echo "$as_me:   * Autoconf : ${abi_ac_version}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * Automake : ${abi_am_version}" >&5
$as_echo "$as_me:   * Automake : ${abi_am_version}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * Libtool  : ${abi_lt_version}" >&5
$as_echo "$as_me:   * Libtool  : ${abi_lt_version}" >&6;}







# Display UI changes

  { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: no change in user interface to report" >&5
$as_echo "$as_me: no change in user interface to report" >&6;}


# Display changes in feature triggers

  { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: reporting changes in feature triggers:" >&5
$as_echo "$as_me: reporting changes in feature triggers:" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * new feature trigger for kokkos available" >&5
$as_echo "$as_me:   * new feature trigger for kokkos available" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:     >>> --with-kokkos, KOKKOS_*FLAGS" >&5
$as_echo "$as_me:     >>> --with-kokkos, KOKKOS_*FLAGS" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * new feature trigger for yakl available" >&5
$as_echo "$as_me:   * new feature trigger for yakl available" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:     >>> --with-yakl, YAKL_*FLAGS" >&5
$as_echo "$as_me:     >>> --with-yakl, YAKL_*FLAGS" >&6;}



# ---------------------------------------------------------------------------- #

#
# Check option consistency
#

# NOTE: please hack this section with EXTREME CARE



  abi_sec_title="Option consistency checking"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# --------- #
# Libraries #
# --------- #

abi_optchk_ok="yes"

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking consistency of command-line options" >&5
$as_echo "$as_me: checking consistency of command-line options" >&6;}

# C-CLOCK requires the building of 02_clib
if test "${abi_cclock_enable}" = "yes"; then
  if test "${abi_clib_enable}" = "" -o "${abi_clib_enable}" = "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: |---> enabling CLib (required by CClock, experimental!)" >&5
$as_echo "$as_me: |---> enabling CLib (required by CClock, experimental!)" >&6;}
    abi_clib_enable="yes"
    abi_optchk_ok="no"
  fi
fi

# Only one of MPI I/O and NetCDF I/O can be the default
if test "${abi_netcdf_default_enable}" = "yes" -a \
        "${abi_mpi_io_default_enable}" = "yes"; then
  as_fn_error $? "MPI I/O and NetCDF are mutually exclusive default I/O modes
                  These maintainer options should only be used for testing
                  purposes. Please do not use them unless you really know
                  what you are doing." "$LINENO" 5
fi

# Closing remarks
if test "${abi_optchk_ok}" = "yes"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: |---> all OK" >&5
$as_echo "$as_me: |---> all OK" >&6;}
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}

# ------------------- #
# Final step: parsing #
# ------------------- #



  { $as_echo "$as_me:${as_lineno-$LINENO}: parsing command-line options" >&5
$as_echo "$as_me: parsing command-line options" >&6;}

  # Parse enable_avx_safe_mode
  if test "${abi_avx_safe_mode_enable}" != ""; then
    for v in `echo "${abi_avx_safe_mode_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_avx_safe_mode = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_avx_safe_mode = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_avx_safe_mode = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_cclock
  if test "${abi_cclock_enable}" != ""; then
    for v in `echo "${abi_cclock_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_cclock = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_cclock = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_cclock = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_crpa_optim
  if test "${abi_crpa_optim_enable}" != ""; then
    for v in `echo "${abi_crpa_optim_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_crpa_optim = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_crpa_optim = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_crpa_optim = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_fc_wrapper
  if test "${abi_fc_wrapper_enable}" != ""; then
    for v in `echo "${abi_fc_wrapper_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_fc_wrapper = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_fc_wrapper = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_fc_wrapper = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_gw_dpc
  if test "${abi_gw_dpc_enable}" != ""; then
    for v in `echo "${abi_gw_dpc_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_gw_dpc = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_gw_dpc = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_gw_dpc = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_hints
  if test "${abi_hints_enable}" != ""; then
    for v in `echo "${abi_hints_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_hints = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_hints = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_hints = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_libtetra
  if test "${abi_libtetra_enable}" != ""; then
    for v in `echo "${abi_libtetra_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_libtetra = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_libtetra = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_libtetra = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_lotf
  if test "${abi_lotf_enable}" != ""; then
    for v in `echo "${abi_lotf_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_lotf = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_lotf = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_lotf = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_memory_profiling
  if test "${abi_memory_profiling_enable}" != ""; then
    for v in `echo "${abi_memory_profiling_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_memory_profiling = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_memory_profiling = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_memory_profiling = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_mpi_gpu_aware
  if test "${abi_mpi_gpu_aware_enable}" != ""; then
    for v in `echo "${abi_mpi_gpu_aware_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_mpi_gpu_aware = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_mpi_gpu_aware = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_mpi_gpu_aware = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_mpi_inplace
  if test "${abi_mpi_inplace_enable}" != ""; then
    for v in `echo "${abi_mpi_inplace_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes auto; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_mpi_inplace = (no|yes|auto)" >&5
$as_echo "$as_me: WARNING: enable_mpi_inplace = (no|yes|auto)" >&2;}
      as_fn_error $? "invalid option: enable_mpi_inplace = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_mpi_interfaces_bugfix
  if test "${abi_mpi_interfaces_bugfix_enable}" != ""; then
    for v in `echo "${abi_mpi_interfaces_bugfix_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes auto; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_mpi_interfaces_bugfix = (no|yes|auto)" >&5
$as_echo "$as_me: WARNING: enable_mpi_interfaces_bugfix = (no|yes|auto)" >&2;}
      as_fn_error $? "invalid option: enable_mpi_interfaces_bugfix = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_mpi_io
  if test "${abi_mpi_io_enable}" != ""; then
    for v in `echo "${abi_mpi_io_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes auto; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_mpi_io = (no|yes|auto)" >&5
$as_echo "$as_me: WARNING: enable_mpi_io = (no|yes|auto)" >&2;}
      as_fn_error $? "invalid option: enable_mpi_io = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_mpi_io_default
  if test "${abi_mpi_io_default_enable}" != ""; then
    for v in `echo "${abi_mpi_io_default_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_mpi_io_default = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_mpi_io_default = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_mpi_io_default = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_netcdf_default
  if test "${abi_netcdf_default_enable}" != ""; then
    for v in `echo "${abi_netcdf_default_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_netcdf_default = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_netcdf_default = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_netcdf_default = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_openmp
  if test "${abi_openmp_enable}" != ""; then
    for v in `echo "${abi_openmp_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_openmp = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_openmp = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_openmp = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_openmp_offload
  if test "${abi_openmp_offload_enable}" != ""; then
    for v in `echo "${abi_openmp_offload_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_openmp_offload = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_openmp_offload = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_openmp_offload = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_python_invocation
  if test "${abi_python_invocation_enable}" != ""; then
    for v in `echo "${abi_python_invocation_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_python_invocation = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_python_invocation = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_python_invocation = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_source_debug
  if test "${abi_source_debug_enable}" != ""; then
    for v in `echo "${abi_source_debug_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_source_debug = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_source_debug = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_source_debug = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_stdin
  if test "${abi_stdin_enable}" != ""; then
    for v in `echo "${abi_stdin_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_stdin = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_stdin = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_stdin = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_timer
  if test "${abi_timer_enable}" != ""; then
    for v in `echo "${abi_timer_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_timer = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_timer = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_timer = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_triqs_v1_4
  if test "${abi_triqs_v1_4_enable}" != ""; then
    for v in `echo "${abi_triqs_v1_4_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_triqs_v1_4 = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_triqs_v1_4 = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_triqs_v1_4 = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_triqs_v2_0
  if test "${abi_triqs_v2_0_enable}" != ""; then
    for v in `echo "${abi_triqs_v2_0_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_triqs_v2_0 = (no|yes)" >&5
$as_echo "$as_me: WARNING: enable_triqs_v2_0 = (no|yes)" >&2;}
      as_fn_error $? "invalid option: enable_triqs_v2_0 = ${v}" "$LINENO" 5
    fi
  fi

  # Parse enable_zdot_bugfix
  if test "${abi_zdot_bugfix_enable}" != ""; then
    for v in `echo "${abi_zdot_bugfix_enable}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in no yes auto; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable_zdot_bugfix = (no|yes|auto)" >&5
$as_echo "$as_me: WARNING: enable_zdot_bugfix = (no|yes|auto)" >&2;}
      as_fn_error $? "invalid option: enable_zdot_bugfix = ${v}" "$LINENO" 5
    fi
  fi

  # Parse with_debug_flavor
  if test "${abi_debug_flavor}" != ""; then
    for v in `echo "${abi_debug_flavor}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in none custom basic verbose enhanced paranoid naughty; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: with_debug_flavor = (none|custom|basic|verbose|enhanced|paranoid|naughty)" >&5
$as_echo "$as_me: WARNING: with_debug_flavor = (none|custom|basic|verbose|enhanced|paranoid|naughty)" >&2;}
      as_fn_error $? "invalid option: with_debug_flavor = ${v}" "$LINENO" 5
    fi
  fi

  # Parse with_fallbacks
 if test "${with_fallbacks}" != ""; then
    opt_ok="yes"
    if test "${with_fallbacks}" != "no" -a "${with_fallbacks}" != "yes"; then
      if test \! -d "${with_fallbacks}" -o \! -r "${with_fallbacks}"; then
        opt_ok="no"
        break
      fi
    fi
  fi

  # Parse with_libxml2
 if test "${with_libxml2}" != ""; then
    opt_ok="yes"
    if test "${with_libxml2}" != "no" -a "${with_libxml2}" != "yes"; then
      if test \! -d "${with_libxml2}" -o \! -r "${with_libxml2}"; then
        opt_ok="no"
        break
      fi
    fi
  fi

  # Parse with_mpi_level
  if test "${abi_mpi_level}" != ""; then
    for v in `echo "${abi_mpi_level}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in 2 3; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: with_mpi_level = (2|3)" >&5
$as_echo "$as_me: WARNING: with_mpi_level = (2|3)" >&2;}
      as_fn_error $? "invalid option: with_mpi_level = ${v}" "$LINENO" 5
    fi
  fi

  # Parse with_optim_flavor
  if test "${abi_optim_flavor}" != ""; then
    for v in `echo "${abi_optim_flavor}" | sed -e 's/+/ /g'`; do
      opt_ok="no"
      for r in none custom safe standard aggressive; do
        if test "${v}" = "${r}";then
          opt_ok="yes"
          break
        fi
      done
      test "${opt_ok}" = "no" && break
    done
    if test "${opt_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: with_optim_flavor = (none|custom|safe|standard|aggressive)" >&5
$as_echo "$as_me: WARNING: with_optim_flavor = (none|custom|safe|standard|aggressive)" >&2;}
      as_fn_error $? "invalid option: with_optim_flavor = ${v}" "$LINENO" 5
    fi
  fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: |---> all OK" >&5
$as_echo "$as_me: |---> all OK" >&6;}

# ---------------------------------------------------------------------------- #

#
# Feature triggers startup
#



  abi_sec_title="Feature triggers and architecture startup"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# Init Steredeg core features

  # Init internal Fortran-related variables
  sd_sys_fcflags=""

  # Substitute Steredeg core variables



# Do we want to use fallbacks? (must be first)

    abi_fbk_config=""
  abi_fbk_enable="no"
  abi_fbk_init="def"
  abi_fbk_list=""
  abi_fbk_prefix=""
  abi_fbk_required=""

    if test "${with_fallbacks}" = "yes"; then
    #AC_CHECK_PROGS([abi_fbk_config],
    #               [${ac_abs_confdir}/fallbacks/build-abinit-fallbacks.sh.in \
    #                ./build-abinit-fallbacks.sh.in])
    abi_fbk_config="${ac_abs_confdir}/fallbacks/build-abinit-fallbacks.sh.in"
    if test "${abi_fbk_config}" != ""; then
      abi_fbk_enable="yes"
      abi_fbk_init="yon"
    fi
    echo "abi_fbk_config = ${abi_fbk_config}"
  elif test -d "${with_fallbacks}"; then
    abi_fbk_prefix="${with_fallbacks}"
    #abi_fbk_config="${abi_fbk_prefix}/build-abinit-fallbacks.sh"
    abi_fbk_config="${ac_abs_confdir}/fallbacks/build-abinit-fallbacks.sh"
        if test -f "${abi_fbk_config}.in"; then
      abi_fbk_enable="yes"
      abi_fbk_init="dir"
    fi
    #echo "abi_fbk_prefix=${ac_abs_confdir}/fallbacks"
    echo "with_fallbacks=${with_fallbacks}"
    echo "abi_fbk_prefix=${abi_fbk_prefix}"
    echo "abi_fbk_config = ${abi_fbk_config}"
    echo "abi_fbk_enable = ${abi_fbk_enable}"
    echo "abi_fbk_init = ${abi_fbk_init}"
  elif test "${with_fallbacks}" != ""; then
    as_fn_error $? "invalid fallbacks install prefix: '${with_fallbacks}'
                  please use --with-fallbacks without argument or make it
                  point to a readable directory actually containing
                  fallbacks (hint: it should contain an executable
                  program called 'build-abinit-fallbacks.sh')" "$LINENO" 5
  fi

    if test "${abi_fbk_enable}" = "no"; then
    if test "${with_fallbacks}" != "" -a "${with_fallbacks}" != "no"; then
      as_fn_error $? "fallbacks not found
                  please check that --with-fallbacks points to a readable
                  directory or that the 'build-abinit-fallbacks.sh' program
                  is available through your PATH environment variable" "$LINENO" 5
    fi
  fi

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can use fallbacks" >&5
$as_echo_n "checking whether we can use fallbacks... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_fbk_enable}" >&5
$as_echo "${abi_fbk_enable}" >&6; }









                    # ------------------------------------ #

# Prepare MPI support

  # Delegate most of the init stage to Steredeg

  # Init
  sd_mpi_cppflags=""
  sd_mpi_cflags=""
  sd_mpi_fcflags=""
  sd_mpi_ldflags=""
  sd_mpi_libs=""
  sd_mpi_cc=""
  sd_mpi_cc_ok="unknown"
  sd_mpi_cc_set="no"
  sd_mpi_cxx=""
  sd_mpi_cxx_ok="unknown"
  sd_mpi_cxx_set="no"
  sd_mpi_fc=""
  sd_mpi_fc_ok="unknown"
  sd_mpi_fc_set="no"
  sd_mpi_enable=""
  sd_mpi_init="unknown"
  sd_mpi_ok="unknown"

  # Set adjustable parameters
  sd_mpi_options="auto optional fail"
  sd_mpi_libs_def="-lmpi"
  sd_mpi_cppflags_def=""
  sd_mpi_cflags_def=""
  sd_mpi_cxxflags_def=""
  sd_mpi_fcflags_def=""
  sd_mpi_ldflags_def=""
  sd_mpi_enable_cxx=""
  sd_mpi_enable_def=""
  sd_mpi_enable_fc=""
  sd_mpi_policy=""
  sd_mpi_status=""

  # Process options
  for kwd in ${sd_mpi_options}; do
    case "${kwd}" in
      auto)
        sd_mpi_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_mpi_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_mpi_policy="${kwd}"
        ;;
      no-cxx)
        sd_mpi_enable_cxx="no"
        ;;
      no-fortran)
        sd_mpi_enable_fc="no"
        ;;
      *)
        as_fn_error $? "invalid Steredeg MPI option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test "${sd_mpi_libs_def}" = "" && sd_mpi_libs_def="-lmpi"
  test "${sd_mpi_policy}" = "" && sd_mpi_policy="fail"
  test "${sd_mpi_status}" = "" && sd_mpi_status="optional"
  test "${sd_mpi_enable_def}" = "" && sd_mpi_enable_def="no"
  case "${sd_mpi_status}" in
    implicit|required)
      sd_mpi_enable_def="yes"
      ;;
  esac
  test "${sd_mpi_enable_cxx}" = "" && sd_mpi_enable_cxx="yes"
  test "${sd_mpi_enable_fc}" = "" && sd_mpi_enable_fc="yes"

  # Declare configure option

# Check whether --with-mpi was given.
if test "${with_mpi+set}" = set; then :
  withval=$with_mpi;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_mpi_enable="${withval}"
        sd_mpi_init="yon"
      else
        sd_mpi_enable="yes"
        sd_mpi_init="dir"
      fi
else
   sd_mpi_enable="${sd_mpi_enable_def}"; sd_mpi_init="def"
fi


  # Declare environment variables








  # Detect use of environment variables
  if test "${sd_mpi_enable}" = "yes" -o "${sd_mpi_enable}" = "auto"; then
    tmp_compil_vars="${CC}"
    tmp_mpi_vars="${MPI_CPPFLAGS}${MPI_CFLAGS}${MPI_LDFLAGS}${MPI_LIBS}"
    if test "${sd_mpi_enable_cxx}" = "yes"; then
      tmp_compil_vars="${tmp_compil_vars}${CXX}"
      tmp_mpi_vars="${tmp_mpi_vars}${MPI_CXXFLAGS}"
    fi
    if test "${sd_mpi_enable_fc}" = "yes"; then
      tmp_compil_vars="${tmp_compil_vars}${FC}"
      tmp_mpi_vars="${tmp_mpi_vars}${MPI_FFLAGS}${MPI_FCFLAGS}"
    fi
    if test "${sd_mpi_init}" = "def" -o "${sd_mpi_init}" = "yon"; then
      if test "${tmp_compil_vars}${tmp_mpi_vars}" != ""; then
        sd_mpi_enable="yes"
        sd_mpi_init="env"
      fi
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_CONFIG_BYPASS_CHECKS}" != "yes"; then

  # Main trigger must be yes, no, or auto
  tmp_mpi_invalid="no"
  if test "${sd_mpi_enable}" != "auto" -a \
          "${sd_mpi_enable}" != "no" -a \
          "${sd_mpi_enable}" != "yes"; then
    case "${sd_mpi_policy}" in
      fail)
        as_fn_error $? "invalid trigger value: sd_mpi_enable = '${sd_mpi_enable}'" "$LINENO" 5
        ;;
      skip)
        tmp_mpi_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid trigger value: sd_mpi_enable = '${sd_mpi_enable}'" >&5
$as_echo "$as_me: WARNING: invalid trigger value: sd_mpi_enable = '${sd_mpi_enable}'" >&2;}
        tmp_mpi_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_mpi_invalid}" = "yes"; then
    if test "${sd_mpi_status}" = "required"; then
      sd_mpi_enable="yes"
    else
      sd_mpi_enable="no"
    fi
    tmp_mpi_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_mpi_enable to '${sd_mpi_enable}'" >&5
$as_echo "$as_me: setting sd_mpi_enable to '${sd_mpi_enable}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_mpi_invalid="no"
  if test "${sd_mpi_status}" = "implicit" -o \
          "${sd_mpi_status}" = "required"; then
    if test "${sd_mpi_enable}" = "no"; then
      case "${sd_mpi_policy}" in
        fail)
          as_fn_error $? "The MPI package is required and cannot be disabled." "$LINENO" 5
          ;;
        skip)
          tmp_mpi_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The MPI package is required and cannot be disabled." >&5
$as_echo "$as_me: WARNING: The MPI package is required and cannot be disabled." >&2;}
          tmp_mpi_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_mpi_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting MPI trigger to yes" >&5
$as_echo "$as_me: setting MPI trigger to yes" >&6;}
      sd_mpi_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_mpi_invalid}" = "yes"; then
    case "${sd_mpi_status}" in
      implicit|required)
        sd_mpi_enable="yes"
        ;;
      optional)
        sd_mpi_enable="no"
        ;;
    esac
    tmp_mpi_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_mpi_enable to '${sd_mpi_enable}'" >&5
$as_echo "$as_me: setting sd_mpi_enable to '${sd_mpi_enable}'" >&6;}
  fi

  # When using environment variables, triggers must be set to yes
  if test "${sd_mpi_init}" = "env" -a "${sd_mpi_enable}" = "no"; then
    if test "${sd_mpi_policy}" != "skip"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: MPI environment variables will be ignored" >&5
$as_echo "$as_me: WARNING: MPI environment variables will be ignored" >&2;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_mpi_status}" = "implicit"; then
    sd_mpi_enable="yes"
    if test "${sd_mpi_cppflags}" != ""; then
      sd_mpi_cppflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting MPI CPP flags (implicit package)" >&5
$as_echo "$as_me: resetting MPI CPP flags (implicit package)" >&6;}
    fi
    if test "${sd_mpi_cflags}" != ""; then
      sd_mpi_cflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting MPI C flags (implicit package)" >&5
$as_echo "$as_me: resetting MPI C flags (implicit package)" >&6;}
    fi
    if test "${sd_mpi_cxxflags}" != ""; then
      sd_mpi_cxxflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting MPI C++ flags (implicit package)" >&5
$as_echo "$as_me: resetting MPI C++ flags (implicit package)" >&6;}
    fi
    if test "${sd_mpi_fcflags}" != ""; then
      sd_mpi_fcflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting MPI Fortran flags (implicit package)" >&5
$as_echo "$as_me: resetting MPI Fortran flags (implicit package)" >&6;}
    fi
    if test "${sd_mpi_ldflags}" != ""; then
      sd_mpi_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting MPI linker flags (implicit package)" >&5
$as_echo "$as_me: resetting MPI linker flags (implicit package)" >&6;}
    fi
    if test "${sd_mpi_libs}" != ""; then
      sd_mpi_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting MPI library flags (implicit package)" >&5
$as_echo "$as_me: resetting MPI library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_mpi_enable}" = "no"; then
    sd_mpi_cppflags=""
    sd_mpi_cflags=""
    sd_mpi_cxxflags=""
    sd_mpi_fcflags=""
    sd_mpi_ldflags=""
    sd_mpi_libs=""
    sd_mpi_ok="no"
  fi

  # Clean-up
  unset tmp_mpi_invalid

  fi

  # Adjust configuration depending on init type
  if test "${sd_mpi_enable}" = "yes" -o "${sd_mpi_enable}" = "auto"; then

    # Set MPI-specific flags
    case "${sd_mpi_init}" in

      def|yon)
        sd_mpi_cppflags="${sd_mpi_cppflags_def}"
        sd_mpi_cflags="${sd_mpi_cflags_def}"
        test "${sd_mpi_enable_cxx}" = "yes" && \
          sd_mpi_cxxflags="${sd_mpi_cxxflags_def}"
        test "${sd_mpi_enable_fc}" = "yes" && \
          sd_mpi_fcflags="${sd_mpi_fcflags_def}"
        sd_mpi_ldflags="${sd_mpi_ldflags_def}"
        sd_mpi_libs="${sd_mpi_libs_def}"
        ;;

      dir)
        sd_mpi_cppflags="-I${with_mpi}/include"
        sd_mpi_cflags="${sd_mpi_cflags_def}"
        test "${sd_mpi_enable_cxx}" = "yes" && \
          sd_mpi_cxxflags="${sd_mpi_cxxflags_def}"
        test "${sd_mpi_enable_fc}" = "yes" && \
          sd_mpi_fcflags="${sd_mpi_fcflags_def} -I${with_mpi}/include"
        sd_mpi_ldflags="${sd_mpi_ldflags_def}"
        sd_mpi_libs="-L${with_mpi}/lib ${sd_mpi_libs_def}"
        ;;

      env)
        sd_mpi_cppflags="${sd_mpi_cppflags_def}"
        sd_mpi_cflags="${sd_mpi_cflags_def}"
        test "${sd_mpi_enable_cxx}" = "yes" && \
          sd_mpi_cxxflags="${sd_mpi_cxxflags_def}"
        test "${sd_mpi_enable_fc}" = "yes" && \
          sd_mpi_fcflags="${sd_mpi_fcflags_def}"
        sd_mpi_ldflags="${sd_mpi_ldflags_def}"
        sd_mpi_libs="${sd_mpi_libs_def}"
        test "${MPI_CPPFLAGS}" != "" && sd_mpi_cppflags="${MPI_CPPFLAGS}"
        test "${MPI_CFLAGS}" != "" && sd_mpi_cflags="${MPI_CFLAGS}"
        if test "${sd_mpi_enable_cxx}" = "yes"; then
          test "${MPI_CXXFLAGS}" != "" && sd_mpi_cxxflags="${MPI_CXXFLAGS}"
        fi
        if test "${sd_mpi_enable_fc}" = "yes"; then
          test "${MPI_FFLAGS}" != "" && sd_mpi_fcflags="${MPI_FFLAGS}"
          test "${MPI_FCFLAGS}" != "" && sd_mpi_fcflags="${MPI_FCFLAGS}"
        fi
        test "${MPI_LDFLAGS}" != "" && sd_mpi_ldflags="${MPI_LDFLAGS}"
        test "${MPI_LIBS}" != "" && sd_mpi_libs="${MPI_LIBS}"
        ;;

      *)
        as_fn_error $? "invalid init type for MPI: '${sd_mpi_init}'" "$LINENO" 5
        ;;

    esac

    # Look for MPI compilers
    if test "${sd_mpi_init}" != "env"; then
      tmp_mpi_keep_libs=""

    case "${sd_mpi_init}" in

    dir)
      if test "${CC}" = ""; then
        sd_mpi_cc="${with_mpi}/bin/mpicc"
      else
        tmp_cc_has_path=`echo "${CC}" | grep '/'`
        if test "${tmp_cc_has_path}" = ""; then
          sd_mpi_cc="${with_mpi}/bin/${CC}"
          test -x "${sd_mpi_cc}" || sd_mpi_cc="${with_mpi}/bin/mpicc"
        else
          sd_mpi_libs="-L${with_mpi}/lib ${sd_mpi_libs_def}"
          { $as_echo "$as_me:${as_lineno-$LINENO}: user-defined MPI library flags: ${sd_mpi_libs}" >&5
$as_echo "$as_me: user-defined MPI library flags: ${sd_mpi_libs}" >&6;}
        fi
      fi

      if test "${sd_mpi_cc}" != ""; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an executable MPI C compiler" >&5
$as_echo_n "checking for an executable MPI C compiler... " >&6; }
        if test -x "${sd_mpi_cc}"; then
          CC="${sd_mpi_cc}"
          sd_mpi_cc_set="yes"
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${CC}" >&5
$as_echo "${CC}" >&6; }
        else
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
$as_echo "not found" >&6; }
          as_fn_error $? "invalid MPI settings
                  Please adjust --with-mpi and/or CC and re-run configure" "$LINENO" 5
        fi
      fi
      ;;

    def|env|yon)
      sd_mpi_cc="${CC}"
      if test "${sd_mpi_cc}" != ""; then
        sd_mpi_cc_set="yes"
      else
        for ac_prog in mpiicc 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_prog_sd_mpi_cc+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$sd_mpi_cc"; then
  ac_cv_prog_sd_mpi_cc="$sd_mpi_cc" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_sd_mpi_cc="$ac_prog"
    $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

fi
fi
sd_mpi_cc=$ac_cv_prog_sd_mpi_cc
if test -n "$sd_mpi_cc"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sd_mpi_cc" >&5
$as_echo "$sd_mpi_cc" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$sd_mpi_cc" && break
done

        if test "${sd_mpi_cc}" != ""; then
          { $as_echo "$as_me:${as_lineno-$LINENO}: setting CC to '${sd_mpi_cc}'" >&5
$as_echo "$as_me: setting CC to '${sd_mpi_cc}'" >&6;}
          CC="${sd_mpi_cc}"
          sd_mpi_cc_set="yes"
        fi
      fi
      ;;

  esac

      tmp_mpi_keep_libs="${tmp_mpi_keep_libs}${sd_mpi_cc_set}"
      if test "${sd_mpi_enable_cxx}" = "yes"; then

  # Look for a MPI C compiler
  case "${sd_mpi_init}" in

    dir)
      if test "${CXX}" = ""; then
        sd_mpi_cxx="${with_mpi}/bin"
      else
        tmp_cxx_has_path=`echo "${CXX}" | grep '/'`
        if test "${tmp_cxx_has_path}" = ""; then
          sd_mpi_cxx="${with_mpi}/bin"
        else
          sd_mpi_libs="-L${with_mpi}/lib ${sd_mpi_libs_def}"
          { $as_echo "$as_me:${as_lineno-$LINENO}: user-defined MPI library flags: ${sd_mpi_libs}" >&5
$as_echo "$as_me: user-defined MPI library flags: ${sd_mpi_libs}" >&6;}
        fi
      fi

      if test "${sd_mpi_cxx}" != ""; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an executable MPI C compiler" >&5
$as_echo_n "checking for an executable MPI C compiler... " >&6; }
        for tmp_cxx_prog in ${CXX} mpic++ mpicxx; do
          if test -x "${sd_mpi_cxx}/${tmp_cxx_prog}"; then
            sd_mpi_cxx="${sd_mpi_cxx}/${tmp_cxx_prog}"
            CXX="${sd_mpi_cxx}"
            sd_mpi_cxx_set="yes"
            break
          fi
        done
        if test "${sd_mpi_cxx_set}" = "yes"; then
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${CXX}" >&5
$as_echo "${CXX}" >&6; }
        else
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
$as_echo "not found" >&6; }
          as_fn_error $? "invalid MPI settings
                  Please adjust --with-mpi and/or CXX and re-run configure" "$LINENO" 5
        fi
      fi
      ;;

    def|env|yon)
      sd_mpi_cxx="${CXX}"
      if test "${sd_mpi_cxx}" != ""; then
        sd_mpi_cxx_set="yes"
      else
        for ac_prog in mpiicpc mpic++ mpicxx
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_prog_sd_mpi_cxx+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$sd_mpi_cxx"; then
  ac_cv_prog_sd_mpi_cxx="$sd_mpi_cxx" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_sd_mpi_cxx="$ac_prog"
    $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

fi
fi
sd_mpi_cxx=$ac_cv_prog_sd_mpi_cxx
if test -n "$sd_mpi_cxx"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sd_mpi_cxx" >&5
$as_echo "$sd_mpi_cxx" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$sd_mpi_cxx" && break
done

        if test "${sd_mpi_cxx}" != ""; then
          { $as_echo "$as_me:${as_lineno-$LINENO}: setting CXX to '${sd_mpi_cxx}'" >&5
$as_echo "$as_me: setting CXX to '${sd_mpi_cxx}'" >&6;}
          CXX="${sd_mpi_cxx}"
          sd_mpi_cxx_set="yes"
        fi
      fi
      ;;

  esac

        tmp_mpi_keep_libs="${tmp_mpi_keep_libs}${sd_mpi_cxx_set}"
      fi
      if test "${sd_mpi_enable_fc}" = "yes"; then

  # Look for a MPI Fortran compiler
  case "${sd_mpi_init}" in

    dir)
      if test "${FC}" = ""; then
        sd_mpi_fc="${with_mpi}/bin/mpif90"
      else
        tmp_fc_has_path=`echo "${FC}" | grep '/'`
        if test "${tmp_fc_has_path}" = ""; then
          sd_mpi_fc="${with_mpi}/bin/${FC}"
          test -x "${sd_mpi_fc}" || sd_mpi_fc="${with_mpi}/bin/mpif90"
        else
          sd_mpi_libs="-L${with_mpi}/lib ${sd_mpi_libs_def}"
          { $as_echo "$as_me:${as_lineno-$LINENO}: user-defined MPI library flags: ${sd_mpi_libs}" >&5
$as_echo "$as_me: user-defined MPI library flags: ${sd_mpi_libs}" >&6;}
        fi
      fi

      if test "${sd_mpi_fc}" != ""; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an executable MPI Fortran compiler" >&5
$as_echo_n "checking for an executable MPI Fortran compiler... " >&6; }
        if test -x "${sd_mpi_fc}"; then
          FC="${sd_mpi_fc}"
          sd_mpi_fc_set="yes"
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${FC}" >&5
$as_echo "${FC}" >&6; }
        else
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
$as_echo "not found" >&6; }
          as_fn_error $? "invalid MPI settings for Fortran
                  Please adjust --with-mpi and/or FC and re-run configure" "$LINENO" 5
        fi
      fi
      ;;

    def|env|yon)
      sd_mpi_fc="${FC}"
      if test "${sd_mpi_fc}" != ""; then
        sd_mpi_fc_set="yes"
      else
        for ac_prog in mpiifort mpifort mpif90 mpif95
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_prog_sd_mpi_fc+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$sd_mpi_fc"; then
  ac_cv_prog_sd_mpi_fc="$sd_mpi_fc" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_sd_mpi_fc="$ac_prog"
    $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

fi
fi
sd_mpi_fc=$ac_cv_prog_sd_mpi_fc
if test -n "$sd_mpi_fc"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sd_mpi_fc" >&5
$as_echo "$sd_mpi_fc" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$sd_mpi_fc" && break
done

        if test "${sd_mpi_fc}" != ""; then
          { $as_echo "$as_me:${as_lineno-$LINENO}: setting FC to '${sd_mpi_fc}'" >&5
$as_echo "$as_me: setting FC to '${sd_mpi_fc}'" >&6;}
          FC="${sd_mpi_fc}"
          sd_mpi_fc_set="yes"
        fi
      fi
      ;;

  esac

        tmp_mpi_keep_libs="${tmp_mpi_keep_libs}${sd_mpi_fc_set}"
      fi
      tmp_mpi_keep_libs=`echo "${tmp_mpi_keep_libs}" | grep "no"`
      if test "${tmp_mpi_keep_libs}" = ""; then
        sd_mpi_libs=""
      fi
      unset tmp_mpi_keep_libs
    fi

  fi

  # Display configuration
  if test "${STEREDEG_CONFIG_BYPASS_CHECKS}" != "yes"; then

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable MPI" >&5
$as_echo_n "checking whether to enable MPI... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_enable}" >&5
$as_echo "${sd_mpi_enable}" >&6; }
  if test "${sd_mpi_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how MPI parameters have been set" >&5
$as_echo_n "checking how MPI parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_init}" >&5
$as_echo "${sd_mpi_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI C compiler is set" >&5
$as_echo_n "checking whether the MPI C compiler is set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_cc_set}" >&5
$as_echo "${sd_mpi_cc_set}" >&6; }
    if test "${sd_mpi_enable_cxx}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI C++ compiler is set" >&5
$as_echo_n "checking whether the MPI C++ compiler is set... " >&6; }
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_cxx_set}" >&5
$as_echo "${sd_mpi_cxx_set}" >&6; }
    fi
    if test "${sd_mpi_enable_fc}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI Fortran compiler is set" >&5
$as_echo_n "checking whether the MPI Fortran compiler is set... " >&6; }
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_fc_set}" >&5
$as_echo "${sd_mpi_fc_set}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI C preprocessing flags" >&5
$as_echo_n "checking for MPI C preprocessing flags... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_cppflags}" >&5
$as_echo "${sd_mpi_cppflags}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI C flags" >&5
$as_echo_n "checking for MPI C flags... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_cflags}" >&5
$as_echo "${sd_mpi_cflags}" >&6; }
    if test "${sd_mpi_enable_cxx}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI C++ flags" >&5
$as_echo_n "checking for MPI C++ flags... " >&6; }
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_cxxflags}" >&5
$as_echo "${sd_mpi_cxxflags}" >&6; }
    fi
    if test "${sd_mpi_enable_fc}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI Fortran flags" >&5
$as_echo_n "checking for MPI Fortran flags... " >&6; }
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_fcflags}" >&5
$as_echo "${sd_mpi_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI linker flags" >&5
$as_echo_n "checking for MPI linker flags... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_ldflags}" >&5
$as_echo "${sd_mpi_ldflags}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI library flags" >&5
$as_echo_n "checking for MPI library flags... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_libs}" >&5
$as_echo "${sd_mpi_libs}" >&6; }
  fi

  fi

  # Export configuration
















  # Clean-up
  unset tmp_compil_vars
  unset tmp_mpi_vars


  # Allow MPI flavors

# Check whether --with-mpi-flavor was given.
if test "${with_mpi_flavor+set}" = set; then :
  withval=$with_mpi_flavor; abi_mpi_flavor="${withval}"
else
  abi_mpi_flavor="auto"
fi


  # Init ABINIT MPI variables
  abi_mpi_enable="${sd_mpi_enable}"
  abi_mpi_fc_level="${abi_mpi_level}"
  abi_mpi_get_library_version="unknown"
  abi_mpi_init="${sd_mpi_init}"

  # Init ABINIT MPI build flags
  abi_mpi_cppflags=""
  abi_mpi_cflags=""
  abi_mpi_cxxflags=""
  abi_mpi_fcflags=""
  abi_mpi_ldflags=""
  abi_mpi_libs=""

  # Init ABINIT MPI build parameters
  if test "${abi_mpi_enable}" = "yes" -o "${abi_mpi_enable}" = "auto"; then

    if test "${with_mpi_level}" != ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: forcing MPI level to ${with_mpi_level} might make the build fail" >&5
$as_echo "$as_me: WARNING: forcing MPI level to ${with_mpi_level} might make the build fail" >&2;}
    fi

    if test "${sd_mpi_cc_set}" != "yes" -o "${sd_mpi_fc_set}" != "yes"; then
      abi_mpi_cppflags="${sd_mpi_cppflags}"
      abi_mpi_cflags="${sd_mpi_cflags}"
      abi_mpi_cxxflags="${sd_mpi_cxxflags}"
      abi_mpi_fcflags="${sd_mpi_fcflags}"
      abi_mpi_ldflags="${sd_mpi_ldflags}"
      abi_mpi_libs="${sd_mpi_libs}"
    fi

  else

    if test "${abi_mpi_init}" != "def"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: MPI support disabled from command-line" >&5
$as_echo "$as_me: MPI support disabled from command-line" >&6;}
    fi
    abi_mpi_enable="no"
    abi_mpi_get_library_version="no"
    abi_mpi_init="cmd"
    abi_mpi_inplace_enable="no"
    abi_mpi_io_enable="no"
    abi_mpi_cppflags=""
    abi_mpi_cflags=""
    abi_mpi_cxxflags=""
    abi_mpi_fcflags=""
    abi_mpi_ldflags=""
    abi_mpi_level=""
    abi_mpi_incs=""
    abi_mpi_libs=""

  fi # abi_mpi_enable

  # Check that a permitted flavor value has been specified
  if test "${abi_mpi_enable}" = "yes"; then
    flavor_values=`echo "${abi_mpi_flavor}" | sed -e 's/+/ /g'`
    tmp_flavor_ok="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the '${abi_mpi_flavor}' MPI flavor is valid" >&5
$as_echo_n "checking whether the '${abi_mpi_flavor}' MPI flavor is valid... " >&6; }
    for chk_flavor in auto double-wrap flags native prefix; do
      for set_flavor in ${flavor_values}; do
        if test "${set_flavor}" = "${chk_flavor}"; then
          tmp_flavor_ok="yes"
          break
        fi
      done
      test "${tmp_flavor_ok}" = "yes" && break
    done
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tmp_flavor_ok}" >&5
$as_echo "${tmp_flavor_ok}" >&6; }
    if test "${tmp_flavor_ok}" = "no"; then
      as_fn_error $? "invalid MPI flavor: '${abi_mpi_flavor}'" "$LINENO" 5
    fi
  else
    abi_mpi_flavor="none"
  fi

  # Enable substitution












# Prepare GPU support (requires MPI)
# Note: must be done after MPI

  # Delegate most of the initialization to Steredeg

  # Init
  sd_gpu_cppflags=""
  sd_gpu_cflags=""
  sd_gpu_fcflags=""
  sd_gpu_ldflags=""
  sd_gpu_libs=""
  sd_gpu_enable=""
  sd_gpu_markers_enable=""
  sd_gpu_init="unknown"
  sd_gpu_ok="unknown"
  sd_gpu_prefix=""

  # Set adjustable parameters
  sd_gpu_options="optional warn"
  sd_gpu_libs_def=""
  sd_gpu_cppflags_def=""
  sd_gpu_cflags_def=""
  sd_gpu_cxxflags_def=""
  sd_gpu_fcflags_def=""
  sd_gpu_ldflags_def=""
  sd_gpu_enable_def=""
  sd_gpu_markers_enable_def=""
  sd_gpu_policy=""
  sd_gpu_status=""

  # Process options
  for kwd in ${sd_gpu_options}; do
    case "${kwd}" in
      auto|no|yes)
        sd_gpu_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_gpu_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_gpu_policy="${kwd}"
        ;;
      *)
        as_fn_error $? "invalid Steredeg GPU option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test -z "${sd_gpu_enable_def}" && sd_gpu_enable_def="no"
  test -z "${sd_gpu_markers_enable_def}" && sd_gpu_markers_enable_def="no"
  test -z "${sd_gpu_policy}" && sd_gpu_policy="warn"
  test -z "${sd_gpu_status}" && sd_gpu_status="optional"
  # FIXME: improve the setting mechanism
  #test -z "${sd_gpu_libs_def}" && sd_gpu_libs_def="-lopencl"

  # Declare main configure option

# Check whether --with-gpu was given.
if test "${with_gpu+set}" = set; then :
  withval=$with_gpu;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_gpu_enable="${withval}"
        sd_gpu_init="yon"
      else
        sd_gpu_prefix="${withval}"
        sd_gpu_enable="yes"
        sd_gpu_init="dir"
      fi
else
   sd_gpu_enable="${sd_gpu_enable_def}"; sd_gpu_init="def"
fi


  # Declare main configure option

# Check whether --with-gpu_markers was given.
if test "${with_gpu_markers+set}" = set; then :
  withval=$with_gpu_markers;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_gpu_markers_enable="${withval}"
      else
        sd_gpu_markers_enable="no"
      fi
else
   sd_gpu_markers_enable="${sd_gpu_markers_enable_def}"; sd_gpu_markers_init="def"
fi


  # Declare flavor option
  sd_gpu_flavors_supported="cuda-double cuda-single hip-double"

# Check whether --with-gpu-flavor was given.
if test "${with_gpu_flavor+set}" = set; then :
  withval=$with_gpu_flavor;  case "${withval}" in
        no|yes)
          { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
          { $as_echo "$as_me:${as_lineno-$LINENO}: available GPU flavors:" >&5
$as_echo "$as_me: available GPU flavors:" >&6;}
          { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
          for tmp_gpu_flavor in ${sd_gpu_flavors_supported}; do
            { $as_echo "$as_me:${as_lineno-$LINENO}:   * ${tmp_gpu_flavor}" >&5
$as_echo "$as_me:   * ${tmp_gpu_flavor}" >&6;}
          done
          { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
          as_fn_error $? "please select a valid GPU flavor" "$LINENO" 5
          ;;
        *)
          tmp_gpu_flavor_ok="no"
          for tmp_gpu_flavor in ${sd_gpu_flavors_supported}; do
            if test "${withval}" = "${tmp_gpu_flavor}"; then
              tmp_gpu_flavor_ok="yes"
              break
            fi
          done
          if test "${tmp_gpu_flavor_ok}" = "yes"; then
            sd_gpu_flavor="${withval}"
            sd_gpu_flavor_init="sel"
          else
            as_fn_error $? "invalid GPU flavor: '${withval}'" "$LINENO" 5
          fi
          unset tmp_gpu_flavor
          unset tmp_gpu_flavor_ok
          ;;
      esac
else
   sd_gpu_flavor=`echo "${sd_gpu_flavors_supported}" | cut -d' ' -f1`
      sd_gpu_flavor_init="def"
fi


  # Declare environment variables








  # Detect use of environment variables
  if test "${sd_gpu_enable}" = "yes" -o "${sd_gpu_enable}" = "auto"; then
    tmp_gpu_vars="${GPU_CPPFLAGS}${GPU_CFLAGS}${GPU_CXXFLAGS}${GPU_FFLAGS}${GPU_FCFLAGS}${GPU_LDFLAGS}${GPU_LIBS}"
    if test "${sd_gpu_init}" = "def" -a ! -z "${tmp_gpu_vars}"; then
      sd_gpu_enable="yes"
      sd_gpu_init="env"
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_CONFIG_BYPASS_CHECKS}" != "yes"; then

  # Main trigger must be yes, no, or auto
  tmp_gpu_invalid="no"
  if test "${sd_gpu_enable}" != "auto" -a \
          "${sd_gpu_enable}" != "no" -a \
          "${sd_gpu_enable}" != "yes"; then
    case "${sd_gpu_policy}" in
      fail)
        as_fn_error $? "invalid trigger value: sd_gpu_enable = '${sd_gpu_enable}'" "$LINENO" 5
        ;;
      skip)
        tmp_gpu_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid trigger value: sd_gpu_enable = '${sd_gpu_enable}'" >&5
$as_echo "$as_me: WARNING: invalid trigger value: sd_gpu_enable = '${sd_gpu_enable}'" >&2;}
        tmp_gpu_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_gpu_invalid}" = "yes"; then
    if test "${sd_gpu_status}" = "required"; then
      sd_gpu_enable="yes"
    else
      sd_gpu_enable="no"
    fi
    tmp_gpu_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_gpu_enable to '${sd_gpu_enable}'" >&5
$as_echo "$as_me: setting sd_gpu_enable to '${sd_gpu_enable}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_gpu_invalid="no"
  if test "${sd_gpu_status}" = "implicit" -o \
          "${sd_gpu_status}" = "required"; then
    if test "${sd_gpu_enable}" = "no"; then
      case "${sd_gpu_policy}" in
        fail)
          as_fn_error $? "The GPU package is required and cannot be disabled." "$LINENO" 5
          ;;
        skip)
          tmp_gpu_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The GPU package is required and cannot be disabled." >&5
$as_echo "$as_me: WARNING: The GPU package is required and cannot be disabled." >&2;}
          tmp_gpu_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_gpu_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting GPU trigger to yes" >&5
$as_echo "$as_me: setting GPU trigger to yes" >&6;}
      sd_gpu_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_gpu_invalid}" = "yes"; then
    case "${sd_gpu_status}" in
      implicit|required)
        sd_gpu_enable="yes"
        ;;
      optional)
        sd_gpu_enable="no"
        ;;
    esac
    tmp_gpu_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_gpu_enable to '${sd_gpu_enable}'" >&5
$as_echo "$as_me: setting sd_gpu_enable to '${sd_gpu_enable}'" >&6;}
  fi

  # When using environment variables, triggers must be set to yes
  if test "${sd_gpu_init}" = "env" -a "${sd_gpu_enable}" = "no"; then
    if test "${sd_gpu_policy}" != "skip"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GPU environment variables will be ignored" >&5
$as_echo "$as_me: WARNING: GPU environment variables will be ignored" >&2;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_gpu_status}" = "implicit"; then
    sd_gpu_enable="yes"
    if test "${sd_gpu_cppflags}" != ""; then
      sd_gpu_cppflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting GPU CPP flags (implicit package)" >&5
$as_echo "$as_me: resetting GPU CPP flags (implicit package)" >&6;}
    fi
    if test "${sd_gpu_cflags}" != ""; then
      sd_gpu_cflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting GPU C flags (implicit package)" >&5
$as_echo "$as_me: resetting GPU C flags (implicit package)" >&6;}
    fi
    if test "${sd_gpu_cxxflags}" != ""; then
      sd_gpu_cxxflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting GPU C++ flags (implicit package)" >&5
$as_echo "$as_me: resetting GPU C++ flags (implicit package)" >&6;}
    fi
    if test "${sd_gpu_fcflags}" != ""; then
      sd_gpu_fcflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting GPU Fortran flags (implicit package)" >&5
$as_echo "$as_me: resetting GPU Fortran flags (implicit package)" >&6;}
    fi
    if test "${sd_gpu_ldflags}" != ""; then
      sd_gpu_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting GPU linker flags (implicit package)" >&5
$as_echo "$as_me: resetting GPU linker flags (implicit package)" >&6;}
    fi
    if test "${sd_gpu_libs}" != ""; then
      sd_gpu_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting GPU library flags (implicit package)" >&5
$as_echo "$as_me: resetting GPU library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_gpu_enable}" = "no"; then
    sd_gpu_cppflags=""
    sd_gpu_cflags=""
    sd_gpu_cxxflags=""
    sd_gpu_fcflags=""
    sd_gpu_ldflags=""
    sd_gpu_libs=""
    sd_gpu_ok="no"
  fi

  # Clean-up
  unset tmp_gpu_invalid

  fi

  # Adjust configuration depending on init type
  if test "${sd_gpu_enable}" = "yes" -o "${sd_gpu_enable}" = "auto"; then

    # Set GPU-specific flags
    case "${sd_gpu_init}" in

      def|yon)
        sd_gpu_cppflags="${sd_gpu_cppflags_def}"
        sd_gpu_cflags="${sd_gpu_cflags_def}"
        sd_gpu_cxxflags="${sd_gpu_cxxflags_def}"
        sd_gpu_fcflags="${sd_gpu_fcflags_def}"
        sd_gpu_ldflags="${sd_gpu_ldflags_def}"
        sd_gpu_libs="${sd_gpu_libs_def}"
        ;;

      dir)
        sd_gpu_cppflags="-I${with_gpu}/include"
        sd_gpu_cflags="${sd_gpu_cflags_def}"
        sd_gpu_cxxflags="${sd_gpu_cxxflags_def}"
        sd_gpu_fcflags="${sd_gpu_fcflags_def} -I${with_gpu}/include"
        sd_gpu_ldflags="${sd_gpu_ldflags_def}"
        sd_gpu_libs="-L${with_gpu}/lib ${sd_gpu_libs_def}"
        ;;

      env)
        sd_gpu_cppflags="${sd_gpu_cppflags_def}"
        sd_gpu_cflags="${sd_gpu_cflags_def}"
        sd_gpu_cxxflags="${sd_gpu_cxxflags_def}"
        sd_gpu_fcflags="${sd_gpu_fcflags_def}"
        sd_gpu_ldflags="${sd_gpu_ldflags_def}"
        sd_gpu_libs="${sd_gpu_libs_def}"
        ;;

      *)
        as_fn_error $? "invalid init type for GPU: '${sd_gpu_init}'" "$LINENO" 5
        ;;

    esac

    test ! -z "${GPU_CPPFLAGS}" && sd_gpu_cppflags="${GPU_CPPFLAGS}"
    test ! -z "${GPU_CFLAGS}" && sd_gpu_cflags="${GPU_CFLAGS}"
    if test "${sd_gpu_enable_cxx}" = "yes"; then
      test ! -z "${GPU_CXXFLAGS}" && sd_gpu_cxxflags="${GPU_CXXFLAGS}"
    fi
    if test "${sd_gpu_enable_fc}" = "yes"; then
      test ! -z "${GPU_FFLAGS}" && sd_gpu_fcflags="${GPU_FFLAGS}"
      test ! -z "${GPU_FCFLAGS}" && sd_gpu_fcflags="${GPU_FCFLAGS}"
    fi
    test ! -z "${GPU_LDFLAGS}" && sd_gpu_ldflags="${GPU_LDFLAGS}"
    test ! -z "${GPU_LIBS}" && sd_gpu_libs="${GPU_LIBS}"

  fi

  # Display configuration
  if test "${STEREDEG_CONFIG_BYPASS_CHECKS}" != "yes"; then

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable GPU" >&5
$as_echo_n "checking whether to enable GPU... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_gpu_enable}" >&5
$as_echo "${sd_gpu_enable}" >&6; }
  if test "${sd_gpu_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how GPU parameters have been set" >&5
$as_echo_n "checking how GPU parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_gpu_init}" >&5
$as_echo "${sd_gpu_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPU C preprocessing flags" >&5
$as_echo_n "checking for GPU C preprocessing flags... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_gpu_cppflags}" >&5
$as_echo "${sd_gpu_cppflags}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPU C flags" >&5
$as_echo_n "checking for GPU C flags... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_gpu_cflags}" >&5
$as_echo "${sd_gpu_cflags}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPU C++ flags" >&5
$as_echo_n "checking for GPU C++ flags... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_gpu_cxxflags}" >&5
$as_echo "${sd_gpu_cxxflags}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPU Fortran flags" >&5
$as_echo_n "checking for GPU Fortran flags... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_gpu_fcflags}" >&5
$as_echo "${sd_gpu_fcflags}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPU linker flags" >&5
$as_echo_n "checking for GPU linker flags... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_gpu_ldflags}" >&5
$as_echo "${sd_gpu_ldflags}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPU library flags" >&5
$as_echo_n "checking for GPU library flags... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_gpu_libs}" >&5
$as_echo "${sd_gpu_libs}" >&6; }
  fi

  fi

  # Export configuration

















  # Clean-up
  unset tmp_gpu_vars


  # Init
  abi_gpu_complete="unknown"
  abi_gpu_enable="${sd_gpu_enable}"
  abi_gpu_markers_enable="${sd_gpu_markers_enable}"
  abi_gpu_has_cc="no"
  abi_gpu_has_fft="no"
  abi_gpu_has_incs="no"
  abi_gpu_has_libs="no"
  abi_gpu_has_linalg="no"
  abi_gpu_usable="no"
  abi_gpu_fcflags=""
  abi_gpu_ldflags=""
  abi_gpu_prefix="${sd_gpu_prefix}"
  abi_gpu_flavor="${sd_gpu_flavor}"
  abi_gpu_incs="${GPU_CPPFLAGS}"
  abi_gpu_libs="${GPU_LIBS}"
  abi_gpu_arch="${GPU_ARCH}"

  if test "${abi_gpu_enable}" = "yes" -o "${abi_gpu_enable}" = "auto"; then

    # Banner
    { $as_echo "$as_me:${as_lineno-$LINENO}: Initializing GPU support" >&5
$as_echo "$as_me: Initializing GPU support" >&6;}
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking which kind of GPU we want" >&5
$as_echo_n "checking which kind of GPU we want... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_gpu_flavor}" >&5
$as_echo "${abi_gpu_flavor}" >&6; }

    # Look for prerequisites
    case "${abi_gpu_flavor}" in

      cuda*)

  # Init
  abi_gpu_cuda_has_cc="no"
  abi_gpu_cuda_has_common="no"
  abi_gpu_cuda_has_fft="no"
  abi_gpu_cuda_has_cusolver="no"
  abi_gpu_cuda_has_incs="no"
  abi_gpu_cuda_has_libs="no"
  abi_gpu_cuda_has_linalg="no"
  abi_gpu_cuda_has_runtime="no"
  abi_gpu_cuda_libdir=""
  abi_gpu_cuda_incs="${GPU_CPPFLAGS}"
  abi_gpu_cuda_libs="${GPU_LIBS}"
  abi_gpu_cuda_root="${abi_gpu_prefix}"
  abi_gpu_cuda_version_10="unknown"
  abi_gpu_nvtx_v3="unknown"

  # Make use of the CUDA_ROOT environment variable
  if test "${abi_gpu_cuda_root}" = ""; then
    abi_gpu_cuda_root="${CUDA_ROOT}"
  fi

  # Check whether to look for generic files
  if test "${abi_gpu_cuda_root}" = ""; then

    # nVidia C compiler
    if test "${NVCC}" = ""; then
      for ac_prog in nvcc
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_prog_NVCC+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$NVCC"; then
  ac_cv_prog_NVCC="$NVCC" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_NVCC="$ac_prog"
    $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

fi
fi
NVCC=$ac_cv_prog_NVCC
if test -n "$NVCC"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NVCC" >&5
$as_echo "$NVCC" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$NVCC" && break
done

    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the nVidia C compiler" >&5
$as_echo_n "checking for the nVidia C compiler... " >&6; }
    if test "${NVCC}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none found" >&5
$as_echo "none found" >&6; }
    else
      abi_gpu_cuda_has_cc="yes"
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${NVCC}" >&5
$as_echo "${NVCC}" >&6; }
    fi

  else

    # nVidia C compiler
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the nVidia C compiler" >&5
$as_echo_n "checking for the nVidia C compiler... " >&6; }
    if test "${NVCC}" = ""; then
      if test -x "${abi_gpu_cuda_root}/bin/nvcc"; then
        abi_gpu_cuda_has_cc="yes"
        NVCC="${abi_gpu_cuda_root}/bin/nvcc"
      fi
    fi
    if test "${NVCC}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none found" >&5
$as_echo "none found" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${NVCC}" >&5
$as_echo "${NVCC}" >&6; }
    fi

    # Headers
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Cuda headers" >&5
$as_echo_n "checking for Cuda headers... " >&6; }
    abi_result=""
    if test -s "${abi_gpu_cuda_root}/include/cuda_runtime_api.h"; then
      if test "${GPU_CPPFLAGS}" = ""; then
        abi_gpu_cuda_incs="-I${abi_gpu_cuda_root}/include"
      fi
      abi_gpu_cuda_has_incs="yes"
      abi_result="${abi_result} run-time"
    fi
    if test -s "${abi_gpu_cuda_root}/include/cufft.h"; then
      abi_result="${abi_result} fft"
    fi
    if test -s "${abi_gpu_cuda_root}/include/cublas.h"; then
      abi_result="${abi_result} blas"
    fi
    if test -s "${abi_gpu_cuda_root}/include/cusolver_common.h"; then
      abi_result="${abi_result} cusolver"
    fi
    if test -s "${abi_gpu_cuda_root}/SDK/C/common/inc/cutil.h"; then
      if test "${GPU_CPPFLAGS}" = ""; then
        abi_gpu_cuda_incs="-I${abi_gpu_cuda_root}/SDK/C/common/inc ${abi_gpu_cuda_incs}"
      fi
      abi_result="${abi_result} sdk"
    fi
    if test "${abi_result}" = ""; then
      abi_result="none"
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_result}" >&5
$as_echo "${abi_result}" >&6; }

    # Libraries
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Cuda libraries" >&5
$as_echo_n "checking for Cuda libraries... " >&6; }
    abi_result=""
    if test "${abi_cpu_64bits}" = "yes"; then
      abi_gpu_cuda_libdir="${abi_gpu_cuda_root}/lib64"
    else
      abi_gpu_cuda_libdir="${abi_gpu_cuda_root}/lib"
    fi
    for tmp_cuda_dir in \
        /usr/lib \
        /usr/local/lib \
        /usr/local/lib${abi_cpu_bits} \
        /usr/lib/nvidia-current \
        /usr/local/lib/nvidia-current \
        /usr/local/lib${abi_cpu_bits}/nvidia-current; do
      if test "${abi_gpu_cuda_has_common}" = "no"; then
        if test -e "${tmp_cuda_dir}/libcuda.${abi_so_ext}"; then
          abi_gpu_cuda_has_libs="yes"
          abi_gpu_cuda_has_common="yes"
          abi_result="${abi_result} common"
        fi
      fi
    done
    if test -e "${abi_gpu_cuda_libdir}/libcudart.${abi_so_ext}"; then
      if test "${GPU_LIBS}" = ""; then
        abi_gpu_cuda_libs="-lcudart"
      fi
      abi_gpu_cuda_has_libs="yes"
      abi_gpu_cuda_has_runtime="yes"
      abi_result="${abi_result} run-time"
    fi
    if test "${abi_gpu_cuda_has_libs}" = "yes"; then
      if test -e "${abi_gpu_cuda_libdir}/libcufft.${abi_so_ext}"; then
        if test "${GPU_LIBS}" = ""; then
          abi_gpu_cuda_libs="-lcufft ${abi_gpu_cuda_libs}"
        fi
        abi_gpu_cuda_has_fft="yes"
        abi_result="${abi_result} fft"
      fi
      if test -e "${abi_gpu_cuda_libdir}/libcublas.${abi_so_ext}"; then
        if test "${GPU_LIBS}" = ""; then
          abi_gpu_cuda_libs="-lcublas ${abi_gpu_cuda_libs}"
        fi
        abi_gpu_cuda_has_linalg="yes"
        abi_result="${abi_result} blas"
      fi
      if test -e "${abi_gpu_cuda_libdir}/libcusolver.${abi_so_ext}"; then
        if test "${GPU_LIBS}" = ""; then
          abi_gpu_cuda_libs="-lcusolver ${abi_gpu_cuda_libs}"
        fi
        abi_gpu_cuda_has_cusolver="yes"
        abi_result="${abi_result} cusolver"
      fi
      if test "${GPU_LIBS}" = ""; then
        abi_gpu_cuda_libs="-L${abi_gpu_cuda_libdir} ${abi_gpu_cuda_libs}"
      fi
    fi

    if test -s "${abi_gpu_cuda_root}/SDK/C/lib/libcutil.a"; then
      if test "${GPU_LIBS}" = ""; then
        abi_gpu_cuda_libs="-L${abi_gpu_cuda_root}/SDK/C/lib -lcutil ${abi_gpu_cuda_libs}"
      fi
      abi_result="${abi_result} sdk"
    fi
    if test "${abi_result}" = ""; then
      abi_result="none"
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_result}" >&5
$as_echo "${abi_result}" >&6; }
    if test "${GPU_LIBS}" = ""; then
      abi_gpu_cuda_libs="${abi_gpu_cuda_libs} -lcuda"
    fi
    if test "${abi_gpu_cuda_has_common}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find libcuda.${abi_so_ext}" >&5
$as_echo "$as_me: WARNING: could not find libcuda.${abi_so_ext}" >&2;}
    fi

    # add standart libc++ link flags
    abi_gpu_cuda_libs="${abi_gpu_cuda_libs} -lstdc++"

    # C and C++ link flags
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Cuda link flags" >&5
$as_echo_n "checking for Cuda link flags... " >&6; }
    if test "${CC_LDFLAGS_GPU}" = ""; then
      if test "${abi_cpu_64bits}" = "yes"; then
        CC_LDFLAGS_GPU="-Wl,-rpath=${abi_gpu_cuda_root}/lib64"
      else
        CC_LDFLAGS_GPU="-Wl,-rpath=${abi_gpu_cuda_root}/lib"
      fi
    fi
    if test "${CXX_LDFLAGS_GPU}" = ""; then
      if test "${abi_cpu_64bits}" = "yes"; then
        CXX_LDFLAGS_GPU="-Wl,-rpath=${abi_gpu_cuda_root}/lib64"
      else
        CXX_LDFLAGS_GPU="-Wl,-rpath=${abi_gpu_cuda_root}/lib"
      fi
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${CC_LDFLAGS_GPU}" >&5
$as_echo "${CC_LDFLAGS_GPU}" >&6; }

  fi # abi_gpu_cuda_root

  { $as_echo "$as_me:${as_lineno-$LINENO}: Cuda incs: ${abi_gpu_cuda_incs}" >&5
$as_echo "$as_me: Cuda incs: ${abi_gpu_cuda_incs}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: Cuda libs: ${abi_gpu_cuda_libs}" >&5
$as_echo "$as_me: Cuda libs: ${abi_gpu_cuda_libs}" >&6;}




        abi_gpu_has_cc="${abi_gpu_cuda_has_cc}"
        abi_gpu_has_fft="${abi_gpu_cuda_has_fft}"
        abi_gpu_has_cublas="${abi_gpu_cuda_has_cublas}"
        abi_gpu_has_incs="${abi_gpu_cuda_has_incs}"
        abi_gpu_has_libs="${abi_gpu_cuda_has_libs}"
        abi_gpu_has_linalg="${abi_gpu_cuda_has_linalg}"
        if test "${abi_gpu_has_cc}" = "yes" -a \
                "${abi_gpu_has_incs}" = "yes" -a \
                "${abi_gpu_has_libs}" = "yes"; then
          abi_gpu_complete="yes"
        else
          abi_gpu_complete="no"
        fi
        ;;

      hip*)

  # Init
  abi_gpu_hip_has_cc="no"
  abi_gpu_hip_has_common="no"
  abi_gpu_hip_has_fft="no"
  abi_gpu_hip_has_cusolver="no"
  abi_gpu_hip_has_incs="no"
  abi_gpu_hip_has_libs="no"
  abi_gpu_hip_has_linalg="no"
  abi_gpu_hip_has_runtime="no"
  abi_gpu_hip_libdir=""
  abi_gpu_hip_incs="${GPU_CPPFLAGS}"
  abi_gpu_hip_libs="${GPU_LIBS}"
  abi_gpu_hip_root="${abi_gpu_prefix}"
  abi_gpu_hip_version_10="unknown"
  abi_gpu_nvtx_v3="unknown"

  # Make use of the ROCM_ROOT environment variable
  if test "${abi_gpu_hip_root}" = ""; then
    abi_gpu_hip_root="${ROCM_ROOT}"
  fi

  # Check whether to look for generic files
  if test "${abi_gpu_hip_root}" = ""; then

   # AMD HIP hipcc is not currently used in the code
   { $as_echo "$as_me:${as_lineno-$LINENO}: \"Skipping AMD HIPCC detection (not used)\"" >&5
$as_echo "$as_me: \"Skipping AMD HIPCC detection (not used)\"" >&6;}
   # # AMD HIP C compiler
   # if test "${NVCC}" = ""; then
   #   AC_CHECK_PROGS(NVCC,[hipcc])
   # fi
   # AC_MSG_CHECKING([for the AMD C compiler])
   # if test "${NVCC}" = ""; then
   #   AC_MSG_RESULT([none found])
   # else
   #   abi_gpu_hip_has_cc="yes"
   #   AC_MSG_RESULT([${NVCC}])
   # fi

  else

   # AMD HIP hipcc is not currently used in the code
   { $as_echo "$as_me:${as_lineno-$LINENO}: \"Skipping AMD HIPCC detection (not used)\"" >&5
$as_echo "$as_me: \"Skipping AMD HIPCC detection (not used)\"" >&6;}
   # # AMD HIP C compiler
   # AC_MSG_CHECKING([for the AMD HIP C compiler])
   # if test "${NVCC}" = ""; then
   #   if test -x "${abi_gpu_hip_root}/bin/hipcc"; then
   #     abi_gpu_hip_has_cc="yes"
   #     NVCC="${abi_gpu_hip_root}/bin/hipcc"
   #   fi
   # fi
   # if test "${NVCC}" = ""; then
   #   AC_MSG_RESULT([none found])
   # else
   #   AC_MSG_RESULT([${NVCC}])
   # fi

    # Headers
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Cuda headers" >&5
$as_echo_n "checking for Cuda headers... " >&6; }
    abi_result=""
    if test -s "${abi_gpu_hip_root}/includea/hip/hip_runtime_api.h"; then
      if test "${GPU_CPPFLAGS}" = ""; then
        abi_gpu_hip_incs="-I${abi_gpu_hip_root}/include"
      fi
      abi_gpu_hip_has_incs="yes"
      abi_result="${abi_result} run-time"
    fi
    if test -s "${abi_gpu_hip_root}/include/hipfft.h"; then
      abi_result="${abi_result} fft"
    fi
    if test -s "${abi_gpu_hip_root}/include/hipblas.h"; then
      abi_result="${abi_result} blas"
    fi
    if test -s "${abi_gpu_hip_root}/include/hipsolver.h"; then
      abi_result="${abi_result} lapack"
    fi
    if test "${abi_result}" = ""; then
      abi_result="none"
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_result}" >&5
$as_echo "${abi_result}" >&6; }

    # Libraries
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ROCm/HIP libraries" >&5
$as_echo_n "checking for ROCm/HIP libraries... " >&6; }
    abi_result=""
    abi_gpu_hip_libdir="${abi_gpu_hip_root}/lib"
    if test -e "${abi_gpu_hip_libdir}/libamdhip64.${abi_so_ext}"; then
      if test "${GPU_LIBS}" = ""; then
        abi_gpu_hip_libs="-lamdhip64"
      fi
      abi_gpu_hip_has_libs="yes"
      abi_gpu_hip_has_runtime="yes"
      abi_result="${abi_result} run-time"
    fi
    if test "${abi_gpu_hip_has_libs}" = "yes"; then
      if test -e "${abi_gpu_hip_libdir}/libhipfft.${abi_so_ext}"; then
        if test "${GPU_LIBS}" = ""; then
          abi_gpu_hip_libs="-lhipfft ${abi_gpu_hip_libs}"
        fi
        abi_gpu_hip_has_fft="yes"
        abi_result="${abi_result} fft"
      fi
      if test -e "${abi_gpu_hip_libdir}/libhipblas.${abi_so_ext}"; then
        if test "${GPU_LIBS}" = ""; then
          abi_gpu_hip_libs="-lhipblas ${abi_gpu_hip_libs}"
        fi
        abi_gpu_hip_has_linalg="yes"
        abi_result="${abi_result} blas"
      fi
      if test -e "${abi_gpu_hip_libdir}/libhipsolver.${abi_so_ext}"; then
        if test "${GPU_LIBS}" = ""; then
          abi_gpu_hip_libs="-lhipsolver ${abi_gpu_hip_libs}"
        fi
        abi_gpu_hip_has_hipsolver="yes"
        abi_result="${abi_result} hipsolver"
      fi
      if test "${GPU_LIBS}" = ""; then
        abi_gpu_hip_libs="-L${abi_gpu_hip_libdir} ${abi_gpu_hip_libs}"
      fi
    fi

    if test "${abi_result}" = ""; then
      abi_result="none"
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_result}" >&5
$as_echo "${abi_result}" >&6; }

    # add standart libc++ link flags
    abi_gpu_hip_libs="${abi_gpu_hip_libs} -lstdc++"

    # C and C++ link flags
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Cuda link flags" >&5
$as_echo_n "checking for Cuda link flags... " >&6; }
    if test "${CC_LDFLAGS_GPU}" = ""; then
      CC_LDFLAGS_GPU="-Wl,-rpath=${abi_gpu_hip_root}/lib"
    fi
    if test "${CXX_LDFLAGS_GPU}" = ""; then
      CXX_LDFLAGS_GPU="-Wl,-rpath=${abi_gpu_hip_root}/lib"
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${CC_LDFLAGS_GPU}" >&5
$as_echo "${CC_LDFLAGS_GPU}" >&6; }

  fi # abi_gpu_hip_root

  { $as_echo "$as_me:${as_lineno-$LINENO}: ROCm/HIP incs: ${abi_gpu_hip_incs}" >&5
$as_echo "$as_me: ROCm/HIP incs: ${abi_gpu_hip_incs}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: ROCm/HIP libs: ${abi_gpu_hip_libs}" >&5
$as_echo "$as_me: ROCm/HIP libs: ${abi_gpu_hip_libs}" >&6;}





        abi_gpu_has_cc="${abi_gpu_hip_has_cc}"
        abi_gpu_has_fft="${abi_gpu_hip_has_fft}"
        abi_gpu_has_cublas="${abi_gpu_hip_has_cublas}"
        abi_gpu_has_incs="${abi_gpu_hip_has_incs}"
        abi_gpu_has_libs="${abi_gpu_hip_has_libs}"
        abi_gpu_has_linalg="${abi_gpu_hip_has_linalg}"
        if test "${abi_gpu_has_cc}" = "yes" -a \
                "${abi_gpu_has_incs}" = "yes" -a \
                "${abi_gpu_has_libs}" = "yes"; then
          abi_gpu_complete="yes"
        else
          abi_gpu_complete="no"
        fi
        ;;

    esac

  else

    { $as_echo "$as_me:${as_lineno-$LINENO}: GPU support disabled from command-line" >&5
$as_echo "$as_me: GPU support disabled from command-line" >&6;}
    abi_gpu_flavor="none"

  fi # abi_gpu_enable

  # Enable substitution







if test "${abi_gpu_enable}" = "yes" -a "${abi_mpi_enable}" != "yes"; then
  as_fn_error $? "GPU support requires MPI" "$LINENO" 5
fi

                    # ------------------------------------ #

# Init triggers parameters (must be call after we know about fallbacks)
# Note: MPI and GPU must be initialized after feature triggers

  # Set up trigger-related variables for abinit_common
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_abinit_common_ok="no"
  else
    abi_fbk_abinit_common_ok="no"
  fi

  # Substitute trigger-related variables for abinit_common


  # Set up trigger-related variables for bigdft
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_bigdft_ok="avail"
  else
    abi_fbk_bigdft_ok="disabled"
  fi

  # Substitute trigger-related variables for bigdft


  # Set up trigger-related variables for fft
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_fft_ok="no"
  else
    abi_fbk_fft_ok="no"
  fi

  # Substitute trigger-related variables for fft


  # Set up trigger-related variables for fftw3
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_fftw3_ok="no"
  else
    abi_fbk_fftw3_ok="no"
  fi

  # Substitute trigger-related variables for fftw3


  # Set up trigger-related variables for gpu
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_gpu_ok="no"
  else
    abi_fbk_gpu_ok="no"
  fi

  # Substitute trigger-related variables for gpu


  # Set up trigger-related variables for hdf5
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_hdf5_ok="avail"
  else
    abi_fbk_hdf5_ok="disabled"
  fi

  # Substitute trigger-related variables for hdf5


  # Set up trigger-related variables for kokkos
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_kokkos_ok="no"
  else
    abi_fbk_kokkos_ok="no"
  fi

  # Substitute trigger-related variables for kokkos


  # Set up trigger-related variables for levmar
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_levmar_ok="no"
  else
    abi_fbk_levmar_ok="no"
  fi

  # Substitute trigger-related variables for levmar


  # Set up trigger-related variables for libpaw
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_libpaw_ok="no"
  else
    abi_fbk_libpaw_ok="no"
  fi

  # Substitute trigger-related variables for libpaw


  # Set up trigger-related variables for libpsml
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_libpsml_ok="avail"
  else
    abi_fbk_libpsml_ok="disabled"
  fi

  # Substitute trigger-related variables for libpsml


  # Set up trigger-related variables for libxc
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_libxc_ok="avail"
  else
    abi_fbk_libxc_ok="disabled"
  fi

  # Substitute trigger-related variables for libxc


  # Init default parameters for libxml2
  abi_libxml2_enable="no"
  abi_libxml2_init="def"
  abi_libxml2_prefix=""

  # Command-line options for libxml2

# Check whether --with-libxml2 was given.
if test "${with_libxml2+set}" = set; then :
  withval=$with_libxml2;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        abi_libxml2_enable="${withval}"
        abi_libxml2_init="yon"
        abi_libxml2_prefix=""
      else
        abi_libxml2_enable="yes"
        abi_libxml2_init="dir"
        abi_libxml2_cppflags=""
        abi_libxml2_libs=""
        abi_libxml2_prefix="${withval}"
      fi
fi





  if test "${LIBXML2_FCFLAGS}${LIBXML2_LIBS}" != ""; then
    abi_libxml2_enable="yes"
    abi_libxml2_init="env"
  fi

  # Set up trigger-related variables for libxml2
  abi_libxml2_ok="unknown"
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_libxml2_ok="no"
  else
    abi_fbk_libxml2_ok="no"
  fi

  # Substitute trigger-related variables for libxml2










  # Set up trigger-related variables for linalg
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_linalg_ok="avail"
  else
    abi_fbk_linalg_ok="disabled"
  fi

  # Substitute trigger-related variables for linalg


  # Set up trigger-related variables for mpi
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_mpi_ok="no"
  else
    abi_fbk_mpi_ok="no"
  fi

  # Substitute trigger-related variables for mpi


  # Set up trigger-related variables for netcdf
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_netcdf_ok="avail"
  else
    abi_fbk_netcdf_ok="disabled"
  fi

  # Substitute trigger-related variables for netcdf


  # Set up trigger-related variables for netcdf_fortran
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_netcdf_fortran_ok="avail"
  else
    abi_fbk_netcdf_fortran_ok="disabled"
  fi

  # Substitute trigger-related variables for netcdf_fortran


  # Set up trigger-related variables for papi
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_papi_ok="no"
  else
    abi_fbk_papi_ok="no"
  fi

  # Substitute trigger-related variables for papi


  # Set up trigger-related variables for pfft
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_pfft_ok="no"
  else
    abi_fbk_pfft_ok="no"
  fi

  # Substitute trigger-related variables for pfft


  # Set up trigger-related variables for triqs
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_triqs_ok="no"
  else
    abi_fbk_triqs_ok="no"
  fi

  # Substitute trigger-related variables for triqs


  # Set up trigger-related variables for wannier90
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_wannier90_ok="avail"
  else
    abi_fbk_wannier90_ok="disabled"
  fi

  # Substitute trigger-related variables for wannier90


  # Set up trigger-related variables for xmlf90
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_xmlf90_ok="avail"
  else
    abi_fbk_xmlf90_ok="disabled"
  fi

  # Substitute trigger-related variables for xmlf90


  # Set up trigger-related variables for yakl
  if test "${abi_fbk_enable}" = "yes"; then
    abi_fbk_yakl_ok="no"
  else
    abi_fbk_yakl_ok="no"
  fi

  # Substitute trigger-related variables for yakl



# ---------------------------------------------------------------------------- #

#
# C support
#



  abi_sec_title="C support"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# Set basic Abinit C parameters
# Note: advanced fetaures are set later on
DEPDIR="${am__leading_dot}deps"

ac_config_commands="$ac_config_commands depfiles"


am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
	@echo this is the am__doit target
.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
     ;;
   esac
fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
$as_echo "$_am_result" >&6; }
rm -f confinc confmf

# Check whether --enable-dependency-tracking was given.
if test "${enable_dependency_tracking+set}" = set; then :
  enableval=$enable_dependency_tracking;
fi

if test "x$enable_dependency_tracking" != xno; then
  am_depcomp="$ac_aux_dir/depcomp"
  AMDEPBACKSLASH='\'
  am__nodep='_no'
fi
 if test "x$enable_dependency_tracking" != xno; then
  AMDEP_TRUE=
  AMDEP_FALSE='#'
else
  AMDEP_TRUE='#'
  AMDEP_FALSE=
fi



  # Init
  if test "${abi_cc_vendor}" = ""; then
    abi_cc_vendor="unknown"
  fi

  # Preserve environment


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"



  # Look for the C compiler
  if test "${CC}" != "" -a ! -x "${CC}"; then
    abi_cc_probe=`echo "${CC}" | sed -e 's/ .*//'`
    if test ! -x "${abi_cc_probe}"; then
      # Extract the first word of "${abi_cc_probe}", so it can be a program name with args.
set dummy ${abi_cc_probe}; 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_abi_cc_path+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $abi_cc_path in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_abi_cc_path="$abi_cc_path" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_abi_cc_path="$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
abi_cc_path=$ac_cv_path_abi_cc_path
if test -n "$abi_cc_path"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $abi_cc_path" >&5
$as_echo "$abi_cc_path" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


      if test "${abi_cc_path}" = ""; then
        as_fn_error $? "could not run C compiler \"${CC}\"" "$LINENO" 5
      fi
    fi
  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
if test -n "$ac_tool_prefix"; then
  for ac_prog in  cc mpiicc mpicc icc icx xlc CC gcc
  do
    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$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_prog_CC+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
    $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

fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


    test -n "$CC" && break
  done
fi
if test -z "$CC"; then
  ac_ct_CC=$CC
  for ac_prog in  cc mpiicc mpicc icc icx xlc CC gcc
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_prog_ac_ct_CC+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_CC"; then
  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_ac_ct_CC="$ac_prog"
    $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

fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$ac_ct_CC" && break
done

  if test "x$ac_ct_CC" = x; then
    CC=""
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    CC=$ac_ct_CC
  fi
fi


test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
See \`config.log' for more details" "$LINENO" 5; }

# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
  { { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
  ac_status=$?
  if test -s conftest.err; then
    sed '10a\
... rest of stderr output deleted ...
         10q' conftest.err >conftest.er1
    cat conftest.er1 >&5
  fi
  rm -f conftest.er1 conftest.err
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }
done

cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
$as_echo_n "checking whether the C compiler works... " >&6; }
ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`

# The possible output files:
ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"

ac_rmfiles=
for ac_file in $ac_files
do
  case $ac_file in
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
  esac
done
rm -f $ac_rmfiles

if { { ac_try="$ac_link_default"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_link_default") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; then :
  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
# in a Makefile.  We should not override ac_cv_exeext if it was cached,
# so that the user can short-circuit this test for compilers unknown to
# Autoconf.
for ac_file in $ac_files ''
do
  test -f "$ac_file" || continue
  case $ac_file in
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
	;;
    [ab].out )
	# We found the default executable, but exeext='' is most
	# certainly right.
	break;;
    *.* )
	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
	then :; else
	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
	fi
	# We set ac_cv_exeext here because the later test for it is not
	# safe: cross compilers may not add the suffix if given an `-o'
	# argument, so we may need to know it at that point already.
	# Even if this section looks crufty: it has the advantage of
	# actually working.
	break;;
    * )
	break;;
  esac
done
test "$ac_cv_exeext" = no && ac_cv_exeext=

else
  ac_file=''
fi
if test -z "$ac_file"; then :
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "C compiler cannot create executables
See \`config.log' for more details" "$LINENO" 5; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
$as_echo_n "checking for C compiler default output file name... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
$as_echo "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext

rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
$as_echo_n "checking for suffix of executables... " >&6; }
if { { ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_link") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; then :
  # If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
# work properly (i.e., refer to `conftest.exe'), while it won't with
# `rm'.
for ac_file in conftest.exe conftest conftest.*; do
  test -f "$ac_file" || continue
  case $ac_file in
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
	  break;;
    * ) break;;
  esac
done
else
  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest conftest$ac_cv_exeext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
$as_echo "$ac_cv_exeext" >&6; }

rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <stdio.h>
int
main ()
{
FILE *f = fopen ("conftest.out", "w");
 return ferror (f) || fclose (f) != 0;

  ;
  return 0;
}
_ACEOF
ac_clean_files="$ac_clean_files conftest.out"
# Check that the compiler produces executables we can run.  If not, either
# the compiler is broken, or we cross compile.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
$as_echo_n "checking whether we are cross compiling... " >&6; }
if test "$cross_compiling" != yes; then
  { { ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_link") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }
  if { ac_try='./conftest$ac_cv_exeext'
  { { case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_try") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; }; then
    cross_compiling=no
  else
    if test "$cross_compiling" = maybe; then
	cross_compiling=yes
    else
	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details" "$LINENO" 5; }
    fi
  fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
$as_echo "$cross_compiling" >&6; }

rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
$as_echo_n "checking for suffix of object files... " >&6; }
if ${ac_cv_objext+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.o conftest.obj
if { { ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_compile") 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; then :
  for ac_file in conftest.o conftest.obj conftest.*; do
  test -f "$ac_file" || continue;
  case $ac_file in
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
       break;;
  esac
done
else
  $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of object files: cannot compile
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
$as_echo "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
if ${ac_cv_c_compiler_gnu+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{
#ifndef __GNUC__
       choke me
#endif

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_compiler_gnu=yes
else
  ac_compiler_gnu=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
$as_echo "$ac_cv_c_compiler_gnu" >&6; }
if test $ac_compiler_gnu = yes; then
  GCC=yes
else
  GCC=
fi
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
$as_echo_n "checking whether $CC accepts -g... " >&6; }
if ${ac_cv_prog_cc_g+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_save_c_werror_flag=$ac_c_werror_flag
   ac_c_werror_flag=yes
   ac_cv_prog_cc_g=no
   CFLAGS="-g"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_prog_cc_g=yes
else
  CFLAGS=""
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :

else
  ac_c_werror_flag=$ac_save_c_werror_flag
	 CFLAGS="-g"
	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_prog_cc_g=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   ac_c_werror_flag=$ac_save_c_werror_flag
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
$as_echo "$ac_cv_prog_cc_g" >&6; }
if test "$ac_test_CFLAGS" = set; then
  CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
  if test "$GCC" = yes; then
    CFLAGS="-g -O2"
  else
    CFLAGS="-g"
  fi
else
  if test "$GCC" = yes; then
    CFLAGS="-O2"
  else
    CFLAGS=
  fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
if ${ac_cv_prog_cc_c89+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <stdarg.h>
#include <stdio.h>
struct stat;
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
     char **p;
     int i;
{
  return p[i];
}
static char *f (char * (*g) (char **, int), char **p, ...)
{
  char *s;
  va_list v;
  va_start (v,p);
  s = g (p, va_arg (v,int));
  va_end (v);
  return s;
}

/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
   function prototypes and stuff, but not '\xHH' hex character constants.
   These don't provoke an error unfortunately, instead are silently treated
   as 'x'.  The following induces an error, until -std is added to get
   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
   array size at least.  It's necessary to write '\x00'==0 to get something
   that's true only with -std.  */
int osf4_cc_array ['\x00' == 0 ? 1 : -1];

/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
   inside strings and character constants.  */
#define FOO(x) 'x'
int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];

int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
int
main ()
{
return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
  ;
  return 0;
}
_ACEOF
for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
  CC="$ac_save_CC $ac_arg"
  if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_prog_cc_c89=$ac_arg
fi
rm -f core conftest.err conftest.$ac_objext
  test "x$ac_cv_prog_cc_c89" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC

fi
# AC_CACHE_VAL
case "x$ac_cv_prog_cc_c89" in
  x)
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
$as_echo "none needed" >&6; } ;;
  xno)
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
$as_echo "unsupported" >&6; } ;;
  *)
    CC="$CC $ac_cv_prog_cc_c89"
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
esac
if test "x$ac_cv_prog_cc_c89" != xno; then :

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

depcc="$CC"   am_compiler_list=

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
$as_echo_n "checking dependency style of $depcc... " >&6; }
if ${am_cv_CC_dependencies_compiler_type+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
  # We make a subdir and do the tests there.  Otherwise we can end up
  # making bogus files that we don't know about and never remove.  For
  # instance it was reported that on HP-UX the gcc test will end up
  # making a dummy file named 'D' -- because '-MD' means "put the output
  # in D".
  rm -rf conftest.dir
  mkdir conftest.dir
  # Copy depcomp to subdir because otherwise we won't find it if we're
  # using a relative directory.
  cp "$am_depcomp" conftest.dir
  cd conftest.dir
  # We will build objects and dependencies in a subdirectory because
  # it helps to detect inapplicable dependency modes.  For instance
  # both Tru64's cc and ICC support -MD to output dependencies as a
  # side effect of compilation, but ICC will put the dependencies in
  # the current directory while Tru64 will put them in the object
  # directory.
  mkdir sub

  am_cv_CC_dependencies_compiler_type=none
  if test "$am_compiler_list" = ""; then
     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
  fi
  am__universal=false
  case " $depcc " in #(
     *\ -arch\ *\ -arch\ *) am__universal=true ;;
     esac

  for depmode in $am_compiler_list; do
    # Setup a source with many dependencies, because some compilers
    # like to wrap large dependency lists on column 80 (with \), and
    # we should not choose a depcomp mode which is confused by this.
    #
    # We need to recreate these files for each test, as the compiler may
    # overwrite some of them when testing with obscure command lines.
    # This happens at least with the AIX C compiler.
    : > sub/conftest.c
    for i in 1 2 3 4 5 6; do
      echo '#include "conftst'$i'.h"' >> sub/conftest.c
      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
      # Solaris 10 /bin/sh.
      echo '/* dummy */' > sub/conftst$i.h
    done
    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf

    # We check with '-c' and '-o' for the sake of the "dashmstdout"
    # mode.  It turns out that the SunPro C++ compiler does not properly
    # handle '-M -o', and we need to detect this.  Also, some Intel
    # versions had trouble with output in subdirs.
    am__obj=sub/conftest.${OBJEXT-o}
    am__minus_obj="-o $am__obj"
    case $depmode in
    gcc)
      # This depmode causes a compiler race in universal mode.
      test "$am__universal" = false || continue
      ;;
    nosideeffect)
      # After this tag, mechanisms are not by side-effect, so they'll
      # only be used when explicitly requested.
      if test "x$enable_dependency_tracking" = xyes; then
	continue
      else
	break
      fi
      ;;
    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
      # This compiler won't grok '-c -o', but also, the minuso test has
      # not run yet.  These depmodes are late enough in the game, and
      # so weak that their functioning should not be impacted.
      am__obj=conftest.${OBJEXT-o}
      am__minus_obj=
      ;;
    none) break ;;
    esac
    if depmode=$depmode \
       source=sub/conftest.c object=$am__obj \
       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
         >/dev/null 2>conftest.err &&
       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
      # icc doesn't choke on unknown options, it will just issue warnings
      # or remarks (even with -Werror).  So we grep stderr for any message
      # that says an option was ignored or not supported.
      # When given -MP, icc 7.0 and 7.1 complain thusly:
      #   icc: Command line warning: ignoring option '-M'; no argument required
      # The diagnosis changed in icc 8.0:
      #   icc: Command line remark: option '-MP' not supported
      if (grep 'ignoring option' conftest.err ||
          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
        am_cv_CC_dependencies_compiler_type=$depmode
        break
      fi
    fi
  done

  cd ..
  rm -rf conftest.dir
else
  am_cv_CC_dependencies_compiler_type=none
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type

 if
  test "x$enable_dependency_tracking" != xno \
  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
  am__fastdepCC_TRUE=
  am__fastdepCC_FALSE='#'
else
  am__fastdepCC_TRUE='#'
  am__fastdepCC_FALSE=
fi



  # Fail if no C compiler is available
  if test "${CC}" = ""; then
    as_fn_error $? "no C compiler available" "$LINENO" 5
  fi

  # Look for the C preprocessor
  if test "${CPP}" != "" -a ! -x "${CPP}"; then
    # Extract the first word of "${CPP}", so it can be a program name with args.
set dummy ${CPP}; 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_abi_cpp_path+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $abi_cpp_path in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_abi_cpp_path="$abi_cpp_path" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_abi_cpp_path="$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
abi_cpp_path=$ac_cv_path_abi_cpp_path
if test -n "$abi_cpp_path"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $abi_cpp_path" >&5
$as_echo "$abi_cpp_path" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


    if test "${abi_cpp_path}" = ""; then
      as_fn_error $? "could not run C preprocessor \"${CPP}\"" "$LINENO" 5
    fi
  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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
$as_echo_n "checking how to run the C preprocessor... " >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -z "$CPP"; then
  if ${ac_cv_prog_CPP+:} false; then :
  $as_echo_n "(cached) " >&6
else
      # Double quotes because CPP needs to be expanded
    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
    do
      ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
  # Use a header file that comes with gcc, so configuring glibc
  # with a fresh cross-compiler works.
  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
  # <limits.h> exists even on freestanding compilers.
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp. "Syntax error" is here to catch this case.
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
		     Syntax error
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :

else
  # Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext

  # OK, works on sane cases.  Now check whether nonexistent headers
  # can be detected and how.
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <ac_nonexistent.h>
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
  # Broken: success on invalid input.
continue
else
  # Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext

done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
  break
fi

    done
    ac_cv_prog_CPP=$CPP

fi
  CPP=$ac_cv_prog_CPP
else
  ac_cv_prog_CPP=$CPP
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
$as_echo "$CPP" >&6; }
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
  # Use a header file that comes with gcc, so configuring glibc
  # with a fresh cross-compiler works.
  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
  # <limits.h> exists even on freestanding compilers.
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp. "Syntax error" is here to catch this case.
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
		     Syntax error
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :

else
  # Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext

  # OK, works on sane cases.  Now check whether nonexistent headers
  # can be detected and how.
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <ac_nonexistent.h>
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
  # Broken: success on invalid input.
continue
else
  # Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext

done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :

else
  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details" "$LINENO" 5; }
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


  # Fail if no C preprocessor is available
  if test "${CPP}" = ""; then
    as_fn_error $? "no C preprocessor available" "$LINENO" 5
  fi

  # Determine C compiler vendor (the order is critical)
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking which type of compiler we have" >&5
$as_echo_n "checking which type of compiler we have... " >&6; }
  if test "${abi_cc_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    cc_info_string=`${CC} -qversion 2>&1 | head -n 1`
  cc_garbage=`${CC} -qversion 2>&1 | wc -l | sed -e 's/ //g'`
  abi_result=`echo "${cc_info_string}" | grep 'IBM XL C/C++'`
  if test "${abi_result}" = ""; then
    abi_result=`echo "${cc_info_string}" | grep 'IBM(R) XL C/C++'`
  fi
  if test "${abi_result}" = ""; then
    abi_result=`echo "${cc_info_string}" | grep 'C for AIX'`
  fi
  if test "${abi_result}" = ""; then
    abi_result="no"
    cc_info_string=""
    abi_cc_vendor="unknown"
    abi_cc_version="unknown"
    if test "${cc_garbage}" -gt 50; then

$as_echo "#define CC_IBM 1" >>confdefs.h

      abi_cc_vendor="ibm"
      abi_cc_version="unknown"
      abi_result="yes"
    fi
  else

$as_echo "#define CC_IBM 1" >>confdefs.h

    abi_cc_vendor="ibm"
    abi_cc_version=`echo "${abi_result}" | sed -e 's/.* V//; s/ .*//'`
    if test "${abi_cc_version}" = "${abi_result}"; then
      abi_cc_version=`echo "${abi_result}" | sed -e 's/C for AIX version //'`
    fi
    if test "${abi_cc_version}" = "${abi_result}"; then
      abi_cc_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  if test "${abi_cc_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    cc_info_string=`${CC} --version 2>/dev/null | head -n 1`
  abi_result=`echo "${cc_info_string}" | grep '^Arm C/C++/Fortran Compiler'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    cc_info_string=""
    abi_cc_vendor="unknown"
    abi_cc_version="unknown"
  else

$as_echo "#define CC_ARM 1" >>confdefs.h

    abi_cc_vendor="arm"
    abi_cc_version=`echo ${abi_result} | sed -e 's/.*ersion //; s/ .*//'`
    if test "${abi_cc_version}" = "${abi_result}"; then
      abi_cc_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  if test "${abi_cc_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    cc_info_string=`${CC} -V 2>&1 | head -n 1`
  abi_result=`echo "${cc_info_string}" | grep '^Intel(R) oneAPI'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    cc_info_string=""
    abi_cc_vendor="unknown"
    abi_cc_version="unknown"
  else

$as_echo "#define CC_INTEL_ONEAPI 1" >>confdefs.h

    abi_cc_vendor="intel"
    abi_cc_version=`echo "${abi_result}" | sed -e 's/.*Version //; s/ .*//'`
    if test "${abi_cc_version}" = "${abi_result}"; then
      abi_cc_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  if test "${abi_cc_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    cc_info_string=`${CC} -V 2>&1 | head -n 1`
  abi_result=`echo "${cc_info_string}" | grep '^Intel(R) C'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    cc_info_string=""
    abi_cc_vendor="unknown"
    abi_cc_version="unknown"
  else

$as_echo "#define CC_INTEL 1" >>confdefs.h

    abi_cc_vendor="intel"
    abi_cc_version=`echo "${abi_result}" | sed -e 's/.*Version //; s/ .*//'`
    if test "${abi_cc_version}" = "${abi_result}"; then
      abi_cc_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  if test "${abi_cc_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    cc_info_string=`${CC} --version 2>/dev/null | head -n 1`
  abi_result=`echo "${cc_info_string}" | grep 'Cray clang'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    cc_info_string=""
    abi_cc_vendor="unknown"
    abi_cc_version="unknown"
  else

$as_echo "#define CC_CRAY 1" >>confdefs.h

    abi_cc_vendor="cray"
    abi_cc_version=`echo ${abi_result} | sed -e 's/.*ersion //; s/ .*//'`
    if test "${abi_cc_version}" = "${abi_result}"; then
      abi_cc_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  if test "${abi_cc_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    cc_info_string=`${CC} --version 2>/dev/null | head -n 1`
  abi_result=`echo "${cc_info_string}" | grep '[Cc]lang'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    cc_info_string=""
    abi_cc_vendor="unknown"
    abi_cc_version="unknown"
  else

$as_echo "#define CC_LLVM 1" >>confdefs.h

    abi_cc_vendor="llvm"
    abi_cc_version=`echo ${abi_result} | sed -e 's/.*ersion //; s/ .*//'`
    if test "${abi_cc_version}" = "${abi_result}"; then
      abi_cc_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  if test "${abi_cc_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    cc_info_string=`${CC} -V 2> /dev/null | grep "^nvc"`
  abi_result=`echo "${cc_info_string}"`
  if test "${abi_result}" = ""; then
    abi_result="no"
    cc_info_string=""
    abi_cc_vendor="unknown"
    abi_cc_version="unknown"
  else

$as_echo "#define CC_NVHPC 1" >>confdefs.h

    abi_cc_vendor="nvhpc"
    abi_cc_version=`echo "${abi_result}" | cut -f2 -d" "`
    if test "${abi_cc_version}" = ""; then
      abi_cc_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  if test "${abi_cc_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    cc_info_string=`${CC} -V 2>&1 | sed -e '/^$/d' | head -n 1`
  abi_result=`echo "${cc_info_string}" | grep '^pgcc'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    cc_info_string=""
    abi_cc_vendor="unknown"
    abi_cc_version="unknown"
  else

$as_echo "#define CC_PGI 1" >>confdefs.h

    abi_cc_vendor="pgi"
    abi_cc_version=`echo "${abi_result}" | sed -e 's/.* //; s/-.*//'`
    if test "${abi_cc_version}" = "${abi_result}"; then
      abi_cc_version="unknown"
    fi
    abi_result="yes"
  fi

  fi

  # Check the GNU compiler last, because other compilers are cloning
  # its CLI
  if test "${abi_cc_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    cc_info_string=`${CC} --version 2>&1 | ${EGREP} '^g?cc' | head -n 1`
  if test "${ac_cv_c_compiler_gnu}" != "yes"; then
    abi_cc_vendor="unknown"
    abi_cc_version="unknown"
    abi_result="no"
  else

$as_echo "#define CC_GNU 1" >>confdefs.h

    abi_cc_vendor="gnu"
    abi_cc_version=`echo ${cc_info_string} | sed -e 's/.*([^)]*) //; s/ .*//'`
    if test "${abi_cc_version}" = "${cc_info_string}"; then
      abi_result=`echo "${cc_info_string}" | grep ' '`
      if test "${abi_result}" != ""; then
        abi_cc_version="unknown"
      fi
    fi
    abi_result="yes"
  fi

  fi

  # Fall back to generic when detection fails
  if test "${abi_cc_vendor}" = "unknown"; then
    abi_cc_vendor="generic"
    abi_cc_version="0.0"
  fi

  # Normalize C compiler version
  abi_cc_version=`echo ${abi_cc_version} | cut -d. -f1-2`

  # Display final result
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_cc_vendor} ${abi_cc_version}" >&5
$as_echo "${abi_cc_vendor} ${abi_cc_version}" >&6; }

  # Restore back CPPFLAGS and CFLAGS
  CPPFLAGS="${abi_env_CPPFLAGS}"
  CFLAGS="${abi_env_CFLAGS}"

  # Schedule compiler info for substitution





# ---------------------------------------------------------------------------- #

#
# C++ support
#



  abi_sec_title="C++ support"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# Set basic Abinit C++ parameters
# Note: advanced fetaures are set later on

  # Init
  if test "${abi_cxx_vendor}" = ""; then
    abi_cxx_vendor="unknown"
  fi

  # Preserve environment


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"



  # Look for the C++ compiler
  if test "${CXX}" != "" -a ! -x "${CXX}"; then
    abi_cxx_probe=`echo "${CXX}" | sed -e 's/ .*//'`
    if test ! -x "${abi_cxx_probe}"; then
      # Extract the first word of "${abi_cxx_probe}", so it can be a program name with args.
set dummy ${abi_cxx_probe}; 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_abi_cxx_path+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $abi_cxx_path in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_abi_cxx_path="$abi_cxx_path" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_abi_cxx_path="$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
abi_cxx_path=$ac_cv_path_abi_cxx_path
if test -n "$abi_cxx_path"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $abi_cxx_path" >&5
$as_echo "$abi_cxx_path" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


      if test "${abi_cxx_path}" = ""; then
        as_fn_error $? "could not run C++ compiler \"${CXX}\"" "$LINENO" 5
      fi
    fi
  fi
  ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
if test -z "$CXX"; then
  if test -n "$CCC"; then
    CXX=$CCC
  else
    if test -n "$ac_tool_prefix"; then
  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
  do
    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$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_prog_CXX+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$CXX"; then
  ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
    $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

fi
fi
CXX=$ac_cv_prog_CXX
if test -n "$CXX"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
$as_echo "$CXX" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


    test -n "$CXX" && break
  done
fi
if test -z "$CXX"; then
  ac_ct_CXX=$CXX
  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
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_prog_ac_ct_CXX+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_CXX"; then
  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_ac_ct_CXX="$ac_prog"
    $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

fi
fi
ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
if test -n "$ac_ct_CXX"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
$as_echo "$ac_ct_CXX" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$ac_ct_CXX" && break
done

  if test "x$ac_ct_CXX" = x; then
    CXX="g++"
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    CXX=$ac_ct_CXX
  fi
fi

  fi
fi
# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
  { { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
  ac_status=$?
  if test -s conftest.err; then
    sed '10a\
... rest of stderr output deleted ...
         10q' conftest.err >conftest.er1
    cat conftest.er1 >&5
  fi
  rm -f conftest.er1 conftest.err
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }
done

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
if ${ac_cv_cxx_compiler_gnu+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{
#ifndef __GNUC__
       choke me
#endif

  ;
  return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
  ac_compiler_gnu=yes
else
  ac_compiler_gnu=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_cxx_compiler_gnu=$ac_compiler_gnu

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
if test $ac_compiler_gnu = yes; then
  GXX=yes
else
  GXX=
fi
ac_test_CXXFLAGS=${CXXFLAGS+set}
ac_save_CXXFLAGS=$CXXFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
$as_echo_n "checking whether $CXX accepts -g... " >&6; }
if ${ac_cv_prog_cxx_g+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
   ac_cxx_werror_flag=yes
   ac_cv_prog_cxx_g=no
   CXXFLAGS="-g"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
  ac_cv_prog_cxx_g=yes
else
  CXXFLAGS=""
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :

else
  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
	 CXXFLAGS="-g"
	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
  ac_cv_prog_cxx_g=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
$as_echo "$ac_cv_prog_cxx_g" >&6; }
if test "$ac_test_CXXFLAGS" = set; then
  CXXFLAGS=$ac_save_CXXFLAGS
elif test $ac_cv_prog_cxx_g = yes; then
  if test "$GXX" = yes; then
    CXXFLAGS="-g -O2"
  else
    CXXFLAGS="-g"
  fi
else
  if test "$GXX" = yes; then
    CXXFLAGS="-O2"
  else
    CXXFLAGS=
  fi
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

depcc="$CXX"  am_compiler_list=

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
$as_echo_n "checking dependency style of $depcc... " >&6; }
if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
  # We make a subdir and do the tests there.  Otherwise we can end up
  # making bogus files that we don't know about and never remove.  For
  # instance it was reported that on HP-UX the gcc test will end up
  # making a dummy file named 'D' -- because '-MD' means "put the output
  # in D".
  rm -rf conftest.dir
  mkdir conftest.dir
  # Copy depcomp to subdir because otherwise we won't find it if we're
  # using a relative directory.
  cp "$am_depcomp" conftest.dir
  cd conftest.dir
  # We will build objects and dependencies in a subdirectory because
  # it helps to detect inapplicable dependency modes.  For instance
  # both Tru64's cc and ICC support -MD to output dependencies as a
  # side effect of compilation, but ICC will put the dependencies in
  # the current directory while Tru64 will put them in the object
  # directory.
  mkdir sub

  am_cv_CXX_dependencies_compiler_type=none
  if test "$am_compiler_list" = ""; then
     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
  fi
  am__universal=false
  case " $depcc " in #(
     *\ -arch\ *\ -arch\ *) am__universal=true ;;
     esac

  for depmode in $am_compiler_list; do
    # Setup a source with many dependencies, because some compilers
    # like to wrap large dependency lists on column 80 (with \), and
    # we should not choose a depcomp mode which is confused by this.
    #
    # We need to recreate these files for each test, as the compiler may
    # overwrite some of them when testing with obscure command lines.
    # This happens at least with the AIX C compiler.
    : > sub/conftest.c
    for i in 1 2 3 4 5 6; do
      echo '#include "conftst'$i'.h"' >> sub/conftest.c
      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
      # Solaris 10 /bin/sh.
      echo '/* dummy */' > sub/conftst$i.h
    done
    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf

    # We check with '-c' and '-o' for the sake of the "dashmstdout"
    # mode.  It turns out that the SunPro C++ compiler does not properly
    # handle '-M -o', and we need to detect this.  Also, some Intel
    # versions had trouble with output in subdirs.
    am__obj=sub/conftest.${OBJEXT-o}
    am__minus_obj="-o $am__obj"
    case $depmode in
    gcc)
      # This depmode causes a compiler race in universal mode.
      test "$am__universal" = false || continue
      ;;
    nosideeffect)
      # After this tag, mechanisms are not by side-effect, so they'll
      # only be used when explicitly requested.
      if test "x$enable_dependency_tracking" = xyes; then
	continue
      else
	break
      fi
      ;;
    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
      # This compiler won't grok '-c -o', but also, the minuso test has
      # not run yet.  These depmodes are late enough in the game, and
      # so weak that their functioning should not be impacted.
      am__obj=conftest.${OBJEXT-o}
      am__minus_obj=
      ;;
    none) break ;;
    esac
    if depmode=$depmode \
       source=sub/conftest.c object=$am__obj \
       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
         >/dev/null 2>conftest.err &&
       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
      # icc doesn't choke on unknown options, it will just issue warnings
      # or remarks (even with -Werror).  So we grep stderr for any message
      # that says an option was ignored or not supported.
      # When given -MP, icc 7.0 and 7.1 complain thusly:
      #   icc: Command line warning: ignoring option '-M'; no argument required
      # The diagnosis changed in icc 8.0:
      #   icc: Command line remark: option '-MP' not supported
      if (grep 'ignoring option' conftest.err ||
          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
        am_cv_CXX_dependencies_compiler_type=$depmode
        break
      fi
    fi
  done

  cd ..
  rm -rf conftest.dir
else
  am_cv_CXX_dependencies_compiler_type=none
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type

 if
  test "x$enable_dependency_tracking" != xno \
  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
  am__fastdepCXX_TRUE=
  am__fastdepCXX_FALSE='#'
else
  am__fastdepCXX_TRUE='#'
  am__fastdepCXX_FALSE=
fi



  # Warn if no C++ compiler is available
  if test "${CXX}" = ""; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no C++ compiler available" >&5
$as_echo "$as_me: WARNING: no C++ compiler available" >&2;}
  fi

  # Determine C++ compiler type (the order is important)
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking which type of C++ compiler we have" >&5
$as_echo_n "checking which type of C++ compiler we have... " >&6; }

  if test "${abi_cxx_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    cxx_info_string=`${CXX} -qversion 2>&1 | head -n 1`
  cxx_garbage=`${CXX} -qversion 2>&1 | wc -l | sed -e 's/ //g'`
  abi_result=`echo "${cc_info_string}" | grep 'IBM XL C/C++'`
  if test "${abi_result}" = ""; then
    abi_result=`echo "${cxx_info_string}" | grep 'IBM(R) XL C/C++'`
  fi
  if test "${abi_result}" = ""; then
    abi_result=`echo "${cxx_info_string}" | grep 'C for AIX'`
  fi
  if test "${abi_result}" = ""; then
    abi_result="no"
    cxx_info_string=""
    abi_cxx_vendor="unknown"
    abi_cxx_version="unknown"
    if test "${cxx_garbage}" -gt 50; then

$as_echo "#define CXX_IBM 1" >>confdefs.h

      abi_cxx_vendor="ibm"
      abi_cxx_version="unknown"
      abi_result="yes"
    fi
  else

$as_echo "#define CXX_IBM 1" >>confdefs.h

    abi_cxx_vendor="ibm"
    abi_cxx_version=`echo "${cxx_info_string}" | sed -e 's/.* V//; s/ .*//'`
    if test "${abi_cxx_version}" = "${cxx_info_string}"; then
      abi_cxx_version=`echo "${cxx_info_string}" | sed -e 's/C for AIX version //'`
    fi
    if test "${abi_cxx_version}" = "${cxx_info_string}"; then
      abi_cxx_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  if test "${abi_cxx_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    cxx_info_string=`${CXX} --version 2>/dev/null | head -n 1`
  abi_result=`echo "${cxx_info_string}" | grep '^Arm C/C++/Fortran Compiler'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    cxx_info_string=""
    abi_cxx_vendor="unknown"
    abi_cxx_version="unknown"
  else

$as_echo "#define CXX_ARM 1" >>confdefs.h

    abi_cxx_vendor="arm"
    abi_cxx_version=`echo ${abi_result} | sed -e 's/.*ersion //; s/ .*//'`
    if test "${abi_cxx_version}" = "${abi_result}"; then
      abi_cxx_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  if test "${abi_cxx_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    cxx_info_string=`${CXX} -v -V 2>&1 | head -n 1`
  abi_result=`echo "${cxx_info_string}" | grep '^Intel(R) C++'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    cxx_info_string=""
    abi_cxx_vendor="unknown"
    abi_cxx_version="unknown"
  else

$as_echo "#define CXX_INTEL 1" >>confdefs.h

    abi_cxx_vendor="intel"
    abi_cxx_version=`echo "${abi_result}" | sed -e 's/.*Version //; s/ .*//'`
    if test "${abi_cxx_version}" = "${abi_result}"; then
      abi_cxx_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  if test "${abi_cxx_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    cxx_info_string=`${CXX} --version 2>/dev/null | head -n 1`
  abi_result=`echo "${cxx_info_string}" | grep 'Cray clang'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    cxx_info_string=""
    abi_cxx_vendor="unknown"
    abi_cxx_version="unknown"
  else

$as_echo "#define CXX_CRAY 1" >>confdefs.h

    abi_cxx_vendor="cray"
    abi_cxx_version=`echo ${abi_result} | sed -e 's/.*ersion //; s/ .*//'`
    if test "${abi_cxx_version}" = "${abi_result}"; then
      abi_cxx_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  if test "${abi_cxx_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    cxx_info_string=`${CXX} --version 2>/dev/null | head -n 1`
  abi_result=`echo "${cxx_info_string}" | grep '[Cc]lang'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    cxx_info_string=""
    abi_cxx_vendor="unknown"
    abi_cxx_version="unknown"
  else

$as_echo "#define CXX_LLVM 1" >>confdefs.h

    abi_cxx_vendor="llvm"
    abi_cxx_version=`echo ${abi_result} | sed -e 's/.*ersion //; s/ .*//'`
    if test "${abi_cxx_version}" = "${abi_result}"; then
      abi_cxx_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  if test "${abi_cxx_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    cxx_info_string=`${CXX} -V 2> /dev/null | grep "^nvc++"`
  abi_result=`echo "${cxx_info_string}"`
  if test "${abi_result}" = ""; then
    abi_result="no"
    cxx_info_string=""
    abi_cxx_vendor="unknown"
    abi_cxx_version="unknown"
  else

$as_echo "#define CXX_NVHPC 1" >>confdefs.h

    abi_cxx_vendor="nvhpc"
    abi_cxx_version=`echo "${abi_result}" | cut -f2 -d" "`
    if test "${abi_cxx_version}" = ""; then
      abi_cxx_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  if test "${abi_cxx_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    cxx_info_string=`${CXX} -v -V 2>&1 | sed -e '/^$/d' | head -n 1`
  abi_result=`echo "${cxx_info_string}" | grep '^pgCC'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    cxx_info_string=""
    abi_cxx_vendor="unknown"
    abi_cxx_version="unknown"
  else

$as_echo "#define CXX_PGI 1" >>confdefs.h

    abi_cxx_vendor="pgi"
    abi_cxx_version=`echo "${abi_result}" | sed -e 's/.* //; s/-.*//'`
    if test "${abi_cxx_version}" = "${abi_result}"; then
      abi_cxx_version="unknown"
    fi
    abi_result="yes"
  fi

  fi

  # Check the GNU compiler last, because other compilers are cloning
  # its CLI
  if test "${abi_cxx_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    cxx_info_string=`${CXX} --version 2>&1 | head -n 1`
  if test "${ac_cv_cxx_compiler_gnu}" != "yes"; then
    cxx_info_string=""
    abi_cxx_vendor="unknown"
    abi_cxx_version="unknown"
    abi_result="no"
  else

$as_echo "#define CXX_GNU 1" >>confdefs.h

    abi_cxx_vendor="gnu"
    abi_cxx_version=`echo ${cxx_info_string} | sed -e 's/.*([^)]*) //; s/ .*//'`
    if test "${abi_cxx_version}" = "${cxx_info_string}"; then
      abi_result=`echo "${cxx_info_string}" | grep ' '`
      if test "${abi_result}" != ""; then
        abi_cxx_version="unknown"
      fi
    fi
    abi_result="yes"
  fi

  fi

  # Fall back to generic when detection fails
  if test "${abi_cxx_vendor}" = "unknown"; then
    abi_cxx_vendor="generic"
    abi_cxx_version="0.0"
  fi

  # Normalize C++ compiler version
  abi_cxx_version=`echo ${abi_cxx_version} | cut -d. -f1-2`

  # Display final result
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_cxx_vendor} ${abi_cxx_version}" >&5
$as_echo "${abi_cxx_vendor} ${abi_cxx_version}" >&6; }

  # Restore back CXXFLAGS
  CXXFLAGS="${abi_env_CXXFLAGS}"

  # Schedule compiler info for substitution





# ---------------------------------------------------------------------------- #

#
# Fortran support
#



  abi_sec_title="Fortran support"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# Set basic Abinit Fortran parameters
# Note: advanced fetaures are set later on

  # Init
  abi_fc_vendor="${with_fc_vendor}"
  abi_fc_version="${with_fc_version}"
  tmp_fc_info_file="${abinit_builddir}/config.fc_info.tmp"

  if test "${abi_fc_vendor}" = ""; then
    abi_fc_vendor="unknown"
  fi
  if test "${abi_fc_version}" = ""; then
    abi_fc_version="unknown"
  fi
  abi_fc_wrap="no"

  # Preserve environment


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"



  # Look for the Fortran compiler
  if test "${FC}" != "" -a ! -x "${FC}"; then
    abi_fc_probe=`echo "${FC}" | sed -e 's/ .*//'`
    if test ! -x "${abi_fc_probe}"; then
      # Extract the first word of "${abi_fc_probe}", so it can be a program name with args.
set dummy ${abi_fc_probe}; 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_abi_fc_path+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $abi_fc_path in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_abi_fc_path="$abi_fc_path" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_abi_fc_path="$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
abi_fc_path=$ac_cv_path_abi_fc_path
if test -n "$abi_fc_path"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $abi_fc_path" >&5
$as_echo "$abi_fc_path" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


      if test "${abi_fc_path}" = ""; then
        as_fn_error $? "could not run Fortran compiler \"${FC}\"" "$LINENO" 5
      fi
    fi
  fi
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
if test -n "$ac_tool_prefix"; then
  for ac_prog in  ftn mpiifort mpifort mpif90 nagfor ifort gfortran
  do
    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$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_prog_FC+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$FC"; then
  ac_cv_prog_FC="$FC" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_FC="$ac_tool_prefix$ac_prog"
    $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

fi
fi
FC=$ac_cv_prog_FC
if test -n "$FC"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5
$as_echo "$FC" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


    test -n "$FC" && break
  done
fi
if test -z "$FC"; then
  ac_ct_FC=$FC
  for ac_prog in  ftn mpiifort mpifort mpif90 nagfor ifort gfortran
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_prog_ac_ct_FC+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_FC"; then
  ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_ac_ct_FC="$ac_prog"
    $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

fi
fi
ac_ct_FC=$ac_cv_prog_ac_ct_FC
if test -n "$ac_ct_FC"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5
$as_echo "$ac_ct_FC" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$ac_ct_FC" && break
done

  if test "x$ac_ct_FC" = x; then
    FC=""
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    FC=$ac_ct_FC
  fi
fi


# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
  { { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
  ac_status=$?
  if test -s conftest.err; then
    sed '10a\
... rest of stderr output deleted ...
         10q' conftest.err >conftest.er1
    cat conftest.er1 >&5
  fi
  rm -f conftest.er1 conftest.err
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }
done
rm -f a.out

# If we don't use `.F' as extension, the preprocessor is not run on the
# input file.  (Note that this only needs to work for GNU compilers.)
ac_save_ext=$ac_ext
ac_ext=F
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran compiler" >&5
$as_echo_n "checking whether we are using the GNU Fortran compiler... " >&6; }
if ${ac_cv_fc_compiler_gnu+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat > conftest.$ac_ext <<_ACEOF
      program main
#ifndef __GNUC__
       choke me
#endif

      end
_ACEOF
if ac_fn_fc_try_compile "$LINENO"; then :
  ac_compiler_gnu=yes
else
  ac_compiler_gnu=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_fc_compiler_gnu=$ac_compiler_gnu

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5
$as_echo "$ac_cv_fc_compiler_gnu" >&6; }
ac_ext=$ac_save_ext
ac_test_FCFLAGS=${FCFLAGS+set}
ac_save_FCFLAGS=$FCFLAGS
FCFLAGS=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5
$as_echo_n "checking whether $FC accepts -g... " >&6; }
if ${ac_cv_prog_fc_g+:} false; then :
  $as_echo_n "(cached) " >&6
else
  FCFLAGS=-g
cat > conftest.$ac_ext <<_ACEOF
      program main

      end
_ACEOF
if ac_fn_fc_try_compile "$LINENO"; then :
  ac_cv_prog_fc_g=yes
else
  ac_cv_prog_fc_g=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5
$as_echo "$ac_cv_prog_fc_g" >&6; }
if test "$ac_test_FCFLAGS" = set; then
  FCFLAGS=$ac_save_FCFLAGS
elif test $ac_cv_prog_fc_g = yes; then
  if test "x$ac_cv_fc_compiler_gnu" = xyes; then
    FCFLAGS="-g -O2"
  else
    FCFLAGS="-g"
  fi
else
  if test "x$ac_cv_fc_compiler_gnu" = xyes; then
    FCFLAGS="-O2"
  else
    FCFLAGS=
  fi
fi

if test $ac_compiler_gnu = yes; then
  GFC=yes
else
  GFC=
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


  # Fail if no Fortran compiler is available
  if test "${FC}" = ""; then
    as_fn_error $? "no Fortran compiler available" "$LINENO" 5
  fi

  # Look for the Fortran preprocessor
  if test "${FPP}" != "" -a ! -x "${FPP}"; then
    # Extract the first word of "${FPP}", so it can be a program name with args.
set dummy ${FPP}; 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_abi_fpp_path+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $abi_fpp_path in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_abi_fpp_path="$abi_fpp_path" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_abi_fpp_path="$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
abi_fpp_path=$ac_cv_path_abi_fpp_path
if test -n "$abi_fpp_path"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $abi_fpp_path" >&5
$as_echo "$abi_fpp_path" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


    if test "${abi_fpp_path}" = ""; then
      as_fn_error $? "could not run Fortran preprocessor \"${FPP}\"" "$LINENO" 5
    fi
  fi
  #AC_PROG_FPP

  # Determine Fortran compiler type (the order is important)
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking which type of Fortran compiler we have" >&5
$as_echo_n "checking which type of Fortran compiler we have... " >&6; }

  # Clear temporary info file
  rm -f "${tmp_fc_info_file}"

  # Get rid of that one as early as possible
  if test "${abi_fc_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    fc_info_string=`${FC} -qversion 2>&1 | head -n 1`
  fc_garbage=`${FC} -qversion 2>&1 | wc -l | sed -e 's/ //g'`
  abi_result=`echo "${fc_info_string}" | grep 'IBM XL Fortran'`
  if test "${abi_result}" = ""; then
    abi_result=`echo "${fc_info_string}" | grep 'IBM(R) XL Fortran'`
  fi
  if test "${abi_result}" = ""; then
    abi_result="no"
    fc_info_string=""
    abi_fc_vendor="unknown"
    abi_fc_version="unknown"
    if test "${fc_garbage}" -gt 50; then

$as_echo "#define FC_IBM 1" >>confdefs.h

      abi_fc_vendor="ibm"
      abi_fc_version="unknown"
      abi_result="yes"
    fi
  else

$as_echo "#define FC_IBM 1" >>confdefs.h

    abi_fc_vendor="ibm"
    abi_fc_version=`echo "${abi_result}" | sed -e 's/.* V//; s/ .*//'`
    if test "${abi_fc_version}" = "${abi_result}"; then
      abi_fc_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  echo "${fc_info_string}" >>"${tmp_fc_info_file}"

  # Should be checked before gfortran because it mimics its behaviour
  if test "${abi_fc_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    fc_info_string=`${FC} -V 2>&1 | head -n 1`
  abi_result=`echo "${fc_info_string}" | grep '^Intel(R) Fortran'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    fc_info_string=""
    abi_fc_vendor="unknown"
    abi_fc_version="unknown"
  else

$as_echo "#define FC_INTEL 1" >>confdefs.h

    abi_fc_vendor="intel"
    abi_fc_version=`echo "${fc_info_string}" | sed -e 's/.*Version //;s/ .*//'`
    if test "${abi_fc_version}" = ""; then
      abi_fc_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  echo "${fc_info_string}" >>"${tmp_fc_info_file}"

  if test "${abi_fc_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    fc_info_string=`${FC} -V 2>/dev/null | head -n 1`
  abi_result=`echo "${fc_info_string}" | grep '^Pro Fortran'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    fc_info_string=""
    abi_fc_vendor="unknown"
    abi_fc_version="unknown"
  else

$as_echo "#define FC_ABSOFT 1" >>confdefs.h

    abi_fc_vendor="absoft"
    abi_fc_version=`echo "${abi_result}" | sed -e 's/Pro Fortran //'`
    if test "${abi_fc_version}" = "${abi_result}"; then
      abi_fc_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  echo "${fc_info_string}" >>"${tmp_fc_info_file}"

  if test "${abi_fc_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    fc_info_string=`${FC} -V 2>&1 | head -n 1`
  abi_result=`echo "${fc_info_string}" | grep '^NAG'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    fc_info_string=""
    abi_fc_vendor="unknown"
    abi_fc_version="unknown"
  else

$as_echo "#define FC_NAG 1" >>confdefs.h

    abi_fc_vendor="nag"
    abi_fc_version=`echo "${fc_info_string}" | sed -e 's/.*Release //;s/[( ].*//'`
    if test "${abi_fc_version}" = ""; then
      abi_fc_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  echo "${fc_info_string}" >>"${tmp_fc_info_file}"

  if test "${abi_fc_vendor}" = "unknown"; then
    echo "CHECK CRAY..."


    fc_info_string=`${FC} --version 2>/dev/null | head -n 1`

  abi_result=`echo "${fc_info_string}" | grep '^Cray Fortran'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    fc_info_string=""
    abi_fc_vendor="unknown"
    abi_fc_version="unknown"
  else

$as_echo "#define FC_CRAY 1" >>confdefs.h


$as_echo "#define HAVE_FORTRAN2003 1" >>confdefs.h

    abi_fc_vendor="cray"
        abi_fc_version=`echo ${abi_result} | cut -d' ' -f5`
    abi_result="yes"
  fi

  fi
  echo "${fc_info_string}" >>"${tmp_fc_info_file}"

  if test "${abi_fc_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    fc_info_string=`${FC} -V 2>&1 | head -n 2 | grep -v "^$"`
  abi_result=`echo "${fc_info_string}" | grep '^pgf9[05]'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    fc_info_string=""
    abi_fc_vendor="unknown"
    abi_fc_version="unknown"
  else

$as_echo "#define FC_PGI 1" >>confdefs.h

    abi_fc_vendor="pgi"
    abi_fc_version=`echo "${abi_result}" | sed -e 's/^pgf9[05] //' | sed -e 's/-.*//'`
    if test "${abi_fc_version}" = "${abi_result}"; then
      abi_fc_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  echo "${fc_info_string}" >>"${tmp_fc_info_file}"

  if test "${abi_fc_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    fc_info_string=`${FC} -V 2> /dev/null | grep "^nvfortran"`
  abi_result=`echo "${fc_info_string}"`
  if test "${abi_result}" = ""; then
    abi_result="no"
    fc_info_string=""
    abi_fc_vendor="unknown"
    abi_fc_version="unknown"
  else

$as_echo "#define FC_NVHPC 1" >>confdefs.h

    abi_fc_vendor="nvhpc"
    abi_fc_version=`echo "${abi_result}" | cut -f2 -d" "`
    if test "${abi_fc_version}" = "${abi_result}"; then
      abi_fc_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  echo "${fc_info_string}" >>"${tmp_fc_info_file}"

 if test "${abi_fc_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    fc_info_string=`${FC} --version 2>/dev/null | head -n 1`
  abi_result=`echo "${fc_info_string}" | grep '^GNU Fortran'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    fc_info_string=""
    abi_fc_vendor="unknown"
    abi_fc_version="unknown"
  else

$as_echo "#define FC_GNU 1" >>confdefs.h


$as_echo "#define HAVE_FORTRAN2003 1" >>confdefs.h

    abi_fc_vendor="gnu"
    abi_fc_version=`echo ${abi_result} | sed -e 's/^[^(]*([^)]*) //; s/ .*//'`
    abi_result="yes"
  fi

  fi
  echo "${fc_info_string}" >>"${tmp_fc_info_file}"

  if test "${abi_fc_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    fc_info_string=`${FC} --version 2>/dev/null | head -n 1`
  abi_result=`echo "${fc_info_string}" | grep -e '[CcFf]lang'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    fc_info_string=""
    abi_fc_vendor="unknown"
    abi_fc_version="unknown"
  else

$as_echo "#define FC_LLVM 1" >>confdefs.h

    abi_fc_vendor="llvm"
    abi_fc_version=`echo ${abi_result} | sed -e 's/.*ersion //; s/ .*//'`
    if test "${abi_fc_version}" = "${abi_result}"; then
      abi_fc_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  echo "${fc_info_string}" >>"${tmp_fc_info_file}"

  if test "${abi_fc_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    fc_info_string=`${FC} --version 2>/dev/null | head -n 1`
  abi_result=`echo "${fc_info_string}" | grep '^Arm C/C++/Fortran Compiler'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    fc_info_string=""
    abi_fc_vendor="unknown"
    abi_fc_version="unknown"
  else

$as_echo "#define FC_ARM 1" >>confdefs.h

    abi_fc_vendor="arm"
    abi_fc_version=`echo ${abi_result} | sed -e 's/.*ersion //; s/ .*//'`
    if test "${abi_fc_version}" = "${abi_result}"; then
      abi_fc_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  echo "${fc_info_string}" >>"${tmp_fc_info_file}"

  if test "${abi_fc_vendor}" = "unknown"; then

  # Do some sanity checking of the arguments

    fc_info_string=`${FC} --version 2>/dev/null | head -n 1`
  abi_result=`echo "${fc_info_string}" | grep -e 'AOCC_'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    fc_info_string=""
    abi_fc_vendor="unknown"
    abi_fc_version="unknown"
  else

$as_echo "#define FC_AOCC 1" >>confdefs.h

    abi_fc_vendor="AMD Flang"
    abi_fc_version=`echo "${abi_result}" | sed -e 's/.*AOCC_//' | sed -e 's/-.*//'`
    if test "${abi_fc_version}" = "${abi_result}"; then
      abi_fc_version="unknown"
    fi
    abi_result="yes"
  fi

  fi
  echo "${fc_info_string}" >>"${tmp_fc_info_file}"

  if test "${abi_fc_vendor}" = "unknown"; then


    fc_info_string=`${FC} --version 2>/dev/null | head -n 1`

  abi_result=`echo "${fc_info_string}" | grep '^Cray Fortran'`
  if test "${abi_result}" = ""; then
    abi_result="no"
    fc_info_string=""
    abi_fc_vendor="unknown"
    abi_fc_version="unknown"
  else

$as_echo "#define FC_CRAY 1" >>confdefs.h


$as_echo "#define HAVE_FORTRAN2003 1" >>confdefs.h

    abi_fc_vendor="cray"
        abi_fc_version=`echo ${abi_result} | cut -d' ' -f5`
    abi_result="yes"
  fi

  fi
  echo "${fc_info_string}" >>"${tmp_fc_info_file}"

  # Fall back to generic when detection fails
  if test "${abi_fc_vendor}" = "unknown"; then
    abi_fc_vendor="generic"
  #else
  #  rm -f "${tmp_fc_info_file}"
  fi

  # Normalize Fortran compiler version
  if test "${abi_fc_version}" = "unknown"; then
    abi_fc_version="0.0"
  else
    abi_fc_version=`echo ${abi_fc_version} | cut -d. -f1-2`
  fi

  # Display final result
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_fc_vendor} ${abi_fc_version}" >&5
$as_echo "${abi_fc_vendor} ${abi_fc_version}" >&6; }

  # Restore back FCFLAGS
  FCFLAGS="${abi_env_FCFLAGS}"

  # Schedule compiler info for substitution






# Set default file extensions


  # Set Fortran module extension

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking fortran 90 modules extension" >&5
$as_echo_n "checking fortran 90 modules extension... " >&6; }
if ${ax_cv_f90_modext+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

i=0
while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
    i=`expr $i + 1`
done
mkdir tmpdir_$i
cd tmpdir_$i
cat > conftest.$ac_ext <<_ACEOF

!234567
            module conftest_module
            contains
            subroutine conftest_routine
            write(*,'(a)') 'gotcha!'
            end subroutine conftest_routine
            end module conftest_module

_ACEOF
if ac_fn_fc_try_compile "$LINENO"; then :
  ax_cv_f90_modext=`ls | sed -n 's,conftest_module\.,,p'`
      if test x$ax_cv_f90_modext = x ; then
          ax_cv_f90_modext=`ls | sed -n 's,CONFTEST_MODULE\.,,p'`
          if test x$ax_cv_f90_modext = x ; then
              ax_cv_f90_modext=""
          fi
      fi

else
  ax_cv_f90_modext=""
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
cd ..
rm -fr tmpdir_$i
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_f90_modext" >&5
$as_echo "$ax_cv_f90_modext" >&6; }
  if test "${ax_cv_f90_modext}" != ""; then
    MODEXT="${ax_cv_f90_modext}"
  else
    MODEXT="mod"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting Fortran module extension to \".${MODEXT}\"" >&5
$as_echo "$as_me: setting Fortran module extension to \".${MODEXT}\"" >&6;}
  fi

  # Change the default Fortran extension for tests
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran flag to compile .F90 files" >&5
$as_echo_n "checking for Fortran flag to compile .F90 files... " >&6; }
if ${ac_cv_fc_srcext_F90+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_ext=F90
ac_fcflags_srcext_save=$ac_fcflags_srcext
ac_fcflags_srcext=
ac_cv_fc_srcext_F90=unknown
case $ac_ext in #(
  [fF]77) ac_try=f77;; #(
  *) ac_try=f95;;
esac
for ac_flag in none -qsuffix=f=F90 -Tf "-x $ac_try"; do
  test "x$ac_flag" != xnone && ac_fcflags_srcext="$ac_flag"
  cat > conftest.$ac_ext <<_ACEOF
      program main

      end
_ACEOF
if ac_fn_fc_try_compile "$LINENO"; then :
  ac_cv_fc_srcext_F90=$ac_flag; break
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
done
rm -f conftest.$ac_objext conftest.F90
ac_fcflags_srcext=$ac_fcflags_srcext_save

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_srcext_F90" >&5
$as_echo "$ac_cv_fc_srcext_F90" >&6; }
if test "x$ac_cv_fc_srcext_F90" = xunknown; then
  abi_fc_src_ok="no"
else
  ac_fc_srcext=F90
  if test "x$ac_cv_fc_srcext_F90" = xnone; then
    ac_fcflags_srcext=""
    FCFLAGS_F90=""
  else
    ac_fcflags_srcext=$ac_cv_fc_srcext_F90
    FCFLAGS_F90=$ac_cv_fc_srcext_F90
  fi

  abi_fc_src_ok="yes"
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

  if test "${abi_fc_src_ok}" != "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Fortran file extension could not be changed" >&5
$as_echo "$as_me: WARNING: Fortran file extension could not be changed" >&2;}
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: some advanced Fortran tests may fail" >&5
$as_echo "$as_me: WARNING: some advanced Fortran tests may fail" >&2;}
  fi


# Get module file case



  # Init
  fc_mod_lowercase="yes"
  fc_mod_uppercase="no"
  { $as_echo "$as_me:${as_lineno-$LINENO}: determining Fortran module case" >&5
$as_echo "$as_me: determining Fortran module case" >&6;}

  # Compile a dummy module
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF

    module conftest
    end module conftest

_ACEOF
if ac_fn_fc_try_compile "$LINENO"; then :

else
  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "unable to compile a simple Fortran module
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f core conftest.err conftest.$ac_objext 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


  # Check module file existence
  if test -f "CONFTEST.${MODEXT}"; then
    fc_mod_lowercase="no"
    fc_mod_uppercase="yes"
  elif test ! -f "conftest.${MODEXT}"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conftest.${MODEXT} Fortran module could not be found" >&5
$as_echo "$as_me: WARNING: conftest.${MODEXT} Fortran module could not be found" >&2;}
  fi

  # Output final outcome
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Fortran modules are upper-case" >&5
$as_echo_n "checking whether Fortran modules are upper-case... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_mod_uppercase}" >&5
$as_echo "${fc_mod_uppercase}" >&6; }


# The IBM Fortran compiler crashes if the mpi module is included
# more than once
if test "${abi_fc_vendor}" = "ibm" -a "${abi_mpi_enable}" = "yes"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: activating MPI workaround for the IBM Fortran compiler" >&5
$as_echo "$as_me: activating MPI workaround for the IBM Fortran compiler" >&6;}

$as_echo "#define HAVE_MPI_INCLUDED_ONCE 1" >>confdefs.h

fi

# Wrap Fortran compiler calls if needed or requested
# Note: must be the last step of basic Fortran configuration
if test "${abi_fc_wrapper_enable}" = "yes"; then
  abi_fc_wrap="yes"
fi

# FIXME: obsolete mechanism


# ---------------------------------------------------------------------------- #

#
# Hints
#



  abi_sec_title="Hints for the build flags"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# Look for a true C preprocessor
if test "${TRUE_CPP}" = ""; then
  for ac_prog in cpp
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_prog_TRUE_CPP+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$TRUE_CPP"; then
  ac_cv_prog_TRUE_CPP="$TRUE_CPP" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_TRUE_CPP="$ac_prog"
    $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

fi
fi
TRUE_CPP=$ac_cv_prog_TRUE_CPP
if test -n "$TRUE_CPP"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TRUE_CPP" >&5
$as_echo "$TRUE_CPP" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$TRUE_CPP" && break
done

fi
if test "${TRUE_CPP}" = ""; then
  # Extract the first word of "cpp", so it can be a program name with args.
set dummy cpp; 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_TRUE_CPP+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $TRUE_CPP in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_TRUE_CPP="$TRUE_CPP" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_TRUE_CPP="$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
TRUE_CPP=$ac_cv_path_TRUE_CPP
if test -n "$TRUE_CPP"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TRUE_CPP" >&5
$as_echo "$TRUE_CPP" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


fi
if test "${TRUE_CPP}" = ""; then
  if test -x "/lib/cpp"; then
    TRUE_CPP="/lib/cpp"
  fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a true C preprocessor" >&5
$as_echo_n "checking for a true C preprocessor... " >&6; }
if test "${TRUE_CPP}" = ""; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${TRUE_CPP}" >&5
$as_echo "${TRUE_CPP}" >&6; }
fi

# Set Fortran preprocessor when needed
if test "${abi_fc_wrap}" = "yes"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Fortran-compatible C preprocessor" >&5
$as_echo_n "checking for a Fortran-compatible C preprocessor... " >&6; }
  if test "${FPP}" = ""; then
    if test "${abi_cpp_user}" != ""; then
      FPP="${abi_cpp_user}"
    else
      if test "${TRUE_CPP}" != ""; then
        FPP="${TRUE_CPP}"
      else
        FPP="${CPP}"
      fi
    fi
  fi
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${FPP}" >&5
$as_echo "${FPP}" >&6; }
fi

# FIXME: set CPP vendor
case "${target_os}" in
  aix*)
    abi_cpp_vendor="ibm"
    abi_xpp_vendor="ibm"
    abi_fpp_vendor="ibm"
    ;;
  *)
    abi_cpp_vendor="default"
    abi_xpp_vendor="default"
    abi_fpp_vendor="default"
    ;;
esac
case "${abi_fc_vendor}" in
  ibm)
    abi_fpp_vendor="ibm"
    ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: setting C preprocessor vendor to '${abi_cpp_vendor}'" >&5
$as_echo "$as_me: setting C preprocessor vendor to '${abi_cpp_vendor}'" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: setting C++ preprocessor vendor to '${abi_xpp_vendor}'" >&5
$as_echo "$as_me: setting C++ preprocessor vendor to '${abi_xpp_vendor}'" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: setting Fortran preprocessor vendor to '${abi_fpp_vendor}'" >&5
$as_echo "$as_me: setting Fortran preprocessor vendor to '${abi_fpp_vendor}'" >&6;}

# Preset flags to have the source building properly
if test "${abi_hints_enable}" = "yes"; then

  # C support

    abi_cpp_vendor_hnt="none"
  abi_cpp_version_hnt="none"
  abi_sys_spec_hnt="none"

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking which cpp hints to apply" >&5
$as_echo_n "checking which cpp hints to apply... " >&6; }

    case "${abi_cpp_vendor}" in
    ibm)
      abi_cpp_vendor_hnt="ibm"
      abi_cpp_version_hnt="default"
      case "${abi_sys_spec}" in
        aix-*)
          abi_sys_spec_hnt="aix-*"
          CPPFLAGS_HINTS_EXT='-P -traditional-cpp'
          ;;
        linux-*)
          abi_sys_spec_hnt="linux-*"
          CPPFLAGS_HINTS_EXT='-P -traditional-cpp'
          ;;
        *)
          abi_sys_spec_hnt="default"
          ;;
      esac   # [case: abi_sys_spec, indent: 2, item: True]
      ;;
    *)
      abi_cpp_vendor_hnt="default"
      abi_cpp_version_hnt="default"
      abi_sys_spec_hnt="default"
      CPPFLAGS_HINTS_EXT='-P -std=c99'
      ;;
  esac   # [case: abi_cpp_vendor, indent: 0, item: True]

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_cpp_vendor_hnt}/${abi_cpp_version_hnt}/${abi_sys_spec_hnt}" >&5
$as_echo "${abi_cpp_vendor_hnt}/${abi_cpp_version_hnt}/${abi_sys_spec_hnt}" >&6; }



    abi_cc_vendor_hnt="none"
  abi_cc_version_hnt="none"
  abi_sys_spec_hnt="none"

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking which cc hints to apply" >&5
$as_echo_n "checking which cc hints to apply... " >&6; }

    case "${abi_cc_vendor}" in
    arm)
      abi_cc_vendor_hnt="arm"
      abi_cc_version_hnt="default"
      abi_sys_spec_hnt="default"
      CFLAGS_32BITS='-m32'
      CFLAGS_64BITS='-m64'
      CFLAGS_PIC='-fPIC'
      ;;
    gnu)
      abi_cc_vendor_hnt="gnu"
      abi_cc_version_hnt="default"
      case "${abi_sys_spec}" in
        irix-mips)
          abi_sys_spec_hnt="irix-mips"
          CFLAGS_32BITS='-mabi=32'
          CFLAGS_64BITS='-mabi=64'
          CFLAGS_PIC='-fPIC'
          ;;
        *)
          abi_sys_spec_hnt="default"
          CFLAGS_32BITS='-m32'
          CFLAGS_64BITS='-m64'
          CFLAGS_PIC='-fPIC'
          ;;
      esac   # [case: abi_sys_spec, indent: 2, item: True]
      ;;
    ibm)
      abi_cc_vendor_hnt="ibm"
      abi_cc_version_hnt="default"
      abi_sys_spec_hnt="default"
      CFLAGS_64BITS='-q64'
      CPPFLAGS_HINTS='-Wp,-DHAVE_CONFIG_H'
      CFLAGS_HINTS='-qlanglvl=extc99 -qsuppress=1520-031:1520-003'
      CFLAGS_PIC='-qpic'
      ;;
    intel)
      abi_cc_vendor_hnt="intel"
      abi_cc_version_hnt="default"
      abi_sys_spec_hnt="default"
      CC_LDFLAGS_HINTS='-static-libgcc -static-intel'
      openmp='-qopenmp'
      CFLAGS_PIC='-fPIC'
      ;;
    llvm)
      abi_cc_vendor_hnt="llvm"
      abi_cc_version_hnt="default"
      abi_sys_spec_hnt="default"
      CFLAGS_32BITS='-m32'
      CFLAGS_64BITS='-m64'
      CFLAGS_PIC='-fPIC'
      ;;
    nvhpc)
      abi_cc_vendor_hnt="nvhpc"
      abi_cc_version_hnt="default"
      abi_sys_spec_hnt="default"
      CFLAGS_32BITS='-m32'
      CFLAGS_64BITS='-m64'
      CFLAGS_PIC='-fPIC'
      ;;
    cray)
      abi_cc_vendor_hnt="cray"
      abi_cc_version_hnt="default"
      abi_sys_spec_hnt="default"
      CFLAGS_PIC='-fPIC'
      ;;
  esac   # [case: abi_cc_vendor, indent: 0, item: True]

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_cc_vendor_hnt}/${abi_cc_version_hnt}/${abi_sys_spec_hnt}" >&5
$as_echo "${abi_cc_vendor_hnt}/${abi_cc_version_hnt}/${abi_sys_spec_hnt}" >&6; }



  # C++ support

    abi_xpp_vendor_hnt="none"
  abi_xpp_version_hnt="none"
  abi_sys_spec_hnt="none"

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking which xpp hints to apply" >&5
$as_echo_n "checking which xpp hints to apply... " >&6; }


    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_xpp_vendor_hnt}/${abi_xpp_version_hnt}/${abi_sys_spec_hnt}" >&5
$as_echo "${abi_xpp_vendor_hnt}/${abi_xpp_version_hnt}/${abi_sys_spec_hnt}" >&6; }



    abi_cxx_vendor_hnt="none"
  abi_cxx_version_hnt="none"
  abi_sys_spec_hnt="none"

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking which cxx hints to apply" >&5
$as_echo_n "checking which cxx hints to apply... " >&6; }

    case "${abi_cxx_vendor}" in
    arm)
      abi_cxx_vendor_hnt="arm"
      abi_cxx_version_hnt="default"
      abi_sys_spec_hnt="default"
      CXXFLAGS_32BITS='-m32'
      CXXFLAGS_64BITS='-m64'
      CXXFLAGS_PIC='-fPIC'
      ;;
    gnu)
      abi_cxx_vendor_hnt="gnu"
      abi_cxx_version_hnt="default"
      abi_sys_spec_hnt="default"
      CXXFLAGS_32BITS='-m32'
      CXXFLAGS_64BITS='-m64'
      CXXFLAGS_PIC='-fPIC'
      ;;
    ibm)
      abi_cxx_vendor_hnt="ibm"
      abi_cxx_version_hnt="default"
      abi_sys_spec_hnt="default"
      CXXFLAGS_64BITS='-q64'
      CXXFLAGS_PIC='-qpic'
      ;;
    intel)
      abi_cxx_vendor_hnt="intel"
      abi_cxx_version_hnt="default"
      abi_sys_spec_hnt="default"
      CXX_LDFLAGS_HINTS='-static-libgcc -static-intel'
      CXXFLAGS_PIC='-fPIC'
      ;;
    llvm)
      abi_cxx_vendor_hnt="llvm"
      abi_cxx_version_hnt="default"
      abi_sys_spec_hnt="default"
      CXXFLAGS_32BITS='-m32'
      CXXFLAGS_64BITS='-m64'
      CXXFLAGS_PIC='-fPIC'
      ;;
    nvhpc)
      abi_cxx_vendor_hnt="nvhpc"
      abi_cxx_version_hnt="default"
      abi_sys_spec_hnt="default"
      CXXFLAGS_PIC='-fPIC'
      ;;
    cray)
      abi_cxx_vendor_hnt="cray"
      abi_cxx_version_hnt="default"
      abi_sys_spec_hnt="default"
      CXXFLAGS_PIC='-fPIC'
      ;;
  esac   # [case: abi_cxx_vendor, indent: 0, item: True]

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_cxx_vendor_hnt}/${abi_cxx_version_hnt}/${abi_sys_spec_hnt}" >&5
$as_echo "${abi_cxx_vendor_hnt}/${abi_cxx_version_hnt}/${abi_sys_spec_hnt}" >&6; }



  # Fortran support

    abi_fpp_vendor_hnt="none"
  abi_fpp_version_hnt="none"
  abi_sys_spec_hnt="none"

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking which fpp hints to apply" >&5
$as_echo_n "checking which fpp hints to apply... " >&6; }

    case "${abi_fpp_vendor}" in
    ibm)
      abi_fpp_vendor_hnt="ibm"
      abi_fpp_version_hnt="default"
      abi_sys_spec_hnt="default"
      FPPFLAGS_HINTS_EXT='-P -traditional-cpp'
      ;;
    *)
      abi_fpp_vendor_hnt="default"
      abi_fpp_version_hnt="default"
      abi_sys_spec_hnt="default"
      FPPFLAGS_HINTS_EXT='-P'
      ;;
  esac   # [case: abi_fpp_vendor, indent: 0, item: True]

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_fpp_vendor_hnt}/${abi_fpp_version_hnt}/${abi_sys_spec_hnt}" >&5
$as_echo "${abi_fpp_vendor_hnt}/${abi_fpp_version_hnt}/${abi_sys_spec_hnt}" >&6; }



    abi_fc_vendor_hnt="none"
  abi_fc_version_hnt="none"
  abi_sys_spec_hnt="none"

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking which fc hints to apply" >&5
$as_echo_n "checking which fc hints to apply... " >&6; }

    case "${abi_fc_vendor}" in
    absoft)
      abi_fc_vendor_hnt="absoft"
      abi_fc_version_hnt="default"
      abi_sys_spec_hnt="default"
      FCFLAGS_FIXEDFORM='-ffixed'
      FCFLAGS_FREEFORM='-ffree'
      FCFLAGS_MODDIR='-p ../mods'
      FCFLAGS_OPENMP='-openmp'
      FCFLAGS_PIC='-fPIC'
      FPPFLAGS_HINTS='-P'
      ;;
    arm)
      abi_fc_vendor_hnt="arm"
      abi_fc_version_hnt="default"
      abi_sys_spec_hnt="default"
      FCFLAGS_32BITS='-m32'
      FCFLAGS_64BITS='-m64'
      FCFLAGS_PIC='-fPIC'
      FCFLAGS_OPENMP='-fopenmp -mp'
      FCFLAGS_MODDIR='-module $(abinit_moddir)'
      FCFLAGS_BIGENDIAN='-mbig-endian -frecord-marker=4'
      FCFLAGS_FREEFORM='-ffree-form'
      FCFLAGS_FIXEDFORM='-ffixed-form'
      FCFLAGS_HINTS='-Mextend -Qunused-arguments'
      ;;
    gnu)
      abi_fc_vendor_hnt="gnu"
      case "${abi_fc_version}" in
        7.*)
          abi_fc_version_hnt="7.*"
          abi_sys_spec_hnt="default"
          FCFLAGS_32BITS='-m32'
          FCFLAGS_64BITS='-m64'
          FCFLAGS_BIGENDIAN='-fconvert=big-endian -frecord-marker=4'
          FCFLAGS_FIXEDFORM='-ffixed-form'
          FCFLAGS_FREEFORM='-ffree-form'
          FCFLAGS_PIC='-fPIC'
          FCFLAGS_MODDIR='-J../mods'
          FCFLAGS_HINTS='-ffree-line-length-none'
          FCFLAGS_OPENMP='-fopenmp'
          ;;
        8.*)
          abi_fc_version_hnt="8.*"
          abi_sys_spec_hnt="default"
          FCFLAGS_32BITS='-m32'
          FCFLAGS_64BITS='-m64'
          FCFLAGS_BIGENDIAN='-fconvert=big-endian -frecord-marker=4'
          FCFLAGS_FIXEDFORM='-ffixed-form'
          FCFLAGS_FREEFORM='-ffree-form'
          FCFLAGS_PIC='-fPIC'
          FCFLAGS_MODDIR='-J../mods'
          FCFLAGS_HINTS='-ffree-line-length-none'
          FCFLAGS_OPENMP='-fopenmp'
          ;;
        9.*)
          abi_fc_version_hnt="9.*"
          abi_sys_spec_hnt="default"
          FCFLAGS_32BITS='-m32'
          FCFLAGS_64BITS='-m64'
          FCFLAGS_BIGENDIAN='-fconvert=big-endian -frecord-marker=4'
          FCFLAGS_FIXEDFORM='-ffixed-form'
          FCFLAGS_FREEFORM='-ffree-form'
          FCFLAGS_PIC='-fPIC'
          FCFLAGS_MODDIR='-J../mods'
          FCFLAGS_HINTS='-ffree-line-length-none'
          FCFLAGS_OPENMP='-fopenmp'
          ;;
        *)
          abi_fc_version_hnt="default"
          abi_sys_spec_hnt="default"
          FCFLAGS_32BITS='-m32'
          FCFLAGS_64BITS='-m64'
          FCFLAGS_BIGENDIAN='-fconvert=big-endian -frecord-marker=4'
          FCFLAGS_FIXEDFORM='-ffixed-form'
          FCFLAGS_FREEFORM='-ffree-form'
          FCFLAGS_PIC='-fPIC'
          FCFLAGS_MODDIR='-J../mods'
          FCFLAGS_HINTS='-ffree-line-length-none -fallow-argument-mismatch'
          FCFLAGS_OPENMP='-fopenmp'
          ;;
      esac   # [case: abi_fc_version, indent: 2, item: True]
      ;;
    ibm)
      abi_fc_vendor_hnt="ibm"
      abi_fc_version_hnt="default"
      abi_sys_spec_hnt="default"
      FCFLAGS_32BITS='-q32'
      FCFLAGS_64BITS='-q64'
      FCFLAGS_FIXEDFORM='-qsuffix=cpp=F:f=f -qfixed'
      FCFLAGS_FREEFORM='-qsuffix=cpp=F90:f=f90 -qfree=f90'
      FCFLAGS_PIC='-qpic'
      FCFLAGS_MODDIR='-qmoddir=../mods -I../mods'
      FPPFLAGS_HINTS='-WF,-DHAVE_CONFIG_H'
      FCFLAGS_HINTS='-q64 -qzerosize -bmaxdata:2000000000 -qmaxmem=-1 -qspillsize=1664 -qstrict -qsuppress=1520-003:1520-031:1515-009'
      FCFLAGS_OPENMP='-qsmp'
      ;;
    intel)
      abi_fc_vendor_hnt="intel"
      abi_fc_version_hnt="default"
      abi_sys_spec_hnt="default"
      FCFLAGS_BIGENDIAN='-convert big_endian'
      FCFLAGS_FIXEDFORM='-fixed'
      FCFLAGS_FREEFORM='-free'
      FCFLAGS_MODDIR='-module ../mods'
      FCFLAGS_PIC='-fPIC'
      FCFLAGS_HINTS='-extend-source -nofpscomp'
      FC_LDFLAGS_HINTS='-static-intel -static-libgcc'
      FCFLAGS_OPENMP='-qopenmp'
      ;;
    llvm)
      abi_fc_vendor_hnt="llvm"
      abi_fc_version_hnt="default"
      abi_sys_spec_hnt="default"
      FCFLAGS_32BITS='-m32'
      FCFLAGS_64BITS='-m64'
      FCFLAGS_PIC='-fPIC'
      FCFLAGS_OPENMP='-fopenmp'
      FCFLAGS_OPENMP_OFFLOAD='-fopenmp --offload-arch=__GPU_ARCH__'
      FCFLAGS_MODDIR='-module ../mods'
      FCFLAGS_BIGENDIAN='-mbig-endian -frecord-marker=4'
      FCFLAGS_FREEFORM='-Mfree'
      FCFLAGS_FIXEDFORM='-Mfixed'
      FCFLAGS_HINTS='-Mextend -Qunused-arguments'
      ;;
    nag)
      abi_fc_vendor_hnt="nag"
      abi_fc_version_hnt="default"
      abi_sys_spec_hnt="default"
      FCFLAGS_64BITS='-64t'
      FCFLAGS_FIXEDFORM='-fixed'
      FCFLAGS_FREEFORM='-free'
      FCFLAGS_PIC='-PIC'
      FCFLAGS_OPENMP='-openmp'
      FCFLAGS_MODDIR='-mdir ../mods -I../mods'
      FCFLAGS_HINTS='-DFC_NAG  -w -kind=byte -gline -dcfuns -C=intovf -C=present -C=array -mismatch'
      ;;
    nvhpc)
      abi_fc_vendor_hnt="nvhpc"
      abi_fc_version_hnt="default"
      abi_sys_spec_hnt="default"
      FCFLAGS_FIXEDFORM='-Mfixed'
      FCFLAGS_FREEFORM='-Mfree'
      FCFLAGS_MODDIR='-module ../mods'
      FCFLAGS_PIC='-fPIC'
      FCFLAGS_HINTS='-Mextend'
      FCFLAGS_OPENMP='-mp'
      FCFLAGS_OPENMP_OFFLOAD='-mp=gpu -Minfo=mp -gpu=cc__GPU_ARCH__'
      FC_LDFLAGS_HINTS=''
      ;;
    pgi)
      abi_fc_vendor_hnt="pgi"
      abi_fc_version_hnt="default"
      abi_sys_spec_hnt="default"
      FCFLAGS_FIXEDFORM='-Mfixed'
      FCFLAGS_FREEFORM='-Mfree'
      FCFLAGS_MODDIR='-module ../mods'
      FCFLAGS_PIC='-fPIC'
      FCFLAGS_HINTS='-Mextend'
      FC_LDFLAGS_HINTS=''
      ;;
    cray)
      abi_fc_vendor_hnt="cray"
      abi_fc_version_hnt="default"
      abi_sys_spec_hnt="default"
      FCFLAGS_BIGENDIAN='-h byteswapio'
      FCFLAGS_FIXEDFORM='-f fixed'
      FCFLAGS_FREEFORM='-f free'
      FCFLAGS_PIC='-f PIC'
      FCFLAGS_MODDIR='-J ../mods'
      FCFLAGS_OPENMP='-f openmp'
      FCFLAGS_HINTS='-DFC_CRAY -ef'
      ;;
  esac   # [case: abi_fc_vendor, indent: 0, item: True]

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_fc_vendor_hnt}/${abi_fc_version_hnt}/${abi_sys_spec_hnt}" >&5
$as_echo "${abi_fc_vendor_hnt}/${abi_fc_version_hnt}/${abi_sys_spec_hnt}" >&6; }



  # Library archiver support
  #ABI_AR_HINTS

fi

# Set Fortran flags according to openMP options


# Empty flags if openMP is not used
if test "${abi_openmp_enable}" != "yes"; then
  FCFLAGS_OPENMP=""
  FCFLAGS_OPENMP_OFFLOAD=""
fi

# Handling OpenMP offload
if test "${abi_openmp_offload_enable}" = "yes"; then

  # Fail if GPU support is not enabled
  if test "${abi_gpu_enable}" = "no"; then
    as_fn_error $? "OpenMP offload is enabled with no GPU support (i.e. CUDA, HIP, ...), please check your config." "$LINENO" 5
  fi

  # Enable OpenMP if OpenMP offload is requested, to remain consistent
  abi_openmp_enable="yes"

  # Manage ARCH variable
  if test "${GPU_ARCH}" = ""; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GPU arch is not set (empty GPU_ARCH variable), defaulting to NVIDIA Ampere (=80)" >&5
$as_echo "$as_me: WARNING: GPU arch is not set (empty GPU_ARCH variable), defaulting to NVIDIA Ampere (=80)" >&2;}
    GPU_ARCH=80
  fi
  # Perform pattern replacement in OpenMP offload flags with requested GPU arch
  FCFLAGS_OPENMP_OFFLOAD=`echo "${FCFLAGS_OPENMP_OFFLOAD}" | sed "s/__GPU_ARCH__/$GPU_ARCH/"`

  #FIXME With LLVM 16 embedded with ROCm 5.6.0, issues occurs if OpenMP offload is enabled everywhere
  #Therefore, we enable it only if subfolders where it's needed and link time.
  if test "${abi_fc_vendor}" == "llvm" -a "${abi_gpu_flavor}" == "hip-double"; then
    amd_openmp_flags="${FCFLAGS_OPENMP_OFFLOAD}"
    FC_LDFLAGS_EXTRA="${FCFLAGS_OPENMP_OFFLOAD} ${FC_LDFLAGS_EXTRA}"
    FCFLAGS_OPENMP_OFFLOAD=""
  fi

  #FIXME With Cray CPE 23.12, it seems that "-lcraymp" isn't always added to LDFLAGS, so we add it here
  if test "${abi_fc_vendor}" == "cray" -a "${abi_gpu_flavor}" == "hip-double"; then
    FC_LDFLAGS_EXTRA="-lcraymp ${FC_LDFLAGS_EXTRA}"
  fi

else
  FCFLAGS_OPENMP_OFFLOAD=""
fi



# Set Fortran preprocessing flags
if test "${abi_fc_wrap}" = "yes"; then
  test "${FPPFLAGS}" = "" && FPPFLAGS="${FPPFLAGS_HINTS_EXT}"
fi

# Display Fortran preprocessing parameters
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which Fortran preprocessor to use" >&5
$as_echo_n "checking which Fortran preprocessor to use... " >&6; }
if test "${FPP}" = ""; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${FPP}" >&5
$as_echo "${FPP}" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which Fortran preprocessor flags to apply" >&5
$as_echo_n "checking which Fortran preprocessor flags to apply... " >&6; }
if test "${FPPFLAGS}" = ""; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${FPPFLAGS}" >&5
$as_echo "${FPPFLAGS}" >&6; }
fi

# Display Fortran compiler wrapper status
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to wrap Fortran compiler calls" >&5
$as_echo_n "checking whether to wrap Fortran compiler calls... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_fc_wrap}" >&5
$as_echo "${abi_fc_wrap}" >&6; }

# Export true CPPFLAGS (required by LibXC)


# ---------------------------------------------------------------------------- #

#
# Debugging
#
# NOTE:
#
#   * Please do not try to set-up the *FLAGS_DEBUG variables manually,
#     as they will systematically be overwritten. These flags should be
#     modified by the --with-*-dbgflags options only, and --enable-debug
#     set to "yes" in this case.
#



  abi_sec_title="Debugging"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# Init debug flags

    abi_debug_flavor="${abi_debug_flavor}"
  abi_debug_verbose="no"

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking debugging status" >&5
$as_echo_n "checking debugging status... " >&6; }
  case "${abi_debug_flavor}" in
    none)
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
$as_echo "disabled" >&6; }
      CPPFLAGS_DEBUG=""
      CFLAGS_DEBUG=""
      CC_LDFLAGS_DEBUG=""
      CC_LIBS_DEBUG=""
      CXXFLAGS_DEBUG=""
      CXX_LDFLAGS_DEBUG=""
      CXX_LIBS_DEBUG=""
      FCFLAGS_DEBUG=""
      FC_LDFLAGS_DEBUG=""
      FC_LIBS_DEBUG=""
      ARFLAGS_DEBUG=""
      ;;
    custom)
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled (using user-specified debug flags)" >&5
$as_echo "enabled (using user-specified debug flags)" >&6; }
      ;;
    *)
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled (profile: ${abi_debug_flavor})" >&5
$as_echo "enabled (profile: ${abi_debug_flavor})" >&6; }
      CPPFLAGS_DEBUG=""
      CFLAGS_DEBUG=""
      CC_LDFLAGS_DEBUG=""
      CC_LIBS_DEBUG=""
      CXXFLAGS_DEBUG=""
      CXX_LDFLAGS_DEBUG=""
      CXX_LIBS_DEBUG=""
      FCFLAGS_DEBUG=""
      FC_LDFLAGS_DEBUG=""
      FC_LIBS_DEBUG=""
      ARFLAGS_DEBUG=""
      ;;
  esac

    if test "${abi_debug_flavor}" != "none" -a \
          "${abi_debug_flavor}" != "custom"; then

        if test "${CFLAGS}" = ""; then
      if test "${ac_cv_prog_cc_g}" = "yes"; then
        CFLAGS_DEBUG="-g"
        { $as_echo "$as_me:${as_lineno-$LINENO}: setting C debug flags to '-g'" >&5
$as_echo "$as_me: setting C debug flags to '-g'" >&6;}
      fi

    abi_cc_vendor_dbg="none"
  abi_cc_version_dbg="none"
  abi_cpu_spec_dbg="none"

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking which cc debug flags to apply" >&5
$as_echo_n "checking which cc debug flags to apply... " >&6; }

    if test "${abi_cc_vendor}" = "gnu"; then
    abi_cc_vendor_dbg="gnu"
    abi_cc_version_dbg="default"
    abi_cpu_spec_dbg="default"
    case "${abi_debug_flavor}" in
      basic)
        abi_debug_flavor_dbg="basic"

        ;;
      verbose)
        abi_debug_flavor_dbg="verbose"

        ;;
      enhanced)
        abi_debug_flavor_dbg="enhanced"
        CFLAGS_DEBUG="${CFLAGS_DEBUG} -g3 -ggdb"
        ;;
      paranoid)
        abi_debug_flavor_dbg="paranoid"
        CFLAGS_DEBUG="${CFLAGS_DEBUG} -g3 -ggdb -Wall -Wextra"
        ;;
      naughty)
        abi_debug_flavor_dbg="naughty"
        CFLAGS_DEBUG="${CFLAGS_DEBUG} -g3 -ggdb -Wall -Wextra"
        ;;
    esac   # [case: abi_debug_flavor, indent: 1, item: False]
  fi

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_cc_vendor_dbg}/${abi_cc_version_dbg}/${abi_cpu_spec_dbg}" >&5
$as_echo "${abi_cc_vendor_dbg}/${abi_cc_version_dbg}/${abi_cpu_spec_dbg}" >&6; }


    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: debugging profile overriden by user-defined CFLAGS" >&5
$as_echo "$as_me: debugging profile overriden by user-defined CFLAGS" >&6;}
    fi

        if test "${CXXFLAGS}" = ""; then
      if test "${ac_cv_prog_cxx_g}" = "yes"; then
        CXXFLAGS_DEBUG="-g"
        { $as_echo "$as_me:${as_lineno-$LINENO}: setting C++ debug flags to '-g'" >&5
$as_echo "$as_me: setting C++ debug flags to '-g'" >&6;}
      fi

    abi_cxx_vendor_dbg="none"
  abi_cxx_version_dbg="none"
  abi_cpu_spec_dbg="none"

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking which cxx debug flags to apply" >&5
$as_echo_n "checking which cxx debug flags to apply... " >&6; }


    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_cxx_vendor_dbg}/${abi_cxx_version_dbg}/${abi_cpu_spec_dbg}" >&5
$as_echo "${abi_cxx_vendor_dbg}/${abi_cxx_version_dbg}/${abi_cpu_spec_dbg}" >&6; }


    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: debugging profile overriden by user-defined CXXFLAGS" >&5
$as_echo "$as_me: debugging profile overriden by user-defined CXXFLAGS" >&6;}
    fi

        if test "${FCFLAGS}" = ""; then
      if test "${ac_cv_prog_fc_g}" = "yes"; then
        FCFLAGS_DEBUG="-g"
        { $as_echo "$as_me:${as_lineno-$LINENO}: setting Fortran debug flags to '-g'" >&5
$as_echo "$as_me: setting Fortran debug flags to '-g'" >&6;}
      fi

    abi_fc_vendor_dbg="none"
  abi_fc_version_dbg="none"
  abi_cpu_spec_dbg="none"

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking which fc debug flags to apply" >&5
$as_echo_n "checking which fc debug flags to apply... " >&6; }

    case "${abi_fc_vendor}" in
    arm)
      abi_fc_vendor_dbg="arm"
      abi_fc_version_dbg="default"
      abi_cpu_spec_dbg="default"
      case "${abi_debug_flavor}" in
        basic)
          abi_debug_flavor_dbg="basic"

          ;;
        verbose)
          abi_debug_flavor_dbg="verbose"

          ;;
        enhanced)
          abi_debug_flavor_dbg="enhanced"
          FCFLAGS_DEBUG="${FCFLAGS_DEBUG} -fbacktrace -finit-real=nan -Wimplicit"
          ;;
        paranoid)
          abi_debug_flavor_dbg="paranoid"
          FCFLAGS_DEBUG="${FCFLAGS_DEBUG} -fbacktrace -finit-real=nan -Wimplicit -fbacktrace -finit-real=nan -Wimplicit -Wall -Wextra"
          ;;
        naughty)
          abi_debug_flavor_dbg="naughty"
          FCFLAGS_DEBUG="${FCFLAGS_DEBUG} -fbacktrace -finit-real=nan -Wimplicit -fbacktrace -finit-real=nan -Wimplicit -Wall -Wextra -fbacktrace -finit-real=nan -Wimplicit -Wall -Wextra"
          ;;
      esac   # [case: abi_debug_flavor, indent: 2, item: True]
      ;;
    gnu)
      abi_fc_vendor_dbg="gnu"
      abi_fc_version_dbg="default"
      abi_cpu_spec_dbg="default"
      case "${abi_debug_flavor}" in
        basic)
          abi_debug_flavor_dbg="basic"

          ;;
        verbose)
          abi_debug_flavor_dbg="verbose"

          ;;
        enhanced)
          abi_debug_flavor_dbg="enhanced"
          FCFLAGS_DEBUG="${FCFLAGS_DEBUG} -fbacktrace -finit-real=nan -Wimplicit-interface -Wno-maybe-uninitialized -Wtabs"
          ;;
        paranoid)
          abi_debug_flavor_dbg="paranoid"
          FCFLAGS_DEBUG="${FCFLAGS_DEBUG} -fbacktrace -finit-real=nan -Wimplicit-interface -Wno-maybe-uninitialized -Wtabs -ffpe-trap=invalid,zero,overflow -Wall -Wextra"
          ;;
        naughty)
          abi_debug_flavor_dbg="naughty"
          FCFLAGS_DEBUG="${FCFLAGS_DEBUG} -fbacktrace -finit-real=nan -Wimplicit-interface -Wno-maybe-uninitialized -Wtabs -ffpe-trap=invalid,zero,overflow -Wall -Wextra -fcheck=all -pedantic"
          ;;
      esac   # [case: abi_debug_flavor, indent: 2, item: True]
      ;;
    ibm)
      abi_fc_vendor_dbg="ibm"
      abi_fc_version_dbg="default"
      abi_cpu_spec_dbg="default"
      case "${abi_debug_flavor}" in
        basic)
          abi_debug_flavor_dbg="basic"

          ;;
        verbose)
          abi_debug_flavor_dbg="verbose"

          ;;
        enhanced)
          abi_debug_flavor_dbg="enhanced"
          FCFLAGS_DEBUG="${FCFLAGS_DEBUG} -qnooptimize -qextcheck -qflag=i:i -qfloat=nans -qinitauto=7FBFFFFF"
          ;;
        paranoid)
          abi_debug_flavor_dbg="paranoid"
          FCFLAGS_DEBUG="${FCFLAGS_DEBUG} -qnooptimize -qextcheck -qflag=i:i -qfloat=nans -qinitauto=7FBFFFFF -qflttrap=overflow:underflow:zerodivide:invalid:enable -qsigtrap"
          ;;
        naughty)
          abi_debug_flavor_dbg="naughty"
          FCFLAGS_DEBUG="${FCFLAGS_DEBUG} -qnooptimize -qextcheck -qflag=i:i -qfloat=nans -qinitauto=7FBFFFFF -qflttrap=overflow:underflow:zerodivide:invalid:enable -qsigtrap -C -qcheck"
          ;;
      esac   # [case: abi_debug_flavor, indent: 2, item: True]
      ;;
    intel)
      abi_fc_vendor_dbg="intel"
      abi_fc_version_dbg="default"
      abi_cpu_spec_dbg="default"
      case "${abi_debug_flavor}" in
        basic)
          abi_debug_flavor_dbg="basic"

          ;;
        verbose)
          abi_debug_flavor_dbg="verbose"

          ;;
        enhanced)
          abi_debug_flavor_dbg="enhanced"
          FCFLAGS_DEBUG="${FCFLAGS_DEBUG} -check uninit -debug all -fp-model source -ftrapuv -traceback"
          ;;
        paranoid)
          abi_debug_flavor_dbg="paranoid"
          FCFLAGS_DEBUG="${FCFLAGS_DEBUG} -check uninit -debug all -fp-model source -ftrapuv -traceback -fp-stack-check -implicitnone -init=snan -warn all"
          ;;
        naughty)
          abi_debug_flavor_dbg="naughty"
          FCFLAGS_DEBUG="${FCFLAGS_DEBUG} -check uninit -debug all -fp-model source -ftrapuv -traceback -fp-stack-check -implicitnone -init=snan -warn all -check all -WB"
          ;;
      esac   # [case: abi_debug_flavor, indent: 2, item: True]
      ;;
    nag)
      abi_fc_vendor_dbg="nag"
      abi_fc_version_dbg="default"
      abi_cpu_spec_dbg="default"
      case "${abi_debug_flavor}" in
        basic)
          abi_debug_flavor_dbg="basic"

          ;;
        verbose)
          abi_debug_flavor_dbg="verbose"

          ;;
        enhanced)
          abi_debug_flavor_dbg="enhanced"
          FCFLAGS_DEBUG="${FCFLAGS_DEBUG} -gline -mtrace=verbose -nan"
          FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG} -mtrace=verbose"
          ;;
        paranoid)
          abi_debug_flavor_dbg="paranoid"
          FCFLAGS_DEBUG="${FCFLAGS_DEBUG} -gline -mtrace=verbose -nan -info"
          FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG} -mtrace=verbose"
          ;;
        naughty)
          abi_debug_flavor_dbg="naughty"
          FCFLAGS_DEBUG="${FCFLAGS_DEBUG} -gline -mtrace=verbose -nan -info -C"
          FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG} -mtrace=verbose"
          ;;
      esac   # [case: abi_debug_flavor, indent: 2, item: True]
      ;;
    llvm)
      abi_fc_vendor_dbg="llvm"
      abi_fc_version_dbg="default"
      abi_cpu_spec_dbg="default"
      case "${abi_debug_flavor}" in
        basic)
          abi_debug_flavor_dbg="basic"

          ;;
        verbose)
          abi_debug_flavor_dbg="verbose"

          ;;
        enhanced)
          abi_debug_flavor_dbg="enhanced"
          FCFLAGS_DEBUG="${FCFLAGS_DEBUG} -fbacktrace -finit-real=nan -Wimplicit"
          ;;
        paranoid)
          abi_debug_flavor_dbg="paranoid"
          FCFLAGS_DEBUG="${FCFLAGS_DEBUG} -fbacktrace -finit-real=nan -Wimplicit -fbacktrace -finit-real=nan -Wimplicit -Wall -Wextra"
          ;;
        naughty)
          abi_debug_flavor_dbg="naughty"
          FCFLAGS_DEBUG="${FCFLAGS_DEBUG} -fbacktrace -finit-real=nan -Wimplicit -fbacktrace -finit-real=nan -Wimplicit -Wall -Wextra -fbacktrace -finit-real=nan -Wimplicit -Wall -Wextra"
          ;;
      esac   # [case: abi_debug_flavor, indent: 2, item: True]
      ;;
  esac   # [case: abi_fc_vendor, indent: 0, item: True]

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_fc_vendor_dbg}/${abi_fc_version_dbg}/${abi_cpu_spec_dbg}" >&5
$as_echo "${abi_fc_vendor_dbg}/${abi_fc_version_dbg}/${abi_cpu_spec_dbg}" >&6; }


    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: debugging profile overriden by user-defined FCFLAGS" >&5
$as_echo "$as_me: debugging profile overriden by user-defined FCFLAGS" >&6;}
    fi

  fi

    case "${abi_debug_flavor}" in
    verbose|enhanced)
      abi_debug_verbose="yes"
      ;;
    paranoid|naughty)
      abi_source_debug_enable="yes"
      abi_debug_verbose="yes"
      ;;
  esac

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to activate debug mode in source files" >&5
$as_echo_n "checking whether to activate debug mode in source files... " >&6; }
  if test "${abi_source_debug_enable}" = "yes"; then

$as_echo "#define DEBUG_MODE 1" >>confdefs.h

  fi
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_source_debug_enable}" >&5
$as_echo "${abi_source_debug_enable}" >&6; }

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to activate verbose debug messages in source files" >&5
$as_echo_n "checking whether to activate verbose debug messages in source files... " >&6; }
  if test "${abi_debug_verbose}" = "yes"; then

$as_echo "#define DEBUG_VERBOSE 1" >>confdefs.h

  fi
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_debug_verbose}" >&5
$as_echo "${abi_debug_verbose}" >&6; }



# Activate "design-by-contract" debugging tests when paranoid
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to activate design-by-contract debugging" >&5
$as_echo_n "checking whether to activate design-by-contract debugging... " >&6; }
if test "${abi_debug_flavor}" = "paranoid"; then

$as_echo "#define DEBUG_CONTRACT 1" >>confdefs.h

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
 if test "${abi_debug_flavor}" = "paranoid"; then
  DO_BUILD_32_CONTRACT_TRUE=
  DO_BUILD_32_CONTRACT_FALSE='#'
else
  DO_BUILD_32_CONTRACT_TRUE='#'
  DO_BUILD_32_CONTRACT_FALSE=
fi


# ---------------------------------------------------------------------------- #

#
# Optimizations
#
# NOTE: The optimizations will be taken from *FLAGS_OPTIM environment
# variables if with_optim_flavor is set to yes, or set to predefined values
# for other optimization profiles.
#



  abi_sec_title="Optimizations"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# Disable optimizations if debug mode is activated in source files
if test "${abi_debug_source}" = "yes"; then
  if test "${abi_optim_flavor}" != "none"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling optimizations" >&5
$as_echo "$as_me: WARNING: disabling optimizations" >&2;}
  fi
  abi_optim_flavor="none"
fi

# Init optimization flags
# Note: must be done only once debugging is configured

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking optimization status" >&5
$as_echo_n "checking optimization status... " >&6; }
  case "${abi_optim_flavor}" in
    none)
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
$as_echo "disabled" >&6; }
      CPPFLAGS_OPTIM=""
      CFLAGS_OPTIM="-O0"
      CC_LDFLAGS_OPTIM=""
      CC_LIBS_OPTIM=""
      CXXFLAGS_OPTIM="-O0"
      CXX_LDFLAGS_OPTIM=""
      CXX_LIBS_OPTIM=""
      FCFLAGS_OPTIM="-O0"
      FC_LDFLAGS_OPTIM=""
      FC_LIBS_OPTIM=""
      ARFLAGS_OPTIM=""
      ;;
    custom)
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled (using user-specified flags)" >&5
$as_echo "enabled (using user-specified flags)" >&6; }
      ;;
    *)
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled (profile: ${abi_optim_flavor})" >&5
$as_echo "enabled (profile: ${abi_optim_flavor})" >&6; }
      CPPFLAGS_OPTIM=""
      CFLAGS_OPTIM=""
      CC_LDFLAGS_OPTIM=""
      CC_LIBS_OPTIM=""
      CXXFLAGS_OPTIM=""
      CXX_LDFLAGS_OPTIM=""
      CXX_LIBS_OPTIM=""
      FCFLAGS_OPTIM=""
      FC_LDFLAGS_OPTIM=""
      FC_LIBS_OPTIM=""
      ARFLAGS_OPTIM=""
      ;;
  esac

    if test "${with_optim_flavor}" != "none" -a \
          "${with_optim_flavor}" != "custom"; then
    if test "${CFLAGS}" = ""; then

    abi_cc_vendor_opt="none"
  abi_cc_version_opt="none"
  abi_cpu_spec_opt="none"

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking which cc optimizations to apply" >&5
$as_echo_n "checking which cc optimizations to apply... " >&6; }

    case "${abi_cc_vendor}" in
    arm)
      abi_cc_vendor_opt="arm"
      abi_cc_version_opt="default"
      abi_cpu_spec_opt="default"
      case "${abi_optim_flavor}" in
        safe)
          abi_optim_flavor_opt="safe"
          CFLAGS_OPTIM="-O2"
          ;;
        standard)
          abi_optim_flavor_opt="standard"
          CFLAGS_OPTIM="-O2 -mtune=native -mcpu=native"
          ;;
        aggressive)
          abi_optim_flavor_opt="aggressive"
          CFLAGS_OPTIM="-O3 -mtune=native -mcpu=native -ffp-contract=fast"
          ;;
      esac   # [case: abi_optim_flavor, indent: 2, item: True]
      ;;
    gnu)
      abi_cc_vendor_opt="gnu"
      abi_cc_version_opt="default"
      abi_cpu_spec_opt="default"
      case "${abi_optim_flavor}" in
        safe)
          abi_optim_flavor_opt="safe"
          CFLAGS_OPTIM="-O2"
          ;;
        standard)
          abi_optim_flavor_opt="standard"
          CFLAGS_OPTIM="-O2 -march=native"
          ;;
        aggressive)
          abi_optim_flavor_opt="aggressive"
          CFLAGS_OPTIM="-O3 -march=native"
          ;;
      esac   # [case: abi_optim_flavor, indent: 2, item: True]
      ;;
    ibm)
      abi_cc_vendor_opt="ibm"
      abi_cc_version_opt="default"
      case "${abi_cpu_spec}" in
        ibm_powerpc)
          abi_cpu_spec_opt="ibm_powerpc"
          case "${abi_optim_flavor}" in
            safe)
              abi_optim_flavor_opt="safe"
              CFLAGS_OPTIM="-O2 -qarch=auto -qtune=auto -qstrict -qspill=2000"
              ;;
            standard)
              abi_optim_flavor_opt="standard"
              CFLAGS_OPTIM="-O3 -qarch=auto -qtune=auto -qstrict -qspill=2000"
              ;;
            aggressive)
              abi_optim_flavor_opt="aggressive"
              CFLAGS_OPTIM="-O4 -qarch=auto -qtune=auto -qstrict -qspill=2000"
              ;;
          esac   # [case: abi_optim_flavor, indent: 4, item: True]
          ;;
        ibm_powerpc64)
          abi_cpu_spec_opt="ibm_powerpc64"
          case "${abi_optim_flavor}" in
            safe)
              abi_optim_flavor_opt="safe"
              CFLAGS_OPTIM="-O2 -qarch=auto -qtune=auto -qstrict -qspill=2000"
              ;;
            standard)
              abi_optim_flavor_opt="standard"
              CFLAGS_OPTIM="-O3 -qarch=auto -qtune=auto -qstrict -qspill=2000"
              ;;
            aggressive)
              abi_optim_flavor_opt="aggressive"
              CFLAGS_OPTIM="-O4 -qarch=auto -qtune=auto -qstrict -qspill=2000"
              ;;
          esac   # [case: abi_optim_flavor, indent: 4, item: True]
          ;;
        *)
          abi_cpu_spec_opt="default"
          case "${abi_optim_flavor}" in
            safe)
              abi_optim_flavor_opt="safe"
              CFLAGS_OPTIM="-O2"
              ;;
            standard)
              abi_optim_flavor_opt="standard"
              CFLAGS_OPTIM="-O2"
              ;;
            aggressive)
              abi_optim_flavor_opt="aggressive"
              CFLAGS_OPTIM="-O3"
              ;;
          esac   # [case: abi_optim_flavor, indent: 4, item: True]
          ;;
      esac   # [case: abi_cpu_spec, indent: 2, item: True]
      ;;
    intel)
      abi_cc_vendor_opt="intel"
      abi_cc_version_opt="default"
      abi_cpu_spec_opt="default"
      case "${abi_optim_flavor}" in
        safe)
          abi_optim_flavor_opt="safe"
          CFLAGS_OPTIM="-O2"
          ;;
        standard)
          abi_optim_flavor_opt="standard"
          CFLAGS_OPTIM="-O2"
          ;;
        aggressive)
          abi_optim_flavor_opt="aggressive"
          CFLAGS_OPTIM="-O3"
          ;;
      esac   # [case: abi_optim_flavor, indent: 2, item: True]
      ;;
    llvm)
      abi_cc_vendor_opt="llvm"
      abi_cc_version_opt="default"
      abi_cpu_spec_opt="default"
      case "${abi_optim_flavor}" in
        safe)
          abi_optim_flavor_opt="safe"
          CFLAGS_OPTIM="-O2"
          ;;
        standard)
          abi_optim_flavor_opt="standard"
          CFLAGS_OPTIM="-O2 -mtune=native -mcpu=native"
          ;;
        aggressive)
          abi_optim_flavor_opt="aggressive"
          CFLAGS_OPTIM="-O3 -mtune=native -mcpu=native -ffp-contract=fast"
          ;;
      esac   # [case: abi_optim_flavor, indent: 2, item: True]
      ;;
    nvhpc)
      abi_cc_vendor_opt="nvhpc"
      abi_cc_version_opt="default"
      abi_cpu_spec_opt="default"
      case "${abi_optim_flavor}" in
        safe)
          abi_optim_flavor_opt="safe"
          CFLAGS_OPTIM="-O2"
          ;;
        standard)
          abi_optim_flavor_opt="standard"
          CFLAGS_OPTIM="-fast"
          ;;
        aggressive)
          abi_optim_flavor_opt="aggressive"
          CFLAGS_OPTIM="-O3"
          ;;
      esac   # [case: abi_optim_flavor, indent: 2, item: True]
      ;;
    cray)
      abi_cc_vendor_opt="cray"
      abi_cc_version_opt="default"
      abi_cpu_spec_opt="default"
      case "${abi_optim_flavor}" in
        safe)
          abi_optim_flavor_opt="safe"
          CFLAGS_OPTIM="-O2"
          ;;
        standard)
          abi_optim_flavor_opt="standard"
          CFLAGS_OPTIM="-O2"
          ;;
        aggressive)
          abi_optim_flavor_opt="aggressive"
          CFLAGS_OPTIM="-O3"
          ;;
      esac   # [case: abi_optim_flavor, indent: 2, item: True]
      ;;
  esac   # [case: abi_cc_vendor, indent: 0, item: True]

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_cc_vendor_opt}/${abi_cc_version_opt}/${abi_cpu_spec_opt}" >&5
$as_echo "${abi_cc_vendor_opt}/${abi_cc_version_opt}/${abi_cpu_spec_opt}" >&6; }


    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization profile overriden by user-defined CFLAGS" >&5
$as_echo "$as_me: optimization profile overriden by user-defined CFLAGS" >&6;}
    fi
    if test "${CXXFLAGS}" = ""; then

    abi_cxx_vendor_opt="none"
  abi_cxx_version_opt="none"
  abi_cpu_spec_opt="none"

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking which cxx optimizations to apply" >&5
$as_echo_n "checking which cxx optimizations to apply... " >&6; }

    case "${abi_cxx_vendor}" in
    arm)
      abi_cxx_vendor_opt="arm"
      abi_cxx_version_opt="default"
      abi_cpu_spec_opt="default"
      case "${abi_optim_flavor}" in
        safe)
          abi_optim_flavor_opt="safe"
          CXXFLAGS_OPTIM="-O2"
          ;;
        standard)
          abi_optim_flavor_opt="standard"
          CXXFLAGS_OPTIM="-O2 -mtune=native -mcpu=native"
          ;;
        aggressive)
          abi_optim_flavor_opt="aggressive"
          CXXFLAGS_OPTIM="-O3 -mtune=native -mcpu=native -ffp-contract=fast"
          ;;
      esac   # [case: abi_optim_flavor, indent: 2, item: True]
      ;;
    gnu)
      abi_cxx_vendor_opt="gnu"
      abi_cxx_version_opt="default"
      abi_cpu_spec_opt="default"
      case "${abi_optim_flavor}" in
        safe)
          abi_optim_flavor_opt="safe"
          CXXFLAGS_OPTIM="-O2"
          ;;
        standard)
          abi_optim_flavor_opt="standard"
          CXXFLAGS_OPTIM="-O2 -march=native"
          ;;
        aggressive)
          abi_optim_flavor_opt="aggressive"
          CXXFLAGS_OPTIM="-O3 -march=native"
          ;;
      esac   # [case: abi_optim_flavor, indent: 2, item: True]
      ;;
    ibm)
      abi_cxx_vendor_opt="ibm"
      abi_cxx_version_opt="default"
      case "${abi_cpu_spec}" in
        ibm_powerpc)
          abi_cpu_spec_opt="ibm_powerpc"
          case "${abi_optim_flavor}" in
            safe)
              abi_optim_flavor_opt="safe"
              CXXFLAGS_OPTIM="-O2 -qarch=auto -qtune=auto -qstrict -qspill=2000 -qessl"
              ;;
            standard)
              abi_optim_flavor_opt="standard"
              CXXFLAGS_OPTIM="-O3 -qarch=auto -qtune=auto -qstrict -qspill=2000 -qessl"
              ;;
            aggressive)
              abi_optim_flavor_opt="aggressive"
              CXXFLAGS_OPTIM="-O4 -qarch=auto -qtune=auto -qstrict -qspill=2000 -qessl"
              ;;
          esac   # [case: abi_optim_flavor, indent: 4, item: True]
          ;;
        ibm_powerpc64)
          abi_cpu_spec_opt="ibm_powerpc64"
          case "${abi_optim_flavor}" in
            safe)
              abi_optim_flavor_opt="safe"
              CXXFLAGS_OPTIM="-O2 -qarch=auto -qtune=auto -qstrict -qspill=2000 -qessl"
              ;;
            standard)
              abi_optim_flavor_opt="standard"
              CXXFLAGS_OPTIM="-O3 -qarch=auto -qtune=auto -qstrict -qspill=2000 -qessl"
              ;;
            aggressive)
              abi_optim_flavor_opt="aggressive"
              CXXFLAGS_OPTIM="-O4 -qarch=auto -qtune=auto -qstrict -qspill=2000 -qessl"
              ;;
          esac   # [case: abi_optim_flavor, indent: 4, item: True]
          ;;
        *)
          abi_cpu_spec_opt="default"
          case "${abi_optim_flavor}" in
            safe)
              abi_optim_flavor_opt="safe"
              CXXFLAGS_OPTIM="-O2"
              ;;
            standard)
              abi_optim_flavor_opt="standard"
              CXXFLAGS_OPTIM="-O2"
              ;;
            aggressive)
              abi_optim_flavor_opt="aggressive"
              CXXFLAGS_OPTIM="-O3"
              ;;
          esac   # [case: abi_optim_flavor, indent: 4, item: True]
          ;;
      esac   # [case: abi_cpu_spec, indent: 2, item: True]
      ;;
    intel)
      abi_cxx_vendor_opt="intel"
      abi_cxx_version_opt="default"
      abi_cpu_spec_opt="default"
      case "${abi_optim_flavor}" in
        safe)
          abi_optim_flavor_opt="safe"
          CXXFLAGS_OPTIM="-O2"
          ;;
        standard)
          abi_optim_flavor_opt="standard"
          CXXFLAGS_OPTIM="-O2"
          ;;
        aggressive)
          abi_optim_flavor_opt="aggressive"
          CXXFLAGS_OPTIM="-O3"
          ;;
      esac   # [case: abi_optim_flavor, indent: 2, item: True]
      ;;
    llvm)
      abi_cxx_vendor_opt="llvm"
      abi_cxx_version_opt="default"
      abi_cpu_spec_opt="default"
      case "${abi_optim_flavor}" in
        safe)
          abi_optim_flavor_opt="safe"
          CXXFLAGS_OPTIM="-O2"
          ;;
        standard)
          abi_optim_flavor_opt="standard"
          CXXFLAGS_OPTIM="-O2 -mtune=native -mcpu=native"
          ;;
        aggressive)
          abi_optim_flavor_opt="aggressive"
          CXXFLAGS_OPTIM="-O3 -mtune=native -mcpu=native -ffp-contract=fast"
          ;;
      esac   # [case: abi_optim_flavor, indent: 2, item: True]
      ;;
    nvhpc)
      abi_cxx_vendor_opt="nvhpc"
      abi_cxx_version_opt="default"
      abi_cpu_spec_opt="default"
      case "${abi_optim_flavor}" in
        safe)
          abi_optim_flavor_opt="safe"
          CXXFLAGS_OPTIM="-O2"
          ;;
        standard)
          abi_optim_flavor_opt="standard"
          CXXFLAGS_OPTIM="-fast"
          ;;
        aggressive)
          abi_optim_flavor_opt="aggressive"
          CXXFLAGS_OPTIM="-O3"
          ;;
      esac   # [case: abi_optim_flavor, indent: 2, item: True]
      ;;
    cray)
      abi_cxx_vendor_opt="cray"
      abi_cxx_version_opt="default"
      abi_cpu_spec_opt="default"
      case "${abi_optim_flavor}" in
        safe)
          abi_optim_flavor_opt="safe"
          CXXFLAGS_OPTIM="-O2"
          ;;
        standard)
          abi_optim_flavor_opt="standard"
          CXXFLAGS_OPTIM="-O2"
          ;;
        aggressive)
          abi_optim_flavor_opt="aggressive"
          CXXFLAGS_OPTIM="-O3"
          ;;
      esac   # [case: abi_optim_flavor, indent: 2, item: True]
      ;;
  esac   # [case: abi_cxx_vendor, indent: 0, item: True]

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_cxx_vendor_opt}/${abi_cxx_version_opt}/${abi_cpu_spec_opt}" >&5
$as_echo "${abi_cxx_vendor_opt}/${abi_cxx_version_opt}/${abi_cpu_spec_opt}" >&6; }


    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization profile overriden by user-defined CXXFLAGS" >&5
$as_echo "$as_me: optimization profile overriden by user-defined CXXFLAGS" >&6;}
    fi
    if test "${FCFLAGS}" = ""; then

    abi_fc_vendor_opt="none"
  abi_fc_version_opt="none"
  abi_cpu_spec_opt="none"

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking which fc optimizations to apply" >&5
$as_echo_n "checking which fc optimizations to apply... " >&6; }

    case "${abi_fc_vendor}" in
    arm)
      abi_fc_vendor_opt="arm"
      abi_fc_version_opt="default"
      abi_cpu_spec_opt="default"
      case "${abi_optim_flavor}" in
        safe)
          abi_optim_flavor_opt="safe"
          FCFLAGS_OPTIM="-O2"
          ;;
        standard)
          abi_optim_flavor_opt="standard"
          FCFLAGS_OPTIM="-O2 -mtune=native -mcpu=native"
          ;;
        aggressive)
          abi_optim_flavor_opt="aggressive"
          FCFLAGS_OPTIM="-O3 -mtune=native -mcpu=native"
          ;;
      esac   # [case: abi_optim_flavor, indent: 2, item: True]
      ;;
    gnu)
      abi_fc_vendor_opt="gnu"
      abi_fc_version_opt="default"
      abi_cpu_spec_opt="default"
      case "${abi_optim_flavor}" in
        safe)
          abi_optim_flavor_opt="safe"
          FCFLAGS_OPTIM="-O2"
          ;;
        standard)
          abi_optim_flavor_opt="standard"
          FCFLAGS_OPTIM="-O2 -march=native"
          ;;
        aggressive)
          abi_optim_flavor_opt="aggressive"
          FCFLAGS_OPTIM="-O3 -march=native -funroll-loops -faggressive-function-elimination"
          ;;
      esac   # [case: abi_optim_flavor, indent: 2, item: True]
      ;;
    ibm)
      abi_fc_vendor_opt="ibm"
      abi_fc_version_opt="default"
      case "${abi_cpu_spec}" in
        ibm_powerpc)
          abi_cpu_spec_opt="ibm_powerpc"
          case "${abi_optim_flavor}" in
            safe)
              abi_optim_flavor_opt="safe"
              FCFLAGS_OPTIM="-O2 -qarch=auto -qtune=auto -qcache=auto"
              FC_LDFLAGS_OPTIM=""
              ;;
            standard)
              abi_optim_flavor_opt="standard"
              FCFLAGS_OPTIM="-O2 -qarch=auto -qtune=auto -qcache=auto"
              FC_LDFLAGS_OPTIM="-lxlopt"
              ;;
            aggressive)
              abi_optim_flavor_opt="aggressive"
              FCFLAGS_OPTIM="-O4 -qarch=auto -qtune=auto -qcache=auto"
              FC_LDFLAGS_OPTIM="-lxlopt"
              ;;
          esac   # [case: abi_optim_flavor, indent: 4, item: True]
          ;;
        ibm_powerpc64)
          abi_cpu_spec_opt="ibm_powerpc64"
          case "${abi_optim_flavor}" in
            safe)
              abi_optim_flavor_opt="safe"
              FCFLAGS_OPTIM="-O2 -qarch=auto -qtune=auto -qcache=auto"
              FC_LDFLAGS_OPTIM=""
              ;;
            standard)
              abi_optim_flavor_opt="standard"
              FCFLAGS_OPTIM="-O2 -qarch=auto -qtune=auto -qcache=auto"
              FC_LDFLAGS_OPTIM="-lxlopt"
              ;;
            aggressive)
              abi_optim_flavor_opt="aggressive"
              FCFLAGS_OPTIM="-O4 -qarch=auto -qtune=auto -qcache=auto"
              FC_LDFLAGS_OPTIM="-lxlopt"
              ;;
          esac   # [case: abi_optim_flavor, indent: 4, item: True]
          ;;
        *)
          abi_cpu_spec_opt="default"
          case "${abi_optim_flavor}" in
            safe)
              abi_optim_flavor_opt="safe"
              FCFLAGS_OPTIM="-O2"
              ;;
            standard)
              abi_optim_flavor_opt="standard"
              FCFLAGS_OPTIM="-O2"
              ;;
            aggressive)
              abi_optim_flavor_opt="aggressive"
              FCFLAGS_OPTIM="-O3"
              ;;
          esac   # [case: abi_optim_flavor, indent: 4, item: True]
          ;;
      esac   # [case: abi_cpu_spec, indent: 2, item: True]
      ;;
    intel)
      abi_fc_vendor_opt="intel"
      abi_fc_version_opt="default"
      case "${abi_cpu_spec}" in
        amd_opteron)
          abi_cpu_spec_opt="amd_opteron"
          case "${abi_optim_flavor}" in
            safe)
              abi_optim_flavor_opt="safe"
              FCFLAGS_OPTIM="-O1"
              ;;
            standard)
              abi_optim_flavor_opt="standard"
              FCFLAGS_OPTIM="-O2"
              ;;
            aggressive)
              abi_optim_flavor_opt="aggressive"
              FCFLAGS_OPTIM="-O3"
              ;;
          esac   # [case: abi_optim_flavor, indent: 4, item: True]
          ;;
        intel_itanium1)
          abi_cpu_spec_opt="intel_itanium1"
          case "${abi_optim_flavor}" in
            safe)
              abi_optim_flavor_opt="safe"
              FCFLAGS_OPTIM="-O2 -fp-model precise -fp-speculation=safe"
              ;;
            standard)
              abi_optim_flavor_opt="standard"
              FCFLAGS_OPTIM="-O2"
              ;;
            aggressive)
              abi_optim_flavor_opt="aggressive"
              FCFLAGS_OPTIM="-O3 -fp-model fast=1 -fp-relaxed -ip"
              ;;
          esac   # [case: abi_optim_flavor, indent: 4, item: True]
          ;;
        intel_itanium2)
          abi_cpu_spec_opt="intel_itanium2"
          case "${abi_optim_flavor}" in
            safe)
              abi_optim_flavor_opt="safe"
              FCFLAGS_OPTIM="-O2 -fp-model precise -fp-speculation=safe"
              ;;
            standard)
              abi_optim_flavor_opt="standard"
              FCFLAGS_OPTIM="-O2"
              ;;
            aggressive)
              abi_optim_flavor_opt="aggressive"
              FCFLAGS_OPTIM="-O3 -fp-model fast=1 -fp-relaxed -ip"
              ;;
          esac   # [case: abi_optim_flavor, indent: 4, item: True]
          ;;
        *)
          abi_cpu_spec_opt="default"
          case "${abi_optim_flavor}" in
            safe)
              abi_optim_flavor_opt="safe"
              FCFLAGS_OPTIM="-O2 -fltconsistency -fp-model precise -fp-speculation=safe -prec-div -prec-sqrt"
              ;;
            standard)
              abi_optim_flavor_opt="standard"
              FCFLAGS_OPTIM="-O3"
              ;;
            aggressive)
              abi_optim_flavor_opt="aggressive"
              FCFLAGS_OPTIM="-O3 -xHOST"
              ;;
          esac   # [case: abi_optim_flavor, indent: 4, item: True]
          ;;
      esac   # [case: abi_cpu_spec, indent: 2, item: True]
      ;;
    llvm)
      abi_fc_vendor_opt="llvm"
      abi_fc_version_opt="default"
      abi_cpu_spec_opt="default"
      case "${abi_optim_flavor}" in
        safe)
          abi_optim_flavor_opt="safe"
          FCFLAGS_OPTIM="-O2"
          ;;
        standard)
          abi_optim_flavor_opt="standard"
          FCFLAGS_OPTIM="-O2 -mtune=native -mcpu=native"
          ;;
        aggressive)
          abi_optim_flavor_opt="aggressive"
          FCFLAGS_OPTIM="-O3 -mtune=native -mcpu=native"
          ;;
      esac   # [case: abi_optim_flavor, indent: 2, item: True]
      ;;
    nag)
      abi_fc_vendor_opt="nag"
      abi_fc_version_opt="default"
      abi_cpu_spec_opt="default"
      case "${abi_optim_flavor}" in
        safe)
          abi_optim_flavor_opt="safe"
          FCFLAGS_OPTIM="-O2"
          ;;
        standard)
          abi_optim_flavor_opt="standard"
          FCFLAGS_OPTIM="-O3"
          ;;
        aggressive)
          abi_optim_flavor_opt="aggressive"
          FCFLAGS_OPTIM="-O4"
          ;;
      esac   # [case: abi_optim_flavor, indent: 2, item: True]
      ;;
    nvhpc)
      abi_fc_vendor_opt="nvhpc"
      abi_fc_version_opt="default"
      abi_cpu_spec_opt="default"
      case "${abi_optim_flavor}" in
        safe)
          abi_optim_flavor_opt="safe"
          FCFLAGS_OPTIM="-O2"
          ;;
        standard)
          abi_optim_flavor_opt="standard"
          FCFLAGS_OPTIM="-fast"
          ;;
        aggressive)
          abi_optim_flavor_opt="aggressive"
          FCFLAGS_OPTIM="-O3"
          ;;
      esac   # [case: abi_optim_flavor, indent: 2, item: True]
      ;;
    pgi)
      abi_fc_vendor_opt="pgi"
      abi_fc_version_opt="default"
      abi_cpu_spec_opt="default"
      case "${abi_optim_flavor}" in
        safe)
          abi_optim_flavor_opt="safe"
          FCFLAGS_OPTIM="-O2 -tp=x64"
          ;;
        standard)
          abi_optim_flavor_opt="standard"
          FCFLAGS_OPTIM="-O2 -tp=x64"
          ;;
        aggressive)
          abi_optim_flavor_opt="aggressive"
          FCFLAGS_OPTIM="-O3 -tp=x64"
          ;;
      esac   # [case: abi_optim_flavor, indent: 2, item: True]
      ;;
    cray)
      abi_fc_vendor_opt="cray"
      abi_fc_version_opt="default"
      abi_cpu_spec_opt="default"
      case "${abi_optim_flavor}" in
        safe)
          abi_optim_flavor_opt="safe"
          FCFLAGS_OPTIM="-O1"
          ;;
        standard)
          abi_optim_flavor_opt="standard"
          FCFLAGS_OPTIM="-O2"
          ;;
        aggressive)
          abi_optim_flavor_opt="aggressive"
          FCFLAGS_OPTIM="-O3"
          ;;
      esac   # [case: abi_optim_flavor, indent: 2, item: True]
      ;;
  esac   # [case: abi_fc_vendor, indent: 0, item: True]

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_fc_vendor_opt}/${abi_fc_version_opt}/${abi_cpu_spec_opt}" >&5
$as_echo "${abi_fc_vendor_opt}/${abi_fc_version_opt}/${abi_cpu_spec_opt}" >&6; }


    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization profile overriden by user-defined FCFLAGS" >&5
$as_echo "$as_me: optimization profile overriden by user-defined FCFLAGS" >&6;}
    fi
  fi



# FIXME: 20_datashare does not support optimizations
  { $as_echo "$as_me:${as_lineno-$LINENO}: disabling optimizations for src/20_datashare/" >&5
$as_echo "$as_me: disabling optimizations for src/20_datashare/" >&6;}
  fcflags_opt_20_datashare="-O0"
  { $as_echo "$as_me:${as_lineno-$LINENO}: disabling optimizations for src/43_ptgroups/" >&5
$as_echo "$as_me: disabling optimizations for src/43_ptgroups/" >&6;}
  fcflags_opt_43_ptgroups="-O0"

# FIXME: AMD LLVM fork for OpenMP GPU (aka AOMP) has a sensitive OpenMP GPU implementation, so we enable it where needed.
# Checked with version 16.0.0 shipped with ROCm 5.6.0 (July 2023).
if test "${abi_fc_vendor}" == "llvm" -a "${abi_gpu_flavor}" == "hip-double"; then
  if test "${abi_openmp_offload_enable}" = "yes"; then
    fcflags_opt_28_numeric_noabirule="${amd_openmp_flags}"
    fcflags_opt_45_xgTools="${amd_openmp_flags}"
    fcflags_opt_46_ghc_omp="${amd_openmp_flags}"
    fcflags_opt_66_nonlocal="${amd_openmp_flags}"
    fcflags_opt_66_wfs="${amd_openmp_flags}"
    fcflags_opt_67_common="${amd_openmp_flags}"
    fcflags_opt_79_seqpar_mpi="${amd_openmp_flags}"
    fcflags_opt_98_main="${amd_openmp_flags}"
  fi
fi

# Set per-directory Fortran optimizations
# Note: must be done only once FCFLAGS_OPTIM is set


  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to apply per-directory optimizations" >&5
$as_echo_n "checking whether to apply per-directory optimizations... " >&6; }
  if test "${enable_optim}" = "no" -o "${FCFLAGS}" != ""; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
  fi

    echo "optim_dumper_template='${abinit_srcdir}/shared/common/src/14_hidewrite/m_optim_dumper.F90.in'" > config.optim
  echo "optim_dumper_output='${abinit_builddir}/shared/common/src/14_hidewrite/m_optim_dumper.F90'" >> config.optim

    fcflags_opt_default="${FCFLAGS_OPTIM}"
  echo "fcflags_opt_default='${fcflags_opt_default}'" >>config.optim
  fcflags_opt_dirlist=""


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_bigdft}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_bigdft="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for bigdft is ${fcflags_opt_bigdft}" >&5
$as_echo "$as_me: optimization for bigdft is ${fcflags_opt_bigdft}" >&6;}
      echo "fcflags_opt_bigdft='${fcflags_opt_bigdft}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} bigdft"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_hdf5}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_hdf5="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for hdf5 is ${fcflags_opt_hdf5}" >&5
$as_echo "$as_me: optimization for hdf5 is ${fcflags_opt_hdf5}" >&6;}
      echo "fcflags_opt_hdf5='${fcflags_opt_hdf5}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} hdf5"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_levmar}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_levmar="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for levmar is ${fcflags_opt_levmar}" >&5
$as_echo "$as_me: optimization for levmar is ${fcflags_opt_levmar}" >&6;}
      echo "fcflags_opt_levmar='${fcflags_opt_levmar}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} levmar"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_libpsml}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_libpsml="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for libpsml is ${fcflags_opt_libpsml}" >&5
$as_echo "$as_me: optimization for libpsml is ${fcflags_opt_libpsml}" >&6;}
      echo "fcflags_opt_libpsml='${fcflags_opt_libpsml}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} libpsml"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_libxc}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_libxc="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for libxc is ${fcflags_opt_libxc}" >&5
$as_echo "$as_me: optimization for libxc is ${fcflags_opt_libxc}" >&6;}
      echo "fcflags_opt_libxc='${fcflags_opt_libxc}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} libxc"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_libxml2}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_libxml2="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for libxml2 is ${fcflags_opt_libxml2}" >&5
$as_echo "$as_me: optimization for libxml2 is ${fcflags_opt_libxml2}" >&6;}
      echo "fcflags_opt_libxml2='${fcflags_opt_libxml2}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} libxml2"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_linalg}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_linalg="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for linalg is ${fcflags_opt_linalg}" >&5
$as_echo "$as_me: optimization for linalg is ${fcflags_opt_linalg}" >&6;}
      echo "fcflags_opt_linalg='${fcflags_opt_linalg}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} linalg"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_netcdf}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_netcdf="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for netcdf is ${fcflags_opt_netcdf}" >&5
$as_echo "$as_me: optimization for netcdf is ${fcflags_opt_netcdf}" >&6;}
      echo "fcflags_opt_netcdf='${fcflags_opt_netcdf}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} netcdf"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_netcdf_fortran}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_netcdf_fortran="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for netcdf_fortran is ${fcflags_opt_netcdf_fortran}" >&5
$as_echo "$as_me: optimization for netcdf_fortran is ${fcflags_opt_netcdf_fortran}" >&6;}
      echo "fcflags_opt_netcdf_fortran='${fcflags_opt_netcdf_fortran}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} netcdf_fortran"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_papi}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_papi="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for papi is ${fcflags_opt_papi}" >&5
$as_echo "$as_me: optimization for papi is ${fcflags_opt_papi}" >&6;}
      echo "fcflags_opt_papi='${fcflags_opt_papi}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} papi"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_triqs}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_triqs="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for triqs is ${fcflags_opt_triqs}" >&5
$as_echo "$as_me: optimization for triqs is ${fcflags_opt_triqs}" >&6;}
      echo "fcflags_opt_triqs='${fcflags_opt_triqs}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} triqs"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_wannier90}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_wannier90="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for wannier90 is ${fcflags_opt_wannier90}" >&5
$as_echo "$as_me: optimization for wannier90 is ${fcflags_opt_wannier90}" >&6;}
      echo "fcflags_opt_wannier90='${fcflags_opt_wannier90}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} wannier90"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_xmlf90}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_xmlf90="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for xmlf90 is ${fcflags_opt_xmlf90}" >&5
$as_echo "$as_me: optimization for xmlf90 is ${fcflags_opt_xmlf90}" >&6;}
      echo "fcflags_opt_xmlf90='${fcflags_opt_xmlf90}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} xmlf90"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_02_clib}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_02_clib="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 02_clib is ${fcflags_opt_02_clib}" >&5
$as_echo "$as_me: optimization for 02_clib is ${fcflags_opt_02_clib}" >&6;}
      echo "fcflags_opt_02_clib='${fcflags_opt_02_clib}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 02_clib"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_10_defs}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_10_defs="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 10_defs is ${fcflags_opt_10_defs}" >&5
$as_echo "$as_me: optimization for 10_defs is ${fcflags_opt_10_defs}" >&6;}
      echo "fcflags_opt_10_defs='${fcflags_opt_10_defs}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 10_defs"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_11_memory_mpi}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_11_memory_mpi="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 11_memory_mpi is ${fcflags_opt_11_memory_mpi}" >&5
$as_echo "$as_me: optimization for 11_memory_mpi is ${fcflags_opt_11_memory_mpi}" >&6;}
      echo "fcflags_opt_11_memory_mpi='${fcflags_opt_11_memory_mpi}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 11_memory_mpi"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_12_hide_mpi}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_12_hide_mpi="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 12_hide_mpi is ${fcflags_opt_12_hide_mpi}" >&5
$as_echo "$as_me: optimization for 12_hide_mpi is ${fcflags_opt_12_hide_mpi}" >&6;}
      echo "fcflags_opt_12_hide_mpi='${fcflags_opt_12_hide_mpi}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 12_hide_mpi"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_14_hidewrite}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_14_hidewrite="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 14_hidewrite is ${fcflags_opt_14_hidewrite}" >&5
$as_echo "$as_me: optimization for 14_hidewrite is ${fcflags_opt_14_hidewrite}" >&6;}
      echo "fcflags_opt_14_hidewrite='${fcflags_opt_14_hidewrite}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 14_hidewrite"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_16_hideleave}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_16_hideleave="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 16_hideleave is ${fcflags_opt_16_hideleave}" >&5
$as_echo "$as_me: optimization for 16_hideleave is ${fcflags_opt_16_hideleave}" >&6;}
      echo "fcflags_opt_16_hideleave='${fcflags_opt_16_hideleave}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 16_hideleave"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_16_kokkos_toolbox}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_16_kokkos_toolbox="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 16_kokkos_toolbox is ${fcflags_opt_16_kokkos_toolbox}" >&5
$as_echo "$as_me: optimization for 16_kokkos_toolbox is ${fcflags_opt_16_kokkos_toolbox}" >&6;}
      echo "fcflags_opt_16_kokkos_toolbox='${fcflags_opt_16_kokkos_toolbox}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 16_kokkos_toolbox"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_17_gpu_toolbox}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_17_gpu_toolbox="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 17_gpu_toolbox is ${fcflags_opt_17_gpu_toolbox}" >&5
$as_echo "$as_me: optimization for 17_gpu_toolbox is ${fcflags_opt_17_gpu_toolbox}" >&6;}
      echo "fcflags_opt_17_gpu_toolbox='${fcflags_opt_17_gpu_toolbox}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 17_gpu_toolbox"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_17_libtetra_ext}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_17_libtetra_ext="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 17_libtetra_ext is ${fcflags_opt_17_libtetra_ext}" >&5
$as_echo "$as_me: optimization for 17_libtetra_ext is ${fcflags_opt_17_libtetra_ext}" >&6;}
      echo "fcflags_opt_17_libtetra_ext='${fcflags_opt_17_libtetra_ext}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 17_libtetra_ext"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_17_minimax}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_17_minimax="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 17_minimax is ${fcflags_opt_17_minimax}" >&5
$as_echo "$as_me: optimization for 17_minimax is ${fcflags_opt_17_minimax}" >&6;}
      echo "fcflags_opt_17_minimax='${fcflags_opt_17_minimax}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 17_minimax"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_17_yaml_out}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_17_yaml_out="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 17_yaml_out is ${fcflags_opt_17_yaml_out}" >&5
$as_echo "$as_me: optimization for 17_yaml_out is ${fcflags_opt_17_yaml_out}" >&6;}
      echo "fcflags_opt_17_yaml_out='${fcflags_opt_17_yaml_out}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 17_yaml_out"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_18_timing}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_18_timing="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 18_timing is ${fcflags_opt_18_timing}" >&5
$as_echo "$as_me: optimization for 18_timing is ${fcflags_opt_18_timing}" >&6;}
      echo "fcflags_opt_18_timing='${fcflags_opt_18_timing}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 18_timing"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_21_hashfuncs}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_21_hashfuncs="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 21_hashfuncs is ${fcflags_opt_21_hashfuncs}" >&5
$as_echo "$as_me: optimization for 21_hashfuncs is ${fcflags_opt_21_hashfuncs}" >&6;}
      echo "fcflags_opt_21_hashfuncs='${fcflags_opt_21_hashfuncs}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 21_hashfuncs"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_27_toolbox_oop}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_27_toolbox_oop="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 27_toolbox_oop is ${fcflags_opt_27_toolbox_oop}" >&5
$as_echo "$as_me: optimization for 27_toolbox_oop is ${fcflags_opt_27_toolbox_oop}" >&6;}
      echo "fcflags_opt_27_toolbox_oop='${fcflags_opt_27_toolbox_oop}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 27_toolbox_oop"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_28_numeric_noabirule}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_28_numeric_noabirule="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 28_numeric_noabirule is ${fcflags_opt_28_numeric_noabirule}" >&5
$as_echo "$as_me: optimization for 28_numeric_noabirule is ${fcflags_opt_28_numeric_noabirule}" >&6;}
      echo "fcflags_opt_28_numeric_noabirule='${fcflags_opt_28_numeric_noabirule}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 28_numeric_noabirule"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_29_kpoints}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_29_kpoints="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 29_kpoints is ${fcflags_opt_29_kpoints}" >&5
$as_echo "$as_me: optimization for 29_kpoints is ${fcflags_opt_29_kpoints}" >&6;}
      echo "fcflags_opt_29_kpoints='${fcflags_opt_29_kpoints}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 29_kpoints"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_32_util}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_32_util="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 32_util is ${fcflags_opt_32_util}" >&5
$as_echo "$as_me: optimization for 32_util is ${fcflags_opt_32_util}" >&6;}
      echo "fcflags_opt_32_util='${fcflags_opt_32_util}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 32_util"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_33_xc_lowlevel}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_33_xc_lowlevel="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 33_xc_lowlevel is ${fcflags_opt_33_xc_lowlevel}" >&5
$as_echo "$as_me: optimization for 33_xc_lowlevel is ${fcflags_opt_33_xc_lowlevel}" >&6;}
      echo "fcflags_opt_33_xc_lowlevel='${fcflags_opt_33_xc_lowlevel}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 33_xc_lowlevel"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_39_libpaw}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_39_libpaw="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 39_libpaw is ${fcflags_opt_39_libpaw}" >&5
$as_echo "$as_me: optimization for 39_libpaw is ${fcflags_opt_39_libpaw}" >&6;}
      echo "fcflags_opt_39_libpaw='${fcflags_opt_39_libpaw}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 39_libpaw"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_41_geometry}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_41_geometry="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 41_geometry is ${fcflags_opt_41_geometry}" >&5
$as_echo "$as_me: optimization for 41_geometry is ${fcflags_opt_41_geometry}" >&6;}
      echo "fcflags_opt_41_geometry='${fcflags_opt_41_geometry}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 41_geometry"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_42_nlstrain}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_42_nlstrain="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 42_nlstrain is ${fcflags_opt_42_nlstrain}" >&5
$as_echo "$as_me: optimization for 42_nlstrain is ${fcflags_opt_42_nlstrain}" >&6;}
      echo "fcflags_opt_42_nlstrain='${fcflags_opt_42_nlstrain}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 42_nlstrain"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_42_parser}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_42_parser="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 42_parser is ${fcflags_opt_42_parser}" >&5
$as_echo "$as_me: optimization for 42_parser is ${fcflags_opt_42_parser}" >&6;}
      echo "fcflags_opt_42_parser='${fcflags_opt_42_parser}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 42_parser"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_43_ptgroups}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_43_ptgroups="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 43_ptgroups is ${fcflags_opt_43_ptgroups}" >&5
$as_echo "$as_me: optimization for 43_ptgroups is ${fcflags_opt_43_ptgroups}" >&6;}
      echo "fcflags_opt_43_ptgroups='${fcflags_opt_43_ptgroups}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 43_ptgroups"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_43_wvl_wrappers}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_43_wvl_wrappers="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 43_wvl_wrappers is ${fcflags_opt_43_wvl_wrappers}" >&5
$as_echo "$as_me: optimization for 43_wvl_wrappers is ${fcflags_opt_43_wvl_wrappers}" >&6;}
      echo "fcflags_opt_43_wvl_wrappers='${fcflags_opt_43_wvl_wrappers}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 43_wvl_wrappers"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_44_abitools}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_44_abitools="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 44_abitools is ${fcflags_opt_44_abitools}" >&5
$as_echo "$as_me: optimization for 44_abitools is ${fcflags_opt_44_abitools}" >&6;}
      echo "fcflags_opt_44_abitools='${fcflags_opt_44_abitools}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 44_abitools"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_44_abitypes_defs}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_44_abitypes_defs="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 44_abitypes_defs is ${fcflags_opt_44_abitypes_defs}" >&5
$as_echo "$as_me: optimization for 44_abitypes_defs is ${fcflags_opt_44_abitypes_defs}" >&6;}
      echo "fcflags_opt_44_abitypes_defs='${fcflags_opt_44_abitypes_defs}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 44_abitypes_defs"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_44_manage_kokkos}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_44_manage_kokkos="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 44_manage_kokkos is ${fcflags_opt_44_manage_kokkos}" >&5
$as_echo "$as_me: optimization for 44_manage_kokkos is ${fcflags_opt_44_manage_kokkos}" >&6;}
      echo "fcflags_opt_44_manage_kokkos='${fcflags_opt_44_manage_kokkos}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 44_manage_kokkos"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_45_geomoptim}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_45_geomoptim="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 45_geomoptim is ${fcflags_opt_45_geomoptim}" >&5
$as_echo "$as_me: optimization for 45_geomoptim is ${fcflags_opt_45_geomoptim}" >&6;}
      echo "fcflags_opt_45_geomoptim='${fcflags_opt_45_geomoptim}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 45_geomoptim"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_45_xgTools}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_45_xgTools="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 45_xgTools is ${fcflags_opt_45_xgTools}" >&5
$as_echo "$as_me: optimization for 45_xgTools is ${fcflags_opt_45_xgTools}" >&6;}
      echo "fcflags_opt_45_xgTools='${fcflags_opt_45_xgTools}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 45_xgTools"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_46_ghc_omp}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_46_ghc_omp="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 46_ghc_omp is ${fcflags_opt_46_ghc_omp}" >&5
$as_echo "$as_me: optimization for 46_ghc_omp is ${fcflags_opt_46_ghc_omp}" >&6;}
      echo "fcflags_opt_46_ghc_omp='${fcflags_opt_46_ghc_omp}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 46_ghc_omp"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_46_manage_cuda}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_46_manage_cuda="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 46_manage_cuda is ${fcflags_opt_46_manage_cuda}" >&5
$as_echo "$as_me: optimization for 46_manage_cuda is ${fcflags_opt_46_manage_cuda}" >&6;}
      echo "fcflags_opt_46_manage_cuda='${fcflags_opt_46_manage_cuda}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 46_manage_cuda"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_48_diago}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_48_diago="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 48_diago is ${fcflags_opt_48_diago}" >&5
$as_echo "$as_me: optimization for 48_diago is ${fcflags_opt_48_diago}" >&6;}
      echo "fcflags_opt_48_diago='${fcflags_opt_48_diago}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 48_diago"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_49_gw_toolbox_oop}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_49_gw_toolbox_oop="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 49_gw_toolbox_oop is ${fcflags_opt_49_gw_toolbox_oop}" >&5
$as_echo "$as_me: optimization for 49_gw_toolbox_oop is ${fcflags_opt_49_gw_toolbox_oop}" >&6;}
      echo "fcflags_opt_49_gw_toolbox_oop='${fcflags_opt_49_gw_toolbox_oop}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 49_gw_toolbox_oop"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_51_manage_mpi}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_51_manage_mpi="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 51_manage_mpi is ${fcflags_opt_51_manage_mpi}" >&5
$as_echo "$as_me: optimization for 51_manage_mpi is ${fcflags_opt_51_manage_mpi}" >&6;}
      echo "fcflags_opt_51_manage_mpi='${fcflags_opt_51_manage_mpi}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 51_manage_mpi"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_52_fft_mpi_noabirule}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_52_fft_mpi_noabirule="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 52_fft_mpi_noabirule is ${fcflags_opt_52_fft_mpi_noabirule}" >&5
$as_echo "$as_me: optimization for 52_fft_mpi_noabirule is ${fcflags_opt_52_fft_mpi_noabirule}" >&6;}
      echo "fcflags_opt_52_fft_mpi_noabirule='${fcflags_opt_52_fft_mpi_noabirule}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 52_fft_mpi_noabirule"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_53_ffts}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_53_ffts="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 53_ffts is ${fcflags_opt_53_ffts}" >&5
$as_echo "$as_me: optimization for 53_ffts is ${fcflags_opt_53_ffts}" >&6;}
      echo "fcflags_opt_53_ffts='${fcflags_opt_53_ffts}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 53_ffts"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_54_spacepar}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_54_spacepar="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 54_spacepar is ${fcflags_opt_54_spacepar}" >&5
$as_echo "$as_me: optimization for 54_spacepar is ${fcflags_opt_54_spacepar}" >&6;}
      echo "fcflags_opt_54_spacepar='${fcflags_opt_54_spacepar}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 54_spacepar"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_55_abiutil}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_55_abiutil="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 55_abiutil is ${fcflags_opt_55_abiutil}" >&5
$as_echo "$as_me: optimization for 55_abiutil is ${fcflags_opt_55_abiutil}" >&6;}
      echo "fcflags_opt_55_abiutil='${fcflags_opt_55_abiutil}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 55_abiutil"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_56_io_mpi}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_56_io_mpi="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 56_io_mpi is ${fcflags_opt_56_io_mpi}" >&5
$as_echo "$as_me: optimization for 56_io_mpi is ${fcflags_opt_56_io_mpi}" >&6;}
      echo "fcflags_opt_56_io_mpi='${fcflags_opt_56_io_mpi}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 56_io_mpi"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_56_mixing}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_56_mixing="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 56_mixing is ${fcflags_opt_56_mixing}" >&5
$as_echo "$as_me: optimization for 56_mixing is ${fcflags_opt_56_mixing}" >&6;}
      echo "fcflags_opt_56_mixing='${fcflags_opt_56_mixing}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 56_mixing"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_56_recipspace}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_56_recipspace="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 56_recipspace is ${fcflags_opt_56_recipspace}" >&5
$as_echo "$as_me: optimization for 56_recipspace is ${fcflags_opt_56_recipspace}" >&6;}
      echo "fcflags_opt_56_recipspace='${fcflags_opt_56_recipspace}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 56_recipspace"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_56_xc}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_56_xc="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 56_xc is ${fcflags_opt_56_xc}" >&5
$as_echo "$as_me: optimization for 56_xc is ${fcflags_opt_56_xc}" >&6;}
      echo "fcflags_opt_56_xc='${fcflags_opt_56_xc}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 56_xc"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_57_iopsp_parser}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_57_iopsp_parser="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 57_iopsp_parser is ${fcflags_opt_57_iopsp_parser}" >&5
$as_echo "$as_me: optimization for 57_iopsp_parser is ${fcflags_opt_57_iopsp_parser}" >&6;}
      echo "fcflags_opt_57_iopsp_parser='${fcflags_opt_57_iopsp_parser}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 57_iopsp_parser"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_57_iovars}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_57_iovars="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 57_iovars is ${fcflags_opt_57_iovars}" >&5
$as_echo "$as_me: optimization for 57_iovars is ${fcflags_opt_57_iovars}" >&6;}
      echo "fcflags_opt_57_iovars='${fcflags_opt_57_iovars}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 57_iovars"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_61_occeig}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_61_occeig="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 61_occeig is ${fcflags_opt_61_occeig}" >&5
$as_echo "$as_me: optimization for 61_occeig is ${fcflags_opt_61_occeig}" >&6;}
      echo "fcflags_opt_61_occeig='${fcflags_opt_61_occeig}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 61_occeig"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_62_cg_noabirule}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_62_cg_noabirule="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 62_cg_noabirule is ${fcflags_opt_62_cg_noabirule}" >&5
$as_echo "$as_me: optimization for 62_cg_noabirule is ${fcflags_opt_62_cg_noabirule}" >&6;}
      echo "fcflags_opt_62_cg_noabirule='${fcflags_opt_62_cg_noabirule}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 62_cg_noabirule"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_62_ctqmc}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_62_ctqmc="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 62_ctqmc is ${fcflags_opt_62_ctqmc}" >&5
$as_echo "$as_me: optimization for 62_ctqmc is ${fcflags_opt_62_ctqmc}" >&6;}
      echo "fcflags_opt_62_ctqmc='${fcflags_opt_62_ctqmc}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 62_ctqmc"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_62_iowfdenpot}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_62_iowfdenpot="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 62_iowfdenpot is ${fcflags_opt_62_iowfdenpot}" >&5
$as_echo "$as_me: optimization for 62_iowfdenpot is ${fcflags_opt_62_iowfdenpot}" >&6;}
      echo "fcflags_opt_62_iowfdenpot='${fcflags_opt_62_iowfdenpot}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 62_iowfdenpot"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_62_poisson}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_62_poisson="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 62_poisson is ${fcflags_opt_62_poisson}" >&5
$as_echo "$as_me: optimization for 62_poisson is ${fcflags_opt_62_poisson}" >&6;}
      echo "fcflags_opt_62_poisson='${fcflags_opt_62_poisson}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 62_poisson"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_62_wvl_wfs}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_62_wvl_wfs="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 62_wvl_wfs is ${fcflags_opt_62_wvl_wfs}" >&5
$as_echo "$as_me: optimization for 62_wvl_wfs is ${fcflags_opt_62_wvl_wfs}" >&6;}
      echo "fcflags_opt_62_wvl_wfs='${fcflags_opt_62_wvl_wfs}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 62_wvl_wfs"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_64_psp}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_64_psp="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 64_psp is ${fcflags_opt_64_psp}" >&5
$as_echo "$as_me: optimization for 64_psp is ${fcflags_opt_64_psp}" >&6;}
      echo "fcflags_opt_64_psp='${fcflags_opt_64_psp}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 64_psp"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_65_lotf_base}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_65_lotf_base="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 65_lotf_base is ${fcflags_opt_65_lotf_base}" >&5
$as_echo "$as_me: optimization for 65_lotf_base is ${fcflags_opt_65_lotf_base}" >&6;}
      echo "fcflags_opt_65_lotf_base='${fcflags_opt_65_lotf_base}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 65_lotf_base"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_65_paw}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_65_paw="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 65_paw is ${fcflags_opt_65_paw}" >&5
$as_echo "$as_me: optimization for 65_paw is ${fcflags_opt_65_paw}" >&6;}
      echo "fcflags_opt_65_paw='${fcflags_opt_65_paw}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 65_paw"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_66_nonlocal}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_66_nonlocal="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 66_nonlocal is ${fcflags_opt_66_nonlocal}" >&5
$as_echo "$as_me: optimization for 66_nonlocal is ${fcflags_opt_66_nonlocal}" >&6;}
      echo "fcflags_opt_66_nonlocal='${fcflags_opt_66_nonlocal}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 66_nonlocal"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_66_vdwxc}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_66_vdwxc="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 66_vdwxc is ${fcflags_opt_66_vdwxc}" >&5
$as_echo "$as_me: optimization for 66_vdwxc is ${fcflags_opt_66_vdwxc}" >&6;}
      echo "fcflags_opt_66_vdwxc='${fcflags_opt_66_vdwxc}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 66_vdwxc"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_66_wfs}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_66_wfs="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 66_wfs is ${fcflags_opt_66_wfs}" >&5
$as_echo "$as_me: optimization for 66_wfs is ${fcflags_opt_66_wfs}" >&6;}
      echo "fcflags_opt_66_wfs='${fcflags_opt_66_wfs}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 66_wfs"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_67_common}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_67_common="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 67_common is ${fcflags_opt_67_common}" >&5
$as_echo "$as_me: optimization for 67_common is ${fcflags_opt_67_common}" >&6;}
      echo "fcflags_opt_67_common='${fcflags_opt_67_common}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 67_common"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_67_python_invocation_ext}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_67_python_invocation_ext="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 67_python_invocation_ext is ${fcflags_opt_67_python_invocation_ext}" >&5
$as_echo "$as_me: optimization for 67_python_invocation_ext is ${fcflags_opt_67_python_invocation_ext}" >&6;}
      echo "fcflags_opt_67_python_invocation_ext='${fcflags_opt_67_python_invocation_ext}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 67_python_invocation_ext"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_67_triqs_ext}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_67_triqs_ext="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 67_triqs_ext is ${fcflags_opt_67_triqs_ext}" >&5
$as_echo "$as_me: optimization for 67_triqs_ext is ${fcflags_opt_67_triqs_ext}" >&6;}
      echo "fcflags_opt_67_triqs_ext='${fcflags_opt_67_triqs_ext}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 67_triqs_ext"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_68_dmft}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_68_dmft="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 68_dmft is ${fcflags_opt_68_dmft}" >&5
$as_echo "$as_me: optimization for 68_dmft is ${fcflags_opt_68_dmft}" >&6;}
      echo "fcflags_opt_68_dmft='${fcflags_opt_68_dmft}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 68_dmft"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_68_lotf}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_68_lotf="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 68_lotf is ${fcflags_opt_68_lotf}" >&5
$as_echo "$as_me: optimization for 68_lotf is ${fcflags_opt_68_lotf}" >&6;}
      echo "fcflags_opt_68_lotf='${fcflags_opt_68_lotf}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 68_lotf"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_68_recursion}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_68_recursion="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 68_recursion is ${fcflags_opt_68_recursion}" >&5
$as_echo "$as_me: optimization for 68_recursion is ${fcflags_opt_68_recursion}" >&6;}
      echo "fcflags_opt_68_recursion='${fcflags_opt_68_recursion}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 68_recursion"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_68_rsprc}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_68_rsprc="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 68_rsprc is ${fcflags_opt_68_rsprc}" >&5
$as_echo "$as_me: optimization for 68_rsprc is ${fcflags_opt_68_rsprc}" >&6;}
      echo "fcflags_opt_68_rsprc='${fcflags_opt_68_rsprc}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 68_rsprc"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_69_wfdesc}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_69_wfdesc="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 69_wfdesc is ${fcflags_opt_69_wfdesc}" >&5
$as_echo "$as_me: optimization for 69_wfdesc is ${fcflags_opt_69_wfdesc}" >&6;}
      echo "fcflags_opt_69_wfdesc='${fcflags_opt_69_wfdesc}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 69_wfdesc"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_70_gw}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_70_gw="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 70_gw is ${fcflags_opt_70_gw}" >&5
$as_echo "$as_me: optimization for 70_gw is ${fcflags_opt_70_gw}" >&6;}
      echo "fcflags_opt_70_gw='${fcflags_opt_70_gw}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 70_gw"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_71_bse}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_71_bse="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 71_bse is ${fcflags_opt_71_bse}" >&5
$as_echo "$as_me: optimization for 71_bse is ${fcflags_opt_71_bse}" >&6;}
      echo "fcflags_opt_71_bse='${fcflags_opt_71_bse}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 71_bse"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_71_wannier}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_71_wannier="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 71_wannier is ${fcflags_opt_71_wannier}" >&5
$as_echo "$as_me: optimization for 71_wannier is ${fcflags_opt_71_wannier}" >&6;}
      echo "fcflags_opt_71_wannier='${fcflags_opt_71_wannier}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 71_wannier"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_72_response}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_72_response="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 72_response is ${fcflags_opt_72_response}" >&5
$as_echo "$as_me: optimization for 72_response is ${fcflags_opt_72_response}" >&6;}
      echo "fcflags_opt_72_response='${fcflags_opt_72_response}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 72_response"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_77_ddb}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_77_ddb="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 77_ddb is ${fcflags_opt_77_ddb}" >&5
$as_echo "$as_me: optimization for 77_ddb is ${fcflags_opt_77_ddb}" >&6;}
      echo "fcflags_opt_77_ddb='${fcflags_opt_77_ddb}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 77_ddb"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_77_suscep}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_77_suscep="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 77_suscep is ${fcflags_opt_77_suscep}" >&5
$as_echo "$as_me: optimization for 77_suscep is ${fcflags_opt_77_suscep}" >&6;}
      echo "fcflags_opt_77_suscep='${fcflags_opt_77_suscep}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 77_suscep"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_78_effpot}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_78_effpot="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 78_effpot is ${fcflags_opt_78_effpot}" >&5
$as_echo "$as_me: optimization for 78_effpot is ${fcflags_opt_78_effpot}" >&6;}
      echo "fcflags_opt_78_effpot='${fcflags_opt_78_effpot}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 78_effpot"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_78_eph}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_78_eph="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 78_eph is ${fcflags_opt_78_eph}" >&5
$as_echo "$as_me: optimization for 78_eph is ${fcflags_opt_78_eph}" >&6;}
      echo "fcflags_opt_78_eph='${fcflags_opt_78_eph}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 78_eph"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_79_seqpar_mpi}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_79_seqpar_mpi="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 79_seqpar_mpi is ${fcflags_opt_79_seqpar_mpi}" >&5
$as_echo "$as_me: optimization for 79_seqpar_mpi is ${fcflags_opt_79_seqpar_mpi}" >&6;}
      echo "fcflags_opt_79_seqpar_mpi='${fcflags_opt_79_seqpar_mpi}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 79_seqpar_mpi"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_80_rttddft}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_80_rttddft="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 80_rttddft is ${fcflags_opt_80_rttddft}" >&5
$as_echo "$as_me: optimization for 80_rttddft is ${fcflags_opt_80_rttddft}" >&6;}
      echo "fcflags_opt_80_rttddft='${fcflags_opt_80_rttddft}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 80_rttddft"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_80_tdep}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_80_tdep="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 80_tdep is ${fcflags_opt_80_tdep}" >&5
$as_echo "$as_me: optimization for 80_tdep is ${fcflags_opt_80_tdep}" >&6;}
      echo "fcflags_opt_80_tdep='${fcflags_opt_80_tdep}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 80_tdep"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_94_scfcv}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_94_scfcv="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 94_scfcv is ${fcflags_opt_94_scfcv}" >&5
$as_echo "$as_me: optimization for 94_scfcv is ${fcflags_opt_94_scfcv}" >&6;}
      echo "fcflags_opt_94_scfcv='${fcflags_opt_94_scfcv}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 94_scfcv"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_95_drive}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_95_drive="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 95_drive is ${fcflags_opt_95_drive}" >&5
$as_echo "$as_me: optimization for 95_drive is ${fcflags_opt_95_drive}" >&6;}
      echo "fcflags_opt_95_drive='${fcflags_opt_95_drive}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 95_drive"
    fi
  fi


    if test "${FCFLAGS}" = ""; then
    if test "${fcflags_opt_98_main}" = "" -o "${enable_optim}" = "no"; then
      fcflags_opt_98_main="${fcflags_opt_default}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: optimization for 98_main is ${fcflags_opt_98_main}" >&5
$as_echo "$as_me: optimization for 98_main is ${fcflags_opt_98_main}" >&6;}
      echo "fcflags_opt_98_main='${fcflags_opt_98_main}'" >>config.optim
      fcflags_opt_dirlist="${fcflags_opt_dirlist} 98_main"
    fi
  fi


  echo "fcflags_opt_dirlist='${fcflags_opt_dirlist}'" >>config.optim


# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #

#
# Save configuration
#



  abi_sec_title="Build flags"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# Set-up target and binary package names
# Note: requires knowledge of Fortran compiler

    abi_target_os=`echo ${target_os} | sed -e 's/-.*//'`

  ABINIT_TARGET="${target_cpu}_${abi_target_os}_${abi_fc_vendor}${abi_fc_version}"

cat >>confdefs.h <<_ACEOF
#define ABINIT_TARGET "${ABINIT_TARGET}"
_ACEOF



ABINIT_BINARY_PACKAGE="${PACKAGE}-${VERSION}_${ABINIT_TARGET}"


# Preserve environment


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"



# Look for archiver
if test "${AR}" = ""; then
  for ac_prog in ar xiar
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_prog_AR+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$AR"; then
  ac_cv_prog_AR="$AR" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_AR="$ac_prog"
    $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

fi
fi
AR=$ac_cv_prog_AR
if test -n "$AR"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
$as_echo "$AR" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$AR" && break
done

fi

# Set archiver command flag
test "${ARFLAGS_CMD}" = "" && ARFLAGS_CMD="rc"


# Look for ranlib
if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; 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_prog_RANLIB+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
    $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

fi
fi
RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
$as_echo "$RANLIB" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


fi
if test -z "$ac_cv_prog_RANLIB"; then
  ac_ct_RANLIB=$RANLIB
  # Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; 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_prog_ac_ct_RANLIB+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ac_ct_RANLIB"; then
  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_ac_ct_RANLIB="ranlib"
    $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

fi
fi
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
if test -n "$ac_ct_RANLIB"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
$as_echo "$ac_ct_RANLIB" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

  if test "x$ac_ct_RANLIB" = x; then
    RANLIB=":"
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
    RANLIB=$ac_ct_RANLIB
  fi
else
  RANLIB="$ac_cv_prog_RANLIB"
fi


# Restore back compile flags
CFLAGS="${abi_env_CFLAGS}"
CXXFLAGS="${abi_env_CXXFLAGS}"
FCFLAGS="${abi_env_FCFLAGS}"

# We want to be able access the archiver from anywhere



# Report the use of libtool-related options




# Final adjustments for library archiver
test "${ARFLAGS}" = "" && \
  ARFLAGS="${ARFLAGS_DEBUG} ${ARFLAGS_OPTIM} ${ARFLAGS_HINTS} ${ARFLAGS_EXTRA} ${ARFLAGS_CMD}"

# Final adjustments for C
test "${CFLAGS}" = "" && \
  CFLAGS="${CFLAGS_DEBUG} ${CFLAGS_OPTIM} ${CFLAGS_HINTS} ${CFLAGS_EXTRA}"
test "${CC_LDFLAGS}" = "" && \
  CC_LDFLAGS="${CC_LDFLAGS_DEBUG} ${CC_LDFLAGS_OPTIM} ${CC_LDFLAGS_HINTS} ${CC_LDFLAGS_EXTRA}"
test "${CC_LIBS}" = "" && \
  CC_LIBS="${CC_LIBS_DEBUG} ${CC_LIBS_OPTIM} ${CC_LIBS_HINTS} ${CC_LIBS_EXTRA}"

# Final adjustments for C++
test "${CXXFLAGS}" = "" && \
  CXXFLAGS="${CXXFLAGS_DEBUG} ${CXXFLAGS_OPTIM} ${CXXFLAGS_HINTS} ${CXXFLAGS_EXTRA}"
test "${CXX_LDFLAGS}" = "" && \
  CXX_LDFLAGS="${CXX_LDFLAGS_DEBUG} ${CXX_LDFLAGS_OPTIM} ${CXX_LDFLAGS_HINTS} ${CXX_LDFLAGS_EXTRA}"
test "${CXX_LIBS}" = "" && \
  CXX_LIBS="${CXX_LIBS_DEBUG} ${CXX_LIBS_OPTIM} ${CXX_LIBS_HINTS} ${CXX_LIBS_EXTRA}"

# Final adjustments for Fortran
# Note: FCFLAGS_OPTIM must not be included (per-directory optimizations)
test "${FCFLAGS}" = "" && \
  FCFLAGS="${FCFLAGS_DEBUG} ${FCFLAGS_HINTS} ${FCFLAGS_OPENMP} ${FCFLAGS_OPENMP_OFFLOAD} ${FCFLAGS_EXTRA}"
test "${FC_LDFLAGS}" = "" && \
  FC_LDFLAGS="${FC_LDFLAGS_DEBUG} ${FC_LDFLAGS_OPTIM} ${FC_LDFLAGS_HINTS} ${FC_LDFLAGS_EXTRA}"
test "${FC_LIBS}" = "" && \
  FC_LIBS="${FC_LIBS_DEBUG} ${FC_LIBS_OPTIM} ${FC_LIBS_HINTS} ${FC_LIBS_EXTRA}"

# Final adjustments for preprocessors
test "${CPPFLAGS}" = "" && \
  CPPFLAGS="${CPPFLAGS_DEBUG} ${CPPFLAGS_OPTIM} ${CPPFLAGS_HINTS} ${CPPFLAGS_EXTRA}"
test "${XPPFLAGS}" = "" && \
  XPPFLAGS="${XPPFLAGS_DEBUG} ${XPPFLAGS_OPTIM} ${XPPFLAGS_HINTS} ${XPPFLAGS_EXTRA}"
test "${FPPFLAGS}" = "" -a "${abi_fc_wrap}" = "no" && \
  FPPFLAGS="${FPPFLAGS_DEBUG} ${FPPFLAGS_OPTIM} ${FPPFLAGS_HINTS} ${FPPFLAGS_EXTRA}"

# Determine Fortran link flags (FCLIBS)
# This is needed after FCFLAGS has been set as some compilers have extra
# libraries linked due to optimizations levels or OpenMP
# This step would be performed inside AC_FC_WRAPPERS but it fails due to a mischievous
# double-quote in FCLIBS when using Cray compiler, so we trim it out in that specific case.
ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get verbose linking output from $FC" >&5
$as_echo_n "checking how to get verbose linking output from $FC... " >&6; }
if ${ac_cv_prog_fc_v+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat > conftest.$ac_ext <<_ACEOF
      program main

      end
_ACEOF
if ac_fn_fc_try_compile "$LINENO"; then :
  ac_cv_prog_fc_v=
# Try some options frequently used verbose output
for ac_verb in -v -verbose --verbose -V -\#\#\#; do
  cat > conftest.$ac_ext <<_ACEOF
      program main

      end
_ACEOF

# Compile and link our simple test program by passing a flag (argument
# 1 to this macro) to the Fortran compiler in order to get
# "verbose" output that we can then parse for the Fortran linker
# flags.
ac_save_FCFLAGS=$FCFLAGS
FCFLAGS="$FCFLAGS $ac_verb"
eval "set x $ac_link"
shift
$as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5
# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH,
# LIBRARY_PATH; skip all such settings.
ac_fc_v_output=`eval $ac_link 5>&1 2>&1 |
  sed '/^Driving:/d; /^Configured with:/d;
      '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"`
$as_echo "$ac_fc_v_output" >&5
FCFLAGS=$ac_save_FCFLAGS

rm -rf conftest*

# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
# /foo, /bar, and /baz are search directories for the Fortran linker.
# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
ac_fc_v_output="`echo $ac_fc_v_output |
	grep 'LPATH is:' |
	sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_fc_v_output"

# FIXME: we keep getting bitten by quoted arguments; a more general fix
#        that detects unbalanced quotes in FLIBS should be implemented
#        and (ugh) tested at some point.
case $ac_fc_v_output in
  # With xlf replace commas with spaces,
  # and remove "-link" and closing parenthesis.
  *xlfentry*)
    ac_fc_v_output=`echo $ac_fc_v_output |
      sed '
        s/,/ /g
        s/ -link / /g
        s/) *$//
      '
    ` ;;

  # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
  # $LIBS confuse us, and the libraries appear later in the output anyway).
  *mGLOB_options_string*)
    ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;;

  # Portland Group compiler has singly- or doubly-quoted -cmdline argument
  # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4.
  # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2".
  *-cmdline\ * | *-ignore\ * | *-def\ *)
    ac_fc_v_output=`echo $ac_fc_v_output | sed "\
	s/-cmdline  *'[^']*'/ /g; s/-cmdline  *\"[^\"]*\"/ /g
	s/-ignore  *'[^']*'/ /g; s/-ignore  *\"[^\"]*\"/ /g
	s/-def  *'[^']*'/ /g; s/-def  *\"[^\"]*\"/ /g"` ;;

  # If we are using fort77 (the f2c wrapper) then filter output and delete quotes.
  *fort77*f2c*gcc*)
    ac_fc_v_output=`echo "$ac_fc_v_output" | sed -n '
        /:[	 ]\+Running[	 ]\{1,\}"gcc"/{
          /"-c"/d
          /[.]c"*/d
          s/^.*"gcc"/"gcc"/
          s/"//gp
        }'` ;;

  # If we are using Cray Fortran then delete quotes.
  *cft90*)
    ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"//g'` ;;
esac


  # look for -l* and *.a constructs in the output
  for ac_arg in $ac_fc_v_output; do
     case $ac_arg in
	[\\/]*.a | ?:[\\/]*.a | -[lLRu]*)
	  ac_cv_prog_fc_v=$ac_verb
	  break 2 ;;
     esac
  done
done
if test -z "$ac_cv_prog_fc_v"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine how to obtain linking information from $FC" >&5
$as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $FC" >&2;}
fi
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compilation failed" >&5
$as_echo "$as_me: WARNING: compilation failed" >&2;}
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_v" >&5
$as_echo "$ac_cv_prog_fc_v" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran libraries of $FC" >&5
$as_echo_n "checking for Fortran libraries of $FC... " >&6; }
if ${ac_cv_fc_libs+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test "x$FCLIBS" != "x"; then
  ac_cv_fc_libs="$FCLIBS" # Let the user override the test.
else

cat > conftest.$ac_ext <<_ACEOF
      program main

      end
_ACEOF

# Compile and link our simple test program by passing a flag (argument
# 1 to this macro) to the Fortran compiler in order to get
# "verbose" output that we can then parse for the Fortran linker
# flags.
ac_save_FCFLAGS=$FCFLAGS
FCFLAGS="$FCFLAGS $ac_cv_prog_fc_v"
eval "set x $ac_link"
shift
$as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5
# gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH,
# LIBRARY_PATH; skip all such settings.
ac_fc_v_output=`eval $ac_link 5>&1 2>&1 |
  sed '/^Driving:/d; /^Configured with:/d;
      '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"`
$as_echo "$ac_fc_v_output" >&5
FCFLAGS=$ac_save_FCFLAGS

rm -rf conftest*

# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
# /foo, /bar, and /baz are search directories for the Fortran linker.
# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
ac_fc_v_output="`echo $ac_fc_v_output |
	grep 'LPATH is:' |
	sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_fc_v_output"

# FIXME: we keep getting bitten by quoted arguments; a more general fix
#        that detects unbalanced quotes in FLIBS should be implemented
#        and (ugh) tested at some point.
case $ac_fc_v_output in
  # With xlf replace commas with spaces,
  # and remove "-link" and closing parenthesis.
  *xlfentry*)
    ac_fc_v_output=`echo $ac_fc_v_output |
      sed '
        s/,/ /g
        s/ -link / /g
        s/) *$//
      '
    ` ;;

  # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
  # $LIBS confuse us, and the libraries appear later in the output anyway).
  *mGLOB_options_string*)
    ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;;

  # Portland Group compiler has singly- or doubly-quoted -cmdline argument
  # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4.
  # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2".
  *-cmdline\ * | *-ignore\ * | *-def\ *)
    ac_fc_v_output=`echo $ac_fc_v_output | sed "\
	s/-cmdline  *'[^']*'/ /g; s/-cmdline  *\"[^\"]*\"/ /g
	s/-ignore  *'[^']*'/ /g; s/-ignore  *\"[^\"]*\"/ /g
	s/-def  *'[^']*'/ /g; s/-def  *\"[^\"]*\"/ /g"` ;;

  # If we are using fort77 (the f2c wrapper) then filter output and delete quotes.
  *fort77*f2c*gcc*)
    ac_fc_v_output=`echo "$ac_fc_v_output" | sed -n '
        /:[	 ]\+Running[	 ]\{1,\}"gcc"/{
          /"-c"/d
          /[.]c"*/d
          s/^.*"gcc"/"gcc"/
          s/"//gp
        }'` ;;

  # If we are using Cray Fortran then delete quotes.
  *cft90*)
    ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"//g'` ;;
esac



ac_cv_fc_libs=

# Save positional arguments (if any)
ac_save_positional="$@"

set X $ac_fc_v_output
while test $# != 1; do
  shift
  ac_arg=$1
  case $ac_arg in
	[\\/]*.a | ?:[\\/]*.a)
	    ac_exists=false
  for ac_i in $ac_cv_fc_libs; do
    if test x"$ac_arg" = x"$ac_i"; then
      ac_exists=true
      break
    fi
  done

  if test x"$ac_exists" = xtrue; then :

else
  ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg"
fi
	  ;;
	-bI:*)
	    ac_exists=false
  for ac_i in $ac_cv_fc_libs; do
    if test x"$ac_arg" = x"$ac_i"; then
      ac_exists=true
      break
    fi
  done

  if test x"$ac_exists" = xtrue; then :

else
  if test "$ac_compiler_gnu" = yes; then
  for ac_link_opt in $ac_arg; do
    ac_cv_fc_libs="$ac_cv_fc_libs -Xlinker $ac_link_opt"
  done
else
  ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg"
fi
fi
	  ;;
	  # Ignore these flags.
	-lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -little \
	  |-LANG:=* | -LIST:* | -LNO:* | -link)
	  ;;
	-lkernel32)
	  case $host_os in
	  *cygwin*) ;;
	  *) ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg"
	    ;;
	  esac
	  ;;
	-[LRuYz])
	  # These flags, when seen by themselves, take an argument.
	  # We remove the space between option and argument and re-iterate
	  # unless we find an empty arg or a new option (starting with -)
	  case $2 in
	     "" | -*);;
	     *)
		ac_arg="$ac_arg$2"
		shift; shift
		set X $ac_arg "$@"
		;;
	  esac
	  ;;
	-YP,*)
	  for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
	      ac_exists=false
  for ac_i in $ac_cv_fc_libs; do
    if test x"$ac_j" = x"$ac_i"; then
      ac_exists=true
      break
    fi
  done

  if test x"$ac_exists" = xtrue; then :

else
  ac_arg="$ac_arg $ac_j"
			       ac_cv_fc_libs="$ac_cv_fc_libs $ac_j"
fi
	  done
	  ;;
	-[lLR]*)
	    ac_exists=false
  for ac_i in $ac_cv_fc_libs; do
    if test x"$ac_arg" = x"$ac_i"; then
      ac_exists=true
      break
    fi
  done

  if test x"$ac_exists" = xtrue; then :

else
  ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg"
fi
	  ;;
	-zallextract*| -zdefaultextract)
	  ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg"
	  ;;
	  # Ignore everything else.
  esac
done
# restore positional arguments
set X $ac_save_positional; shift

# We only consider "LD_RUN_PATH" on Solaris systems.  If this is seen,
# then we insist that the "run path" must be an absolute path (i.e. it
# must begin with a "/").
case `(uname -sr) 2>/dev/null` in
   "SunOS 5"*)
      ac_ld_run_path=`$as_echo "$ac_fc_v_output" |
			sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'`
      test "x$ac_ld_run_path" != x &&
	if test "$ac_compiler_gnu" = yes; then
  for ac_link_opt in $ac_ld_run_path; do
    ac_cv_fc_libs="$ac_cv_fc_libs -Xlinker $ac_link_opt"
  done
else
  ac_cv_fc_libs="$ac_cv_fc_libs $ac_ld_run_path"
fi
      ;;
esac
fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x"

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_libs" >&5
$as_echo "$ac_cv_fc_libs" >&6; }
FCLIBS="$ac_cv_fc_libs"


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 "${abi_fc_vendor}" = "cray"; then
  FCLIBS=`echo ${FCLIBS} | tr '"' ' '`
fi

# Determine Fortran-C name mangling scheme

ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dummy main to link with Fortran libraries" >&5
$as_echo_n "checking for dummy main to link with Fortran libraries... " >&6; }
if ${ac_cv_fc_dummy_main+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_fc_dm_save_LIBS=$LIBS
 LIBS="$LIBS $FCLIBS"
 ac_fortran_dm_var=FC_DUMMY_MAIN
 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

 # First, try linking without a dummy main:
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_fortran_dummy_main=none
else
  ac_cv_fortran_dummy_main=unknown
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext

 if test $ac_cv_fortran_dummy_main = unknown; then
   for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#define $ac_fortran_dm_var $ac_func
#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_fortran_dummy_main=$ac_func; break
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
   done
 fi
 ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
 ac_cv_fc_dummy_main=$ac_cv_fortran_dummy_main
 rm -rf conftest*
 LIBS=$ac_fc_dm_save_LIBS

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_dummy_main" >&5
$as_echo "$ac_cv_fc_dummy_main" >&6; }
FC_DUMMY_MAIN=$ac_cv_fc_dummy_main
if test "$FC_DUMMY_MAIN" != unknown; then :
  if test $FC_DUMMY_MAIN != none; then

cat >>confdefs.h <<_ACEOF
#define FC_DUMMY_MAIN $FC_DUMMY_MAIN
_ACEOF

  if test "x$ac_cv_fc_dummy_main" = "x$ac_cv_f77_dummy_main"; then

$as_echo "#define FC_DUMMY_MAIN_EQ_F77 1" >>confdefs.h

  fi
fi
else
  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "linking to Fortran libraries from C fails
See \`config.log' for more details" "$LINENO" 5; }
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

ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran name-mangling scheme" >&5
$as_echo_n "checking for Fortran name-mangling scheme... " >&6; }
if ${ac_cv_fc_mangling+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat > conftest.$ac_ext <<_ACEOF
      subroutine foobar()
      return
      end
      subroutine foo_bar()
      return
      end
_ACEOF
if ac_fn_fc_try_compile "$LINENO"; then :
  mv conftest.$ac_objext cfortran_test.$ac_objext

  ac_save_LIBS=$LIBS
  LIBS="cfortran_test.$ac_objext $LIBS $FCLIBS"

  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_success=no
  for ac_foobar in foobar FOOBAR; do
    for ac_underscore in "" "_"; do
      ac_func="$ac_foobar$ac_underscore"
      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 $ac_func ();
#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
return $ac_func ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_success=yes; break 2
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
    done
  done
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  if test "$ac_success" = "yes"; then
     case $ac_foobar in
	foobar)
	   ac_case=lower
	   ac_foo_bar=foo_bar
	   ;;
	FOOBAR)
	   ac_case=upper
	   ac_foo_bar=FOO_BAR
	   ;;
     esac

     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_success_extra=no
     for ac_extra in "" "_"; do
	ac_func="$ac_foo_bar$ac_underscore$ac_extra"
	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 $ac_func ();
#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
return $ac_func ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_success_extra=yes; break
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
     done
     ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

     if test "$ac_success_extra" = "yes"; then
	ac_cv_fc_mangling="$ac_case case"
	if test -z "$ac_underscore"; then
	   ac_cv_fc_mangling="$ac_cv_fc_mangling, no underscore"
	else
	   ac_cv_fc_mangling="$ac_cv_fc_mangling, underscore"
	fi
	if test -z "$ac_extra"; then
	   ac_cv_fc_mangling="$ac_cv_fc_mangling, no extra underscore"
	else
	   ac_cv_fc_mangling="$ac_cv_fc_mangling, extra underscore"
	fi
      else
	ac_cv_fc_mangling="unknown"
      fi
  else
     ac_cv_fc_mangling="unknown"
  fi

  LIBS=$ac_save_LIBS
  rm -rf conftest*
  rm -f cfortran_test*
else
  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compile a simple Fortran program
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_mangling" >&5
$as_echo "$ac_cv_fc_mangling" >&6; }

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_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
case $ac_cv_fc_mangling in
  "lower case, no underscore, no extra underscore")
	  $as_echo "#define FC_FUNC(name,NAME) name" >>confdefs.h

	  $as_echo "#define FC_FUNC_(name,NAME) name" >>confdefs.h
 ;;
  "lower case, no underscore, extra underscore")
	  $as_echo "#define FC_FUNC(name,NAME) name" >>confdefs.h

	  $as_echo "#define FC_FUNC_(name,NAME) name ## _" >>confdefs.h
 ;;
  "lower case, underscore, no extra underscore")
	  $as_echo "#define FC_FUNC(name,NAME) name ## _" >>confdefs.h

	  $as_echo "#define FC_FUNC_(name,NAME) name ## _" >>confdefs.h
 ;;
  "lower case, underscore, extra underscore")
	  $as_echo "#define FC_FUNC(name,NAME) name ## _" >>confdefs.h

	  $as_echo "#define FC_FUNC_(name,NAME) name ## __" >>confdefs.h
 ;;
  "upper case, no underscore, no extra underscore")
	  $as_echo "#define FC_FUNC(name,NAME) NAME" >>confdefs.h

	  $as_echo "#define FC_FUNC_(name,NAME) NAME" >>confdefs.h
 ;;
  "upper case, no underscore, extra underscore")
	  $as_echo "#define FC_FUNC(name,NAME) NAME" >>confdefs.h

	  $as_echo "#define FC_FUNC_(name,NAME) NAME ## _" >>confdefs.h
 ;;
  "upper case, underscore, no extra underscore")
	  $as_echo "#define FC_FUNC(name,NAME) NAME ## _" >>confdefs.h

	  $as_echo "#define FC_FUNC_(name,NAME) NAME ## _" >>confdefs.h
 ;;
  "upper case, underscore, extra underscore")
	  $as_echo "#define FC_FUNC(name,NAME) NAME ## _" >>confdefs.h

	  $as_echo "#define FC_FUNC_(name,NAME) NAME ## __" >>confdefs.h
 ;;
  *)
	  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown Fortran name-mangling scheme" >&5
$as_echo "$as_me: WARNING: unknown Fortran name-mangling scheme" >&2;}
	  ;;
esac

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


# FIXME: temporary workaround for Macs
if test "${abi_cpu_platform}" = "apple"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${abi_cpu_platform} is not able to handle full link information" >&5
$as_echo "$as_me: WARNING: ${abi_cpu_platform} is not able to handle full link information" >&2;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: static builds will fail" >&5
$as_echo "$as_me: WARNING: static builds will fail" >&2;}
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: static builds may be performed" >&5
$as_echo "$as_me: static builds may be performed" >&6;}
  FC_LIBS="${FC_LIBS} ${FCLIBS}"
fi

# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #

#
# Advanced language features
#

# Note: these tests have to be performed after the flags have been
#       saved.



  abi_sec_title="Advanced language features"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# Look for desired C features

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable assertions" >&5
$as_echo_n "checking whether to enable assertions... " >&6; }
  # Check whether --enable-assert was given.
if test "${enable_assert+set}" = set; then :
  enableval=$enable_assert; ac_enable_assert=$enableval
     if       test "x$enableval" = xno; then :

$as_echo "#define NDEBUG 1" >>confdefs.h

elif test "x$enableval" != xyes; then :
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-assert" >&5
$as_echo "$as_me: WARNING: invalid argument supplied to --enable-assert" >&2;}
	ac_enable_assert=yes
fi
else
  ac_enable_assert=yes
fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_enable_assert" >&5
$as_echo "$ac_enable_assert" >&6; }


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
$as_echo_n "checking for ANSI C header files... " >&6; }
if ${ac_cv_header_stdc+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_header_stdc=yes
else
  ac_cv_header_stdc=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

if test $ac_cv_header_stdc = yes; then
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <string.h>

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "memchr" >/dev/null 2>&1; then :

else
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <stdlib.h>

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "free" >/dev/null 2>&1; then :

else
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  if test "$cross_compiling" = yes; then :
  :
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <ctype.h>
#include <stdlib.h>
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#else
# define ISLOWER(c) \
		   (('a' <= (c) && (c) <= 'i') \
		     || ('j' <= (c) && (c) <= 'r') \
		     || ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif

#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int
main ()
{
  int i;
  for (i = 0; i < 256; i++)
    if (XOR (islower (i), ISLOWER (i))
	|| toupper (i) != TOUPPER (i))
      return 2;
  return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :

else
  ac_cv_header_stdc=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  conftest.$ac_objext conftest.beam conftest.$ac_ext
fi

fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
$as_echo "$ac_cv_header_stdc" >&6; }
if test $ac_cv_header_stdc = yes; then

$as_echo "#define STDC_HEADERS 1" >>confdefs.h

fi

# On IRIX 5.3, sys/types and inttypes.h are conflicting.
for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
		  inttypes.h stdint.h unistd.h
do :
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
  cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done



  # Explore compiler peculiarities

  # Look for standard headers

  for ac_header in stdio.h string.h termios.h unistd.h
do :
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
  cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done

  for ac_header in errno.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default"
if test "x$ac_cv_header_errno_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_ERRNO_H 1
_ACEOF

fi

done

  for ac_header in inttypes.h math.h stddef.h stdint.h
do :
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
  cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done

  for ac_header in mcheck.h time.h
do :
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
  cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done

  for ac_header in sys/ioctl.h sys/resource.h sys/stat.h sys/time.h sys/types.h
do :
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
  cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done


  # Look for malloc.h
  CPPFLAGS_MALLOC=""
  for ac_header in sys/malloc.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "sys/malloc.h" "ac_cv_header_sys_malloc_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_malloc_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_SYS_MALLOC_H 1
_ACEOF

fi

done

  for ac_header in malloc.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default"
if test "x$ac_cv_header_malloc_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_MALLOC_H 1
_ACEOF
 abi_hdr_malloc="yes"
else
  abi_hdr_malloc="no"
fi

done

  if test "${abi_hdr_malloc}" = "no"; then
    for ac_header in malloc/malloc.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "malloc/malloc.h" "ac_cv_header_malloc_malloc_h" "$ac_includes_default"
if test "x$ac_cv_header_malloc_malloc_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_MALLOC_MALLOC_H 1
_ACEOF
 abi_hdr_malloc="yes"
else
  abi_hdr_malloc="no"
fi

done

  fi


  # Init AC_MSG_CHECKING([for library functions])

    for ac_func in abort
do :
  ac_fn_c_check_func "$LINENO" "abort" "ac_cv_func_abort"
if test "x$ac_cv_func_abort" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_ABORT 1
_ACEOF

fi
done

  for ac_func in mallinfo
do :
  ac_fn_c_check_func "$LINENO" "mallinfo" "ac_cv_func_mallinfo"
if test "x$ac_cv_func_mallinfo" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_MALLINFO 1
_ACEOF

fi
done




  # Init AC_MSG_CHECKING([for C compiler characteristics])

  # The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5
$as_echo_n "checking size of char... " >&6; }
if ${ac_cv_sizeof_char+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_char" = yes; 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 77 "cannot compute sizeof (char)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_char=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5
$as_echo "$ac_cv_sizeof_char" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_CHAR $ac_cv_sizeof_char
_ACEOF


  # The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
$as_echo_n "checking size of short... " >&6; }
if ${ac_cv_sizeof_short+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_short" = yes; 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 77 "cannot compute sizeof (short)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_short=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5
$as_echo "$ac_cv_sizeof_short" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_SHORT $ac_cv_sizeof_short
_ACEOF


  # The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
$as_echo_n "checking size of int... " >&6; }
if ${ac_cv_sizeof_int+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_int" = yes; 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 77 "cannot compute sizeof (int)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_int=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
$as_echo "$ac_cv_sizeof_int" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_INT $ac_cv_sizeof_int
_ACEOF


  # The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
$as_echo_n "checking size of long... " >&6; }
if ${ac_cv_sizeof_long+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_long" = yes; 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 77 "cannot compute sizeof (long)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_long=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
$as_echo "$ac_cv_sizeof_long" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_LONG $ac_cv_sizeof_long
_ACEOF


  # The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5
$as_echo_n "checking size of long long... " >&6; }
if ${ac_cv_sizeof_long_long+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_long_long" = yes; 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 77 "cannot compute sizeof (long long)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_long_long=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5
$as_echo "$ac_cv_sizeof_long_long" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
_ACEOF


  # The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned int" >&5
$as_echo_n "checking size of unsigned int... " >&6; }
if ${ac_cv_sizeof_unsigned_int+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned int))" "ac_cv_sizeof_unsigned_int"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_unsigned_int" = yes; 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 77 "cannot compute sizeof (unsigned int)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_unsigned_int=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_int" >&5
$as_echo "$ac_cv_sizeof_unsigned_int" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_UNSIGNED_INT $ac_cv_sizeof_unsigned_int
_ACEOF


  # The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long" >&5
$as_echo_n "checking size of unsigned long... " >&6; }
if ${ac_cv_sizeof_unsigned_long+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long))" "ac_cv_sizeof_unsigned_long"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_unsigned_long" = yes; 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 77 "cannot compute sizeof (unsigned long)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_unsigned_long=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long" >&5
$as_echo "$ac_cv_sizeof_unsigned_long" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long
_ACEOF


  # The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long long" >&5
$as_echo_n "checking size of unsigned long long... " >&6; }
if ${ac_cv_sizeof_unsigned_long_long+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long long))" "ac_cv_sizeof_unsigned_long_long"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_unsigned_long_long" = yes; 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 77 "cannot compute sizeof (unsigned long long)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_unsigned_long_long=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long_long" >&5
$as_echo "$ac_cv_sizeof_unsigned_long_long" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_UNSIGNED_LONG_LONG $ac_cv_sizeof_unsigned_long_long
_ACEOF


  # The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5
$as_echo_n "checking size of float... " >&6; }
if ${ac_cv_sizeof_float+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))" "ac_cv_sizeof_float"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_float" = yes; 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 77 "cannot compute sizeof (float)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_float=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_float" >&5
$as_echo "$ac_cv_sizeof_float" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_FLOAT $ac_cv_sizeof_float
_ACEOF


  # The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5
$as_echo_n "checking size of double... " >&6; }
if ${ac_cv_sizeof_double+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_double" = yes; 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 77 "cannot compute sizeof (double)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_double=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5
$as_echo "$ac_cv_sizeof_double" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_DOUBLE $ac_cv_sizeof_double
_ACEOF


  # The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5
$as_echo_n "checking size of long double... " >&6; }
if ${ac_cv_sizeof_long_double+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_long_double" = yes; 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 77 "cannot compute sizeof (long double)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_long_double=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5
$as_echo "$ac_cv_sizeof_long_double" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double
_ACEOF


  # The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
$as_echo_n "checking size of size_t... " >&6; }
if ${ac_cv_sizeof_size_t+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_size_t" = yes; 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 77 "cannot compute sizeof (size_t)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_size_t=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
$as_echo "$ac_cv_sizeof_size_t" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
_ACEOF


  # The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ptrdiff_t" >&5
$as_echo_n "checking size of ptrdiff_t... " >&6; }
if ${ac_cv_sizeof_ptrdiff_t+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ptrdiff_t))" "ac_cv_sizeof_ptrdiff_t"        "$ac_includes_default"; then :

else
  if test "$ac_cv_type_ptrdiff_t" = yes; 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 77 "cannot compute sizeof (ptrdiff_t)
See \`config.log' for more details" "$LINENO" 5; }
   else
     ac_cv_sizeof_ptrdiff_t=0
   fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ptrdiff_t" >&5
$as_echo "$ac_cv_sizeof_ptrdiff_t" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_PTRDIFF_T $ac_cv_sizeof_ptrdiff_t
_ACEOF



  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
if ${ac_cv_c_const+:} false; then :
  $as_echo_n "(cached) " >&6
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

#ifndef __cplusplus
  /* Ultrix mips cc rejects this sort of thing.  */
  typedef int charset[2];
  const charset cs = { 0, 0 };
  /* SunOS 4.1.1 cc rejects this.  */
  char const *const *pcpcc;
  char **ppc;
  /* NEC SVR4.0.2 mips cc rejects this.  */
  struct point {int x, y;};
  static struct point const zero = {0,0};
  /* AIX XL C 1.02.0.0 rejects this.
     It does not let you subtract one const X* pointer from another in
     an arm of an if-expression whose if-part is not a constant
     expression */
  const char *g = "string";
  pcpcc = &g + (g ? g-g : 0);
  /* HPUX 7.0 cc rejects these. */
  ++pcpcc;
  ppc = (char**) pcpcc;
  pcpcc = (char const *const *) ppc;
  { /* SCO 3.2v4 cc rejects this sort of thing.  */
    char tx;
    char *t = &tx;
    char const *s = 0 ? (char *) 0 : (char const *) 0;

    *t++ = 0;
    if (s) return 0;
  }
  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
    int x[] = {25, 17};
    const int *foo = &x[0];
    ++foo;
  }
  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
    typedef const int *iptr;
    iptr p = 0;
    ++p;
  }
  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
    struct s { int j; const int *ap[3]; } bx;
    struct s *b = &bx; b->j = 5;
  }
  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
    const int foo = 10;
    if (!foo) return 0;
  }
  return !cs[0] && !zero.x;
#endif

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_c_const=yes
else
  ac_cv_c_const=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
$as_echo "$ac_cv_c_const" >&6; }
if test $ac_cv_c_const = no; then

$as_echo "#define const /**/" >>confdefs.h

fi

  ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
if test "x$ac_cv_type_size_t" = xyes; then :

else

cat >>confdefs.h <<_ACEOF
#define size_t unsigned int
_ACEOF

fi

   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
if ${ac_cv_c_bigendian+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_cv_c_bigendian=unknown
    # See if we're dealing with a universal compiler.
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#ifndef __APPLE_CC__
	       not a universal capable compiler
	     #endif
	     typedef int dummy;

_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :

	# Check for potential -arch flags.  It is not universal unless
	# there are at least two -arch flags with different values.
	ac_arch=
	ac_prev=
	for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
	 if test -n "$ac_prev"; then
	   case $ac_word in
	     i?86 | x86_64 | ppc | ppc64)
	       if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
		 ac_arch=$ac_word
	       else
		 ac_cv_c_bigendian=universal
		 break
	       fi
	       ;;
	   esac
	   ac_prev=
	 elif test "x$ac_word" = "x-arch"; then
	   ac_prev=arch
	 fi
       done
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    if test $ac_cv_c_bigendian = unknown; then
      # See if sys/param.h defines the BYTE_ORDER macro.
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <sys/types.h>
	     #include <sys/param.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
		     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
		     && LITTLE_ENDIAN)
	      bogus endian macros
	     #endif

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  # It does; now see whether it defined to BIG_ENDIAN or not.
	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <sys/types.h>
		#include <sys/param.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
#if BYTE_ORDER != BIG_ENDIAN
		 not big endian
		#endif

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_c_bigendian=yes
else
  ac_cv_c_bigendian=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    fi
    if test $ac_cv_c_bigendian = unknown; then
      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <limits.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
	      bogus endian macros
	     #endif

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  # It does; now see whether it defined to _BIG_ENDIAN or not.
	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <limits.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
#ifndef _BIG_ENDIAN
		 not big endian
		#endif

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_c_bigendian=yes
else
  ac_cv_c_bigendian=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    fi
    if test $ac_cv_c_bigendian = unknown; then
      # Compile a test program.
      if test "$cross_compiling" = yes; then :
  # Try to guess by grepping values from an object file.
	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
short int ascii_mm[] =
		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
		short int ascii_ii[] =
		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
		int use_ascii (int i) {
		  return ascii_mm[i] + ascii_ii[i];
		}
		short int ebcdic_ii[] =
		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
		short int ebcdic_mm[] =
		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
		int use_ebcdic (int i) {
		  return ebcdic_mm[i] + ebcdic_ii[i];
		}
		extern int foo;

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
return use_ascii (foo) == use_ebcdic (foo);
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
	      ac_cv_c_bigendian=yes
	    fi
	    if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
	      if test "$ac_cv_c_bigendian" = unknown; then
		ac_cv_c_bigendian=no
	      else
		# finding both strings is unlikely to happen, but who knows?
		ac_cv_c_bigendian=unknown
	      fi
	    fi
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
$ac_includes_default
#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

	     /* Are we little or big endian?  From Harbison&Steele.  */
	     union
	     {
	       long int l;
	       char c[sizeof (long int)];
	     } u;
	     u.l = 1;
	     return u.c[sizeof (long int) - 1] == 1;

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
  ac_cv_c_bigendian=no
else
  ac_cv_c_bigendian=yes
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  conftest.$ac_objext conftest.beam conftest.$ac_ext
fi

    fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
$as_echo "$ac_cv_c_bigendian" >&6; }
 case $ac_cv_c_bigendian in #(
   yes)
     $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
;; #(
   no)
      ;; #(
   universal)

$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h

     ;; #(
   *)
     as_fn_error $? "unknown endianness
 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
 esac




  abi_libxml2_cppflags=""
  abi_libxml2_fcflags=""
  abi_libxml2_ldflags=""
  abi_libxml2_libs=""
  if test "${abi_libxml2_enable}" = "yes" -o "${abi_libxml2_enable}" = "auto"; 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



# Check whether --with-xml-prefix was given.
if test "${with_xml_prefix+set}" = set; then :
  withval=$with_xml_prefix; xml_config_prefix="$withval"
else
  xml_config_prefix=""
fi


# Check whether --with-xml-exec-prefix was given.
if test "${with_xml_exec_prefix+set}" = set; then :
  withval=$with_xml_exec_prefix; xml_config_exec_prefix="$withval"
else
  xml_config_exec_prefix=""
fi

# Check whether --enable-xmltest was given.
if test "${enable_xmltest+set}" = set; then :
  enableval=$enable_xmltest;
else
  enable_xmltest=yes
fi


  if test x$xml_config_exec_prefix != x ; then
     xml_config_args="$xml_config_args"
     if test x${XML2_CONFIG+set} != xset ; then
        XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
     fi
  fi
  if test x$xml_config_prefix != x ; then
     xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
     if test x${XML2_CONFIG+set} != xset ; then
        XML2_CONFIG=$xml_config_prefix/bin/xml2-config
     fi
  fi

  # Extract the first word of "xml2-config", so it can be a program name with args.
set dummy xml2-config; 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_XML2_CONFIG+:} false; then :
  $as_echo_n "(cached) " >&6
else
  case $XML2_CONFIG in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_XML2_CONFIG="$XML2_CONFIG" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_XML2_CONFIG="$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

  test -z "$ac_cv_path_XML2_CONFIG" && ac_cv_path_XML2_CONFIG="no"
  ;;
esac
fi
XML2_CONFIG=$ac_cv_path_XML2_CONFIG
if test -n "$XML2_CONFIG"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5
$as_echo "$XML2_CONFIG" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  min_xml_version=2.7.6
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml - version >= $min_xml_version" >&5
$as_echo_n "checking for libxml - version >= $min_xml_version... " >&6; }
  no_xml=""
  if test "$XML2_CONFIG" = "no" ; then
    no_xml=yes
  else
    XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
    XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
    xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
    xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
    xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
    if test "x$enable_xmltest" = "xyes" ; then
      ac_save_CPPFLAGS="$CPPFLAGS"
      ac_save_LIBS="$LIBS"
      CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
      LIBS="$XML_LIBS $LIBS"
      rm -f conf.xmltest
      if test "$cross_compiling" = yes; then :
  echo $ac_n "cross compiling; assumed OK... $ac_c"
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <libxml/xmlversion.h>

int
main()
{
  int xml_major_version, xml_minor_version, xml_micro_version;
  int major, minor, micro;
  char *tmp_version;

  system("touch conf.xmltest");

  /* Capture xml2-config output via autoconf/configure variables */
  /* HP/UX 9 (%@#!) writes to sscanf strings */
  tmp_version = (char *)strdup("$min_xml_version");
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
     printf("%s, bad version string from xml2-config\n", "$min_xml_version");
     exit(1);
   }
   free(tmp_version);

   /* Capture the version information from the header files */
   tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
   if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
     printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
     exit(1);
   }
   free(tmp_version);

 /* Compare xml2-config output to the libxml headers */
  if ((xml_major_version != $xml_config_major_version) ||
      (xml_minor_version != $xml_config_minor_version) ||
      (xml_micro_version != $xml_config_micro_version))
    {
      printf("*** libxml header files (version %d.%d.%d) do not match\n",
         xml_major_version, xml_minor_version, xml_micro_version);
      printf("*** xml2-config (version %d.%d.%d)\n",
         $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
      return 1;
    }
/* Compare the headers to the library to make sure we match */
  /* Less than ideal -- doesn't provide us with return value feedback,
   * only exits if there's a serious mismatch between header and library.
   */
    LIBXML_TEST_VERSION;

    /* Test that the library is greater than our minimum version */
    if ((xml_major_version > major) ||
        ((xml_major_version == major) && (xml_minor_version > minor)) ||
        ((xml_major_version == major) && (xml_minor_version == minor) &&
        (xml_micro_version >= micro)))
      {
        return 0;
       }
     else
      {
        printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
               xml_major_version, xml_minor_version, xml_micro_version);
        printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
           major, minor, micro);
        printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
        printf("***\n");
        printf("*** If you have already installed a sufficiently new version, this error\n");
        printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
        printf("*** being found. The easiest way to fix this is to remove the old version\n");
        printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
        printf("*** correct copy of xml2-config. (In this case, you will have to\n");
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
        printf("*** so that the correct libraries are found at run-time))\n");
    }
  return 1;
}

_ACEOF
if ac_fn_c_try_run "$LINENO"; then :

else
  no_xml=yes
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  conftest.$ac_objext conftest.beam conftest.$ac_ext
fi

       CPPFLAGS="$ac_save_CPPFLAGS"
       LIBS="$ac_save_LIBS"
     fi
  fi

  if test "x$no_xml" = x ; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version)" >&5
$as_echo "yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version)" >&6; }
     abi_libxml2_ok="yes"
  else
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
     if test "$XML2_CONFIG" = "no" ; then
       echo "*** The xml2-config script installed by LIBXML could not be found"
       echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
       echo "*** your path, or set the XML2_CONFIG environment variable to the"
       echo "*** full path to xml2-config."
     else
       if test -f conf.xmltest ; then
        :
       else
          echo "*** Could not run libxml test program, checking why..."
          CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
          LIBS="$LIBS $XML_LIBS"
          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#include <libxml/xmlversion.h>
#include <stdio.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
 LIBXML_TEST_VERSION; return 0;
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
   echo "*** The test program compiled, but did not run. This usually means"
          echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
          echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
          echo "*** is required on your system"
          echo "***"
          echo "*** If you have an old version installed, it is best to remove it, although"
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
else
   echo "*** The test program failed to compile or link. See the file config.log for the"
          echo "*** exact error that occured. This usually means LIBXML was incorrectly installed"
          echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
          echo "*** may want to edit the xml2-config script: $XML2_CONFIG"
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
          CPPFLAGS="$ac_save_CPPFLAGS"
          LIBS="$ac_save_LIBS"
       fi
     fi

     XML_CPPFLAGS=""
     XML_LIBS=""
     abi_libxml2_ok="no"
  fi


  rm -f conf.xmltest

    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 "${abi_libxml2_ok}" = "yes"; then
      abi_libxml2_enable="yes"
      abi_libxml2_cppflags="${XML_CPPFLAGS}"
      abi_libxml2_fcflags="${XML_CPPFLAGS}"
      abi_libxml2_libs="${XML_LIBS}"
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find a usable XML library => disabling XML support" >&5
$as_echo "$as_me: WARNING: could not find a usable XML library => disabling XML support" >&2;}
      abi_libxml2_enable="no"
    fi
  fi







# Look for desired Fortran features

  # Explore compiler peculiarities

  # Init
  fc_has_async="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler accepts the ASYNCHRONOUS attribute" >&5
$as_echo_n "checking whether the Fortran compiler accepts the ASYNCHRONOUS attribute... " >&6; }

  # Try to compile a program using asynchronous arrays (F2003)
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

     INTEGER, ASYNCHRONOUS :: int_array(10)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_async="yes"
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 "${fc_has_async}" = "yes"; then

$as_echo "#define HAVE_FC_ASYNC 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_async}" >&5
$as_echo "${fc_has_async}" >&6; }


  # Init
  fc_has_backtrace="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler supports BACKTRACE" >&5
$as_echo_n "checking whether the Fortran compiler supports BACKTRACE... " >&6; }

  # Try to compile a piece of code that calls BACKTRACE.
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  if test "$cross_compiling" = yes; 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 $? "cannot run test program while cross compiling
See \`config.log' for more details" "$LINENO" 5; }
else
  cat > conftest.$ac_ext <<_ACEOF
      program main

      call backtrace()


      end
_ACEOF
if ac_fn_fc_try_run "$LINENO"; then :
  fc_has_backtrace="yes"
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  conftest.$ac_objext conftest.beam conftest.$ac_ext
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


  if test "${fc_has_backtrace}" = "yes"; then

$as_echo "#define HAVE_FC_BACKTRACE 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_backtrace}" >&5
$as_echo "${fc_has_backtrace}" >&6; }


  # Init
  fc_has_command_argument="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler supports GET_COMMAND_ARGUMENT" >&5
$as_echo_n "checking whether the Fortran compiler supports GET_COMMAND_ARGUMENT... " >&6; }

  # Try to compile a piece of code that calls get_command_argument.
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      integer :: ii
      character(len=500) :: arg

      call get_command(arg)

      do ii=1,command_argument_count()
        call get_command_argument(ii, arg)
      end do


      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_command_argument="yes"
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 "${fc_has_command_argument}" = "yes"; then

$as_echo "#define HAVE_FC_COMMAND_ARGUMENT 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_command_argument}" >&5
$as_echo "${fc_has_command_argument}" >&6; }


  # Init
  fc_has_command_line="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler supports EXECUTE_COMMAND_LINE" >&5
$as_echo_n "checking whether the Fortran compiler supports EXECUTE_COMMAND_LINE... " >&6; }

  # Try to compile a piece of code that calls execute_command_line.
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      integer :: i

      call execute_command_line ("external_prog.exe", exitstat=i)
      print *, "Exit status of external_prog.exe was ", i

      call execute_command_line ("reindex_files.exe", wait=.false.)
      print *, "Now reindexing files in the background"

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_command_line="yes"
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 "${fc_has_command_line}" = "yes"; then

$as_echo "#define HAVE_FC_COMMAND_LINE 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_command_line}" >&5
$as_echo "${fc_has_command_line}" >&6; }


  # Init
  fc_has_system="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler supports SYSTEM" >&5
$as_echo_n "checking whether the Fortran compiler supports SYSTEM... " >&6; }

  # Try to compile a piece of code that calls system.
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call system ("ls -l")

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_system="yes"
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 "${fc_has_system}" = "yes"; then

$as_echo "#define HAVE_FC_SYSTEM 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_system}" >&5
$as_echo "${fc_has_system}" >&6; }


  # Init
  fc_has_contiguous="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler accepts the CONTIGUOUS attribute" >&5
$as_echo_n "checking whether the Fortran compiler accepts the CONTIGUOUS attribute... " >&6; }

  # Try to compile a program using contiguous (F2008)
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

     integer, parameter :: dp=kind(1.0d0)
     integer, parameter :: dpc=kind((1.0_dp,1.0_dp))

     integer,contiguous,pointer :: i_ptr(:)
     real(dp),contiguous,pointer :: r_ptr(:,:)
     complex(dpc),contiguous,pointer :: c_ptr(:,:,:)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_contiguous="yes"
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 "${fc_has_contiguous}" = "yes"; then

$as_echo "#define HAVE_FC_CONTIGUOUS 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_contiguous}" >&5
$as_echo "${fc_has_contiguous}" >&6; }


  # Init
  fc_has_dtarrays="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler supports allocatable arrays in datatypes" >&5
$as_echo_n "checking whether the Fortran compiler supports allocatable arrays in datatypes... " >&6; }

  # Try to compile a type with an allocatable array
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main


         integer, parameter :: dp=kind(1.0d0)
         integer, parameter :: dpc=kind((1.0_dp,1.0_dp))

         type test_type
           integer,allocatable :: i(:)
           real(dp),allocatable :: r(:,:)
           complex(dpc),allocatable :: c(:,:,:)
         end type test_type


      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_dtarrays="yes"
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 "${fc_has_dtarrays}" = "yes"; then

$as_echo "#define HAVE_FC_ALLOCATABLE_DTARRAYS 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_dtarrays}" >&5
$as_echo "${fc_has_dtarrays}" >&6; }


  # Init
  fc_has_ieee_arithmetic="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler supports IEEE_ARITHMETIC" >&5
$as_echo_n "checking whether the Fortran compiler supports IEEE_ARITHMETIC... " >&6; }

  # Try to compile a piece of code that uses the module.
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use, intrinsic :: ieee_arithmetic
      real :: val

      if (ieee_is_nan(val)) then  ! NaN
        write(*,*)"Hello NAN"
      end if


      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_ieee_arithmetic="yes"
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 "${fc_has_ieee_arithmetic}" = "yes"; then

$as_echo "#define HAVE_FC_IEEE_ARITHMETIC 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_ieee_arithmetic}" >&5
$as_echo "${fc_has_ieee_arithmetic}" >&6; }


  # Init
  fc_has_ieee_exceptions="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler supports IEEE_EXCEPTIONS" >&5
$as_echo_n "checking whether the Fortran compiler supports IEEE_EXCEPTIONS... " >&6; }

  # Try to compile a piece of code that uses the module.
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use, intrinsic :: ieee_exceptions
      type(ieee_status_type) :: status_value

      call ieee_get_status(status_value)   ! Get the flags
      call ieee_set_flag(ieee_all,.false.) ! Set the flags quiet
      call ieee_set_status(status_value)   ! Restore the flags


      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_ieee_exceptions="yes"
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 "${fc_has_ieee_exceptions}" = "yes"; then

$as_echo "#define HAVE_FC_IEEE_EXCEPTIONS 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_ieee_exceptions}" >&5
$as_echo "${fc_has_ieee_exceptions}" >&6; }


  # Init
  fc_has_iomsg="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler supports IOMSG" >&5
$as_echo_n "checking whether the Fortran compiler supports IOMSG... " >&6; }

  # Try to compile a piece of code that opens, reads, writes and closes a file using iomsg.
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

         IMPLICIT NONE
         CHARACTER(len=500) :: ERRMSG, DUMMY

         OPEN(UNIT=11, FILE="iomsg.demo", STATUS="NEW", IOMSG=ERRMSG)
         WRITE(11,IOMSG=ERRMSG) "first"
         READ(11, IOMSG=ERRMSG) DUMMY
         CLOSE(UNIT=11, IOMSG=ERRMSG)


      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_iomsg="yes"
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 "${fc_has_iomsg}" = "yes"; then

$as_echo "#define HAVE_FC_IOMSG 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_iomsg}" >&5
$as_echo "${fc_has_iomsg}" >&6; }


  # Init
  fc_has_iso_c_binding="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler provides the iso_c_binding module" >&5
$as_echo_n "checking whether the Fortran compiler provides the iso_c_binding module... " >&6; }

  # Try to compile a simple piece of code using iso_c_binding
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

         use iso_c_binding
         implicit none
         integer(c_int) :: ii
         logical :: lbool
         type(c_ptr) :: ptr
         ptr = c_null_ptr
         lbool = c_associated(ptr)


      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_iso_c_binding="yes"
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 "${fc_has_iso_c_binding}" = "yes"; then

$as_echo "#define HAVE_FC_ISO_C_BINDING 1" >>confdefs.h

  else
    as_fn_error $? "Fortran compiler does not provide iso_c_binding module. Use a more recent version or a different compiler" "$LINENO" 5
  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_iso_c_binding}" >&5
$as_echo "${fc_has_iso_c_binding}" >&6; }


  # Init
  fc_has_exit="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler accepts exit()" >&5
$as_echo_n "checking whether the Fortran compiler accepts exit()... " >&6; }

  # Try to compile a program calling exit()
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

            call exit(1)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_exit="yes"
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 "${fc_has_exit}" = "yes"; then

$as_echo "#define HAVE_FC_EXIT 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_exit}" >&5
$as_echo "${fc_has_exit}" >&6; }


  # Init
  fc_has_flush="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler accepts flush()" >&5
$as_echo_n "checking whether the Fortran compiler accepts flush()... " >&6; }

  # Try to compile a program calling flush()
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

            call flush(1)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_flush="yes"
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 "${fc_has_flush}" = "yes"; then

$as_echo "#define HAVE_FC_FLUSH 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_flush}" >&5
$as_echo "${fc_has_flush}" >&6; }


  # Init
  fc_has_flush_="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler accepts flush_()" >&5
$as_echo_n "checking whether the Fortran compiler accepts flush_()... " >&6; }

  # Try to compile a program calling flush_()
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

            call flush_(1)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_flush_="yes"
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 "${fc_has_flush_}" = "yes"; then

$as_echo "#define HAVE_FC_FLUSH_ 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_flush_}" >&5
$as_echo "${fc_has_flush_}" >&6; }


  # Init
  fc_has_gamma="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler accepts gamma()" >&5
$as_echo_n "checking whether the Fortran compiler accepts gamma()... " >&6; }

  # Try to compile a program using gamma()
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

            real :: x
            x = gamma(1.5)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_gamma="yes"
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 "${fc_has_gamma}" = "yes"; then

$as_echo "#define HAVE_FC_GAMMA 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_gamma}" >&5
$as_echo "${fc_has_gamma}" >&6; }


  # Init
  fc_has_shiftlr="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler accepts shiftl() and shiftr()" >&5
$as_echo_n "checking whether the Fortran compiler accepts shiftl() and shiftr()... " >&6; }

  # Try to compile a call to cpu_time
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      integer :: ii,ishft,res
      res=shiftl(ii,ishft)
      res=shiftr(ii,ishft)


      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_shiftlr="yes"
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 "${fc_has_shiftlr}" = "yes"; then

$as_echo "#define HAVE_FC_SHIFTLR 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_shiftlr}" >&5
$as_echo "${fc_has_shiftlr}" >&6; }


  # Init
  fc_has_getenv="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler accepts getenv()" >&5
$as_echo_n "checking whether the Fortran compiler accepts getenv()... " >&6; }

  # Try to compile a call to getenv
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      character(len=255) :: homedir
      call getenv("HOME", homedir)


      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_getenv="yes"
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 "${fc_has_getenv}" = "yes"; then

$as_echo "#define HAVE_FC_GETENV 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_getenv}" >&5
$as_echo "${fc_has_getenv}" >&6; }


  # Init
  fc_has_getpid="no"

  # Look for getpid() support
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

          call getpid()

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_getpid="yes"
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


  # Determine whether to use getpid()
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler accepts getpid()" >&5
$as_echo_n "checking whether the Fortran compiler accepts getpid()... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_getpid}" >&5
$as_echo "${fc_has_getpid}" >&6; }
  if test "${fc_has_getpid}" = "yes"; then

$as_echo "#define HAVE_FC_GETPID 1" >>confdefs.h

  fi


  # Init
  fc_has_int_quad="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler accepts quadruple integers" >&5
$as_echo_n "checking whether the Fortran compiler accepts quadruple integers... " >&6; }

  # Try to compile a program defining a quadruple integer
  # Note: xlf "works around" the problem by changing the integer length
  # Note: need to test "integer*16" and "integer(kind=16)" (seems not
  #       equivalent)
  if test "${abi_fc_vendor}" != "ibm"; then
    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

    cat > conftest.$ac_ext <<_ACEOF
      program main

              integer*16 my_int
              integer(kind=16) :: my_int2

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_int_quad="yes"
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

  fi

  if test "${fc_has_int_quad}" = "yes"; then

$as_echo "#define HAVE_FC_INT_QUAD 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_int_quad}" >&5
$as_echo "${fc_has_int_quad}" >&6; }


  # Init
  fc_has_iso_fortran_2008="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler supports 2008 standard in ISO_FORTRAN_ENV" >&5
$as_echo_n "checking whether the Fortran compiler supports 2008 standard in ISO_FORTRAN_ENV... " >&6; }

  # Try to compile a program using ISO_FORTRAN_ENV with int16,int32,int64
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

          use ISO_FORTRAN_ENV, only : int16,int32,int64

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_iso_fortran_2008="yes"
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 "${fc_has_iso_fortran_2008}" = "yes"; then

$as_echo "#define HAVE_FC_ISO_FORTRAN_2008 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_iso_fortran_2008}" >&5
$as_echo "${fc_has_iso_fortran_2008}" >&6; }


  # Init
  fc_has_long_lines="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler accepts long lines" >&5
$as_echo_n "checking whether the Fortran compiler accepts long lines... " >&6; }

  # Try to compile a single line exceeding 136 columns.
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

         write(*,*)"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" !142

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_long_lines="yes"
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


  # This is not correctly implemented on LLVM
  if test "${abi_fc_vendor}" = "llvm" -o "${abi_fc_vendor}" = "arm" ; then
    fc_has_long_lines="no"
  fi

  if test "${fc_has_long_lines}" = "yes"; then

$as_echo "#define HAVE_FC_LONG_LINES 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_long_lines}" >&5
$as_echo "${fc_has_long_lines}" >&6; }

  # Official macro added in autoconf ??



  # Init
  fc_has_macro_newline="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler supports \newline in CPP macros" >&5
$as_echo_n "checking whether the Fortran compiler supports \newline in CPP macros... " >&6; }

  # Try to compile a piece of code that opens a file using \newline in a macro (has to use F90 ext).
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

#        define NEWLINE \newline
         print *,"foo1" NEWLINE print *,"foo2"


      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_macro_newline="yes"
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 "${fc_has_macro_newline}" = "yes"; then

$as_echo "#define HAVE_FC_MACRO_NEWLINE 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_macro_newline}" >&5
$as_echo "${fc_has_macro_newline}" >&6; }


  # Init
  fc_has_move_alloc="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler supports MOVE_ALLOC (F2003)" >&5
$as_echo_n "checking whether the Fortran compiler supports MOVE_ALLOC (F2003)... " >&6; }

  # Try to compile a piece of code that uses move_alloc (F2003)
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

     integer, allocatable :: a(:), b(:)
     allocate(a(3))
     a = (/1, 2, 3/)
     call move_alloc(a, b)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_move_alloc="yes"
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 "${fc_has_move_alloc}" = "yes"; then

$as_echo "#define HAVE_FC_MOVE_ALLOC 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_move_alloc}" >&5
$as_echo "${fc_has_move_alloc}" >&6; }


  # Init
  fc_has_private="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler accepts the PRIVATE attribute" >&5
$as_echo_n "checking whether the Fortran compiler accepts the PRIVATE attribute... " >&6; }

  # Try to compile a program using private entities (F2003)
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF

     module foo
       type, public :: bar_t
         integer :: pub
         integer,private :: priv
       end type bar_t
     end module foo

_ACEOF
if ac_fn_fc_try_compile "$LINENO"; then :
  fc_has_private="yes"
fi
rm -f core conftest.err conftest.$ac_objext 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 "${fc_has_private}" = "yes"; then

$as_echo "#define HAVE_FC_PRIVATE 1" >>confdefs.h

  fi

  # remove the module.
  if test -f "FOO.${MODEXT}"; then
    rm -f "FOO.${MODEXT}";
  elif test -f "foo.${MODEXT}"; then
    rm -f "foo.${MODEXT}";
  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_private}" >&5
$as_echo "${fc_has_private}" >&6; }


  # Init
  fc_has_protected="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler accepts the PROTECTED attribute" >&5
$as_echo_n "checking whether the Fortran compiler accepts the PROTECTED attribute... " >&6; }

  # Try to compile a program using protected module entities (F2003)
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF

    module foo
     real,save,protected :: aprot(10)
    end module foo

_ACEOF
if ac_fn_fc_try_compile "$LINENO"; then :
  fc_has_protected="yes"
fi
rm -f core conftest.err conftest.$ac_objext 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 "${fc_has_protected}" = "yes"; then

$as_echo "#define HAVE_FC_PROTECTED 1" >>confdefs.h

  fi

  # Remove the module
  if test -f "FOO.${MODEXT}"; then
    rm -f "FOO.${MODEXT}";
  elif test -f "foo.${MODEXT}"; then
    rm -f "foo.${MODEXT}";
  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_protected}" >&5
$as_echo "${fc_has_protected}" >&6; }


  # Init
  fc_has_stream_io="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler supports stream IO" >&5
$as_echo_n "checking whether the Fortran compiler supports stream IO... " >&6; }

  # Try to compile a piece of code that opens a file using unformatted stream access.
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

         IMPLICIT NONE
         INTEGER :: myvalue = 12345, mypos
         OPEN(UNIT=11, FILE="ustream.demo", STATUS="NEW", ACCESS="STREAM")
         WRITE(11) "first"
         WRITE(11) "second"
         INQUIRE(UNIT=11, POS=mypos)
         PRINT *, "Myvalue will be written at position ", mypos
         WRITE(11) myvalue
         CLOSE(UNIT=11)


      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_stream_io="yes"
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 "${fc_has_stream_io}" = "yes"; then

$as_echo "#define HAVE_FC_STREAM_IO 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_stream_io}" >&5
$as_echo "${fc_has_stream_io}" >&6; }


  # Init
  fc_has_cputime="no"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler accepts cpu_time()" >&5
$as_echo_n "checking whether the Fortran compiler accepts cpu_time()... " >&6; }

  # Try to compile a call to cpu_time
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      real :: second
      call cpu_time(second)


      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_cputime="yes"
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 "${fc_has_cputime}" = "yes"; then

$as_echo "#define HAVE_FC_CPUTIME 1" >>confdefs.h

  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_cputime}" >&5
$as_echo "${fc_has_cputime}" >&6; }


  # Init
  fc_timing="standard"
  fc_has_etime="no"

  # Look for etime() support
  if test "${fc_timing}" = "standard"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler accepts etime()" >&5
$as_echo_n "checking whether the Fortran compiler accepts etime()... " >&6; }

    # Try to compile a program calling etime()
    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

    cat > conftest.$ac_ext <<_ACEOF
      program main

            call etime(1)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_etime="yes"
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 "${fc_has_etime}" = "yes"; then

$as_echo "#define HAVE_FC_ETIME 1" >>confdefs.h

    fi

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_etime}" >&5
$as_echo "${fc_has_etime}" >&6; }

  fi

  # Determine whether to use C clock for timings
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use C clock for timings" >&5
$as_echo_n "checking whether to use C clock for timings... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${enable_cclock}" >&5
$as_echo "${enable_cclock}" >&6; }
  if test "${enable_cclock}" = "yes"; then

$as_echo "#define HAVE_CCLOCK 1" >>confdefs.h

    fc_timing="cclock"
  fi
   if test "${enable_cclock}" = "yes"; then
  DO_BUILD_CCLOCK_TRUE=
  DO_BUILD_CCLOCK_FALSE='#'
else
  DO_BUILD_CCLOCK_TRUE='#'
  DO_BUILD_CCLOCK_FALSE=
fi


  # Schedule info for substitution



  # Init
  fc_has_getpid="no"

  # Look for shape() in routine arguments support
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      integer :: x(3,4)
      call test_on_the_fly_shape(x)
      contains
      subroutine test_on_the_fly_shape(x)
        integer, intent(inout) :: x(:,:)
        integer :: y(product(shape(x)))
      end subroutine test_on_the_fly_shape

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  fc_has_on_the_fly_shape="yes"
else
  fc_has_on_the_fly_shape="no"
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


  # Determine whether to use an enhanced Fortran shape()
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran compiler can shape arrays on-the-fly" >&5
$as_echo_n "checking whether the Fortran compiler can shape arrays on-the-fly... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${fc_has_on_the_fly_shape}" >&5
$as_echo "${fc_has_on_the_fly_shape}" >&6; }
  if test "${fc_has_on_the_fly_shape}" = "yes"; then

$as_echo "#define HAVE_FC_ON_THE_FLY_SHAPE 1" >>confdefs.h

  fi



# Look for desired Python features

  # Init
  abi_python_ok="no"

  # Preserve environment


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"



  # Get Python CPPFLAGS
  if test "${PYTHON}" != "" -a "${PYTHON_CONFIG}" != ""; then
    if test "${PYTHON_CPPFLAGS}" = ""; then
      PYTHON_CPPFLAGS=`${PYTHON_CONFIG} --includes`
    fi
    if test "${PYTHON_CFLAGS}" = ""; then
      PYTHON_CFLAGS=`${PYTHON_CONFIG} --cflags`
    fi
    if test "${PYTHON_LDFLAGS}" = ""; then
      PYTHON_LDFLAGS=`${PYTHON_CONFIG} --ldflags`
    fi
    if test "${PYTHON_LIBS}" = ""; then
      PYTHON_LIBS=`${PYTHON_CONFIG} --libs`
    fi
  fi
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python CPPFLAGS" >&5
$as_echo_n "checking for Python CPPFLAGS... " >&6; }
  if test "${PYTHON_CPPFLAGS}" = ""; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none found" >&5
$as_echo "none found" >&6; }
  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${PYTHON_CPPFLAGS}" >&5
$as_echo "${PYTHON_CPPFLAGS}" >&6; }
  fi
  CPPFLAGS="${PYTHON_CPPFLAGS} ${CPPFLAGS}"
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python CFLAGS" >&5
$as_echo_n "checking for Python CFLAGS... " >&6; }
  if test "${PYTHON_CFLAGS}" = ""; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none found" >&5
$as_echo "none found" >&6; }
  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${PYTHON_CFLAGS}" >&5
$as_echo "${PYTHON_CFLAGS}" >&6; }
  fi
  CFLAGS="${PYTHON_CFLAGS} ${CFLAGS}"
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python LDFLAGS" >&5
$as_echo_n "checking for Python LDFLAGS... " >&6; }
  if test "${PYTHON_LDFLAGS}" = ""; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none found" >&5
$as_echo "none found" >&6; }
  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${PYTHON_LDFLAGS}" >&5
$as_echo "${PYTHON_LDFLAGS}" >&6; }
  fi
  LDFLAGS="${PYTHON_LDFLAGS} ${LDFLAGS}"
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python LIBS" >&5
$as_echo_n "checking for Python LIBS... " >&6; }
  if test "${PYTHON_LIBS}" = ""; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none found" >&5
$as_echo "none found" >&6; }
  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${PYTHON_LIBS}" >&5
$as_echo "${PYTHON_LIBS}" >&6; }
  fi
  LIBS="${PYTHON_LIBS} ${LIBS}"

  # Preliminary Pyton tests
  ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default"
if test "x$ac_cv_header_Python_h" = xyes; then :
  abi_python_ok="yes"
fi



  # Look for Python modules
  if test "${abi_python_ok}" = "yes"; then

  # Init
  abi_numpy_ok="no"

  # Look for a standard implementation
  if test "${abi_numpy_ok}" = "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for numpy/arrayobject.h" >&5
$as_echo_n "checking for numpy/arrayobject.h... " >&6; }
    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

    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#include <Python.h>
#include <numpy/arrayobject.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{



  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  abi_numpy_ok="yes"
else
  abi_numpy_ok="no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    if test "${abi_numpy_ok}" = "yes"; then

$as_echo "#define HAVE_NUMPY 1" >>confdefs.h

    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

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_numpy_ok}" >&5
$as_echo "${abi_numpy_ok}" >&6; }
  fi

    if test "${abi_numpy_ok}" = "no"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: adding \"-I/usr/include/numpy\" to CPPFLAGS" >&5
$as_echo "$as_me: adding \"-I/usr/include/numpy\" to CPPFLAGS" >&6;}
      CPPFLAGS="${CPPFLAGS} -I/usr/include/numpy"

  # Init
  abi_numpy_ok="no"

  # Look for a standard implementation
  if test "${abi_numpy_ok}" = "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for numpy/arrayobject.h" >&5
$as_echo_n "checking for numpy/arrayobject.h... " >&6; }
    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

    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#include <Python.h>
#include <numpy/arrayobject.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{



  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  abi_numpy_ok="yes"
else
  abi_numpy_ok="no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    if test "${abi_numpy_ok}" = "yes"; then

$as_echo "#define HAVE_NUMPY 1" >>confdefs.h

    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

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_numpy_ok}" >&5
$as_echo "${abi_numpy_ok}" >&6; }
  fi

      if test "${abi_numpy_ok}" = "yes"; then
        PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS} -I/usr/include/numpy"
      fi
    fi
  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: your Python development environment is not working" >&5
$as_echo "$as_me: WARNING: your Python development environment is not working" >&2;}
  fi

  # Restore environment
  CPPFLAGS="${abi_env_CPPFLAGS}"
  CFLAGS="${abi_env_CFLAGS}"
  LDFLAGS="${abi_env_LDFLAGS}"
  LIBS="${abi_env_LIBS}"


# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #

#
# Platform-specific libraries
#

# Note: these tests have to be performed after the flags have been
#       saved.



  abi_sec_title="Platform-specific libraries"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which operating system we have" >&5
$as_echo_n "checking which operating system we have... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${target_os}" >&5
$as_echo "${target_os}" >&6; }

# Basic mathematical functions
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 for library containing expl" >&5
$as_echo_n "checking for library containing expl... " >&6; }
if ${ac_cv_search_expl+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$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.  */
#ifdef __cplusplus
extern "C"
#endif
char expl ();
#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
return expl ();
  ;
  return 0;
}
_ACEOF
for ac_lib in '' m ml; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_expl=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if ${ac_cv_search_expl+:} false; then :
  break
fi
done
if ${ac_cv_search_expl+:} false; then :

else
  ac_cv_search_expl=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_expl" >&5
$as_echo "$ac_cv_search_expl" >&6; }
ac_res=$ac_cv_search_expl
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
  abi_math_expl_ok="yes"
else
  abi_math_expl_ok="no"
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing logl" >&5
$as_echo_n "checking for library containing logl... " >&6; }
if ${ac_cv_search_logl+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_func_search_save_LIBS=$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.  */
#ifdef __cplusplus
extern "C"
#endif
char logl ();
#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
return logl ();
  ;
  return 0;
}
_ACEOF
for ac_lib in '' m ml; do
  if test -z "$ac_lib"; then
    ac_res="none required"
  else
    ac_res=-l$ac_lib
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
  fi
  if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_search_logl=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext
  if ${ac_cv_search_logl+:} false; then :
  break
fi
done
if ${ac_cv_search_logl+:} false; then :

else
  ac_cv_search_logl=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_logl" >&5
$as_echo "$ac_cv_search_logl" >&6; }
ac_res=$ac_cv_search_logl
if test "$ac_res" != no; then :
  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
  abi_math_logl_ok="yes"
else
  abi_math_logl_ok="no"
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


# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #

#
# Multicore architecture support

# Note: the following settings will be used by the connectors.



  abi_sec_title="Multicore architecture support"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# MPI support


  # Delegate the actual detection to Steredeg

  # Display configuration
  if test "${STEREDEG_CONFIG_BYPASS_CHECKS}" != "yes"; then

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable MPI" >&5
$as_echo_n "checking whether to enable MPI... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_enable}" >&5
$as_echo "${sd_mpi_enable}" >&6; }
  if test "${sd_mpi_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how MPI parameters have been set" >&5
$as_echo_n "checking how MPI parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_init}" >&5
$as_echo "${sd_mpi_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI C compiler is set" >&5
$as_echo_n "checking whether the MPI C compiler is set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_cc_set}" >&5
$as_echo "${sd_mpi_cc_set}" >&6; }
    if test "${sd_mpi_enable_cxx}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI C++ compiler is set" >&5
$as_echo_n "checking whether the MPI C++ compiler is set... " >&6; }
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_cxx_set}" >&5
$as_echo "${sd_mpi_cxx_set}" >&6; }
    fi
    if test "${sd_mpi_enable_fc}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI Fortran compiler is set" >&5
$as_echo_n "checking whether the MPI Fortran compiler is set... " >&6; }
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_fc_set}" >&5
$as_echo "${sd_mpi_fc_set}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI C preprocessing flags" >&5
$as_echo_n "checking for MPI C preprocessing flags... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_cppflags}" >&5
$as_echo "${sd_mpi_cppflags}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI C flags" >&5
$as_echo_n "checking for MPI C flags... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_cflags}" >&5
$as_echo "${sd_mpi_cflags}" >&6; }
    if test "${sd_mpi_enable_cxx}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI C++ flags" >&5
$as_echo_n "checking for MPI C++ flags... " >&6; }
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_cxxflags}" >&5
$as_echo "${sd_mpi_cxxflags}" >&6; }
    fi
    if test "${sd_mpi_enable_fc}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI Fortran flags" >&5
$as_echo_n "checking for MPI Fortran flags... " >&6; }
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_fcflags}" >&5
$as_echo "${sd_mpi_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI linker flags" >&5
$as_echo_n "checking for MPI linker flags... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_ldflags}" >&5
$as_echo "${sd_mpi_ldflags}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI library flags" >&5
$as_echo_n "checking for MPI library flags... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_libs}" >&5
$as_echo "${sd_mpi_libs}" >&6; }
  fi

  fi

  # Check compilers or APIs
  if test "${sd_mpi_enable}" = "yes" -o "${sd_mpi_enable}" = "auto"; then


  # Init
  sd_mpi_cc_ok="unknown"
  sd_mpi_cc_api_ok="unknown"

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  CPPFLAGS="${CPPFLAGS} ${sd_mpi_cppflags}"
  CFLAGS="${CFLAGS} ${sd_mpi_cflags}"
  LDFLAGS="${LDFLAGS} ${sd_mpi_ldflags}"
  LIBS="${sd_mpi_libs} ${LIBS}"

  # Check the MPI implementation

  # Check MPI C API
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI C API works" >&5
$as_echo_n "checking whether the MPI C API works... " >&6; }
  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

  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#include <stdlib.h>
#include <mpi.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

      int *argc = NULL;
      char ***argv = NULL;
      MPI_Init(argc, argv);

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  sd_mpi_cc_api_ok="yes"
else
  sd_mpi_cc_api_ok="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_cc_api_ok}" >&5
$as_echo "${sd_mpi_cc_api_ok}" >&6; }


  # Validate C support
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI C environment works" >&5
$as_echo_n "checking whether the MPI C environment works... " >&6; }
  if test "${sd_mpi_cc_api_ok}" = "yes"; then
    sd_mpi_cc_ok="yes"
  else
    sd_mpi_cc_ok="no"
  fi
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_cc_ok}" >&5
$as_echo "${sd_mpi_cc_ok}" >&6; }

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"


    if test "${sd_mpi_cc_ok}" = "yes"; then
      if test "${sd_mpi_enable_cxx}" = "yes"; then

  # Init
  sd_mpi_cxx_ok="unknown"
  sd_mpi_cxx_api_ok="unknown"

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  CPPFLAGS="${CPPFLAGS} ${sd_mpi_cppflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_mpi_cxxflags}"
  LDFLAGS="${LDFLAGS} ${sd_mpi_ldflags}"
  LIBS="${sd_mpi_libs} ${LIBS}"

  # Check the MPI implementation

  # Check MPI C++ API
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI C++ API works" >&5
$as_echo_n "checking whether the MPI C++ API works... " >&6; }
  ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu

  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#     include <mpi.h>
      using namespace std;

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

      int *argc = 0;
      char ***argv = 0;
      MPI_Init(argc, argv);

  ;
  return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
  sd_mpi_cxx_api_ok="yes"
else
  sd_mpi_cxx_api_ok="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_cxx_api_ok}" >&5
$as_echo "${sd_mpi_cxx_api_ok}" >&6; }


  # Validate C++ support
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI C++ environment works" >&5
$as_echo_n "checking whether the MPI C++ environment works... " >&6; }
  if test "${sd_mpi_cxx_api_ok}" = "yes"; then
    sd_mpi_cxx_ok="yes"
  else
    sd_mpi_cxx_ok="no"
  fi
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_cxx_ok}" >&5
$as_echo "${sd_mpi_cxx_ok}" >&6; }

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"


      fi
      if test "${sd_mpi_enable_fc}" = "yes"; then

  # Init
  sd_mpi_fc_ok="unknown"
  sd_mpi_fc_api_ok="unknown"

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  CPPFLAGS="${CPPFLAGS} ${sd_mpi_cppflags}"
  FCFLAGS="${FCFLAGS} ${sd_mpi_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_mpi_ldflags}"
  LIBS="${sd_mpi_libs} ${LIBS}"

  # Check the MPI implementation

  # Check MPI C API
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI Fortran API works" >&5
$as_echo_n "checking whether the MPI Fortran API works... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use mpi
      integer :: ierr
      call mpi_init(ierr)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_mpi_fc_api_ok="yes"
else
  sd_mpi_fc_api_ok="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_fc_api_ok}" >&5
$as_echo "${sd_mpi_fc_api_ok}" >&6; }


  # Validate Fortran support
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI Fortran environment works" >&5
$as_echo_n "checking whether the MPI Fortran environment works... " >&6; }
  if test "${sd_mpi_fc_api_ok}" = "yes"; then
    sd_mpi_fc_ok="yes"
  else
    sd_mpi_fc_ok="no"
  fi
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_mpi_fc_ok}" >&5
$as_echo "${sd_mpi_fc_ok}" >&6; }

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"


      fi
    fi

    # Validate implementation status
    tmp_mpi_ok="yes"
    if test "${sd_mpi_cc_ok}" = "yes"; then
      if test "${sd_mpi_enable_cxx}" = "yes" -a "${sd_mpi_cxx_ok}" != "yes"; then
        #tmp_mpi_ok="no"
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: MPI C++ support is broken" >&5
$as_echo "$as_me: WARNING: MPI C++ support is broken" >&2;}
      fi
      if test "${sd_mpi_enable_fc}" = "yes" -a "${sd_mpi_fc_ok}" != "yes"; then
        tmp_mpi_ok="no"
      fi
      sd_mpi_ok="${tmp_mpi_ok}"
    else
      sd_mpi_ok="no"
    fi

    # Take decision according to policy
    if test "${sd_mpi_ok}" = "yes"; then
      sd_mpi_enable="yes"
    else
      if test "${sd_mpi_enable}" = "yes"; then
        case "${sd_mpi_policy}" in
          fail)
            { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "MPI support does not work
See \`config.log' for more details" "$LINENO" 5; }
            ;;
          skip)
            sd_mpi_enable="no"
            ;;
          warn)
            sd_mpi_enable="no"
            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: MPI support does not work and has been disabled" >&5
$as_echo "$as_me: WARNING: MPI support does not work and has been disabled" >&2;}
	    ;;
        esac
      else
        sd_mpi_enable="no"
      fi
    fi

  fi

  # Make MPI status available to the source code
  if test "${sd_mpi_enable}" = "yes" -a "${sd_mpi_ok}" = "yes"; then

$as_echo "#define HAVE_MPI 1" >>confdefs.h

  fi

  abi_mpi_ok="${sd_mpi_ok}"

  if test "${sd_mpi_enable}" = "yes"; then

    if test "${sd_mpi_ok}" = "yes"; then

      # Force abi_mpi_enable to "yes", for clarity and to avoid having to
      # further test "auto"
      abi_mpi_enable="yes"

      # Propagate MPI I/O trigger
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build MPI I/O code" >&5
$as_echo_n "checking whether to build MPI I/O code... " >&6; }
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_mpi_io_enable}" >&5
$as_echo "${abi_mpi_io_enable}" >&6; }
      if test "${abi_mpi_io_enable}" = "yes" -o "${abi_mpi_io_enable}" = "auto"; then
        abi_mpi_io_enable="yes"

$as_echo "#define HAVE_MPI_IO 1" >>confdefs.h

      fi

      # Check MPI I/O trigger
      if test "${abi_mpi_enable}" = "yes" -a "${abi_mpi_io_enable}" = "no"; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling MPI I/O is not recommended" >&5
$as_echo "$as_me: WARNING: disabling MPI I/O is not recommended" >&2;}
      fi

      # Check MPI level actually supported

  if test "${sd_mpi_fc_ok}" = "yes"; then

    # Back-up build environment


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"



    # Prepare build environment
    CPPFLAGS="${CPPFLAGS} ${abi_mpi_incs}"
    LDFLAGS="${FC_LDFLAGS}"
    LIBS="${FC_LIBS} ${abi_mpi_libs}"

    # Try to compile a MPI-2 Fortran program
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking which level of MPI is supported by the Fortran compiler" >&5
$as_echo_n "checking which level of MPI is supported by the Fortran compiler... " >&6; }
    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

    cat > conftest.$ac_ext <<_ACEOF
      program main

              use mpi
              integer :: ierr
              call mpi_init(ierr)
              call mpi_finalize(ierr)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  abi_mpi_fc_level="2"
else
  abi_mpi_fc_level="1"
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

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_mpi_fc_level}" >&5
$as_echo "${abi_mpi_fc_level}" >&6; }

    # Restore build environment


    ABI_CPPFLAGS="${abi_env_ABI_CPPFLAGS}"

    AR="${abi_env_AR}"

    ARFLAGS="${abi_env_ARFLAGS}"

    ARFLAGS_CMD="${abi_env_ARFLAGS_CMD}"

    ARFLAGS_DEBUG="${abi_env_ARFLAGS_DEBUG}"

    ARFLAGS_EXTRA="${abi_env_ARFLAGS_EXTRA}"

    ARFLAGS_HINTS="${abi_env_ARFLAGS_HINTS}"

    ARFLAGS_OPTIM="${abi_env_ARFLAGS_OPTIM}"

    CC="${abi_env_CC}"

    CC_LDFLAGS="${abi_env_CC_LDFLAGS}"

    CC_LDFLAGS_DEBUG="${abi_env_CC_LDFLAGS_DEBUG}"

    CC_LDFLAGS_EXTRA="${abi_env_CC_LDFLAGS_EXTRA}"

    CC_LDFLAGS_GPU="${abi_env_CC_LDFLAGS_GPU}"

    CC_LDFLAGS_HINTS="${abi_env_CC_LDFLAGS_HINTS}"

    CC_LDFLAGS_OPTIM="${abi_env_CC_LDFLAGS_OPTIM}"

    CC_LIBS="${abi_env_CC_LIBS}"

    CC_LIBS_DEBUG="${abi_env_CC_LIBS_DEBUG}"

    CC_LIBS_EXTRA="${abi_env_CC_LIBS_EXTRA}"

    CC_LIBS_GPU="${abi_env_CC_LIBS_GPU}"

    CC_LIBS_HINTS="${abi_env_CC_LIBS_HINTS}"

    CC_LIBS_OPTIM="${abi_env_CC_LIBS_OPTIM}"

    CFLAGS="${abi_env_CFLAGS}"

    CFLAGS_DEBUG="${abi_env_CFLAGS_DEBUG}"

    CFLAGS_EXTRA="${abi_env_CFLAGS_EXTRA}"

    CFLAGS_GPU="${abi_env_CFLAGS_GPU}"

    CFLAGS_HINTS="${abi_env_CFLAGS_HINTS}"

    CFLAGS_OPTIM="${abi_env_CFLAGS_OPTIM}"

    CPP="${abi_env_CPP}"

    CPPFLAGS="${abi_env_CPPFLAGS}"

    CPPFLAGS_DEBUG="${abi_env_CPPFLAGS_DEBUG}"

    CPPFLAGS_EXTRA="${abi_env_CPPFLAGS_EXTRA}"

    CPPFLAGS_GPU="${abi_env_CPPFLAGS_GPU}"

    CPPFLAGS_HINTS="${abi_env_CPPFLAGS_HINTS}"

    CPPFLAGS_OPTIM="${abi_env_CPPFLAGS_OPTIM}"

    CXX="${abi_env_CXX}"

    CXXFLAGS="${abi_env_CXXFLAGS}"

    CXXFLAGS_DEBUG="${abi_env_CXXFLAGS_DEBUG}"

    CXXFLAGS_EXTRA="${abi_env_CXXFLAGS_EXTRA}"

    CXXFLAGS_GPU="${abi_env_CXXFLAGS_GPU}"

    CXXFLAGS_HINTS="${abi_env_CXXFLAGS_HINTS}"

    CXXFLAGS_OPTIM="${abi_env_CXXFLAGS_OPTIM}"

    CXX_LDFLAGS="${abi_env_CXX_LDFLAGS}"

    CXX_LDFLAGS_DEBUG="${abi_env_CXX_LDFLAGS_DEBUG}"

    CXX_LDFLAGS_EXTRA="${abi_env_CXX_LDFLAGS_EXTRA}"

    CXX_LDFLAGS_GPU="${abi_env_CXX_LDFLAGS_GPU}"

    CXX_LDFLAGS_HINTS="${abi_env_CXX_LDFLAGS_HINTS}"

    CXX_LDFLAGS_OPTIM="${abi_env_CXX_LDFLAGS_OPTIM}"

    CXX_LIBS="${abi_env_CXX_LIBS}"

    CXX_LIBS_DEBUG="${abi_env_CXX_LIBS_DEBUG}"

    CXX_LIBS_EXTRA="${abi_env_CXX_LIBS_EXTRA}"

    CXX_LIBS_GPU="${abi_env_CXX_LIBS_GPU}"

    CXX_LIBS_HINTS="${abi_env_CXX_LIBS_HINTS}"

    CXX_LIBS_OPTIM="${abi_env_CXX_LIBS_OPTIM}"

    DEFS="${abi_env_DEFS}"

    F77="${abi_env_F77}"

    FC="${abi_env_FC}"

    FCFLAGS="${abi_env_FCFLAGS}"

    FCFLAGS_DEBUG="${abi_env_FCFLAGS_DEBUG}"

    FCFLAGS_EXTRA="${abi_env_FCFLAGS_EXTRA}"

    FCFLAGS_FIXEDFORM="${abi_env_FCFLAGS_FIXEDFORM}"

    FCFLAGS_FREEFORM="${abi_env_FCFLAGS_FREEFORM}"

    FCFLAGS_HINTS="${abi_env_FCFLAGS_HINTS}"

    FCFLAGS_MODDIR="${abi_env_FCFLAGS_MODDIR}"

    FCFLAGS_OPENMP="${abi_env_FCFLAGS_OPENMP}"

    FCFLAGS_OPENMP_OFFLOAD="${abi_env_FCFLAGS_OPENMP_OFFLOAD}"

    FCFLAGS_OPTIM="${abi_env_FCFLAGS_OPTIM}"

    FC_LDFLAGS="${abi_env_FC_LDFLAGS}"

    FC_LDFLAGS_DEBUG="${abi_env_FC_LDFLAGS_DEBUG}"

    FC_LDFLAGS_EXTRA="${abi_env_FC_LDFLAGS_EXTRA}"

    FC_LDFLAGS_HINTS="${abi_env_FC_LDFLAGS_HINTS}"

    FC_LDFLAGS_OPTIM="${abi_env_FC_LDFLAGS_OPTIM}"

    FC_LIBS="${abi_env_FC_LIBS}"

    FC_LIBS_DEBUG="${abi_env_FC_LIBS_DEBUG}"

    FC_LIBS_EXTRA="${abi_env_FC_LIBS_EXTRA}"

    FC_LIBS_HINTS="${abi_env_FC_LIBS_HINTS}"

    FC_LIBS_OPTIM="${abi_env_FC_LIBS_OPTIM}"

    FFT_CFLAGS="${abi_env_FFT_CFLAGS}"

    FFT_FCFLAGS="${abi_env_FFT_FCFLAGS}"

    FPP="${abi_env_FPP}"

    FPPFLAGS="${abi_env_FPPFLAGS}"

    FPPFLAGS_DEBUG="${abi_env_FPPFLAGS_DEBUG}"

    FPPFLAGS_EXTRA="${abi_env_FPPFLAGS_EXTRA}"

    FPPFLAGS_HINTS="${abi_env_FPPFLAGS_HINTS}"

    FPPFLAGS_OPTIM="${abi_env_FPPFLAGS_OPTIM}"

    GPU_ARCH="${abi_env_GPU_ARCH}"

    LD="${abi_env_LD}"

    MODEXT="${abi_env_MODEXT}"

    NM="${abi_env_NM}"

    NVCC="${abi_env_NVCC}"

    NVCC_CFLAGS="${abi_env_NVCC_CFLAGS}"

    NVCC_CPPFLAGS="${abi_env_NVCC_CPPFLAGS}"

    NVCC_LDFLAGS="${abi_env_NVCC_LDFLAGS}"

    NVCC_LIBS="${abi_env_NVCC_LIBS}"

    PYFLAGS="${abi_env_PYFLAGS}"

    PYTHON_CPPFLAGS="${abi_env_PYTHON_CPPFLAGS}"

    RANLIB="${abi_env_RANLIB}"

    TRUE_CPP="${abi_env_TRUE_CPP}"

    XPP="${abi_env_XPP}"

    XPPFLAGS="${abi_env_XPPFLAGS}"

    XPPFLAGS_DEBUG="${abi_env_XPPFLAGS_DEBUG}"

    XPPFLAGS_EXTRA="${abi_env_XPPFLAGS_EXTRA}"

    XPPFLAGS_OPTIM="${abi_env_XPPFLAGS_OPTIM}"



  fi # sd_mpi_fc_ok = yes


      # Select MPI level
      if test "${abi_mpi_level}" = ""; then
        abi_mpi_level="${abi_mpi_fc_level}"
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: forcing MPI-${abi_mpi_level} standard level support" >&5
$as_echo "$as_me: forcing MPI-${abi_mpi_level} standard level support" >&6;}
        if test "${abi_mpi_level}" != "${abi_mpi_fc_level}"; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: detected MPI-${abi_mpi_fc_level} support but using MPI-${abi_mpi_level} instructions" >&5
$as_echo "$as_me: WARNING: detected MPI-${abi_mpi_fc_level} support but using MPI-${abi_mpi_level} instructions" >&2;}
        fi
      fi

      # Propagate MPI level
      case "${abi_mpi_level}" in
        1)
          as_fn_error $? "prehistoric MPI implementations are not supported anymore" "$LINENO" 5
          ;;
        2)

$as_echo "#define HAVE_MPI2 1" >>confdefs.h

          ;;
        3)

$as_echo "#define HAVE_MPI3 1" >>confdefs.h

          ;;
        *)
          as_fn_error $? "invalid MPI level: MPI-${abi_mpi_level}" "$LINENO" 5
          ;;
      esac

      # Test if MPI has buggy interfaces for scalars
      if test "${abi_mpi_interfaces_bugfix_enable}" = "no" -o "${abi_mpi_interfaces_bugfix_enable}" = "auto"; then

  # Set default values
  abi_mpi_buggy="no"

  if test "${abi_mpi_fc_level}" -ge "2"; then

    # Back-up build environment


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"



    # Prepare build environment
    CPPFLAGS="${CPPFLAGS} ${abi_mpi_incs}"
    LDFLAGS="${FC_LDFLAGS}"
    LIBS="${FC_LIBS} ${abi_mpi_libs}"

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether MPI has buggy interfaces for scalars" >&5
$as_echo_n "checking whether MPI has buggy interfaces for scalars... " >&6; }
    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

    cat > conftest.$ac_ext <<_ACEOF
      program main

        use mpi
        integer :: comm,ierr,ival,isum
        real*8 :: xval,xsum
        call mpi_init(ierr)
        call mpi_allreduce(ival,isum,1,MPI_INTEGER,MPI_SUM,comm,ierr)
        call mpi_allreduce(xval,xsum,1,MPI_DOUBLE_PRECISION,MPI_SUM,comm,ierr)
        call mpi_allgather(xval,1,MPI_DOUBLE_PRECISION,xsum,1,MPI_DOUBLE_PRECISION,comm,ierr)
        call mpi_finalize(ierr)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  abi_mpi_buggy="no"
else
  abi_mpi_buggy="yes"
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

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_mpi_buggy}" >&5
$as_echo "${abi_mpi_buggy}" >&6; }

    # Restore build environment


    ABI_CPPFLAGS="${abi_env_ABI_CPPFLAGS}"

    AR="${abi_env_AR}"

    ARFLAGS="${abi_env_ARFLAGS}"

    ARFLAGS_CMD="${abi_env_ARFLAGS_CMD}"

    ARFLAGS_DEBUG="${abi_env_ARFLAGS_DEBUG}"

    ARFLAGS_EXTRA="${abi_env_ARFLAGS_EXTRA}"

    ARFLAGS_HINTS="${abi_env_ARFLAGS_HINTS}"

    ARFLAGS_OPTIM="${abi_env_ARFLAGS_OPTIM}"

    CC="${abi_env_CC}"

    CC_LDFLAGS="${abi_env_CC_LDFLAGS}"

    CC_LDFLAGS_DEBUG="${abi_env_CC_LDFLAGS_DEBUG}"

    CC_LDFLAGS_EXTRA="${abi_env_CC_LDFLAGS_EXTRA}"

    CC_LDFLAGS_GPU="${abi_env_CC_LDFLAGS_GPU}"

    CC_LDFLAGS_HINTS="${abi_env_CC_LDFLAGS_HINTS}"

    CC_LDFLAGS_OPTIM="${abi_env_CC_LDFLAGS_OPTIM}"

    CC_LIBS="${abi_env_CC_LIBS}"

    CC_LIBS_DEBUG="${abi_env_CC_LIBS_DEBUG}"

    CC_LIBS_EXTRA="${abi_env_CC_LIBS_EXTRA}"

    CC_LIBS_GPU="${abi_env_CC_LIBS_GPU}"

    CC_LIBS_HINTS="${abi_env_CC_LIBS_HINTS}"

    CC_LIBS_OPTIM="${abi_env_CC_LIBS_OPTIM}"

    CFLAGS="${abi_env_CFLAGS}"

    CFLAGS_DEBUG="${abi_env_CFLAGS_DEBUG}"

    CFLAGS_EXTRA="${abi_env_CFLAGS_EXTRA}"

    CFLAGS_GPU="${abi_env_CFLAGS_GPU}"

    CFLAGS_HINTS="${abi_env_CFLAGS_HINTS}"

    CFLAGS_OPTIM="${abi_env_CFLAGS_OPTIM}"

    CPP="${abi_env_CPP}"

    CPPFLAGS="${abi_env_CPPFLAGS}"

    CPPFLAGS_DEBUG="${abi_env_CPPFLAGS_DEBUG}"

    CPPFLAGS_EXTRA="${abi_env_CPPFLAGS_EXTRA}"

    CPPFLAGS_GPU="${abi_env_CPPFLAGS_GPU}"

    CPPFLAGS_HINTS="${abi_env_CPPFLAGS_HINTS}"

    CPPFLAGS_OPTIM="${abi_env_CPPFLAGS_OPTIM}"

    CXX="${abi_env_CXX}"

    CXXFLAGS="${abi_env_CXXFLAGS}"

    CXXFLAGS_DEBUG="${abi_env_CXXFLAGS_DEBUG}"

    CXXFLAGS_EXTRA="${abi_env_CXXFLAGS_EXTRA}"

    CXXFLAGS_GPU="${abi_env_CXXFLAGS_GPU}"

    CXXFLAGS_HINTS="${abi_env_CXXFLAGS_HINTS}"

    CXXFLAGS_OPTIM="${abi_env_CXXFLAGS_OPTIM}"

    CXX_LDFLAGS="${abi_env_CXX_LDFLAGS}"

    CXX_LDFLAGS_DEBUG="${abi_env_CXX_LDFLAGS_DEBUG}"

    CXX_LDFLAGS_EXTRA="${abi_env_CXX_LDFLAGS_EXTRA}"

    CXX_LDFLAGS_GPU="${abi_env_CXX_LDFLAGS_GPU}"

    CXX_LDFLAGS_HINTS="${abi_env_CXX_LDFLAGS_HINTS}"

    CXX_LDFLAGS_OPTIM="${abi_env_CXX_LDFLAGS_OPTIM}"

    CXX_LIBS="${abi_env_CXX_LIBS}"

    CXX_LIBS_DEBUG="${abi_env_CXX_LIBS_DEBUG}"

    CXX_LIBS_EXTRA="${abi_env_CXX_LIBS_EXTRA}"

    CXX_LIBS_GPU="${abi_env_CXX_LIBS_GPU}"

    CXX_LIBS_HINTS="${abi_env_CXX_LIBS_HINTS}"

    CXX_LIBS_OPTIM="${abi_env_CXX_LIBS_OPTIM}"

    DEFS="${abi_env_DEFS}"

    F77="${abi_env_F77}"

    FC="${abi_env_FC}"

    FCFLAGS="${abi_env_FCFLAGS}"

    FCFLAGS_DEBUG="${abi_env_FCFLAGS_DEBUG}"

    FCFLAGS_EXTRA="${abi_env_FCFLAGS_EXTRA}"

    FCFLAGS_FIXEDFORM="${abi_env_FCFLAGS_FIXEDFORM}"

    FCFLAGS_FREEFORM="${abi_env_FCFLAGS_FREEFORM}"

    FCFLAGS_HINTS="${abi_env_FCFLAGS_HINTS}"

    FCFLAGS_MODDIR="${abi_env_FCFLAGS_MODDIR}"

    FCFLAGS_OPENMP="${abi_env_FCFLAGS_OPENMP}"

    FCFLAGS_OPENMP_OFFLOAD="${abi_env_FCFLAGS_OPENMP_OFFLOAD}"

    FCFLAGS_OPTIM="${abi_env_FCFLAGS_OPTIM}"

    FC_LDFLAGS="${abi_env_FC_LDFLAGS}"

    FC_LDFLAGS_DEBUG="${abi_env_FC_LDFLAGS_DEBUG}"

    FC_LDFLAGS_EXTRA="${abi_env_FC_LDFLAGS_EXTRA}"

    FC_LDFLAGS_HINTS="${abi_env_FC_LDFLAGS_HINTS}"

    FC_LDFLAGS_OPTIM="${abi_env_FC_LDFLAGS_OPTIM}"

    FC_LIBS="${abi_env_FC_LIBS}"

    FC_LIBS_DEBUG="${abi_env_FC_LIBS_DEBUG}"

    FC_LIBS_EXTRA="${abi_env_FC_LIBS_EXTRA}"

    FC_LIBS_HINTS="${abi_env_FC_LIBS_HINTS}"

    FC_LIBS_OPTIM="${abi_env_FC_LIBS_OPTIM}"

    FFT_CFLAGS="${abi_env_FFT_CFLAGS}"

    FFT_FCFLAGS="${abi_env_FFT_FCFLAGS}"

    FPP="${abi_env_FPP}"

    FPPFLAGS="${abi_env_FPPFLAGS}"

    FPPFLAGS_DEBUG="${abi_env_FPPFLAGS_DEBUG}"

    FPPFLAGS_EXTRA="${abi_env_FPPFLAGS_EXTRA}"

    FPPFLAGS_HINTS="${abi_env_FPPFLAGS_HINTS}"

    FPPFLAGS_OPTIM="${abi_env_FPPFLAGS_OPTIM}"

    GPU_ARCH="${abi_env_GPU_ARCH}"

    LD="${abi_env_LD}"

    MODEXT="${abi_env_MODEXT}"

    NM="${abi_env_NM}"

    NVCC="${abi_env_NVCC}"

    NVCC_CFLAGS="${abi_env_NVCC_CFLAGS}"

    NVCC_CPPFLAGS="${abi_env_NVCC_CPPFLAGS}"

    NVCC_LDFLAGS="${abi_env_NVCC_LDFLAGS}"

    NVCC_LIBS="${abi_env_NVCC_LIBS}"

    PYFLAGS="${abi_env_PYFLAGS}"

    PYTHON_CPPFLAGS="${abi_env_PYTHON_CPPFLAGS}"

    RANLIB="${abi_env_RANLIB}"

    TRUE_CPP="${abi_env_TRUE_CPP}"

    XPP="${abi_env_XPP}"

    XPPFLAGS="${abi_env_XPPFLAGS}"

    XPPFLAGS_DEBUG="${abi_env_XPPFLAGS_DEBUG}"

    XPPFLAGS_EXTRA="${abi_env_XPPFLAGS_EXTRA}"

    XPPFLAGS_OPTIM="${abi_env_XPPFLAGS_OPTIM}"


  fi

        if test "${abi_mpi_buggy}" = "yes" -a "${abi_mpi_interfaces_bugfix_enable}" = "no"; then
          as_fn_error $? "--enable-mpi-interfaces-bugfix option is deactivated but MPI seems to have buggy interfaces!" "$LINENO" 5
        fi
        if test "${abi_mpi_interfaces_bugfix_enable}" = "auto"; then
          abi_mpi_interfaces_bugfix_enable="${abi_mpi_buggy}"
        fi
      fi
      if test "${abi_mpi_interfaces_bugfix_enable}" = "yes"; then

$as_echo "#define HAVE_MPI_BUGGY_INTERFACES 1" >>confdefs.h

      fi

      # Test the availability of MPI_IN_PLACE
      if test "${abi_mpi_inplace_enable}" = "yes" -o "${abi_mpi_inplace_enable}" = "auto"; then
        if test "${abi_mpi_buggy}" = "no"; then

  # Set default values
  abi_mpi_inplace="no"

  if test "${abi_mpi_fc_level}" -ge "2"; then

    # Back-up build environment


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"



    # Prepare build environment
    CPPFLAGS="${CPPFLAGS} ${abi_mpi_incs}"
    LDFLAGS="${FC_LDFLAGS}"
    LIBS="${FC_LIBS} ${abi_mpi_libs}"

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether MPI provides MPI_IN_PLACE" >&5
$as_echo_n "checking whether MPI provides MPI_IN_PLACE... " >&6; }
    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

    cat > conftest.$ac_ext <<_ACEOF
      program main

        use mpi
        integer :: comm,ierr,counts(3),displs(3)
        real*8 :: xval(5)
        call mpi_init(ierr)
        call mpi_allreduce(MPI_IN_PLACE,xval,5,MPI_DOUBLE_PRECISION,MPI_SUM,comm,ierr)
        call mpi_allgather(MPI_IN_PLACE,1,MPI_DOUBLE_PRECISION,xval,5,MPI_DOUBLE_PRECISION,comm,ierr)
        call mpi_allgatherv(MPI_IN_PLACE,1,MPI_DOUBLE_PRECISION,xval,counts,displs,MPI_DOUBLE_PRECISION,comm,ierr)
        call mpi_finalize(ierr)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  abi_mpi_inplace="yes"
else
  abi_mpi_inplace="no"
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

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_mpi_inplace}" >&5
$as_echo "${abi_mpi_inplace}" >&6; }

    # Restore build environment


    ABI_CPPFLAGS="${abi_env_ABI_CPPFLAGS}"

    AR="${abi_env_AR}"

    ARFLAGS="${abi_env_ARFLAGS}"

    ARFLAGS_CMD="${abi_env_ARFLAGS_CMD}"

    ARFLAGS_DEBUG="${abi_env_ARFLAGS_DEBUG}"

    ARFLAGS_EXTRA="${abi_env_ARFLAGS_EXTRA}"

    ARFLAGS_HINTS="${abi_env_ARFLAGS_HINTS}"

    ARFLAGS_OPTIM="${abi_env_ARFLAGS_OPTIM}"

    CC="${abi_env_CC}"

    CC_LDFLAGS="${abi_env_CC_LDFLAGS}"

    CC_LDFLAGS_DEBUG="${abi_env_CC_LDFLAGS_DEBUG}"

    CC_LDFLAGS_EXTRA="${abi_env_CC_LDFLAGS_EXTRA}"

    CC_LDFLAGS_GPU="${abi_env_CC_LDFLAGS_GPU}"

    CC_LDFLAGS_HINTS="${abi_env_CC_LDFLAGS_HINTS}"

    CC_LDFLAGS_OPTIM="${abi_env_CC_LDFLAGS_OPTIM}"

    CC_LIBS="${abi_env_CC_LIBS}"

    CC_LIBS_DEBUG="${abi_env_CC_LIBS_DEBUG}"

    CC_LIBS_EXTRA="${abi_env_CC_LIBS_EXTRA}"

    CC_LIBS_GPU="${abi_env_CC_LIBS_GPU}"

    CC_LIBS_HINTS="${abi_env_CC_LIBS_HINTS}"

    CC_LIBS_OPTIM="${abi_env_CC_LIBS_OPTIM}"

    CFLAGS="${abi_env_CFLAGS}"

    CFLAGS_DEBUG="${abi_env_CFLAGS_DEBUG}"

    CFLAGS_EXTRA="${abi_env_CFLAGS_EXTRA}"

    CFLAGS_GPU="${abi_env_CFLAGS_GPU}"

    CFLAGS_HINTS="${abi_env_CFLAGS_HINTS}"

    CFLAGS_OPTIM="${abi_env_CFLAGS_OPTIM}"

    CPP="${abi_env_CPP}"

    CPPFLAGS="${abi_env_CPPFLAGS}"

    CPPFLAGS_DEBUG="${abi_env_CPPFLAGS_DEBUG}"

    CPPFLAGS_EXTRA="${abi_env_CPPFLAGS_EXTRA}"

    CPPFLAGS_GPU="${abi_env_CPPFLAGS_GPU}"

    CPPFLAGS_HINTS="${abi_env_CPPFLAGS_HINTS}"

    CPPFLAGS_OPTIM="${abi_env_CPPFLAGS_OPTIM}"

    CXX="${abi_env_CXX}"

    CXXFLAGS="${abi_env_CXXFLAGS}"

    CXXFLAGS_DEBUG="${abi_env_CXXFLAGS_DEBUG}"

    CXXFLAGS_EXTRA="${abi_env_CXXFLAGS_EXTRA}"

    CXXFLAGS_GPU="${abi_env_CXXFLAGS_GPU}"

    CXXFLAGS_HINTS="${abi_env_CXXFLAGS_HINTS}"

    CXXFLAGS_OPTIM="${abi_env_CXXFLAGS_OPTIM}"

    CXX_LDFLAGS="${abi_env_CXX_LDFLAGS}"

    CXX_LDFLAGS_DEBUG="${abi_env_CXX_LDFLAGS_DEBUG}"

    CXX_LDFLAGS_EXTRA="${abi_env_CXX_LDFLAGS_EXTRA}"

    CXX_LDFLAGS_GPU="${abi_env_CXX_LDFLAGS_GPU}"

    CXX_LDFLAGS_HINTS="${abi_env_CXX_LDFLAGS_HINTS}"

    CXX_LDFLAGS_OPTIM="${abi_env_CXX_LDFLAGS_OPTIM}"

    CXX_LIBS="${abi_env_CXX_LIBS}"

    CXX_LIBS_DEBUG="${abi_env_CXX_LIBS_DEBUG}"

    CXX_LIBS_EXTRA="${abi_env_CXX_LIBS_EXTRA}"

    CXX_LIBS_GPU="${abi_env_CXX_LIBS_GPU}"

    CXX_LIBS_HINTS="${abi_env_CXX_LIBS_HINTS}"

    CXX_LIBS_OPTIM="${abi_env_CXX_LIBS_OPTIM}"

    DEFS="${abi_env_DEFS}"

    F77="${abi_env_F77}"

    FC="${abi_env_FC}"

    FCFLAGS="${abi_env_FCFLAGS}"

    FCFLAGS_DEBUG="${abi_env_FCFLAGS_DEBUG}"

    FCFLAGS_EXTRA="${abi_env_FCFLAGS_EXTRA}"

    FCFLAGS_FIXEDFORM="${abi_env_FCFLAGS_FIXEDFORM}"

    FCFLAGS_FREEFORM="${abi_env_FCFLAGS_FREEFORM}"

    FCFLAGS_HINTS="${abi_env_FCFLAGS_HINTS}"

    FCFLAGS_MODDIR="${abi_env_FCFLAGS_MODDIR}"

    FCFLAGS_OPENMP="${abi_env_FCFLAGS_OPENMP}"

    FCFLAGS_OPENMP_OFFLOAD="${abi_env_FCFLAGS_OPENMP_OFFLOAD}"

    FCFLAGS_OPTIM="${abi_env_FCFLAGS_OPTIM}"

    FC_LDFLAGS="${abi_env_FC_LDFLAGS}"

    FC_LDFLAGS_DEBUG="${abi_env_FC_LDFLAGS_DEBUG}"

    FC_LDFLAGS_EXTRA="${abi_env_FC_LDFLAGS_EXTRA}"

    FC_LDFLAGS_HINTS="${abi_env_FC_LDFLAGS_HINTS}"

    FC_LDFLAGS_OPTIM="${abi_env_FC_LDFLAGS_OPTIM}"

    FC_LIBS="${abi_env_FC_LIBS}"

    FC_LIBS_DEBUG="${abi_env_FC_LIBS_DEBUG}"

    FC_LIBS_EXTRA="${abi_env_FC_LIBS_EXTRA}"

    FC_LIBS_HINTS="${abi_env_FC_LIBS_HINTS}"

    FC_LIBS_OPTIM="${abi_env_FC_LIBS_OPTIM}"

    FFT_CFLAGS="${abi_env_FFT_CFLAGS}"

    FFT_FCFLAGS="${abi_env_FFT_FCFLAGS}"

    FPP="${abi_env_FPP}"

    FPPFLAGS="${abi_env_FPPFLAGS}"

    FPPFLAGS_DEBUG="${abi_env_FPPFLAGS_DEBUG}"

    FPPFLAGS_EXTRA="${abi_env_FPPFLAGS_EXTRA}"

    FPPFLAGS_HINTS="${abi_env_FPPFLAGS_HINTS}"

    FPPFLAGS_OPTIM="${abi_env_FPPFLAGS_OPTIM}"

    GPU_ARCH="${abi_env_GPU_ARCH}"

    LD="${abi_env_LD}"

    MODEXT="${abi_env_MODEXT}"

    NM="${abi_env_NM}"

    NVCC="${abi_env_NVCC}"

    NVCC_CFLAGS="${abi_env_NVCC_CFLAGS}"

    NVCC_CPPFLAGS="${abi_env_NVCC_CPPFLAGS}"

    NVCC_LDFLAGS="${abi_env_NVCC_LDFLAGS}"

    NVCC_LIBS="${abi_env_NVCC_LIBS}"

    PYFLAGS="${abi_env_PYFLAGS}"

    PYTHON_CPPFLAGS="${abi_env_PYTHON_CPPFLAGS}"

    RANLIB="${abi_env_RANLIB}"

    TRUE_CPP="${abi_env_TRUE_CPP}"

    XPP="${abi_env_XPP}"

    XPPFLAGS="${abi_env_XPPFLAGS}"

    XPPFLAGS_DEBUG="${abi_env_XPPFLAGS_DEBUG}"

    XPPFLAGS_EXTRA="${abi_env_XPPFLAGS_EXTRA}"

    XPPFLAGS_OPTIM="${abi_env_XPPFLAGS_OPTIM}"


  fi

          if test "${abi_mpi_inplace}" = "no" -a "${abi_mpi_inplace_enable}" = "yes"; then
            as_fn_error $? "--enable-mpi-inplace option is activated but MPI_IN_PLACE is not available!" "$LINENO" 5
          fi
        else
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: MPI_IN_PLACE is deactivated because MPI has buggy interfaces" >&5
$as_echo "$as_me: WARNING: MPI_IN_PLACE is deactivated because MPI has buggy interfaces" >&2;}
          abi_mpi_inplace = "no"
        fi
        if test "${abi_mpi_inplace_enable}" = "auto"; then
          abi_mpi_inplace_enable="${abi_mpi_inplace}"
        fi
      fi
      if test "${abi_mpi_inplace_enable}" = "yes"; then

$as_echo "#define HAVE_MPI2_INPLACE 1" >>confdefs.h

      fi

      # Test the availability of problematic MPI constants

  # Set default values
  abi_mpi_integer16_ok="no"


  # Back-up build environment


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"



  # Prepare build environment
  CPPFLAGS="${CPPFLAGS} ${lib_mpi_incs}"
  LDFLAGS="${FC_LDFLAGS}"
  LIBS="${FC_LIBS} ${lib_mpi_libs}"

  # Try to compile a Fortran program
  # Note: we assume a MPI implementation that provides the mpi module
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI library supports MPI_INTEGER16" >&5
$as_echo_n "checking whether the MPI library supports MPI_INTEGER16... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use mpi

      integer, parameter :: ii = MPI_INTEGER16


      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  abi_mpi_integer16_ok="yes"
else
  abi_mpi_integer16_ok="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_mpi_integer16_ok}" >&5
$as_echo "${abi_mpi_integer16_ok}" >&6; }

  # Restore build environment


    ABI_CPPFLAGS="${abi_env_ABI_CPPFLAGS}"

    AR="${abi_env_AR}"

    ARFLAGS="${abi_env_ARFLAGS}"

    ARFLAGS_CMD="${abi_env_ARFLAGS_CMD}"

    ARFLAGS_DEBUG="${abi_env_ARFLAGS_DEBUG}"

    ARFLAGS_EXTRA="${abi_env_ARFLAGS_EXTRA}"

    ARFLAGS_HINTS="${abi_env_ARFLAGS_HINTS}"

    ARFLAGS_OPTIM="${abi_env_ARFLAGS_OPTIM}"

    CC="${abi_env_CC}"

    CC_LDFLAGS="${abi_env_CC_LDFLAGS}"

    CC_LDFLAGS_DEBUG="${abi_env_CC_LDFLAGS_DEBUG}"

    CC_LDFLAGS_EXTRA="${abi_env_CC_LDFLAGS_EXTRA}"

    CC_LDFLAGS_GPU="${abi_env_CC_LDFLAGS_GPU}"

    CC_LDFLAGS_HINTS="${abi_env_CC_LDFLAGS_HINTS}"

    CC_LDFLAGS_OPTIM="${abi_env_CC_LDFLAGS_OPTIM}"

    CC_LIBS="${abi_env_CC_LIBS}"

    CC_LIBS_DEBUG="${abi_env_CC_LIBS_DEBUG}"

    CC_LIBS_EXTRA="${abi_env_CC_LIBS_EXTRA}"

    CC_LIBS_GPU="${abi_env_CC_LIBS_GPU}"

    CC_LIBS_HINTS="${abi_env_CC_LIBS_HINTS}"

    CC_LIBS_OPTIM="${abi_env_CC_LIBS_OPTIM}"

    CFLAGS="${abi_env_CFLAGS}"

    CFLAGS_DEBUG="${abi_env_CFLAGS_DEBUG}"

    CFLAGS_EXTRA="${abi_env_CFLAGS_EXTRA}"

    CFLAGS_GPU="${abi_env_CFLAGS_GPU}"

    CFLAGS_HINTS="${abi_env_CFLAGS_HINTS}"

    CFLAGS_OPTIM="${abi_env_CFLAGS_OPTIM}"

    CPP="${abi_env_CPP}"

    CPPFLAGS="${abi_env_CPPFLAGS}"

    CPPFLAGS_DEBUG="${abi_env_CPPFLAGS_DEBUG}"

    CPPFLAGS_EXTRA="${abi_env_CPPFLAGS_EXTRA}"

    CPPFLAGS_GPU="${abi_env_CPPFLAGS_GPU}"

    CPPFLAGS_HINTS="${abi_env_CPPFLAGS_HINTS}"

    CPPFLAGS_OPTIM="${abi_env_CPPFLAGS_OPTIM}"

    CXX="${abi_env_CXX}"

    CXXFLAGS="${abi_env_CXXFLAGS}"

    CXXFLAGS_DEBUG="${abi_env_CXXFLAGS_DEBUG}"

    CXXFLAGS_EXTRA="${abi_env_CXXFLAGS_EXTRA}"

    CXXFLAGS_GPU="${abi_env_CXXFLAGS_GPU}"

    CXXFLAGS_HINTS="${abi_env_CXXFLAGS_HINTS}"

    CXXFLAGS_OPTIM="${abi_env_CXXFLAGS_OPTIM}"

    CXX_LDFLAGS="${abi_env_CXX_LDFLAGS}"

    CXX_LDFLAGS_DEBUG="${abi_env_CXX_LDFLAGS_DEBUG}"

    CXX_LDFLAGS_EXTRA="${abi_env_CXX_LDFLAGS_EXTRA}"

    CXX_LDFLAGS_GPU="${abi_env_CXX_LDFLAGS_GPU}"

    CXX_LDFLAGS_HINTS="${abi_env_CXX_LDFLAGS_HINTS}"

    CXX_LDFLAGS_OPTIM="${abi_env_CXX_LDFLAGS_OPTIM}"

    CXX_LIBS="${abi_env_CXX_LIBS}"

    CXX_LIBS_DEBUG="${abi_env_CXX_LIBS_DEBUG}"

    CXX_LIBS_EXTRA="${abi_env_CXX_LIBS_EXTRA}"

    CXX_LIBS_GPU="${abi_env_CXX_LIBS_GPU}"

    CXX_LIBS_HINTS="${abi_env_CXX_LIBS_HINTS}"

    CXX_LIBS_OPTIM="${abi_env_CXX_LIBS_OPTIM}"

    DEFS="${abi_env_DEFS}"

    F77="${abi_env_F77}"

    FC="${abi_env_FC}"

    FCFLAGS="${abi_env_FCFLAGS}"

    FCFLAGS_DEBUG="${abi_env_FCFLAGS_DEBUG}"

    FCFLAGS_EXTRA="${abi_env_FCFLAGS_EXTRA}"

    FCFLAGS_FIXEDFORM="${abi_env_FCFLAGS_FIXEDFORM}"

    FCFLAGS_FREEFORM="${abi_env_FCFLAGS_FREEFORM}"

    FCFLAGS_HINTS="${abi_env_FCFLAGS_HINTS}"

    FCFLAGS_MODDIR="${abi_env_FCFLAGS_MODDIR}"

    FCFLAGS_OPENMP="${abi_env_FCFLAGS_OPENMP}"

    FCFLAGS_OPENMP_OFFLOAD="${abi_env_FCFLAGS_OPENMP_OFFLOAD}"

    FCFLAGS_OPTIM="${abi_env_FCFLAGS_OPTIM}"

    FC_LDFLAGS="${abi_env_FC_LDFLAGS}"

    FC_LDFLAGS_DEBUG="${abi_env_FC_LDFLAGS_DEBUG}"

    FC_LDFLAGS_EXTRA="${abi_env_FC_LDFLAGS_EXTRA}"

    FC_LDFLAGS_HINTS="${abi_env_FC_LDFLAGS_HINTS}"

    FC_LDFLAGS_OPTIM="${abi_env_FC_LDFLAGS_OPTIM}"

    FC_LIBS="${abi_env_FC_LIBS}"

    FC_LIBS_DEBUG="${abi_env_FC_LIBS_DEBUG}"

    FC_LIBS_EXTRA="${abi_env_FC_LIBS_EXTRA}"

    FC_LIBS_HINTS="${abi_env_FC_LIBS_HINTS}"

    FC_LIBS_OPTIM="${abi_env_FC_LIBS_OPTIM}"

    FFT_CFLAGS="${abi_env_FFT_CFLAGS}"

    FFT_FCFLAGS="${abi_env_FFT_FCFLAGS}"

    FPP="${abi_env_FPP}"

    FPPFLAGS="${abi_env_FPPFLAGS}"

    FPPFLAGS_DEBUG="${abi_env_FPPFLAGS_DEBUG}"

    FPPFLAGS_EXTRA="${abi_env_FPPFLAGS_EXTRA}"

    FPPFLAGS_HINTS="${abi_env_FPPFLAGS_HINTS}"

    FPPFLAGS_OPTIM="${abi_env_FPPFLAGS_OPTIM}"

    GPU_ARCH="${abi_env_GPU_ARCH}"

    LD="${abi_env_LD}"

    MODEXT="${abi_env_MODEXT}"

    NM="${abi_env_NM}"

    NVCC="${abi_env_NVCC}"

    NVCC_CFLAGS="${abi_env_NVCC_CFLAGS}"

    NVCC_CPPFLAGS="${abi_env_NVCC_CPPFLAGS}"

    NVCC_LDFLAGS="${abi_env_NVCC_LDFLAGS}"

    NVCC_LIBS="${abi_env_NVCC_LIBS}"

    PYFLAGS="${abi_env_PYFLAGS}"

    PYTHON_CPPFLAGS="${abi_env_PYTHON_CPPFLAGS}"

    RANLIB="${abi_env_RANLIB}"

    TRUE_CPP="${abi_env_TRUE_CPP}"

    XPP="${abi_env_XPP}"

    XPPFLAGS="${abi_env_XPPFLAGS}"

    XPPFLAGS_DEBUG="${abi_env_XPPFLAGS_DEBUG}"

    XPPFLAGS_EXTRA="${abi_env_XPPFLAGS_EXTRA}"

    XPPFLAGS_OPTIM="${abi_env_XPPFLAGS_OPTIM}"



  # Forward information to the compiler
  if test "${abi_mpi_integer16_ok}" = "yes"; then

$as_echo "#define HAVE_MPI_INTEGER16 1" >>confdefs.h

  fi


      # Check the availability of useful MPI primitives

  # Set default values
  abi_mpi_get_library_version="unknown"

  if test "${abi_mpi_fc_ok}" = "yes"; then

    # Back-up build environment


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"



    # Prepare build environment
    CPPFLAGS="${CPPFLAGS} ${abi_mpi_incs}"
    LDFLAGS="${FC_LDFLAGS}"
    LIBS="${FC_LIBS} ${abi_mpi_libs}"

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether MPI provides MPI_Get_library_version" >&5
$as_echo_n "checking whether MPI provides MPI_Get_library_version... " >&6; }
    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

    cat > conftest.$ac_ext <<_ACEOF
      program main

              use mpi
              character(len=MPI_MAX_LIBRARY_VERSION_STRING) :: info
              integer :: ilen, ierr
              call mpi_init(ierr)
              call mpi_get_library_version(info, ilen, ierr)
              call mpi_finalize(ierr)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  abi_mpi_get_library_version="yes"
else
  abi_mpi_get_library_version="no"
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

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_mpi_get_library_version}" >&5
$as_echo "${abi_mpi_get_library_version}" >&6; }

    # Restore build environment


    ABI_CPPFLAGS="${abi_env_ABI_CPPFLAGS}"

    AR="${abi_env_AR}"

    ARFLAGS="${abi_env_ARFLAGS}"

    ARFLAGS_CMD="${abi_env_ARFLAGS_CMD}"

    ARFLAGS_DEBUG="${abi_env_ARFLAGS_DEBUG}"

    ARFLAGS_EXTRA="${abi_env_ARFLAGS_EXTRA}"

    ARFLAGS_HINTS="${abi_env_ARFLAGS_HINTS}"

    ARFLAGS_OPTIM="${abi_env_ARFLAGS_OPTIM}"

    CC="${abi_env_CC}"

    CC_LDFLAGS="${abi_env_CC_LDFLAGS}"

    CC_LDFLAGS_DEBUG="${abi_env_CC_LDFLAGS_DEBUG}"

    CC_LDFLAGS_EXTRA="${abi_env_CC_LDFLAGS_EXTRA}"

    CC_LDFLAGS_GPU="${abi_env_CC_LDFLAGS_GPU}"

    CC_LDFLAGS_HINTS="${abi_env_CC_LDFLAGS_HINTS}"

    CC_LDFLAGS_OPTIM="${abi_env_CC_LDFLAGS_OPTIM}"

    CC_LIBS="${abi_env_CC_LIBS}"

    CC_LIBS_DEBUG="${abi_env_CC_LIBS_DEBUG}"

    CC_LIBS_EXTRA="${abi_env_CC_LIBS_EXTRA}"

    CC_LIBS_GPU="${abi_env_CC_LIBS_GPU}"

    CC_LIBS_HINTS="${abi_env_CC_LIBS_HINTS}"

    CC_LIBS_OPTIM="${abi_env_CC_LIBS_OPTIM}"

    CFLAGS="${abi_env_CFLAGS}"

    CFLAGS_DEBUG="${abi_env_CFLAGS_DEBUG}"

    CFLAGS_EXTRA="${abi_env_CFLAGS_EXTRA}"

    CFLAGS_GPU="${abi_env_CFLAGS_GPU}"

    CFLAGS_HINTS="${abi_env_CFLAGS_HINTS}"

    CFLAGS_OPTIM="${abi_env_CFLAGS_OPTIM}"

    CPP="${abi_env_CPP}"

    CPPFLAGS="${abi_env_CPPFLAGS}"

    CPPFLAGS_DEBUG="${abi_env_CPPFLAGS_DEBUG}"

    CPPFLAGS_EXTRA="${abi_env_CPPFLAGS_EXTRA}"

    CPPFLAGS_GPU="${abi_env_CPPFLAGS_GPU}"

    CPPFLAGS_HINTS="${abi_env_CPPFLAGS_HINTS}"

    CPPFLAGS_OPTIM="${abi_env_CPPFLAGS_OPTIM}"

    CXX="${abi_env_CXX}"

    CXXFLAGS="${abi_env_CXXFLAGS}"

    CXXFLAGS_DEBUG="${abi_env_CXXFLAGS_DEBUG}"

    CXXFLAGS_EXTRA="${abi_env_CXXFLAGS_EXTRA}"

    CXXFLAGS_GPU="${abi_env_CXXFLAGS_GPU}"

    CXXFLAGS_HINTS="${abi_env_CXXFLAGS_HINTS}"

    CXXFLAGS_OPTIM="${abi_env_CXXFLAGS_OPTIM}"

    CXX_LDFLAGS="${abi_env_CXX_LDFLAGS}"

    CXX_LDFLAGS_DEBUG="${abi_env_CXX_LDFLAGS_DEBUG}"

    CXX_LDFLAGS_EXTRA="${abi_env_CXX_LDFLAGS_EXTRA}"

    CXX_LDFLAGS_GPU="${abi_env_CXX_LDFLAGS_GPU}"

    CXX_LDFLAGS_HINTS="${abi_env_CXX_LDFLAGS_HINTS}"

    CXX_LDFLAGS_OPTIM="${abi_env_CXX_LDFLAGS_OPTIM}"

    CXX_LIBS="${abi_env_CXX_LIBS}"

    CXX_LIBS_DEBUG="${abi_env_CXX_LIBS_DEBUG}"

    CXX_LIBS_EXTRA="${abi_env_CXX_LIBS_EXTRA}"

    CXX_LIBS_GPU="${abi_env_CXX_LIBS_GPU}"

    CXX_LIBS_HINTS="${abi_env_CXX_LIBS_HINTS}"

    CXX_LIBS_OPTIM="${abi_env_CXX_LIBS_OPTIM}"

    DEFS="${abi_env_DEFS}"

    F77="${abi_env_F77}"

    FC="${abi_env_FC}"

    FCFLAGS="${abi_env_FCFLAGS}"

    FCFLAGS_DEBUG="${abi_env_FCFLAGS_DEBUG}"

    FCFLAGS_EXTRA="${abi_env_FCFLAGS_EXTRA}"

    FCFLAGS_FIXEDFORM="${abi_env_FCFLAGS_FIXEDFORM}"

    FCFLAGS_FREEFORM="${abi_env_FCFLAGS_FREEFORM}"

    FCFLAGS_HINTS="${abi_env_FCFLAGS_HINTS}"

    FCFLAGS_MODDIR="${abi_env_FCFLAGS_MODDIR}"

    FCFLAGS_OPENMP="${abi_env_FCFLAGS_OPENMP}"

    FCFLAGS_OPENMP_OFFLOAD="${abi_env_FCFLAGS_OPENMP_OFFLOAD}"

    FCFLAGS_OPTIM="${abi_env_FCFLAGS_OPTIM}"

    FC_LDFLAGS="${abi_env_FC_LDFLAGS}"

    FC_LDFLAGS_DEBUG="${abi_env_FC_LDFLAGS_DEBUG}"

    FC_LDFLAGS_EXTRA="${abi_env_FC_LDFLAGS_EXTRA}"

    FC_LDFLAGS_HINTS="${abi_env_FC_LDFLAGS_HINTS}"

    FC_LDFLAGS_OPTIM="${abi_env_FC_LDFLAGS_OPTIM}"

    FC_LIBS="${abi_env_FC_LIBS}"

    FC_LIBS_DEBUG="${abi_env_FC_LIBS_DEBUG}"

    FC_LIBS_EXTRA="${abi_env_FC_LIBS_EXTRA}"

    FC_LIBS_HINTS="${abi_env_FC_LIBS_HINTS}"

    FC_LIBS_OPTIM="${abi_env_FC_LIBS_OPTIM}"

    FFT_CFLAGS="${abi_env_FFT_CFLAGS}"

    FFT_FCFLAGS="${abi_env_FFT_FCFLAGS}"

    FPP="${abi_env_FPP}"

    FPPFLAGS="${abi_env_FPPFLAGS}"

    FPPFLAGS_DEBUG="${abi_env_FPPFLAGS_DEBUG}"

    FPPFLAGS_EXTRA="${abi_env_FPPFLAGS_EXTRA}"

    FPPFLAGS_HINTS="${abi_env_FPPFLAGS_HINTS}"

    FPPFLAGS_OPTIM="${abi_env_FPPFLAGS_OPTIM}"

    GPU_ARCH="${abi_env_GPU_ARCH}"

    LD="${abi_env_LD}"

    MODEXT="${abi_env_MODEXT}"

    NM="${abi_env_NM}"

    NVCC="${abi_env_NVCC}"

    NVCC_CFLAGS="${abi_env_NVCC_CFLAGS}"

    NVCC_CPPFLAGS="${abi_env_NVCC_CPPFLAGS}"

    NVCC_LDFLAGS="${abi_env_NVCC_LDFLAGS}"

    NVCC_LIBS="${abi_env_NVCC_LIBS}"

    PYFLAGS="${abi_env_PYFLAGS}"

    PYTHON_CPPFLAGS="${abi_env_PYTHON_CPPFLAGS}"

    RANLIB="${abi_env_RANLIB}"

    TRUE_CPP="${abi_env_TRUE_CPP}"

    XPP="${abi_env_XPP}"

    XPPFLAGS="${abi_env_XPPFLAGS}"

    XPPFLAGS_DEBUG="${abi_env_XPPFLAGS_DEBUG}"

    XPPFLAGS_EXTRA="${abi_env_XPPFLAGS_EXTRA}"

    XPPFLAGS_OPTIM="${abi_env_XPPFLAGS_OPTIM}"


  fi

      if test "${abi_mpi_get_library_version}" = "yes"; then

$as_echo "#define HAVE_MPI_GET_LIBRARY_VERSION 1" >>confdefs.h

      fi

      # Check the availability of problematic MPI primitives

  # Set default values
  abi_mpi_type_create_struct_ok="no"

  if test "${abi_mpi_fc_level}" -ge "2"; then

    # No problem should appear for MPI2 or MPI3 but we test it anyway.

    # Back-up build environment


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"



    # Prepare build environment
    CPPFLAGS="${CPPFLAGS} ${abi_mpi_incs}"
    LDFLAGS="${FC_LDFLAGS}"
    LIBS="${FC_LIBS} ${abi_mpi_libs}"

    # Try to compile a Fortran MPI program
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI library supports MPI_CREATE_TYPE_STRUCT" >&5
$as_echo_n "checking whether the MPI library supports MPI_CREATE_TYPE_STRUCT... " >&6; }
    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

    cat > conftest.$ac_ext <<_ACEOF
      program main

        use mpi
        integer, parameter :: ncount=10
        integer :: ierr, new_type
        integer :: block_length(ncount), block_type(ncount)
        integer(MPI_ADDRESS_KIND) :: block_displ(ncount)
        call mpi_init(ierr)
        call MPI_TYPE_CREATE_STRUCT(ncount, block_length, block_displ, &
&         block_type, new_type, ierr)
        call mpi_finalize(ierr)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  abi_mpi_type_create_struct_ok="yes"
else
  abi_mpi_type_create_struct_ok="no"
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

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_mpi_type_create_struct_ok}" >&5
$as_echo "${abi_mpi_type_create_struct_ok}" >&6; }

    # Restore build environment


    ABI_CPPFLAGS="${abi_env_ABI_CPPFLAGS}"

    AR="${abi_env_AR}"

    ARFLAGS="${abi_env_ARFLAGS}"

    ARFLAGS_CMD="${abi_env_ARFLAGS_CMD}"

    ARFLAGS_DEBUG="${abi_env_ARFLAGS_DEBUG}"

    ARFLAGS_EXTRA="${abi_env_ARFLAGS_EXTRA}"

    ARFLAGS_HINTS="${abi_env_ARFLAGS_HINTS}"

    ARFLAGS_OPTIM="${abi_env_ARFLAGS_OPTIM}"

    CC="${abi_env_CC}"

    CC_LDFLAGS="${abi_env_CC_LDFLAGS}"

    CC_LDFLAGS_DEBUG="${abi_env_CC_LDFLAGS_DEBUG}"

    CC_LDFLAGS_EXTRA="${abi_env_CC_LDFLAGS_EXTRA}"

    CC_LDFLAGS_GPU="${abi_env_CC_LDFLAGS_GPU}"

    CC_LDFLAGS_HINTS="${abi_env_CC_LDFLAGS_HINTS}"

    CC_LDFLAGS_OPTIM="${abi_env_CC_LDFLAGS_OPTIM}"

    CC_LIBS="${abi_env_CC_LIBS}"

    CC_LIBS_DEBUG="${abi_env_CC_LIBS_DEBUG}"

    CC_LIBS_EXTRA="${abi_env_CC_LIBS_EXTRA}"

    CC_LIBS_GPU="${abi_env_CC_LIBS_GPU}"

    CC_LIBS_HINTS="${abi_env_CC_LIBS_HINTS}"

    CC_LIBS_OPTIM="${abi_env_CC_LIBS_OPTIM}"

    CFLAGS="${abi_env_CFLAGS}"

    CFLAGS_DEBUG="${abi_env_CFLAGS_DEBUG}"

    CFLAGS_EXTRA="${abi_env_CFLAGS_EXTRA}"

    CFLAGS_GPU="${abi_env_CFLAGS_GPU}"

    CFLAGS_HINTS="${abi_env_CFLAGS_HINTS}"

    CFLAGS_OPTIM="${abi_env_CFLAGS_OPTIM}"

    CPP="${abi_env_CPP}"

    CPPFLAGS="${abi_env_CPPFLAGS}"

    CPPFLAGS_DEBUG="${abi_env_CPPFLAGS_DEBUG}"

    CPPFLAGS_EXTRA="${abi_env_CPPFLAGS_EXTRA}"

    CPPFLAGS_GPU="${abi_env_CPPFLAGS_GPU}"

    CPPFLAGS_HINTS="${abi_env_CPPFLAGS_HINTS}"

    CPPFLAGS_OPTIM="${abi_env_CPPFLAGS_OPTIM}"

    CXX="${abi_env_CXX}"

    CXXFLAGS="${abi_env_CXXFLAGS}"

    CXXFLAGS_DEBUG="${abi_env_CXXFLAGS_DEBUG}"

    CXXFLAGS_EXTRA="${abi_env_CXXFLAGS_EXTRA}"

    CXXFLAGS_GPU="${abi_env_CXXFLAGS_GPU}"

    CXXFLAGS_HINTS="${abi_env_CXXFLAGS_HINTS}"

    CXXFLAGS_OPTIM="${abi_env_CXXFLAGS_OPTIM}"

    CXX_LDFLAGS="${abi_env_CXX_LDFLAGS}"

    CXX_LDFLAGS_DEBUG="${abi_env_CXX_LDFLAGS_DEBUG}"

    CXX_LDFLAGS_EXTRA="${abi_env_CXX_LDFLAGS_EXTRA}"

    CXX_LDFLAGS_GPU="${abi_env_CXX_LDFLAGS_GPU}"

    CXX_LDFLAGS_HINTS="${abi_env_CXX_LDFLAGS_HINTS}"

    CXX_LDFLAGS_OPTIM="${abi_env_CXX_LDFLAGS_OPTIM}"

    CXX_LIBS="${abi_env_CXX_LIBS}"

    CXX_LIBS_DEBUG="${abi_env_CXX_LIBS_DEBUG}"

    CXX_LIBS_EXTRA="${abi_env_CXX_LIBS_EXTRA}"

    CXX_LIBS_GPU="${abi_env_CXX_LIBS_GPU}"

    CXX_LIBS_HINTS="${abi_env_CXX_LIBS_HINTS}"

    CXX_LIBS_OPTIM="${abi_env_CXX_LIBS_OPTIM}"

    DEFS="${abi_env_DEFS}"

    F77="${abi_env_F77}"

    FC="${abi_env_FC}"

    FCFLAGS="${abi_env_FCFLAGS}"

    FCFLAGS_DEBUG="${abi_env_FCFLAGS_DEBUG}"

    FCFLAGS_EXTRA="${abi_env_FCFLAGS_EXTRA}"

    FCFLAGS_FIXEDFORM="${abi_env_FCFLAGS_FIXEDFORM}"

    FCFLAGS_FREEFORM="${abi_env_FCFLAGS_FREEFORM}"

    FCFLAGS_HINTS="${abi_env_FCFLAGS_HINTS}"

    FCFLAGS_MODDIR="${abi_env_FCFLAGS_MODDIR}"

    FCFLAGS_OPENMP="${abi_env_FCFLAGS_OPENMP}"

    FCFLAGS_OPENMP_OFFLOAD="${abi_env_FCFLAGS_OPENMP_OFFLOAD}"

    FCFLAGS_OPTIM="${abi_env_FCFLAGS_OPTIM}"

    FC_LDFLAGS="${abi_env_FC_LDFLAGS}"

    FC_LDFLAGS_DEBUG="${abi_env_FC_LDFLAGS_DEBUG}"

    FC_LDFLAGS_EXTRA="${abi_env_FC_LDFLAGS_EXTRA}"

    FC_LDFLAGS_HINTS="${abi_env_FC_LDFLAGS_HINTS}"

    FC_LDFLAGS_OPTIM="${abi_env_FC_LDFLAGS_OPTIM}"

    FC_LIBS="${abi_env_FC_LIBS}"

    FC_LIBS_DEBUG="${abi_env_FC_LIBS_DEBUG}"

    FC_LIBS_EXTRA="${abi_env_FC_LIBS_EXTRA}"

    FC_LIBS_HINTS="${abi_env_FC_LIBS_HINTS}"

    FC_LIBS_OPTIM="${abi_env_FC_LIBS_OPTIM}"

    FFT_CFLAGS="${abi_env_FFT_CFLAGS}"

    FFT_FCFLAGS="${abi_env_FFT_FCFLAGS}"

    FPP="${abi_env_FPP}"

    FPPFLAGS="${abi_env_FPPFLAGS}"

    FPPFLAGS_DEBUG="${abi_env_FPPFLAGS_DEBUG}"

    FPPFLAGS_EXTRA="${abi_env_FPPFLAGS_EXTRA}"

    FPPFLAGS_HINTS="${abi_env_FPPFLAGS_HINTS}"

    FPPFLAGS_OPTIM="${abi_env_FPPFLAGS_OPTIM}"

    GPU_ARCH="${abi_env_GPU_ARCH}"

    LD="${abi_env_LD}"

    MODEXT="${abi_env_MODEXT}"

    NM="${abi_env_NM}"

    NVCC="${abi_env_NVCC}"

    NVCC_CFLAGS="${abi_env_NVCC_CFLAGS}"

    NVCC_CPPFLAGS="${abi_env_NVCC_CPPFLAGS}"

    NVCC_LDFLAGS="${abi_env_NVCC_LDFLAGS}"

    NVCC_LIBS="${abi_env_NVCC_LIBS}"

    PYFLAGS="${abi_env_PYFLAGS}"

    PYTHON_CPPFLAGS="${abi_env_PYTHON_CPPFLAGS}"

    RANLIB="${abi_env_RANLIB}"

    TRUE_CPP="${abi_env_TRUE_CPP}"

    XPP="${abi_env_XPP}"

    XPPFLAGS="${abi_env_XPPFLAGS}"

    XPPFLAGS_DEBUG="${abi_env_XPPFLAGS_DEBUG}"

    XPPFLAGS_EXTRA="${abi_env_XPPFLAGS_EXTRA}"

    XPPFLAGS_OPTIM="${abi_env_XPPFLAGS_OPTIM}"



  else

    # Back-up build environment


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"



    # Prepare build environment
    CPPFLAGS="${CPPFLAGS} ${abi_mpi_incs}"
    LDFLAGS="${FC_LDFLAGS}"
    LIBS="${FC_LIBS} ${abi_mpi_libs}"

    # Try to compile a Fortran MPI program
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI library supports MPI_CREATE_TYPE_STRUCT" >&5
$as_echo_n "checking whether the MPI library supports MPI_CREATE_TYPE_STRUCT... " >&6; }
    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

    cat > conftest.$ac_ext <<_ACEOF
      program main

        include "mpif.h"
        integer, parameter :: ncount=10
        integer :: ierr, new_type
        integer :: block_length(ncount), block_type(ncount)
        integer(MPI_ADDRESS_KIND) :: block_displ(ncount)
        call mpi_init(ierr)
        call MPI_TYPE_CREATE_STRUCT(ncount, block_length, block_displ, &
&         block_type, new_type, ierr)
        call mpi_finalize(ierr)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  abi_mpi_type_create_struct_ok="yes"
else
  abi_mpi_type_create_struct_ok="no"
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

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_mpi_type_create_struct_ok}" >&5
$as_echo "${abi_mpi_type_create_struct_ok}" >&6; }

    # Restore build environment


    ABI_CPPFLAGS="${abi_env_ABI_CPPFLAGS}"

    AR="${abi_env_AR}"

    ARFLAGS="${abi_env_ARFLAGS}"

    ARFLAGS_CMD="${abi_env_ARFLAGS_CMD}"

    ARFLAGS_DEBUG="${abi_env_ARFLAGS_DEBUG}"

    ARFLAGS_EXTRA="${abi_env_ARFLAGS_EXTRA}"

    ARFLAGS_HINTS="${abi_env_ARFLAGS_HINTS}"

    ARFLAGS_OPTIM="${abi_env_ARFLAGS_OPTIM}"

    CC="${abi_env_CC}"

    CC_LDFLAGS="${abi_env_CC_LDFLAGS}"

    CC_LDFLAGS_DEBUG="${abi_env_CC_LDFLAGS_DEBUG}"

    CC_LDFLAGS_EXTRA="${abi_env_CC_LDFLAGS_EXTRA}"

    CC_LDFLAGS_GPU="${abi_env_CC_LDFLAGS_GPU}"

    CC_LDFLAGS_HINTS="${abi_env_CC_LDFLAGS_HINTS}"

    CC_LDFLAGS_OPTIM="${abi_env_CC_LDFLAGS_OPTIM}"

    CC_LIBS="${abi_env_CC_LIBS}"

    CC_LIBS_DEBUG="${abi_env_CC_LIBS_DEBUG}"

    CC_LIBS_EXTRA="${abi_env_CC_LIBS_EXTRA}"

    CC_LIBS_GPU="${abi_env_CC_LIBS_GPU}"

    CC_LIBS_HINTS="${abi_env_CC_LIBS_HINTS}"

    CC_LIBS_OPTIM="${abi_env_CC_LIBS_OPTIM}"

    CFLAGS="${abi_env_CFLAGS}"

    CFLAGS_DEBUG="${abi_env_CFLAGS_DEBUG}"

    CFLAGS_EXTRA="${abi_env_CFLAGS_EXTRA}"

    CFLAGS_GPU="${abi_env_CFLAGS_GPU}"

    CFLAGS_HINTS="${abi_env_CFLAGS_HINTS}"

    CFLAGS_OPTIM="${abi_env_CFLAGS_OPTIM}"

    CPP="${abi_env_CPP}"

    CPPFLAGS="${abi_env_CPPFLAGS}"

    CPPFLAGS_DEBUG="${abi_env_CPPFLAGS_DEBUG}"

    CPPFLAGS_EXTRA="${abi_env_CPPFLAGS_EXTRA}"

    CPPFLAGS_GPU="${abi_env_CPPFLAGS_GPU}"

    CPPFLAGS_HINTS="${abi_env_CPPFLAGS_HINTS}"

    CPPFLAGS_OPTIM="${abi_env_CPPFLAGS_OPTIM}"

    CXX="${abi_env_CXX}"

    CXXFLAGS="${abi_env_CXXFLAGS}"

    CXXFLAGS_DEBUG="${abi_env_CXXFLAGS_DEBUG}"

    CXXFLAGS_EXTRA="${abi_env_CXXFLAGS_EXTRA}"

    CXXFLAGS_GPU="${abi_env_CXXFLAGS_GPU}"

    CXXFLAGS_HINTS="${abi_env_CXXFLAGS_HINTS}"

    CXXFLAGS_OPTIM="${abi_env_CXXFLAGS_OPTIM}"

    CXX_LDFLAGS="${abi_env_CXX_LDFLAGS}"

    CXX_LDFLAGS_DEBUG="${abi_env_CXX_LDFLAGS_DEBUG}"

    CXX_LDFLAGS_EXTRA="${abi_env_CXX_LDFLAGS_EXTRA}"

    CXX_LDFLAGS_GPU="${abi_env_CXX_LDFLAGS_GPU}"

    CXX_LDFLAGS_HINTS="${abi_env_CXX_LDFLAGS_HINTS}"

    CXX_LDFLAGS_OPTIM="${abi_env_CXX_LDFLAGS_OPTIM}"

    CXX_LIBS="${abi_env_CXX_LIBS}"

    CXX_LIBS_DEBUG="${abi_env_CXX_LIBS_DEBUG}"

    CXX_LIBS_EXTRA="${abi_env_CXX_LIBS_EXTRA}"

    CXX_LIBS_GPU="${abi_env_CXX_LIBS_GPU}"

    CXX_LIBS_HINTS="${abi_env_CXX_LIBS_HINTS}"

    CXX_LIBS_OPTIM="${abi_env_CXX_LIBS_OPTIM}"

    DEFS="${abi_env_DEFS}"

    F77="${abi_env_F77}"

    FC="${abi_env_FC}"

    FCFLAGS="${abi_env_FCFLAGS}"

    FCFLAGS_DEBUG="${abi_env_FCFLAGS_DEBUG}"

    FCFLAGS_EXTRA="${abi_env_FCFLAGS_EXTRA}"

    FCFLAGS_FIXEDFORM="${abi_env_FCFLAGS_FIXEDFORM}"

    FCFLAGS_FREEFORM="${abi_env_FCFLAGS_FREEFORM}"

    FCFLAGS_HINTS="${abi_env_FCFLAGS_HINTS}"

    FCFLAGS_MODDIR="${abi_env_FCFLAGS_MODDIR}"

    FCFLAGS_OPENMP="${abi_env_FCFLAGS_OPENMP}"

    FCFLAGS_OPENMP_OFFLOAD="${abi_env_FCFLAGS_OPENMP_OFFLOAD}"

    FCFLAGS_OPTIM="${abi_env_FCFLAGS_OPTIM}"

    FC_LDFLAGS="${abi_env_FC_LDFLAGS}"

    FC_LDFLAGS_DEBUG="${abi_env_FC_LDFLAGS_DEBUG}"

    FC_LDFLAGS_EXTRA="${abi_env_FC_LDFLAGS_EXTRA}"

    FC_LDFLAGS_HINTS="${abi_env_FC_LDFLAGS_HINTS}"

    FC_LDFLAGS_OPTIM="${abi_env_FC_LDFLAGS_OPTIM}"

    FC_LIBS="${abi_env_FC_LIBS}"

    FC_LIBS_DEBUG="${abi_env_FC_LIBS_DEBUG}"

    FC_LIBS_EXTRA="${abi_env_FC_LIBS_EXTRA}"

    FC_LIBS_HINTS="${abi_env_FC_LIBS_HINTS}"

    FC_LIBS_OPTIM="${abi_env_FC_LIBS_OPTIM}"

    FFT_CFLAGS="${abi_env_FFT_CFLAGS}"

    FFT_FCFLAGS="${abi_env_FFT_FCFLAGS}"

    FPP="${abi_env_FPP}"

    FPPFLAGS="${abi_env_FPPFLAGS}"

    FPPFLAGS_DEBUG="${abi_env_FPPFLAGS_DEBUG}"

    FPPFLAGS_EXTRA="${abi_env_FPPFLAGS_EXTRA}"

    FPPFLAGS_HINTS="${abi_env_FPPFLAGS_HINTS}"

    FPPFLAGS_OPTIM="${abi_env_FPPFLAGS_OPTIM}"

    GPU_ARCH="${abi_env_GPU_ARCH}"

    LD="${abi_env_LD}"

    MODEXT="${abi_env_MODEXT}"

    NM="${abi_env_NM}"

    NVCC="${abi_env_NVCC}"

    NVCC_CFLAGS="${abi_env_NVCC_CFLAGS}"

    NVCC_CPPFLAGS="${abi_env_NVCC_CPPFLAGS}"

    NVCC_LDFLAGS="${abi_env_NVCC_LDFLAGS}"

    NVCC_LIBS="${abi_env_NVCC_LIBS}"

    PYFLAGS="${abi_env_PYFLAGS}"

    PYTHON_CPPFLAGS="${abi_env_PYTHON_CPPFLAGS}"

    RANLIB="${abi_env_RANLIB}"

    TRUE_CPP="${abi_env_TRUE_CPP}"

    XPP="${abi_env_XPP}"

    XPPFLAGS="${abi_env_XPPFLAGS}"

    XPPFLAGS_DEBUG="${abi_env_XPPFLAGS_DEBUG}"

    XPPFLAGS_EXTRA="${abi_env_XPPFLAGS_EXTRA}"

    XPPFLAGS_OPTIM="${abi_env_XPPFLAGS_OPTIM}"



  fi

  # Forward information to the compiler
  if test "${abi_mpi_type_create_struct_ok}" = "yes"; then

$as_echo "#define HAVE_MPI_TYPE_CREATE_STRUCT 1" >>confdefs.h

  fi


      # Check MPI3 extensions (very) important for HPC.

    abi_mpi_ibcast_ok="no"

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI library supports MPI_IBCAST (MPI3)" >&5
$as_echo_n "checking whether the MPI library supports MPI_IBCAST (MPI3)... " >&6; }




    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"



    CPPFLAGS="${CPPFLAGS} ${lib_mpi_incs}"
  LDFLAGS="${FC_LDFLAGS}"
  LIBS="${FC_LIBS} ${lib_mpi_libs}"

  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use mpi

      integer,parameter :: siz=5
      integer :: buffer(siz)
      integer :: comm, root, request, ierr

      ! Prototype
      !  MPI_IBCAST(buffer, count, datatype, root, comm, request, ierr)
      !  INOUT buffer	starting address of buffer (choice)
      !  IN count	number of entries in buffer (non-negative integer)
      !  IN datatype	data type of buffer (handle)
      !  IN root	rank of broadcast root (integer)
      !  IN comm	communicator (handle)
      !  OUT request	communication request (handle)

      call MPI_IBCAST(buffer, siz, MPI_INTEGER, root, comm, request, ierr)


      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  abi_mpi_ibcast_ok="yes"
else
  abi_mpi_ibcast_ok="no"
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




    ABI_CPPFLAGS="${abi_env_ABI_CPPFLAGS}"

    AR="${abi_env_AR}"

    ARFLAGS="${abi_env_ARFLAGS}"

    ARFLAGS_CMD="${abi_env_ARFLAGS_CMD}"

    ARFLAGS_DEBUG="${abi_env_ARFLAGS_DEBUG}"

    ARFLAGS_EXTRA="${abi_env_ARFLAGS_EXTRA}"

    ARFLAGS_HINTS="${abi_env_ARFLAGS_HINTS}"

    ARFLAGS_OPTIM="${abi_env_ARFLAGS_OPTIM}"

    CC="${abi_env_CC}"

    CC_LDFLAGS="${abi_env_CC_LDFLAGS}"

    CC_LDFLAGS_DEBUG="${abi_env_CC_LDFLAGS_DEBUG}"

    CC_LDFLAGS_EXTRA="${abi_env_CC_LDFLAGS_EXTRA}"

    CC_LDFLAGS_GPU="${abi_env_CC_LDFLAGS_GPU}"

    CC_LDFLAGS_HINTS="${abi_env_CC_LDFLAGS_HINTS}"

    CC_LDFLAGS_OPTIM="${abi_env_CC_LDFLAGS_OPTIM}"

    CC_LIBS="${abi_env_CC_LIBS}"

    CC_LIBS_DEBUG="${abi_env_CC_LIBS_DEBUG}"

    CC_LIBS_EXTRA="${abi_env_CC_LIBS_EXTRA}"

    CC_LIBS_GPU="${abi_env_CC_LIBS_GPU}"

    CC_LIBS_HINTS="${abi_env_CC_LIBS_HINTS}"

    CC_LIBS_OPTIM="${abi_env_CC_LIBS_OPTIM}"

    CFLAGS="${abi_env_CFLAGS}"

    CFLAGS_DEBUG="${abi_env_CFLAGS_DEBUG}"

    CFLAGS_EXTRA="${abi_env_CFLAGS_EXTRA}"

    CFLAGS_GPU="${abi_env_CFLAGS_GPU}"

    CFLAGS_HINTS="${abi_env_CFLAGS_HINTS}"

    CFLAGS_OPTIM="${abi_env_CFLAGS_OPTIM}"

    CPP="${abi_env_CPP}"

    CPPFLAGS="${abi_env_CPPFLAGS}"

    CPPFLAGS_DEBUG="${abi_env_CPPFLAGS_DEBUG}"

    CPPFLAGS_EXTRA="${abi_env_CPPFLAGS_EXTRA}"

    CPPFLAGS_GPU="${abi_env_CPPFLAGS_GPU}"

    CPPFLAGS_HINTS="${abi_env_CPPFLAGS_HINTS}"

    CPPFLAGS_OPTIM="${abi_env_CPPFLAGS_OPTIM}"

    CXX="${abi_env_CXX}"

    CXXFLAGS="${abi_env_CXXFLAGS}"

    CXXFLAGS_DEBUG="${abi_env_CXXFLAGS_DEBUG}"

    CXXFLAGS_EXTRA="${abi_env_CXXFLAGS_EXTRA}"

    CXXFLAGS_GPU="${abi_env_CXXFLAGS_GPU}"

    CXXFLAGS_HINTS="${abi_env_CXXFLAGS_HINTS}"

    CXXFLAGS_OPTIM="${abi_env_CXXFLAGS_OPTIM}"

    CXX_LDFLAGS="${abi_env_CXX_LDFLAGS}"

    CXX_LDFLAGS_DEBUG="${abi_env_CXX_LDFLAGS_DEBUG}"

    CXX_LDFLAGS_EXTRA="${abi_env_CXX_LDFLAGS_EXTRA}"

    CXX_LDFLAGS_GPU="${abi_env_CXX_LDFLAGS_GPU}"

    CXX_LDFLAGS_HINTS="${abi_env_CXX_LDFLAGS_HINTS}"

    CXX_LDFLAGS_OPTIM="${abi_env_CXX_LDFLAGS_OPTIM}"

    CXX_LIBS="${abi_env_CXX_LIBS}"

    CXX_LIBS_DEBUG="${abi_env_CXX_LIBS_DEBUG}"

    CXX_LIBS_EXTRA="${abi_env_CXX_LIBS_EXTRA}"

    CXX_LIBS_GPU="${abi_env_CXX_LIBS_GPU}"

    CXX_LIBS_HINTS="${abi_env_CXX_LIBS_HINTS}"

    CXX_LIBS_OPTIM="${abi_env_CXX_LIBS_OPTIM}"

    DEFS="${abi_env_DEFS}"

    F77="${abi_env_F77}"

    FC="${abi_env_FC}"

    FCFLAGS="${abi_env_FCFLAGS}"

    FCFLAGS_DEBUG="${abi_env_FCFLAGS_DEBUG}"

    FCFLAGS_EXTRA="${abi_env_FCFLAGS_EXTRA}"

    FCFLAGS_FIXEDFORM="${abi_env_FCFLAGS_FIXEDFORM}"

    FCFLAGS_FREEFORM="${abi_env_FCFLAGS_FREEFORM}"

    FCFLAGS_HINTS="${abi_env_FCFLAGS_HINTS}"

    FCFLAGS_MODDIR="${abi_env_FCFLAGS_MODDIR}"

    FCFLAGS_OPENMP="${abi_env_FCFLAGS_OPENMP}"

    FCFLAGS_OPENMP_OFFLOAD="${abi_env_FCFLAGS_OPENMP_OFFLOAD}"

    FCFLAGS_OPTIM="${abi_env_FCFLAGS_OPTIM}"

    FC_LDFLAGS="${abi_env_FC_LDFLAGS}"

    FC_LDFLAGS_DEBUG="${abi_env_FC_LDFLAGS_DEBUG}"

    FC_LDFLAGS_EXTRA="${abi_env_FC_LDFLAGS_EXTRA}"

    FC_LDFLAGS_HINTS="${abi_env_FC_LDFLAGS_HINTS}"

    FC_LDFLAGS_OPTIM="${abi_env_FC_LDFLAGS_OPTIM}"

    FC_LIBS="${abi_env_FC_LIBS}"

    FC_LIBS_DEBUG="${abi_env_FC_LIBS_DEBUG}"

    FC_LIBS_EXTRA="${abi_env_FC_LIBS_EXTRA}"

    FC_LIBS_HINTS="${abi_env_FC_LIBS_HINTS}"

    FC_LIBS_OPTIM="${abi_env_FC_LIBS_OPTIM}"

    FFT_CFLAGS="${abi_env_FFT_CFLAGS}"

    FFT_FCFLAGS="${abi_env_FFT_FCFLAGS}"

    FPP="${abi_env_FPP}"

    FPPFLAGS="${abi_env_FPPFLAGS}"

    FPPFLAGS_DEBUG="${abi_env_FPPFLAGS_DEBUG}"

    FPPFLAGS_EXTRA="${abi_env_FPPFLAGS_EXTRA}"

    FPPFLAGS_HINTS="${abi_env_FPPFLAGS_HINTS}"

    FPPFLAGS_OPTIM="${abi_env_FPPFLAGS_OPTIM}"

    GPU_ARCH="${abi_env_GPU_ARCH}"

    LD="${abi_env_LD}"

    MODEXT="${abi_env_MODEXT}"

    NM="${abi_env_NM}"

    NVCC="${abi_env_NVCC}"

    NVCC_CFLAGS="${abi_env_NVCC_CFLAGS}"

    NVCC_CPPFLAGS="${abi_env_NVCC_CPPFLAGS}"

    NVCC_LDFLAGS="${abi_env_NVCC_LDFLAGS}"

    NVCC_LIBS="${abi_env_NVCC_LIBS}"

    PYFLAGS="${abi_env_PYFLAGS}"

    PYTHON_CPPFLAGS="${abi_env_PYTHON_CPPFLAGS}"

    RANLIB="${abi_env_RANLIB}"

    TRUE_CPP="${abi_env_TRUE_CPP}"

    XPP="${abi_env_XPP}"

    XPPFLAGS="${abi_env_XPPFLAGS}"

    XPPFLAGS_DEBUG="${abi_env_XPPFLAGS_DEBUG}"

    XPPFLAGS_EXTRA="${abi_env_XPPFLAGS_EXTRA}"

    XPPFLAGS_OPTIM="${abi_env_XPPFLAGS_OPTIM}"



  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_mpi_ibcast_ok}" >&5
$as_echo "${abi_mpi_ibcast_ok}" >&6; }

  if test "${abi_mpi_ibcast_ok}" = "yes"; then

$as_echo "#define HAVE_MPI_IBCAST 1" >>confdefs.h

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your MPI library does not support non-blocking communications. The wall time of certain algorithms will increase with the number of MPI processes. It is strongly suggested to use a more recent MPI2+ library!" >&5
$as_echo "$as_me: WARNING: Your MPI library does not support non-blocking communications. The wall time of certain algorithms will increase with the number of MPI processes. It is strongly suggested to use a more recent MPI2+ library!" >&2;}
  fi



  # Set default values
  abi_mpi_iallgather_ok="no"

  # Back-up build environment


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"



  # Prepare build environment
  CPPFLAGS="${CPPFLAGS} ${abi_mpi_incs}"
  LDFLAGS="${FC_LDFLAGS}"
  LIBS="${FC_LIBS} ${abi_mpi_libs}"

  # Try to compile a Fortran program
  # Note: we assume a MPI implementation that provides the mpi module
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI library supports MPI_IALLGATHER (MPI3)" >&5
$as_echo_n "checking whether the MPI library supports MPI_IALLGATHER (MPI3)... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use mpi

      integer, parameter :: siz=5
      integer :: SENDBUF(siz), RECVBUF(siz)
      integer :: SENDCOUNT, SENDTYPE, RECVCOUNT, RECVTYPE
      integer :: COMM, REQUEST, IERROR

      ! Prototype
      ! MPI_IALLGATHER(SENDBUF, SENDCOUNT, SENDTYPE, RECVBUF, RECVCOUNT,
      !  RECVTYPE, COMM, REQUEST, IERROR)
      !  <type>    SENDBUF(*), RECVBUF (*)
      !  INTEGER    SENDCOUNT, SENDTYPE, RECVCOUNT, RECVTYPE, COMM
      !  INTEGER    REQUEST, IERROR

      call MPI_IALLGATHER(SENDBUF, SENDCOUNT, SENDTYPE, RECVBUF, RECVCOUNT, &
                          RECVTYPE, COMM, REQUEST, IERROR)


      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  abi_mpi_iallgather_ok="yes"
else
  abi_mpi_iallgather_ok="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_mpi_iallgather_ok}" >&5
$as_echo "${abi_mpi_iallgather_ok}" >&6; }

  # Restore build environment


    ABI_CPPFLAGS="${abi_env_ABI_CPPFLAGS}"

    AR="${abi_env_AR}"

    ARFLAGS="${abi_env_ARFLAGS}"

    ARFLAGS_CMD="${abi_env_ARFLAGS_CMD}"

    ARFLAGS_DEBUG="${abi_env_ARFLAGS_DEBUG}"

    ARFLAGS_EXTRA="${abi_env_ARFLAGS_EXTRA}"

    ARFLAGS_HINTS="${abi_env_ARFLAGS_HINTS}"

    ARFLAGS_OPTIM="${abi_env_ARFLAGS_OPTIM}"

    CC="${abi_env_CC}"

    CC_LDFLAGS="${abi_env_CC_LDFLAGS}"

    CC_LDFLAGS_DEBUG="${abi_env_CC_LDFLAGS_DEBUG}"

    CC_LDFLAGS_EXTRA="${abi_env_CC_LDFLAGS_EXTRA}"

    CC_LDFLAGS_GPU="${abi_env_CC_LDFLAGS_GPU}"

    CC_LDFLAGS_HINTS="${abi_env_CC_LDFLAGS_HINTS}"

    CC_LDFLAGS_OPTIM="${abi_env_CC_LDFLAGS_OPTIM}"

    CC_LIBS="${abi_env_CC_LIBS}"

    CC_LIBS_DEBUG="${abi_env_CC_LIBS_DEBUG}"

    CC_LIBS_EXTRA="${abi_env_CC_LIBS_EXTRA}"

    CC_LIBS_GPU="${abi_env_CC_LIBS_GPU}"

    CC_LIBS_HINTS="${abi_env_CC_LIBS_HINTS}"

    CC_LIBS_OPTIM="${abi_env_CC_LIBS_OPTIM}"

    CFLAGS="${abi_env_CFLAGS}"

    CFLAGS_DEBUG="${abi_env_CFLAGS_DEBUG}"

    CFLAGS_EXTRA="${abi_env_CFLAGS_EXTRA}"

    CFLAGS_GPU="${abi_env_CFLAGS_GPU}"

    CFLAGS_HINTS="${abi_env_CFLAGS_HINTS}"

    CFLAGS_OPTIM="${abi_env_CFLAGS_OPTIM}"

    CPP="${abi_env_CPP}"

    CPPFLAGS="${abi_env_CPPFLAGS}"

    CPPFLAGS_DEBUG="${abi_env_CPPFLAGS_DEBUG}"

    CPPFLAGS_EXTRA="${abi_env_CPPFLAGS_EXTRA}"

    CPPFLAGS_GPU="${abi_env_CPPFLAGS_GPU}"

    CPPFLAGS_HINTS="${abi_env_CPPFLAGS_HINTS}"

    CPPFLAGS_OPTIM="${abi_env_CPPFLAGS_OPTIM}"

    CXX="${abi_env_CXX}"

    CXXFLAGS="${abi_env_CXXFLAGS}"

    CXXFLAGS_DEBUG="${abi_env_CXXFLAGS_DEBUG}"

    CXXFLAGS_EXTRA="${abi_env_CXXFLAGS_EXTRA}"

    CXXFLAGS_GPU="${abi_env_CXXFLAGS_GPU}"

    CXXFLAGS_HINTS="${abi_env_CXXFLAGS_HINTS}"

    CXXFLAGS_OPTIM="${abi_env_CXXFLAGS_OPTIM}"

    CXX_LDFLAGS="${abi_env_CXX_LDFLAGS}"

    CXX_LDFLAGS_DEBUG="${abi_env_CXX_LDFLAGS_DEBUG}"

    CXX_LDFLAGS_EXTRA="${abi_env_CXX_LDFLAGS_EXTRA}"

    CXX_LDFLAGS_GPU="${abi_env_CXX_LDFLAGS_GPU}"

    CXX_LDFLAGS_HINTS="${abi_env_CXX_LDFLAGS_HINTS}"

    CXX_LDFLAGS_OPTIM="${abi_env_CXX_LDFLAGS_OPTIM}"

    CXX_LIBS="${abi_env_CXX_LIBS}"

    CXX_LIBS_DEBUG="${abi_env_CXX_LIBS_DEBUG}"

    CXX_LIBS_EXTRA="${abi_env_CXX_LIBS_EXTRA}"

    CXX_LIBS_GPU="${abi_env_CXX_LIBS_GPU}"

    CXX_LIBS_HINTS="${abi_env_CXX_LIBS_HINTS}"

    CXX_LIBS_OPTIM="${abi_env_CXX_LIBS_OPTIM}"

    DEFS="${abi_env_DEFS}"

    F77="${abi_env_F77}"

    FC="${abi_env_FC}"

    FCFLAGS="${abi_env_FCFLAGS}"

    FCFLAGS_DEBUG="${abi_env_FCFLAGS_DEBUG}"

    FCFLAGS_EXTRA="${abi_env_FCFLAGS_EXTRA}"

    FCFLAGS_FIXEDFORM="${abi_env_FCFLAGS_FIXEDFORM}"

    FCFLAGS_FREEFORM="${abi_env_FCFLAGS_FREEFORM}"

    FCFLAGS_HINTS="${abi_env_FCFLAGS_HINTS}"

    FCFLAGS_MODDIR="${abi_env_FCFLAGS_MODDIR}"

    FCFLAGS_OPENMP="${abi_env_FCFLAGS_OPENMP}"

    FCFLAGS_OPENMP_OFFLOAD="${abi_env_FCFLAGS_OPENMP_OFFLOAD}"

    FCFLAGS_OPTIM="${abi_env_FCFLAGS_OPTIM}"

    FC_LDFLAGS="${abi_env_FC_LDFLAGS}"

    FC_LDFLAGS_DEBUG="${abi_env_FC_LDFLAGS_DEBUG}"

    FC_LDFLAGS_EXTRA="${abi_env_FC_LDFLAGS_EXTRA}"

    FC_LDFLAGS_HINTS="${abi_env_FC_LDFLAGS_HINTS}"

    FC_LDFLAGS_OPTIM="${abi_env_FC_LDFLAGS_OPTIM}"

    FC_LIBS="${abi_env_FC_LIBS}"

    FC_LIBS_DEBUG="${abi_env_FC_LIBS_DEBUG}"

    FC_LIBS_EXTRA="${abi_env_FC_LIBS_EXTRA}"

    FC_LIBS_HINTS="${abi_env_FC_LIBS_HINTS}"

    FC_LIBS_OPTIM="${abi_env_FC_LIBS_OPTIM}"

    FFT_CFLAGS="${abi_env_FFT_CFLAGS}"

    FFT_FCFLAGS="${abi_env_FFT_FCFLAGS}"

    FPP="${abi_env_FPP}"

    FPPFLAGS="${abi_env_FPPFLAGS}"

    FPPFLAGS_DEBUG="${abi_env_FPPFLAGS_DEBUG}"

    FPPFLAGS_EXTRA="${abi_env_FPPFLAGS_EXTRA}"

    FPPFLAGS_HINTS="${abi_env_FPPFLAGS_HINTS}"

    FPPFLAGS_OPTIM="${abi_env_FPPFLAGS_OPTIM}"

    GPU_ARCH="${abi_env_GPU_ARCH}"

    LD="${abi_env_LD}"

    MODEXT="${abi_env_MODEXT}"

    NM="${abi_env_NM}"

    NVCC="${abi_env_NVCC}"

    NVCC_CFLAGS="${abi_env_NVCC_CFLAGS}"

    NVCC_CPPFLAGS="${abi_env_NVCC_CPPFLAGS}"

    NVCC_LDFLAGS="${abi_env_NVCC_LDFLAGS}"

    NVCC_LIBS="${abi_env_NVCC_LIBS}"

    PYFLAGS="${abi_env_PYFLAGS}"

    PYTHON_CPPFLAGS="${abi_env_PYTHON_CPPFLAGS}"

    RANLIB="${abi_env_RANLIB}"

    TRUE_CPP="${abi_env_TRUE_CPP}"

    XPP="${abi_env_XPP}"

    XPPFLAGS="${abi_env_XPPFLAGS}"

    XPPFLAGS_DEBUG="${abi_env_XPPFLAGS_DEBUG}"

    XPPFLAGS_EXTRA="${abi_env_XPPFLAGS_EXTRA}"

    XPPFLAGS_OPTIM="${abi_env_XPPFLAGS_OPTIM}"



  # Forward information to the compiler
  if test "${abi_mpi_iallgather_ok}" = "yes"; then

$as_echo "#define HAVE_MPI_IALLGATHER 1" >>confdefs.h

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your MPI library does not support non-blocking communications. The wall time of certain algorithms will increase with the number of MPI processes. It is strongly suggested to use a more recent MPI2+ library!" >&5
$as_echo "$as_me: WARNING: Your MPI library does not support non-blocking communications. The wall time of certain algorithms will increase with the number of MPI processes. It is strongly suggested to use a more recent MPI2+ library!" >&2;}
  fi


  # Set default values
  abi_mpi_ialltoall_ok="no"

  # Back-up build environment


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"



  # Prepare build environment
  CPPFLAGS="${CPPFLAGS} ${abi_mpi_incs}"
  LDFLAGS="${FC_LDFLAGS}"
  LIBS="${FC_LIBS} ${abi_mpi_libs}"

  # Try to compile a Fortran program
  # Note: we assume a MPI implementation that provides the mpi module
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI library supports MPI_IALLTOALL (MPI3)" >&5
$as_echo_n "checking whether the MPI library supports MPI_IALLTOALL (MPI3)... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use mpi

      integer, parameter :: siz=5
      integer :: SENDBUF(siz), RECVBUF(siz)
      integer :: SENDCOUNT, SENDTYPE, RECVCOUNT, RECVTYPE
      integer :: COMM, REQUEST, IERROR

      ! Prototype
      ! <type>    SENDBUF(*), RECVBUF(*)
      ! INTEGER    SENDCOUNT, SENDTYPE, RECVCOUNT, RECVTYPE
      ! INTEGER    COMM, REQUEST, IERROR

      call MPI_IALLTOALL(SENDBUF, SENDCOUNT, SENDTYPE, RECVBUF, RECVCOUNT, &
      &  RECVTYPE, COMM, REQUEST, IERROR)


      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  abi_mpi_ialltoall_ok="yes"
else
  abi_mpi_ialltoall_ok="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_mpi_ialltoall_ok}" >&5
$as_echo "${abi_mpi_ialltoall_ok}" >&6; }

  # Restore build environment


    ABI_CPPFLAGS="${abi_env_ABI_CPPFLAGS}"

    AR="${abi_env_AR}"

    ARFLAGS="${abi_env_ARFLAGS}"

    ARFLAGS_CMD="${abi_env_ARFLAGS_CMD}"

    ARFLAGS_DEBUG="${abi_env_ARFLAGS_DEBUG}"

    ARFLAGS_EXTRA="${abi_env_ARFLAGS_EXTRA}"

    ARFLAGS_HINTS="${abi_env_ARFLAGS_HINTS}"

    ARFLAGS_OPTIM="${abi_env_ARFLAGS_OPTIM}"

    CC="${abi_env_CC}"

    CC_LDFLAGS="${abi_env_CC_LDFLAGS}"

    CC_LDFLAGS_DEBUG="${abi_env_CC_LDFLAGS_DEBUG}"

    CC_LDFLAGS_EXTRA="${abi_env_CC_LDFLAGS_EXTRA}"

    CC_LDFLAGS_GPU="${abi_env_CC_LDFLAGS_GPU}"

    CC_LDFLAGS_HINTS="${abi_env_CC_LDFLAGS_HINTS}"

    CC_LDFLAGS_OPTIM="${abi_env_CC_LDFLAGS_OPTIM}"

    CC_LIBS="${abi_env_CC_LIBS}"

    CC_LIBS_DEBUG="${abi_env_CC_LIBS_DEBUG}"

    CC_LIBS_EXTRA="${abi_env_CC_LIBS_EXTRA}"

    CC_LIBS_GPU="${abi_env_CC_LIBS_GPU}"

    CC_LIBS_HINTS="${abi_env_CC_LIBS_HINTS}"

    CC_LIBS_OPTIM="${abi_env_CC_LIBS_OPTIM}"

    CFLAGS="${abi_env_CFLAGS}"

    CFLAGS_DEBUG="${abi_env_CFLAGS_DEBUG}"

    CFLAGS_EXTRA="${abi_env_CFLAGS_EXTRA}"

    CFLAGS_GPU="${abi_env_CFLAGS_GPU}"

    CFLAGS_HINTS="${abi_env_CFLAGS_HINTS}"

    CFLAGS_OPTIM="${abi_env_CFLAGS_OPTIM}"

    CPP="${abi_env_CPP}"

    CPPFLAGS="${abi_env_CPPFLAGS}"

    CPPFLAGS_DEBUG="${abi_env_CPPFLAGS_DEBUG}"

    CPPFLAGS_EXTRA="${abi_env_CPPFLAGS_EXTRA}"

    CPPFLAGS_GPU="${abi_env_CPPFLAGS_GPU}"

    CPPFLAGS_HINTS="${abi_env_CPPFLAGS_HINTS}"

    CPPFLAGS_OPTIM="${abi_env_CPPFLAGS_OPTIM}"

    CXX="${abi_env_CXX}"

    CXXFLAGS="${abi_env_CXXFLAGS}"

    CXXFLAGS_DEBUG="${abi_env_CXXFLAGS_DEBUG}"

    CXXFLAGS_EXTRA="${abi_env_CXXFLAGS_EXTRA}"

    CXXFLAGS_GPU="${abi_env_CXXFLAGS_GPU}"

    CXXFLAGS_HINTS="${abi_env_CXXFLAGS_HINTS}"

    CXXFLAGS_OPTIM="${abi_env_CXXFLAGS_OPTIM}"

    CXX_LDFLAGS="${abi_env_CXX_LDFLAGS}"

    CXX_LDFLAGS_DEBUG="${abi_env_CXX_LDFLAGS_DEBUG}"

    CXX_LDFLAGS_EXTRA="${abi_env_CXX_LDFLAGS_EXTRA}"

    CXX_LDFLAGS_GPU="${abi_env_CXX_LDFLAGS_GPU}"

    CXX_LDFLAGS_HINTS="${abi_env_CXX_LDFLAGS_HINTS}"

    CXX_LDFLAGS_OPTIM="${abi_env_CXX_LDFLAGS_OPTIM}"

    CXX_LIBS="${abi_env_CXX_LIBS}"

    CXX_LIBS_DEBUG="${abi_env_CXX_LIBS_DEBUG}"

    CXX_LIBS_EXTRA="${abi_env_CXX_LIBS_EXTRA}"

    CXX_LIBS_GPU="${abi_env_CXX_LIBS_GPU}"

    CXX_LIBS_HINTS="${abi_env_CXX_LIBS_HINTS}"

    CXX_LIBS_OPTIM="${abi_env_CXX_LIBS_OPTIM}"

    DEFS="${abi_env_DEFS}"

    F77="${abi_env_F77}"

    FC="${abi_env_FC}"

    FCFLAGS="${abi_env_FCFLAGS}"

    FCFLAGS_DEBUG="${abi_env_FCFLAGS_DEBUG}"

    FCFLAGS_EXTRA="${abi_env_FCFLAGS_EXTRA}"

    FCFLAGS_FIXEDFORM="${abi_env_FCFLAGS_FIXEDFORM}"

    FCFLAGS_FREEFORM="${abi_env_FCFLAGS_FREEFORM}"

    FCFLAGS_HINTS="${abi_env_FCFLAGS_HINTS}"

    FCFLAGS_MODDIR="${abi_env_FCFLAGS_MODDIR}"

    FCFLAGS_OPENMP="${abi_env_FCFLAGS_OPENMP}"

    FCFLAGS_OPENMP_OFFLOAD="${abi_env_FCFLAGS_OPENMP_OFFLOAD}"

    FCFLAGS_OPTIM="${abi_env_FCFLAGS_OPTIM}"

    FC_LDFLAGS="${abi_env_FC_LDFLAGS}"

    FC_LDFLAGS_DEBUG="${abi_env_FC_LDFLAGS_DEBUG}"

    FC_LDFLAGS_EXTRA="${abi_env_FC_LDFLAGS_EXTRA}"

    FC_LDFLAGS_HINTS="${abi_env_FC_LDFLAGS_HINTS}"

    FC_LDFLAGS_OPTIM="${abi_env_FC_LDFLAGS_OPTIM}"

    FC_LIBS="${abi_env_FC_LIBS}"

    FC_LIBS_DEBUG="${abi_env_FC_LIBS_DEBUG}"

    FC_LIBS_EXTRA="${abi_env_FC_LIBS_EXTRA}"

    FC_LIBS_HINTS="${abi_env_FC_LIBS_HINTS}"

    FC_LIBS_OPTIM="${abi_env_FC_LIBS_OPTIM}"

    FFT_CFLAGS="${abi_env_FFT_CFLAGS}"

    FFT_FCFLAGS="${abi_env_FFT_FCFLAGS}"

    FPP="${abi_env_FPP}"

    FPPFLAGS="${abi_env_FPPFLAGS}"

    FPPFLAGS_DEBUG="${abi_env_FPPFLAGS_DEBUG}"

    FPPFLAGS_EXTRA="${abi_env_FPPFLAGS_EXTRA}"

    FPPFLAGS_HINTS="${abi_env_FPPFLAGS_HINTS}"

    FPPFLAGS_OPTIM="${abi_env_FPPFLAGS_OPTIM}"

    GPU_ARCH="${abi_env_GPU_ARCH}"

    LD="${abi_env_LD}"

    MODEXT="${abi_env_MODEXT}"

    NM="${abi_env_NM}"

    NVCC="${abi_env_NVCC}"

    NVCC_CFLAGS="${abi_env_NVCC_CFLAGS}"

    NVCC_CPPFLAGS="${abi_env_NVCC_CPPFLAGS}"

    NVCC_LDFLAGS="${abi_env_NVCC_LDFLAGS}"

    NVCC_LIBS="${abi_env_NVCC_LIBS}"

    PYFLAGS="${abi_env_PYFLAGS}"

    PYTHON_CPPFLAGS="${abi_env_PYTHON_CPPFLAGS}"

    RANLIB="${abi_env_RANLIB}"

    TRUE_CPP="${abi_env_TRUE_CPP}"

    XPP="${abi_env_XPP}"

    XPPFLAGS="${abi_env_XPPFLAGS}"

    XPPFLAGS_DEBUG="${abi_env_XPPFLAGS_DEBUG}"

    XPPFLAGS_EXTRA="${abi_env_XPPFLAGS_EXTRA}"

    XPPFLAGS_OPTIM="${abi_env_XPPFLAGS_OPTIM}"



  # Forward information to the compiler
  if test "${abi_mpi_ialltoall_ok}" = "yes"; then

$as_echo "#define HAVE_MPI_IALLTOALL 1" >>confdefs.h

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your MPI library does not support non-blocking communications. The wall time of certain algorithms will increase with the number of MPI processes. It is strongly suggested to use a more recent MPI2+ library!" >&5
$as_echo "$as_me: WARNING: Your MPI library does not support non-blocking communications. The wall time of certain algorithms will increase with the number of MPI processes. It is strongly suggested to use a more recent MPI2+ library!" >&2;}
  fi


  # Set default values
  abi_mpi_ialltoallv_ok="no"

  # Back-up build environment


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"



  # Prepare build environment
  CPPFLAGS="${CPPFLAGS} ${abi_mpi_incs}"
  LDFLAGS="${FC_LDFLAGS}"
  LIBS="${FC_LIBS} ${abi_mpi_libs}"

  # Try to compile a Fortran program
  # Note: we assume a MPI implementation that provides the mpi module
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI library supports MPI_IALLTOALLV (MPI3)" >&5
$as_echo_n "checking whether the MPI library supports MPI_IALLTOALLV (MPI3)... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use mpi

      integer, parameter :: siz=5, group_size=3
      integer :: SENDBUF(siz), RECVBUF(siz)
      integer :: SENDCOUNTS(group_size), SDISPLS(group_size)
      integer :: RECVCOUNTS(group_size), RDISPLS(group_size)
      integer :: SENDTYPE, RECVTYPE
      integer :: COMM, REQUEST, IERROR

      call MPI_IALLTOALLV(SENDBUF, SENDCOUNTS, SDISPLS, SENDTYPE, &
&       RECVBUF, RECVCOUNTS, RDISPLS, RECVTYPE, COMM, REQUEST, IERROR)

      !call MPI_Ialltoallv(const void *sendbuf, const int sendcounts[], const int sdispls[],
      !MPI_Datatype sendtype, void *recvbuf, const int recvcounts[],
      !  const int rdispls[], MPI_Datatype recvtype, MPI_Comm comm,
      !  MPI_Request *request)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  abi_mpi_ialltoallv_ok="yes"
else
  abi_mpi_ialltoallv_ok="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_mpi_ialltoallv_ok}" >&5
$as_echo "${abi_mpi_ialltoallv_ok}" >&6; }

  # Restore build environment


    ABI_CPPFLAGS="${abi_env_ABI_CPPFLAGS}"

    AR="${abi_env_AR}"

    ARFLAGS="${abi_env_ARFLAGS}"

    ARFLAGS_CMD="${abi_env_ARFLAGS_CMD}"

    ARFLAGS_DEBUG="${abi_env_ARFLAGS_DEBUG}"

    ARFLAGS_EXTRA="${abi_env_ARFLAGS_EXTRA}"

    ARFLAGS_HINTS="${abi_env_ARFLAGS_HINTS}"

    ARFLAGS_OPTIM="${abi_env_ARFLAGS_OPTIM}"

    CC="${abi_env_CC}"

    CC_LDFLAGS="${abi_env_CC_LDFLAGS}"

    CC_LDFLAGS_DEBUG="${abi_env_CC_LDFLAGS_DEBUG}"

    CC_LDFLAGS_EXTRA="${abi_env_CC_LDFLAGS_EXTRA}"

    CC_LDFLAGS_GPU="${abi_env_CC_LDFLAGS_GPU}"

    CC_LDFLAGS_HINTS="${abi_env_CC_LDFLAGS_HINTS}"

    CC_LDFLAGS_OPTIM="${abi_env_CC_LDFLAGS_OPTIM}"

    CC_LIBS="${abi_env_CC_LIBS}"

    CC_LIBS_DEBUG="${abi_env_CC_LIBS_DEBUG}"

    CC_LIBS_EXTRA="${abi_env_CC_LIBS_EXTRA}"

    CC_LIBS_GPU="${abi_env_CC_LIBS_GPU}"

    CC_LIBS_HINTS="${abi_env_CC_LIBS_HINTS}"

    CC_LIBS_OPTIM="${abi_env_CC_LIBS_OPTIM}"

    CFLAGS="${abi_env_CFLAGS}"

    CFLAGS_DEBUG="${abi_env_CFLAGS_DEBUG}"

    CFLAGS_EXTRA="${abi_env_CFLAGS_EXTRA}"

    CFLAGS_GPU="${abi_env_CFLAGS_GPU}"

    CFLAGS_HINTS="${abi_env_CFLAGS_HINTS}"

    CFLAGS_OPTIM="${abi_env_CFLAGS_OPTIM}"

    CPP="${abi_env_CPP}"

    CPPFLAGS="${abi_env_CPPFLAGS}"

    CPPFLAGS_DEBUG="${abi_env_CPPFLAGS_DEBUG}"

    CPPFLAGS_EXTRA="${abi_env_CPPFLAGS_EXTRA}"

    CPPFLAGS_GPU="${abi_env_CPPFLAGS_GPU}"

    CPPFLAGS_HINTS="${abi_env_CPPFLAGS_HINTS}"

    CPPFLAGS_OPTIM="${abi_env_CPPFLAGS_OPTIM}"

    CXX="${abi_env_CXX}"

    CXXFLAGS="${abi_env_CXXFLAGS}"

    CXXFLAGS_DEBUG="${abi_env_CXXFLAGS_DEBUG}"

    CXXFLAGS_EXTRA="${abi_env_CXXFLAGS_EXTRA}"

    CXXFLAGS_GPU="${abi_env_CXXFLAGS_GPU}"

    CXXFLAGS_HINTS="${abi_env_CXXFLAGS_HINTS}"

    CXXFLAGS_OPTIM="${abi_env_CXXFLAGS_OPTIM}"

    CXX_LDFLAGS="${abi_env_CXX_LDFLAGS}"

    CXX_LDFLAGS_DEBUG="${abi_env_CXX_LDFLAGS_DEBUG}"

    CXX_LDFLAGS_EXTRA="${abi_env_CXX_LDFLAGS_EXTRA}"

    CXX_LDFLAGS_GPU="${abi_env_CXX_LDFLAGS_GPU}"

    CXX_LDFLAGS_HINTS="${abi_env_CXX_LDFLAGS_HINTS}"

    CXX_LDFLAGS_OPTIM="${abi_env_CXX_LDFLAGS_OPTIM}"

    CXX_LIBS="${abi_env_CXX_LIBS}"

    CXX_LIBS_DEBUG="${abi_env_CXX_LIBS_DEBUG}"

    CXX_LIBS_EXTRA="${abi_env_CXX_LIBS_EXTRA}"

    CXX_LIBS_GPU="${abi_env_CXX_LIBS_GPU}"

    CXX_LIBS_HINTS="${abi_env_CXX_LIBS_HINTS}"

    CXX_LIBS_OPTIM="${abi_env_CXX_LIBS_OPTIM}"

    DEFS="${abi_env_DEFS}"

    F77="${abi_env_F77}"

    FC="${abi_env_FC}"

    FCFLAGS="${abi_env_FCFLAGS}"

    FCFLAGS_DEBUG="${abi_env_FCFLAGS_DEBUG}"

    FCFLAGS_EXTRA="${abi_env_FCFLAGS_EXTRA}"

    FCFLAGS_FIXEDFORM="${abi_env_FCFLAGS_FIXEDFORM}"

    FCFLAGS_FREEFORM="${abi_env_FCFLAGS_FREEFORM}"

    FCFLAGS_HINTS="${abi_env_FCFLAGS_HINTS}"

    FCFLAGS_MODDIR="${abi_env_FCFLAGS_MODDIR}"

    FCFLAGS_OPENMP="${abi_env_FCFLAGS_OPENMP}"

    FCFLAGS_OPENMP_OFFLOAD="${abi_env_FCFLAGS_OPENMP_OFFLOAD}"

    FCFLAGS_OPTIM="${abi_env_FCFLAGS_OPTIM}"

    FC_LDFLAGS="${abi_env_FC_LDFLAGS}"

    FC_LDFLAGS_DEBUG="${abi_env_FC_LDFLAGS_DEBUG}"

    FC_LDFLAGS_EXTRA="${abi_env_FC_LDFLAGS_EXTRA}"

    FC_LDFLAGS_HINTS="${abi_env_FC_LDFLAGS_HINTS}"

    FC_LDFLAGS_OPTIM="${abi_env_FC_LDFLAGS_OPTIM}"

    FC_LIBS="${abi_env_FC_LIBS}"

    FC_LIBS_DEBUG="${abi_env_FC_LIBS_DEBUG}"

    FC_LIBS_EXTRA="${abi_env_FC_LIBS_EXTRA}"

    FC_LIBS_HINTS="${abi_env_FC_LIBS_HINTS}"

    FC_LIBS_OPTIM="${abi_env_FC_LIBS_OPTIM}"

    FFT_CFLAGS="${abi_env_FFT_CFLAGS}"

    FFT_FCFLAGS="${abi_env_FFT_FCFLAGS}"

    FPP="${abi_env_FPP}"

    FPPFLAGS="${abi_env_FPPFLAGS}"

    FPPFLAGS_DEBUG="${abi_env_FPPFLAGS_DEBUG}"

    FPPFLAGS_EXTRA="${abi_env_FPPFLAGS_EXTRA}"

    FPPFLAGS_HINTS="${abi_env_FPPFLAGS_HINTS}"

    FPPFLAGS_OPTIM="${abi_env_FPPFLAGS_OPTIM}"

    GPU_ARCH="${abi_env_GPU_ARCH}"

    LD="${abi_env_LD}"

    MODEXT="${abi_env_MODEXT}"

    NM="${abi_env_NM}"

    NVCC="${abi_env_NVCC}"

    NVCC_CFLAGS="${abi_env_NVCC_CFLAGS}"

    NVCC_CPPFLAGS="${abi_env_NVCC_CPPFLAGS}"

    NVCC_LDFLAGS="${abi_env_NVCC_LDFLAGS}"

    NVCC_LIBS="${abi_env_NVCC_LIBS}"

    PYFLAGS="${abi_env_PYFLAGS}"

    PYTHON_CPPFLAGS="${abi_env_PYTHON_CPPFLAGS}"

    RANLIB="${abi_env_RANLIB}"

    TRUE_CPP="${abi_env_TRUE_CPP}"

    XPP="${abi_env_XPP}"

    XPPFLAGS="${abi_env_XPPFLAGS}"

    XPPFLAGS_DEBUG="${abi_env_XPPFLAGS_DEBUG}"

    XPPFLAGS_EXTRA="${abi_env_XPPFLAGS_EXTRA}"

    XPPFLAGS_OPTIM="${abi_env_XPPFLAGS_OPTIM}"



  # Forward information to the compiler
  if test "${abi_mpi_ialltoallv_ok}" = "yes"; then

$as_echo "#define HAVE_MPI_IALLTOALLV 1" >>confdefs.h

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your MPI library does not support non-blocking communications. The wall time of certain algorithms will increase with the number of MPI processes. It is strongly suggested to use a more recent MPI2+ library!" >&5
$as_echo "$as_me: WARNING: Your MPI library does not support non-blocking communications. The wall time of certain algorithms will increase with the number of MPI processes. It is strongly suggested to use a more recent MPI2+ library!" >&2;}
  fi


  # Set default values
  abi_mpi_igatherv_ok="no"

  # Try to compile a Fortran program
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI library supports MPI_IGATHERV (MPI3)" >&5
$as_echo_n "checking whether the MPI library supports MPI_IGATHERV (MPI3)... " >&6; }

  # We assume a MPI implementation that provides the mpi module

  # Back-up build environment


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"



  # Prepare build environment
  CPPFLAGS="${CPPFLAGS} ${lib_mpi_incs}"
  LDFLAGS="${FC_LDFLAGS}"
  LIBS="${FC_LIBS} ${lib_mpi_libs}"

  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use mpi

      integer,parameter :: siz=5,group_size=3
      integer :: SENDBUF(siz), RECVBUF(siz)
      integer :: SDISPLS(group_size), RECVCOUNTS(group_size),RDISPLS(group_size)
      integer :: SENDCOUNTS, SENDTYPE, RECVTYPE
      integer :: ROOT=0, COMM, REQUEST, IERROR

      call MPI_IGATHERV(SENDBUF,SENDCOUNTS,SENDTYPE,&
        RECVBUF,RECVCOUNTS,RDISPLS,RECVTYPE,ROOT,COMM,REQUEST,IERROR)

      !int MPI_Igatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
      !                 const int recvcounts[], const int displs[], MPI_Datatype recvtype, int root,
      !                 MPI_Comm comm, MPI_Request * request)


      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  abi_mpi_igatherv_ok="yes"
else
  abi_mpi_igatherv_ok="no"
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


  # Restore build environment


    ABI_CPPFLAGS="${abi_env_ABI_CPPFLAGS}"

    AR="${abi_env_AR}"

    ARFLAGS="${abi_env_ARFLAGS}"

    ARFLAGS_CMD="${abi_env_ARFLAGS_CMD}"

    ARFLAGS_DEBUG="${abi_env_ARFLAGS_DEBUG}"

    ARFLAGS_EXTRA="${abi_env_ARFLAGS_EXTRA}"

    ARFLAGS_HINTS="${abi_env_ARFLAGS_HINTS}"

    ARFLAGS_OPTIM="${abi_env_ARFLAGS_OPTIM}"

    CC="${abi_env_CC}"

    CC_LDFLAGS="${abi_env_CC_LDFLAGS}"

    CC_LDFLAGS_DEBUG="${abi_env_CC_LDFLAGS_DEBUG}"

    CC_LDFLAGS_EXTRA="${abi_env_CC_LDFLAGS_EXTRA}"

    CC_LDFLAGS_GPU="${abi_env_CC_LDFLAGS_GPU}"

    CC_LDFLAGS_HINTS="${abi_env_CC_LDFLAGS_HINTS}"

    CC_LDFLAGS_OPTIM="${abi_env_CC_LDFLAGS_OPTIM}"

    CC_LIBS="${abi_env_CC_LIBS}"

    CC_LIBS_DEBUG="${abi_env_CC_LIBS_DEBUG}"

    CC_LIBS_EXTRA="${abi_env_CC_LIBS_EXTRA}"

    CC_LIBS_GPU="${abi_env_CC_LIBS_GPU}"

    CC_LIBS_HINTS="${abi_env_CC_LIBS_HINTS}"

    CC_LIBS_OPTIM="${abi_env_CC_LIBS_OPTIM}"

    CFLAGS="${abi_env_CFLAGS}"

    CFLAGS_DEBUG="${abi_env_CFLAGS_DEBUG}"

    CFLAGS_EXTRA="${abi_env_CFLAGS_EXTRA}"

    CFLAGS_GPU="${abi_env_CFLAGS_GPU}"

    CFLAGS_HINTS="${abi_env_CFLAGS_HINTS}"

    CFLAGS_OPTIM="${abi_env_CFLAGS_OPTIM}"

    CPP="${abi_env_CPP}"

    CPPFLAGS="${abi_env_CPPFLAGS}"

    CPPFLAGS_DEBUG="${abi_env_CPPFLAGS_DEBUG}"

    CPPFLAGS_EXTRA="${abi_env_CPPFLAGS_EXTRA}"

    CPPFLAGS_GPU="${abi_env_CPPFLAGS_GPU}"

    CPPFLAGS_HINTS="${abi_env_CPPFLAGS_HINTS}"

    CPPFLAGS_OPTIM="${abi_env_CPPFLAGS_OPTIM}"

    CXX="${abi_env_CXX}"

    CXXFLAGS="${abi_env_CXXFLAGS}"

    CXXFLAGS_DEBUG="${abi_env_CXXFLAGS_DEBUG}"

    CXXFLAGS_EXTRA="${abi_env_CXXFLAGS_EXTRA}"

    CXXFLAGS_GPU="${abi_env_CXXFLAGS_GPU}"

    CXXFLAGS_HINTS="${abi_env_CXXFLAGS_HINTS}"

    CXXFLAGS_OPTIM="${abi_env_CXXFLAGS_OPTIM}"

    CXX_LDFLAGS="${abi_env_CXX_LDFLAGS}"

    CXX_LDFLAGS_DEBUG="${abi_env_CXX_LDFLAGS_DEBUG}"

    CXX_LDFLAGS_EXTRA="${abi_env_CXX_LDFLAGS_EXTRA}"

    CXX_LDFLAGS_GPU="${abi_env_CXX_LDFLAGS_GPU}"

    CXX_LDFLAGS_HINTS="${abi_env_CXX_LDFLAGS_HINTS}"

    CXX_LDFLAGS_OPTIM="${abi_env_CXX_LDFLAGS_OPTIM}"

    CXX_LIBS="${abi_env_CXX_LIBS}"

    CXX_LIBS_DEBUG="${abi_env_CXX_LIBS_DEBUG}"

    CXX_LIBS_EXTRA="${abi_env_CXX_LIBS_EXTRA}"

    CXX_LIBS_GPU="${abi_env_CXX_LIBS_GPU}"

    CXX_LIBS_HINTS="${abi_env_CXX_LIBS_HINTS}"

    CXX_LIBS_OPTIM="${abi_env_CXX_LIBS_OPTIM}"

    DEFS="${abi_env_DEFS}"

    F77="${abi_env_F77}"

    FC="${abi_env_FC}"

    FCFLAGS="${abi_env_FCFLAGS}"

    FCFLAGS_DEBUG="${abi_env_FCFLAGS_DEBUG}"

    FCFLAGS_EXTRA="${abi_env_FCFLAGS_EXTRA}"

    FCFLAGS_FIXEDFORM="${abi_env_FCFLAGS_FIXEDFORM}"

    FCFLAGS_FREEFORM="${abi_env_FCFLAGS_FREEFORM}"

    FCFLAGS_HINTS="${abi_env_FCFLAGS_HINTS}"

    FCFLAGS_MODDIR="${abi_env_FCFLAGS_MODDIR}"

    FCFLAGS_OPENMP="${abi_env_FCFLAGS_OPENMP}"

    FCFLAGS_OPENMP_OFFLOAD="${abi_env_FCFLAGS_OPENMP_OFFLOAD}"

    FCFLAGS_OPTIM="${abi_env_FCFLAGS_OPTIM}"

    FC_LDFLAGS="${abi_env_FC_LDFLAGS}"

    FC_LDFLAGS_DEBUG="${abi_env_FC_LDFLAGS_DEBUG}"

    FC_LDFLAGS_EXTRA="${abi_env_FC_LDFLAGS_EXTRA}"

    FC_LDFLAGS_HINTS="${abi_env_FC_LDFLAGS_HINTS}"

    FC_LDFLAGS_OPTIM="${abi_env_FC_LDFLAGS_OPTIM}"

    FC_LIBS="${abi_env_FC_LIBS}"

    FC_LIBS_DEBUG="${abi_env_FC_LIBS_DEBUG}"

    FC_LIBS_EXTRA="${abi_env_FC_LIBS_EXTRA}"

    FC_LIBS_HINTS="${abi_env_FC_LIBS_HINTS}"

    FC_LIBS_OPTIM="${abi_env_FC_LIBS_OPTIM}"

    FFT_CFLAGS="${abi_env_FFT_CFLAGS}"

    FFT_FCFLAGS="${abi_env_FFT_FCFLAGS}"

    FPP="${abi_env_FPP}"

    FPPFLAGS="${abi_env_FPPFLAGS}"

    FPPFLAGS_DEBUG="${abi_env_FPPFLAGS_DEBUG}"

    FPPFLAGS_EXTRA="${abi_env_FPPFLAGS_EXTRA}"

    FPPFLAGS_HINTS="${abi_env_FPPFLAGS_HINTS}"

    FPPFLAGS_OPTIM="${abi_env_FPPFLAGS_OPTIM}"

    GPU_ARCH="${abi_env_GPU_ARCH}"

    LD="${abi_env_LD}"

    MODEXT="${abi_env_MODEXT}"

    NM="${abi_env_NM}"

    NVCC="${abi_env_NVCC}"

    NVCC_CFLAGS="${abi_env_NVCC_CFLAGS}"

    NVCC_CPPFLAGS="${abi_env_NVCC_CPPFLAGS}"

    NVCC_LDFLAGS="${abi_env_NVCC_LDFLAGS}"

    NVCC_LIBS="${abi_env_NVCC_LIBS}"

    PYFLAGS="${abi_env_PYFLAGS}"

    PYTHON_CPPFLAGS="${abi_env_PYTHON_CPPFLAGS}"

    RANLIB="${abi_env_RANLIB}"

    TRUE_CPP="${abi_env_TRUE_CPP}"

    XPP="${abi_env_XPP}"

    XPPFLAGS="${abi_env_XPPFLAGS}"

    XPPFLAGS_DEBUG="${abi_env_XPPFLAGS_DEBUG}"

    XPPFLAGS_EXTRA="${abi_env_XPPFLAGS_EXTRA}"

    XPPFLAGS_OPTIM="${abi_env_XPPFLAGS_OPTIM}"



  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_mpi_igatherv_ok}" >&5
$as_echo "${abi_mpi_igatherv_ok}" >&6; }

  if test "${abi_mpi_igatherv_ok}" = "yes"; then

$as_echo "#define HAVE_MPI_IGATHERV 1" >>confdefs.h

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your MPI library does not support non-blocking communications. The wall time of certain algorithms will increase with the number of MPI processes. It is strongly suggested to use a more recent MPI2+ library!" >&5
$as_echo "$as_me: WARNING: Your MPI library does not support non-blocking communications. The wall time of certain algorithms will increase with the number of MPI processes. It is strongly suggested to use a more recent MPI2+ library!" >&2;}
  fi



  # Set default values
  abi_mpi_iallreduce_ok="no"

  # Back-up build environment


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"



  # Prepare build environment
  CPPFLAGS="${CPPFLAGS} ${abi_mpi_incs}"
  LDFLAGS="${FC_LDFLAGS}"
  LIBS="${FC_LIBS} ${abi_mpi_libs}"

  # Try to compile a Fortran MPI program
  # Note: we assume a MPI implementation that provides the mpi module
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the MPI library supports MPI_IALLREDUCE (MPI3)" >&5
$as_echo_n "checking whether the MPI library supports MPI_IALLREDUCE (MPI3)... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use mpi

      integer, parameter :: count=5
      integer :: SENDBUF(count), RECVBUF(count)
      integer :: SENDCOUNT, SENDTYPE, RECVCOUNT, RECVTYPE
      integer :: COMM, REQUEST, IERROR

      ! Prototype
      !<type> SENDBUF(*), RECVBUF(*) INTEGER COUNT, DATATYPE, OP, COMM, REQUEST, IERROR

      call MPI_IALLREDUCE(sendbuf, recvbuf, count, MPI_INTEGER, MPI_SUM, comm, request, ierror)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  abi_mpi_iallreduce_ok="yes"
else
  abi_mpi_iallreduce_ok="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_mpi_iallreduce_ok}" >&5
$as_echo "${abi_mpi_iallreduce_ok}" >&6; }

  # Restore build environment


    ABI_CPPFLAGS="${abi_env_ABI_CPPFLAGS}"

    AR="${abi_env_AR}"

    ARFLAGS="${abi_env_ARFLAGS}"

    ARFLAGS_CMD="${abi_env_ARFLAGS_CMD}"

    ARFLAGS_DEBUG="${abi_env_ARFLAGS_DEBUG}"

    ARFLAGS_EXTRA="${abi_env_ARFLAGS_EXTRA}"

    ARFLAGS_HINTS="${abi_env_ARFLAGS_HINTS}"

    ARFLAGS_OPTIM="${abi_env_ARFLAGS_OPTIM}"

    CC="${abi_env_CC}"

    CC_LDFLAGS="${abi_env_CC_LDFLAGS}"

    CC_LDFLAGS_DEBUG="${abi_env_CC_LDFLAGS_DEBUG}"

    CC_LDFLAGS_EXTRA="${abi_env_CC_LDFLAGS_EXTRA}"

    CC_LDFLAGS_GPU="${abi_env_CC_LDFLAGS_GPU}"

    CC_LDFLAGS_HINTS="${abi_env_CC_LDFLAGS_HINTS}"

    CC_LDFLAGS_OPTIM="${abi_env_CC_LDFLAGS_OPTIM}"

    CC_LIBS="${abi_env_CC_LIBS}"

    CC_LIBS_DEBUG="${abi_env_CC_LIBS_DEBUG}"

    CC_LIBS_EXTRA="${abi_env_CC_LIBS_EXTRA}"

    CC_LIBS_GPU="${abi_env_CC_LIBS_GPU}"

    CC_LIBS_HINTS="${abi_env_CC_LIBS_HINTS}"

    CC_LIBS_OPTIM="${abi_env_CC_LIBS_OPTIM}"

    CFLAGS="${abi_env_CFLAGS}"

    CFLAGS_DEBUG="${abi_env_CFLAGS_DEBUG}"

    CFLAGS_EXTRA="${abi_env_CFLAGS_EXTRA}"

    CFLAGS_GPU="${abi_env_CFLAGS_GPU}"

    CFLAGS_HINTS="${abi_env_CFLAGS_HINTS}"

    CFLAGS_OPTIM="${abi_env_CFLAGS_OPTIM}"

    CPP="${abi_env_CPP}"

    CPPFLAGS="${abi_env_CPPFLAGS}"

    CPPFLAGS_DEBUG="${abi_env_CPPFLAGS_DEBUG}"

    CPPFLAGS_EXTRA="${abi_env_CPPFLAGS_EXTRA}"

    CPPFLAGS_GPU="${abi_env_CPPFLAGS_GPU}"

    CPPFLAGS_HINTS="${abi_env_CPPFLAGS_HINTS}"

    CPPFLAGS_OPTIM="${abi_env_CPPFLAGS_OPTIM}"

    CXX="${abi_env_CXX}"

    CXXFLAGS="${abi_env_CXXFLAGS}"

    CXXFLAGS_DEBUG="${abi_env_CXXFLAGS_DEBUG}"

    CXXFLAGS_EXTRA="${abi_env_CXXFLAGS_EXTRA}"

    CXXFLAGS_GPU="${abi_env_CXXFLAGS_GPU}"

    CXXFLAGS_HINTS="${abi_env_CXXFLAGS_HINTS}"

    CXXFLAGS_OPTIM="${abi_env_CXXFLAGS_OPTIM}"

    CXX_LDFLAGS="${abi_env_CXX_LDFLAGS}"

    CXX_LDFLAGS_DEBUG="${abi_env_CXX_LDFLAGS_DEBUG}"

    CXX_LDFLAGS_EXTRA="${abi_env_CXX_LDFLAGS_EXTRA}"

    CXX_LDFLAGS_GPU="${abi_env_CXX_LDFLAGS_GPU}"

    CXX_LDFLAGS_HINTS="${abi_env_CXX_LDFLAGS_HINTS}"

    CXX_LDFLAGS_OPTIM="${abi_env_CXX_LDFLAGS_OPTIM}"

    CXX_LIBS="${abi_env_CXX_LIBS}"

    CXX_LIBS_DEBUG="${abi_env_CXX_LIBS_DEBUG}"

    CXX_LIBS_EXTRA="${abi_env_CXX_LIBS_EXTRA}"

    CXX_LIBS_GPU="${abi_env_CXX_LIBS_GPU}"

    CXX_LIBS_HINTS="${abi_env_CXX_LIBS_HINTS}"

    CXX_LIBS_OPTIM="${abi_env_CXX_LIBS_OPTIM}"

    DEFS="${abi_env_DEFS}"

    F77="${abi_env_F77}"

    FC="${abi_env_FC}"

    FCFLAGS="${abi_env_FCFLAGS}"

    FCFLAGS_DEBUG="${abi_env_FCFLAGS_DEBUG}"

    FCFLAGS_EXTRA="${abi_env_FCFLAGS_EXTRA}"

    FCFLAGS_FIXEDFORM="${abi_env_FCFLAGS_FIXEDFORM}"

    FCFLAGS_FREEFORM="${abi_env_FCFLAGS_FREEFORM}"

    FCFLAGS_HINTS="${abi_env_FCFLAGS_HINTS}"

    FCFLAGS_MODDIR="${abi_env_FCFLAGS_MODDIR}"

    FCFLAGS_OPENMP="${abi_env_FCFLAGS_OPENMP}"

    FCFLAGS_OPENMP_OFFLOAD="${abi_env_FCFLAGS_OPENMP_OFFLOAD}"

    FCFLAGS_OPTIM="${abi_env_FCFLAGS_OPTIM}"

    FC_LDFLAGS="${abi_env_FC_LDFLAGS}"

    FC_LDFLAGS_DEBUG="${abi_env_FC_LDFLAGS_DEBUG}"

    FC_LDFLAGS_EXTRA="${abi_env_FC_LDFLAGS_EXTRA}"

    FC_LDFLAGS_HINTS="${abi_env_FC_LDFLAGS_HINTS}"

    FC_LDFLAGS_OPTIM="${abi_env_FC_LDFLAGS_OPTIM}"

    FC_LIBS="${abi_env_FC_LIBS}"

    FC_LIBS_DEBUG="${abi_env_FC_LIBS_DEBUG}"

    FC_LIBS_EXTRA="${abi_env_FC_LIBS_EXTRA}"

    FC_LIBS_HINTS="${abi_env_FC_LIBS_HINTS}"

    FC_LIBS_OPTIM="${abi_env_FC_LIBS_OPTIM}"

    FFT_CFLAGS="${abi_env_FFT_CFLAGS}"

    FFT_FCFLAGS="${abi_env_FFT_FCFLAGS}"

    FPP="${abi_env_FPP}"

    FPPFLAGS="${abi_env_FPPFLAGS}"

    FPPFLAGS_DEBUG="${abi_env_FPPFLAGS_DEBUG}"

    FPPFLAGS_EXTRA="${abi_env_FPPFLAGS_EXTRA}"

    FPPFLAGS_HINTS="${abi_env_FPPFLAGS_HINTS}"

    FPPFLAGS_OPTIM="${abi_env_FPPFLAGS_OPTIM}"

    GPU_ARCH="${abi_env_GPU_ARCH}"

    LD="${abi_env_LD}"

    MODEXT="${abi_env_MODEXT}"

    NM="${abi_env_NM}"

    NVCC="${abi_env_NVCC}"

    NVCC_CFLAGS="${abi_env_NVCC_CFLAGS}"

    NVCC_CPPFLAGS="${abi_env_NVCC_CPPFLAGS}"

    NVCC_LDFLAGS="${abi_env_NVCC_LDFLAGS}"

    NVCC_LIBS="${abi_env_NVCC_LIBS}"

    PYFLAGS="${abi_env_PYFLAGS}"

    PYTHON_CPPFLAGS="${abi_env_PYTHON_CPPFLAGS}"

    RANLIB="${abi_env_RANLIB}"

    TRUE_CPP="${abi_env_TRUE_CPP}"

    XPP="${abi_env_XPP}"

    XPPFLAGS="${abi_env_XPPFLAGS}"

    XPPFLAGS_DEBUG="${abi_env_XPPFLAGS_DEBUG}"

    XPPFLAGS_EXTRA="${abi_env_XPPFLAGS_EXTRA}"

    XPPFLAGS_OPTIM="${abi_env_XPPFLAGS_OPTIM}"



  # Forward information to the compiler
  if test "${abi_mpi_iallreduce_ok}" = "yes"; then

$as_echo "#define HAVE_MPI_IALLREDUCE 1" >>confdefs.h

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your MPI library does not support non-blocking communications. The wall time of certain algorithms will increase with the number of MPI processes. It is strongly suggested to use a more recent MPI2+ library!" >&5
$as_echo "$as_me: WARNING: Your MPI library does not support non-blocking communications. The wall time of certain algorithms will increase with the number of MPI processes. It is strongly suggested to use a more recent MPI2+ library!" >&2;}
  fi


    fi # sd_mpi_ok

  fi # sd_mpi_enable

if test "${abi_mpi_enable}" = "yes"; then

  { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: dumping all MPI parameters for diagnostics" >&5
$as_echo "$as_me: dumping all MPI parameters for diagnostics" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: ------------------------------------------" >&5
$as_echo "$as_me: ------------------------------------------" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: Configure options:" >&5
$as_echo "$as_me: Configure options:" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * enable_mpi_inplace = '${enable_mpi_inplace}'" >&5
$as_echo "$as_me:   * enable_mpi_inplace = '${enable_mpi_inplace}'" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * enable_mpi_io      = '${enable_mpi_io}'" >&5
$as_echo "$as_me:   * enable_mpi_io      = '${enable_mpi_io}'" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * with_mpi           = '${with_mpi}'" >&5
$as_echo "$as_me:   * with_mpi           = '${with_mpi}'" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * with_mpi_level     = '${with_mpi_level}'" >&5
$as_echo "$as_me:   * with_mpi_level     = '${with_mpi_level}'" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: Internal parameters" >&5
$as_echo "$as_me: Internal parameters" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * MPI enabled (required)                       : ${abi_mpi_enable}" >&5
$as_echo "$as_me:   * MPI enabled (required)                       : ${abi_mpi_enable}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * MPI C compiler is set (required)             : ${sd_mpi_cc_set}" >&5
$as_echo "$as_me:   * MPI C compiler is set (required)             : ${sd_mpi_cc_set}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * MPI C compiler works (required)              : ${sd_mpi_cc_ok}" >&5
$as_echo "$as_me:   * MPI C compiler works (required)              : ${sd_mpi_cc_ok}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * MPI Fortran compiler is set (required)       : ${sd_mpi_fc_set}" >&5
$as_echo "$as_me:   * MPI Fortran compiler is set (required)       : ${sd_mpi_fc_set}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * MPI Fortran compiler works (required)        : ${sd_mpi_fc_ok}" >&5
$as_echo "$as_me:   * MPI Fortran compiler works (required)        : ${sd_mpi_fc_ok}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * MPI environment usable (required)            : ${abi_mpi_ok}" >&5
$as_echo "$as_me:   * MPI environment usable (required)            : ${abi_mpi_ok}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * MPI C++ compiler is set (optional)           : ${sd_mpi_cxx_set}" >&5
$as_echo "$as_me:   * MPI C++ compiler is set (optional)           : ${sd_mpi_cxx_set}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * MPI C++ compiler works (optional)            : ${sd_mpi_cxx_ok}" >&5
$as_echo "$as_me:   * MPI C++ compiler works (optional)            : ${sd_mpi_cxx_ok}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * MPI-in-place enabled (optional)              : ${abi_mpi_inplace_enable}" >&5
$as_echo "$as_me:   * MPI-in-place enabled (optional)              : ${abi_mpi_inplace_enable}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * MPI-IO enabled (optional)                    : ${abi_mpi_io_enable}" >&5
$as_echo "$as_me:   * MPI-IO enabled (optional)                    : ${abi_mpi_io_enable}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * MPI configuration type (computed)            : ${abi_mpi_init}" >&5
$as_echo "$as_me:   * MPI configuration type (computed)            : ${abi_mpi_init}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * MPI Fortran level supported (detected)       : ${abi_mpi_fc_level}" >&5
$as_echo "$as_me:   * MPI Fortran level supported (detected)       : ${abi_mpi_fc_level}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}:   * MPI_Get_library_version available (detected) : ${abi_mpi_get_library_version}" >&5
$as_echo "$as_me:   * MPI_Get_library_version available (detected) : ${abi_mpi_get_library_version}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: All required parameters must be set to 'yes'." >&5
$as_echo "$as_me: All required parameters must be set to 'yes'." >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: If not, the configuration and/or the build with" >&5
$as_echo "$as_me: If not, the configuration and/or the build with" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: MPI support will very likely fail." >&5
$as_echo "$as_me: MPI support will very likely fail." >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}

fi

# OpenMP support
# Note: OPENMP_INIT has to be done after openMP Fortran flags have been set


  # Use existing OPENMP env variables (Fortran only)
  OPENMP_FCFLAGS=""
  OPENMP_CFLAGS=""
  OPENMP_CXXFLAGS=""
  OPENMP_LDFLAGS=""
  OPENMP_LIBS=""
  test ! -z "${FCFLAGS_OPENMP}" && OPENMP_FCFLAGS="${OPENMP_FCFLAGS} ${FCFLAGS_OPENMP}"
  test ! -z "${FCFLAGS_OPENMP_OFFLOAD}" && OPENMP_FCFLAGS="${OPENMP_FCFLAGS} ${FCFLAGS_OPENMP_OFFLOAD}"

  # Delegate most of the init stage to Steredeg

  # Init
  sd_openmp_cppflags=""
  sd_openmp_cflags=""
  sd_openmp_fcflags=""
  sd_openmp_ldflags=""
  sd_openmp_libs=""
  sd_openmp_cc=""
  sd_openmp_cc_ok="unknown"
  sd_openmp_cxx=""
  sd_openmp_cxx_ok="unknown"
  sd_openmp_fc=""
  sd_openmp_fc_ok="unknown"
  sd_openmp_enable=""
  sd_openmp_init="unknown"
  sd_openmp_ok="unknown"

  # Set adjustable parameters
  sd_openmp_options="auto optional warn no-cc no-cxx"
  sd_openmp_libs_def=""
  sd_openmp_cppflags_def=""
  sd_openmp_cflags_def=""
  sd_openmp_cxxflags_def=""
  sd_openmp_fcflags_def=""
  sd_openmp_ldflags_def=""
  sd_openmp_enable_def=""
  sd_openmp_enable_cc=""
  sd_openmp_enable_cxx=""
  sd_openmp_enable_fc=""
  sd_openmp_policy=""
  sd_openmp_status=""

  # Process options
  for kwd in ${sd_openmp_options}; do
    case "${kwd}" in
      auto|no|yes)
        sd_openmp_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_openmp_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_openmp_policy="${kwd}"
        ;;
      no-cc)
        sd_openmp_enable_cc="no"
        ;;
      no-cxx)
        sd_openmp_enable_cxx="no"
        ;;
      no-fortran)
        sd_openmp_enable_fc="no"
        ;;
      *)
        as_fn_error $? "invalid Steredeg openMP option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test -z "${sd_openmp_policy}" && sd_openmp_policy="warn"
  test -z "${sd_openmp_status}" && sd_openmp_status="optional"
  test "${sd_openmp_enable_cc}" = "" && sd_openmp_enable_cc="yes"
  test "${sd_openmp_enable_cxx}" = "" && sd_openmp_enable_cxx="yes"
  test "${sd_openmp_enable_fc}" = "" && sd_openmp_enable_fc="yes"
  test -z "${sd_openmp_enable_def}" && sd_openmp_enable_def="no"
  case "${sd_openmp_status}" in
    implicit|required)
      sd_openmp_enable_def="yes"
      ;;
  esac

  # Declare configure option
  # Check whether --enable-openmp was given.
if test "${enable_openmp+set}" = set; then :
  enableval=$enable_openmp; sd_openmp_enable="${enableval}"; sd_openmp_init="yon"
else
  sd_openmp_enable="no"; sd_openmp_init="def"
fi


  # Declare environment variables
  #AC_ARG_VAR([OPENMP_CPPFLAGS], [C preprocessing flags for openMP.])
  #AC_ARG_VAR([OPENMP_CFLAGS], [C flags for openMP.])
  #AC_ARG_VAR([OPENMP_CXXFLAGS], [C++ flags for openMP.])
  #AC_ARG_VAR([OPENMP_FCFLAGS], [Fortran flags for openMP.])
  #AC_ARG_VAR([OPENMP_FFLAGS], [Fortran flags for openMP (better use OPENMP_FCFLAGS).])
  #AC_ARG_VAR([OPENMP_LDFLAGS], [Linker flags for openMP.])
  #AC_ARG_VAR([OPENMP_LIBS], [Library flags for openMP.])

  # Detect use of environment variables
  if test "${sd_openmp_enable}" = "yes" -o "${sd_openmp_enable}" = "auto"; then
    tmp_openmp_vars="${OPENMP_CPPFLAGS}${OPENMP_LDFLAGS}${OPENMP_LIBS}"
    if test "${sd_openmp_enable_cc}" = "yes"; then
      test ! -z "${OPENMP_CFLAGS}" && tmp_openmp_vars="${tmp_openmp_vars}${OPENMP_CFLAGS}"
    fi
    if test "${sd_openmp_enable_cxx}" = "yes"; then
      test ! -z "${OPENMP_CXXFLAGS}" && tmp_openmp_vars="${tmp_openmp_vars}${OPENMP_CXXFLAGS}"
    fi
    if test "${sd_openmp_enable_fc}" = "yes"; then
      test ! -z "${OPENMP_FFLAGS}" && tmp_openmp_vars="${tmp_openmp_vars}${OPENMP_FFLAGS}"
      test ! -z "${OPENMP_FCFLAGS}" && tmp_openmp_vars="${tmp_openmp_vars}${OPENMP_FCFLAGS}"
    fi
    if test "${sd_openmp_init}" = "def" -o "${sd_openmp_init}" = "yon"; then
      if test "${tmp_openmp_vars}" != ""; then
        sd_openmp_enable="yes"
        sd_openmp_init="env"
      fi
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_CONFIG_BYPASS_CHECKS}" != "yes"; then

  # Main trigger must be yes, no, or auto
  tmp_openmp_invalid="no"
  if test "${sd_openmp_enable}" != "auto" -a \
          "${sd_openmp_enable}" != "no" -a \
          "${sd_openmp_enable}" != "yes"; then
    case "${sd_openmp_policy}" in
      fail)
        as_fn_error $? "invalid trigger value: sd_openmp_enable = '${sd_openmp_enable}'" "$LINENO" 5
        ;;
      skip)
        tmp_openmp_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid trigger value: sd_openmp_enable = '${sd_openmp_enable}'" >&5
$as_echo "$as_me: WARNING: invalid trigger value: sd_openmp_enable = '${sd_openmp_enable}'" >&2;}
        tmp_openmp_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_openmp_invalid}" = "yes"; then
    if test "${sd_openmp_status}" = "required"; then
      sd_openmp_enable="yes"
    else
      sd_openmp_enable="no"
    fi
    tmp_openmp_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_openmp_enable to '${sd_openmp_enable}'" >&5
$as_echo "$as_me: setting sd_openmp_enable to '${sd_openmp_enable}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_openmp_invalid="no"
  if test "${sd_openmp_status}" = "implicit" -o \
          "${sd_openmp_status}" = "required"; then
    if test "${sd_openmp_enable}" = "no"; then
      case "${sd_openmp_policy}" in
        fail)
          as_fn_error $? "The openMP option is required and cannot be disabled." "$LINENO" 5
          ;;
        skip)
          tmp_openmp_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The openMP option is recommended and cannot be disabled." >&5
$as_echo "$as_me: WARNING: The openMP option is recommended and cannot be disabled." >&2;}
          tmp_openmp_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_openmp_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting openMP trigger to yes" >&5
$as_echo "$as_me: setting openMP trigger to yes" >&6;}
      sd_openmp_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_openmp_invalid}" = "yes"; then
    case "${sd_openmp_status}" in
      implicit|required)
        sd_openmp_enable="yes"
        ;;
      optional)
        sd_openmp_enable="no"
        ;;
    esac
    tmp_openmp_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_openmp_enable to '${sd_openmp_enable}'" >&5
$as_echo "$as_me: setting sd_openmp_enable to '${sd_openmp_enable}'" >&6;}
  fi

  # When using environment variables, triggers must be set to yes
  if test "${sd_openmp_init}" = "env" -a "${sd_openmp_enable}" = "no"; then
    if test "${sd_openmp_policy}" != "skip"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: openMP environment variables will be ignored" >&5
$as_echo "$as_me: WARNING: openMP environment variables will be ignored" >&2;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_openmp_status}" = "implicit"; then
    sd_openmp_enable="yes"
    if test "${sd_openmp_cppflags}" != ""; then
      sd_openmp_cppflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting openMP CPP flags (implicit package)" >&5
$as_echo "$as_me: resetting openMP CPP flags (implicit package)" >&6;}
    fi
    if test "${sd_openmp_cflags}" != ""; then
      sd_openmp_cflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting openMP C flags (implicit package)" >&5
$as_echo "$as_me: resetting openMP C flags (implicit package)" >&6;}
    fi
    if test "${sd_openmp_cxxflags}" != ""; then
      sd_openmp_cxxflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting openMP C++ flags (implicit package)" >&5
$as_echo "$as_me: resetting openMP C++ flags (implicit package)" >&6;}
    fi
    if test "${sd_openmp_fcflags}" != ""; then
      sd_openmp_fcflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting openMP Fortran flags (implicit package)" >&5
$as_echo "$as_me: resetting openMP Fortran flags (implicit package)" >&6;}
    fi
    if test "${sd_openmp_ldflags}" != ""; then
      sd_openmp_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting openMP linker flags (implicit package)" >&5
$as_echo "$as_me: resetting openMP linker flags (implicit package)" >&6;}
    fi
    if test "${sd_openmp_libs}" != ""; then
      sd_openmp_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting openMP library flags (implicit package)" >&5
$as_echo "$as_me: resetting openMP library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_openmp_enable}" = "no"; then
    sd_openmp_cppflags=""
    sd_openmp_cflags=""
    sd_openmp_cxxflags=""
    sd_openmp_fcflags=""
    sd_openmp_ldflags=""
    sd_openmp_libs=""
    sd_openmp_ok="no"
  fi

  # Clean-up
  unset tmp_openmp_invalid

  fi

  # Adjust configuration depending on init type
  if test "${sd_openmp_enable}" = "yes" -o "${sd_openmp_enable}" = "auto"; then

    # Set openMP-specific flags
    case "${sd_openmp_init}" in

      def|yon)
        sd_openmp_cppflags="${sd_openmp_cppflags_def}"
        test "${sd_openmp_enable_cc}" = "yes" && sd_openmp_cflags="${sd_openmp_cflags_def}"
        test "${sd_openmp_enable_cxx}" = "yes" && sd_openmp_cxxflags="${sd_openmp_cxxflags_def}"
        test "${sd_openmp_enable_fc}" = "yes" && sd_openmp_fcflags="${sd_openmp_fcflags_def}"
        sd_openmp_ldflags="${sd_openmp_ldflags_def}"
        sd_openmp_libs="${sd_openmp_libs_def}"
        ;;

      env)
        sd_openmp_cppflags="${sd_openmp_cppflags_def}"
        test "${sd_openmp_enable_cc}" = "yes" && sd_openmp_cflags="${sd_openmp_cflags_def}"
        test "${sd_openmp_enable_cxx}" = "yes" && sd_openmp_cxxflags="${sd_openmp_cxxflags_def}"
        test "${sd_openmp_enable_fc}" = "yes" && sd_openmp_fcflags="${sd_openmp_fcflags_def}"
        sd_openmp_ldflags="${sd_openmp_ldflags_def}"
        sd_openmp_libs="${sd_openmp_libs_def}"
        test "${OPENMP_CPPFLAGS}" != "" && sd_openmp_cppflags="${OPENMP_CPPFLAGS}"
        if test "${sd_openmp_enable_cc}" = "yes"; then
          test "${OPENMP_CFLAGS}" != "" && sd_openmp_cflags="${OPENMP_CFLAGS}"
        fi
        if test "${sd_openmp_enable_cxx}" = "yes"; then
          test "${OPENMP_CXXFLAGS}" != "" && sd_openmp_cxxflags="${OPENMP_CXXFLAGS}"
        fi
        if test "${sd_openmp_enable_fc}" = "yes"; then
          test "${OPENMP_FFLAGS}" != "" && sd_openmp_fcflags="${OPENMP_FFLAGS}"
          test "${OPENMP_FCFLAGS}" != "" && sd_openmp_fcflags="${OPENMP_FCFLAGS}"
        fi
        test "${OPENMP_LDFLAGS}" != "" && sd_openmp_ldflags="${OPENMP_LDFLAGS}"
        test "${OPENMP_LIBS}" != "" && sd_openmp_libs="${OPENMP_LIBS}"
        ;;

      *)
        as_fn_error $? "invalid init type for openMP: '${sd_openmp_init}'" "$LINENO" 5
        ;;

    esac

  fi

  # Display configuration
  #if test "${STEREDEG_CONFIG_BYPASS_CHECKS}" != "yes"; then
  #  _SD_OPENMP_DUMP_CONFIG
  #fi

  # Export configuration





















  # Clean-up
  unset tmp_openmp_vars


  # Init ABINIT openMP variables
  abi_openmp_enable="${sd_openmp_enable}"
  abi_openmp_init="${sd_openmp_init}"

  # Init ABINIT openMP build flags
  abi_openmp_cppflags=""
  abi_openmp_cflags=""
  abi_openmp_cxxflags=""
  abi_openmp_fcflags=""
  abi_openmp_ldflags=""
  abi_openmp_libs=""

  # Init ABINIT openMP build parameters
  if test "${abi_openmp_enable}" = "yes" -o "${abi_openmp_enable}" = "auto"; then
    abi_openmp_cppflags="${sd_openmp_cppflags}"
    abi_openmp_ldflags="${sd_openmp_ldflags}"
    abi_openmp_libs="${sd_openmp_libs}"
    if test "${sd_openmp_cc_ok}" = "yes"; then
      abi_openmp_cflags="${sd_openmp_cflags}"
    fi
    if test "${sd_openmp_cxx_ok}" = "yes"; then
      abi_openmp_cxxflags="${sd_openmp_cxxflags}"
    fi
    if test "${sd_openmp_fc_ok}" = "yes"; then
      abi_openmp_fcflags="${sd_openmp_fcflags}"
    fi
  else
    if test "${abi_openmp_init}" != "def"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: openMP support disabled from command-line" >&5
$as_echo "$as_me: openMP support disabled from command-line" >&6;}
    fi
    abi_openmp_enable="no"
    abi_openmp_init="cmd"
    abi_openmp_cppflags=""
    abi_openmp_cflags=""
    abi_openmp_cxxflags=""
    abi_openmp_fcflags=""
    abi_openmp_ldflags=""
    abi_openmp_libs=""
  fi # abi_openmp_enable

  # Enable substitution












  # Delegate the actual detection to Steredeg

  # Display configuration
  if test "${STEREDEG_CONFIG_BYPASS_CHECKS}" != "yes"; then

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable openMP" >&5
$as_echo_n "checking whether to enable openMP... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_openmp_enable}" >&5
$as_echo "${sd_openmp_enable}" >&6; }
  if test "${sd_openmp_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how openMP parameters have been set" >&5
$as_echo_n "checking how openMP parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_openmp_init}" >&5
$as_echo "${sd_openmp_init}" >&6; }
    # AC_MSG_CHECKING([for openMP C preprocessing flags])
    # AC_MSG_RESULT([${sd_openmp_cppflags}])
    if test "${sd_openmp_enable_cc}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openMP C flags" >&5
$as_echo_n "checking for openMP C flags... " >&6; }
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_openmp_cflags}" >&5
$as_echo "${sd_openmp_cflags}" >&6; }
    fi
    if test "${sd_openmp_enable_cxx}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openMP C++ flags" >&5
$as_echo_n "checking for openMP C++ flags... " >&6; }
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_openmp_cxxflags}" >&5
$as_echo "${sd_openmp_cxxflags}" >&6; }
    fi
    if test "${sd_openmp_enable_fc}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openMP Fortran flags" >&5
$as_echo_n "checking for openMP Fortran flags... " >&6; }
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_openmp_fcflags}" >&5
$as_echo "${sd_openmp_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openMP linker flags" >&5
$as_echo_n "checking for openMP linker flags... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_openmp_ldflags}" >&5
$as_echo "${sd_openmp_ldflags}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openMP library flags" >&5
$as_echo_n "checking for openMP library flags... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_openmp_libs}" >&5
$as_echo "${sd_openmp_libs}" >&6; }
  fi

  fi

  # Check whether we can compile and run a simple programs
  # and update build flags if successful
  if test "${sd_openmp_enable}" = "yes" -o "${sd_openmp_enable}" = "auto"; then

    sd_openmp_ok="yes"
    if test "${sd_openmp_enable_cc}" = "yes"; then

  # Init
  sd_openmp_cc_ok="unknown"
  sd_openmp_cc_api_ok="unknown"

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  CPPFLAGS="${CPPFLAGS} ${sd_openmp_cppflags}"
  CFLAGS="${CFLAGS} ${sd_openmp_cflags}"
  LDFLAGS="${LDFLAGS} ${sd_openmp_ldflags}"
  LIBS="${sd_openmp_libs} ${LIBS}"

  # Check the openMP implementation

  # Check if openMP directives work with C
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the openMP directives work with C" >&5
$as_echo_n "checking whether the openMP directives work with C... " >&6; }
  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

  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#include <omp.h>
#include <math.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

    int i, n, m;
    int array[10];
    n = 10;
#pragma omp parallel for
    for (i = 0; i < n; i++) {
        array[i] = sqrt((float)i);
    }
    m = omp_get_max_threads();
    return 0;

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  sd_openmp_cc_api_ok="yes"
else
  sd_openmp_cc_api_ok="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_openmp_cc_api_ok}" >&5
$as_echo "${sd_openmp_cc_api_ok}" >&6; }


  # Validate C support
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the openMP C environment works" >&5
$as_echo_n "checking whether the openMP C environment works... " >&6; }
  if test "${sd_openmp_cc_api_ok}" = "yes"; then
    sd_openmp_cc_ok="yes"
  else
    sd_openmp_cc_ok="no"
  fi
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_openmp_cc_ok}" >&5
$as_echo "${sd_openmp_cc_ok}" >&6; }

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"


      if test "${sd_openmp_cc_ok}" = "no"; then
        sd_openmp_ok="no"
      fi
    fi
    if test "${sd_openmp_enable_cxx}" = "yes"; then

  # Init
  sd_openmp_cxx_ok="unknown"
  sd_openmp_cxx_api_ok="unknown"

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  CPPFLAGS="${CPPFLAGS} ${sd_openmp_cppflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_openmp_cxxflags}"
  LDFLAGS="${LDFLAGS} ${sd_openmp_ldflags}"
  LIBS="${sd_openmp_libs} ${LIBS}"

  # Check the openMP implementation

  # Check if openMP directives work with C++
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the openMP directives work with C++" >&5
$as_echo_n "checking whether the openMP directives work with C++... " >&6; }
  ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu

  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#include <omp.h>
#include <cmath>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

    int i, n, m;
    int array[10];
    n = 10;
#pragma omp parallel for
    for (i = 0; i < n; i++) {
        array[i] = std::sqrt(static_cast<float>(i));
    }
    m = omp_get_max_threads();
    return 0;

  ;
  return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
  sd_openmp_cxx_api_ok="yes"
else
  sd_openmp_cxx_api_ok="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_openmp_cxx_api_ok}" >&5
$as_echo "${sd_openmp_cxx_api_ok}" >&6; }


  # Validate C++ support
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the openMP C++ environment works" >&5
$as_echo_n "checking whether the openMP C++ environment works... " >&6; }
  if test "${sd_openmp_cxx_api_ok}" = "yes"; then
    sd_openmp_cxx_ok="yes"
  else
    sd_openmp_cxx_ok="no"
  fi
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_openmp_cxx_ok}" >&5
$as_echo "${sd_openmp_cxx_ok}" >&6; }

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"


      if test "${sd_openmp_cxx_ok}" = "no"; then
        sd_openmp_ok="no"
      fi
    fi
    if test "${sd_openmp_enable_fc}" = "yes"; then

  # Init
  sd_openmp_fc_ok="unknown"
  sd_openmp_fc_api_ok="unknown"

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  CPPFLAGS="${CPPFLAGS} ${sd_openmp_cppflags}"
  FCFLAGS="${FCFLAGS} ${sd_openmp_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_openmp_ldflags}"
  LIBS="${sd_openmp_libs} ${LIBS}"

  # Check the openMP implementation

  # Check if openMP directives work with Fortran
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the openMP directives work with Fortran" >&5
$as_echo_n "checking whether the openMP directives work with Fortran... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  if test "$cross_compiling" = yes; 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 $? "cannot run test program while cross compiling
See \`config.log' for more details" "$LINENO" 5; }
else
  cat > conftest.$ac_ext <<_ACEOF
      program main

      use omp_lib
      integer :: i,n,m
      integer :: array(10)
      n = 10
!$OMP PARALLEL DO
      do i = 1, n
        array(i) = sqrt(real(i))
      enddo
!$OMP END PARALLEL DO
      m=omp_get_max_threads()

      end
_ACEOF
if ac_fn_fc_try_run "$LINENO"; then :
  sd_openmp_fc_api_ok="yes"
else
  sd_openmp_fc_api_ok="no"
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  conftest.$ac_objext conftest.beam conftest.$ac_ext
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_openmp_fc_api_ok}" >&5
$as_echo "${sd_openmp_fc_api_ok}" >&6; }


  # Validate Fortran support
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the openMP Fortran environment works" >&5
$as_echo_n "checking whether the openMP Fortran environment works... " >&6; }
  if test "${sd_openmp_fc_api_ok}" = "yes"; then
    sd_openmp_fc_ok="yes"
  else
    sd_openmp_fc_ok="no"
  fi
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_openmp_fc_ok}" >&5
$as_echo "${sd_openmp_fc_ok}" >&6; }

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"


      if test "${sd_openmp_fc_ok}" = "no"; then
        sd_openmp_ok="no"
      fi
    fi

    # Take decision according to policy
    if test "${sd_openmp_ok}" = "yes"; then
      sd_openmp_enable="yes"
    else
      if test "${sd_openmp_enable}" = "yes"; then
        case "${sd_openmp_policy}" in
          fail)
            { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "openMP support does not work
See \`config.log' for more details" "$LINENO" 5; }
            ;;
          skip)
            sd_openmp_enable="no"
            ;;
          warn)
            sd_openmp_enable="no"
            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: openMP support does not work and has been disabled" >&5
$as_echo "$as_me: WARNING: openMP support does not work and has been disabled" >&2;}
	    ;;
        esac
      else
        sd_openmp_enable="no"
      fi
    fi

    # Update build flags
    if test "${sd_openmp_ok}" = "yes"; then
      CPPFLAGS="${CPPFLAGS} ${sd_openmp_cppflags}"
      if test "${sd_openmp_enable_cc}" = "yes"; then
        CFLAGS="${CFLAGS} ${sd_openmp_cflags}"
      fi
      if test "${sd_openmp_enable_cxx}" = "yes"; then
        CXXFLAGS="${CXXFLAGS} ${sd_openmp_cxxflags}"
      fi
      if test "${sd_openmp_enable_fc}" = "yes"; then
        FCFLAGS="${FCFLAGS} ${sd_openmp_fcflags}"
      fi
      LIBS="${sd_openmp_libs} ${LIBS}"
      LDFLAGS="${LDFLAGS} ${sd_openmp_ldflags}"
    else
      if test "${sd_openmp_status}" = "optional" -a \
              "${sd_openmp_init}" = "def"; then
        sd_openmp_enable="no"
        sd_openmp_cppflags=""
        sd_openmp_cflags=""
        sd_openmp_fcflags=""
        sd_openmp_ldflags=""
        sd_openmp_libs=""
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid openMP configuration" >&5
$as_echo "$as_me: WARNING: invalid openMP configuration" >&2;}
      fi
    fi

  else
    sd_openmp_enable="no"
    sd_openmp_cppflags=""
    sd_openmp_cflags=""
    sd_openmp_fcflags=""
    sd_openmp_ldflags=""
    sd_openmp_libs=""
  fi

  # Make openMP status available to the source code
  if test "${sd_openmp_enable}" = "yes" -a "${sd_openmp_ok}" = "yes"; then

$as_echo "#define HAVE_OPENMP 1" >>confdefs.h

  fi


  { $as_echo "$as_me:${as_lineno-$LINENO}: OpenMP support is enabled in Fortran source code only" >&5
$as_echo "$as_me: OpenMP support is enabled in Fortran source code only" >&6;}

  abi_openmp_ok="${sd_openmp_ok}"

  if test "${sd_openmp_enable}" = "yes"; then

    if test "${sd_openmp_ok}" = "yes"; then

      # Force abi_openmp_enable to "yes", for clarity and to avoid having to
      # further test "auto"
      abi_openmp_enable="yes"

      # Check whether OpenMP has a working implementation of COLLAPSE

    abi_omp_has_collapse="unknown"

    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether OpenMP COLLAPSE works with Fortran" >&5
$as_echo_n "checking whether OpenMP COLLAPSE works with Fortran... " >&6; }
  if test "$cross_compiling" = yes; 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 $? "cannot run test program while cross compiling
See \`config.log' for more details" "$LINENO" 5; }
else
  cat > conftest.$ac_ext <<_ACEOF
      program main

      integer :: alfa,i,levels
      levels = 1
      open(unit=10,file="conftest.collapse")
!$OMP PARALLEL DO COLLAPSE(2) PRIVATE(alfa,i) DEFAULT(shared)
       do alfa=1,1
         do i=1,levels
           write(10,'(I1)') i*alfa
         end do
       end do
!$OMP END PARALLEL DO
       close(unit=10)

      end
_ACEOF
if ac_fn_fc_try_run "$LINENO"; then :
  abi_omp_has_collapse="yes"; abi_omp_collapse_result=`cat conftest.collapse 2>/dev/null`; rm -f conftest.collapse
else
  abi_omp_has_collapse="no"; rm -f conftest.collapse
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  conftest.$ac_objext conftest.beam conftest.$ac_ext
fi

  test "${abi_omp_collapse_result}" = "1" || abi_omp_has_collapse="no"
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_omp_has_collapse}" >&5
$as_echo "${abi_omp_has_collapse}" >&6; }
  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 "${abi_omp_has_collapse}" = "yes"; then

$as_echo "#define HAVE_OMP_COLLAPSE 1" >>confdefs.h

  fi


      # Check if openMP offload is available
      abi_omp_has_gpu_offload="no"
      if test "${abi_openmp_offload_enable}" = "yes"; then

    abi_omp_has_gpu_offload="unknown"
  abi_omp_has_gpu_get_mapped_ptr="unknown"
  abi_omp_has_gpu_offload_datastructure="unknown"

    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether OpenMP TARGET offload directives are recognized in Fortran" >&5
$as_echo_n "checking whether OpenMP TARGET offload directives are recognized in Fortran... " >&6; }
  cat > conftest.$ac_ext <<_ACEOF
      program main

      use omp_lib
      use, intrinsic :: iso_c_binding, only : c_ptr
      integer :: alfa,i,levels,arr(7),device_id,rc,num
      logical :: is_bool
      type(c_ptr) :: ptr

      levels = 7
      arr = 0
      is_bool = omp_is_initial_device()
      device_id = omp_get_initial_device()
      device_id = omp_get_default_device()
      rc = omp_target_is_present(ptr, device_id)
      call omp_set_default_device(device_id)
      num = omp_get_num_devices()

      ! Not an actual GPU offload test, as users may not compile on host with GPU.
      ! Only compiler capabilities are checked.
      if (levels == 8) then
!$OMP TARGET ENTER DATA MAP(to:arr)
!$OMP TARGET PARALLEL DO COLLAPSE(2) PRIVATE(alfa,i) MAP(to:arr)
      do alfa=1,1
        do i=1,levels
          arr(i)=i
        end do
      end do
!$OMP END TARGET PARALLEL DO

!$OMP TARGET DATA USE_DEVICE_ADDR(arr)
      alfa=1
!$OMP END TARGET DATA
!$OMP TARGET EXIT DATA MAP(from:arr)
      end if


      end
_ACEOF
if ac_fn_fc_try_compile "$LINENO"; then :
  abi_omp_has_gpu_offload="yes"
else
  abi_omp_has_gpu_offload="no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_omp_has_gpu_offload}" >&5
$as_echo "${abi_omp_has_gpu_offload}" >&6; }

  if test "${abi_omp_has_gpu_offload}" != "yes"; then
    as_fn_error $? "OpenMP GPU offload is enabled but is not supported by your compiler. Perhaps do you have flags missing ?" "$LINENO" 5
  fi

    if test "${abi_omp_has_gpu_offload}" == "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler implements omp_get_mapped_ptr" >&5
$as_echo_n "checking whether compiler implements omp_get_mapped_ptr... " >&6; }
    cat > conftest.$ac_ext <<_ACEOF
      program main

        use omp_lib
        use, intrinsic :: iso_c_binding, only : c_ptr
        integer :: device_id
        type(c_ptr) :: ptr,ptr2

        device_id = omp_get_default_device()

        ptr2 = omp_get_mapped_ptr(ptr, device_id)


      end
_ACEOF
if ac_fn_fc_try_compile "$LINENO"; then :
  abi_omp_has_gpu_get_mapped_ptr="yes"
else
  abi_omp_has_gpu_get_mapped_ptr="no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_omp_has_gpu_get_mapped_ptr}" >&5
$as_echo "${abi_omp_has_gpu_get_mapped_ptr}" >&6; }
    if test "${abi_omp_has_gpu_get_mapped_ptr}" == "yes"; then

$as_echo "#define HAVE_OPENMP_GET_MAPPED_PTR 1" >>confdefs.h

    fi
  fi

    if test "${abi_omp_has_gpu_offload}" == "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler correctly handles structured types in OMP TARGET directives" >&5
$as_echo_n "checking whether compiler correctly handles structured types in OMP TARGET directives... " >&6; }

        if test "${abi_fc_vendor}" == "nvhpc"; then
      abi_omp_has_gpu_offload_datastructure="yes"
    else
      abi_omp_has_gpu_offload_datastructure="no"
    fi

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_omp_has_gpu_offload_datastructure}" >&5
$as_echo "${abi_omp_has_gpu_offload_datastructure}" >&6; }
    if test "${abi_omp_has_gpu_offload_datastructure}" == "yes"; then

$as_echo "#define HAVE_OPENMP_OFFLOAD_DATASTRUCTURE 1" >>confdefs.h

    fi
  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


      fi

    fi # sd_openmp_ok

  fi # sd_mpi_enable


# GPU support

  # Initial setup
  abi_gpu_serial="no"
  abi_gpu_precision=`echo "${abi_gpu_flavor}" | cut -d- -f2`
  test "${abi_gpu_precision}" = "" && abi_gpu_precision="single"

  # Display user requests
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to activate GPU support" >&5
$as_echo_n "checking whether to activate GPU support... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_gpu_enable}" >&5
$as_echo "${abi_gpu_enable}" >&6; }

  # Look for GPU libraries
  if test "${abi_gpu_enable}" = "yes"; then

    # Check whether we have a working gpu environment
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the requested GPU support" >&5
$as_echo_n "checking for the requested GPU support... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_gpu_flavor}" >&5
$as_echo "${abi_gpu_flavor}" >&6; }

    case "${abi_gpu_flavor}" in

      cuda*)

  # Init
  abi_gpu_cuda_serial="no"
  abi_gpu_cuda_old="unknown"

  # Display variables
  { $as_echo "$as_me:${as_lineno-$LINENO}: Cuda incs: ${abi_gpu_cuda_incs}" >&5
$as_echo "$as_me: Cuda incs: ${abi_gpu_cuda_incs}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: Cuda libs: ${abi_gpu_cuda_libs}" >&5
$as_echo "$as_me: Cuda libs: ${abi_gpu_cuda_libs}" >&6;}

  # Prepare environment


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"


  CPPFLAGS="${CPPFLAGS} ${abi_gpu_cuda_incs}"
  LDFLAGS="${CC_LDFLAGS} ${CC_LDFLAGS_GPU}"
  abi_saved_LIBS="${LIBS}"
  LIBS="${abi_gpu_cuda_libs} ${LIBS}"
  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


  # Check usability of headers
  for ac_header in cuda_runtime_api.h cufft.h cublas.h cusolver_common.h
do :
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
  cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done


  # Look for libraries and routines
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Cuda programs can be compiled" >&5
$as_echo_n "checking whether Cuda programs can be compiled... " >&6; }
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#if defined HAVE_CUDA_RUNTIME_API_H
#include "cuda_runtime_api.h"
#endif

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

      cudaError_t err;
      int *count;
      err = cudaGetDeviceCount(count);

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  abi_gpu_cuda_serial="yes"
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_gpu_cuda_serial}" >&5
$as_echo "${abi_gpu_cuda_serial}" >&6; }

  # Do we have an old version of Cuda?
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have Cuda < 4" >&5
$as_echo_n "checking whether we have Cuda < 4... " >&6; }
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#if defined HAVE_CUDA_RUNTIME_API_H
#include "cuda_runtime_api.h"
#endif

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

      cudaDeviceReset();

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  abi_gpu_cuda_old="no"
else
  abi_gpu_cuda_old="yes"
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_gpu_cuda_old}" >&5
$as_echo "${abi_gpu_cuda_old}" >&6; }

  # Check ISO C Binding (Fortran)
  if test "${fc_has_iso_c_binding}" != "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: your Fortran compiler does not provide any ISO C binding module" >&5
$as_echo "$as_me: WARNING: your Fortran compiler does not provide any ISO C binding module" >&2;}
  fi

  # call this macro here to make sure variable `abi_gpu_cuda_version_10`
  #
  # check if we are using CUDA runtime version at least 10
  # version 10 of CUDA is required for NVTX (header only)
  #
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have Cuda >= 10" >&5
$as_echo_n "checking whether we have Cuda >= 10... " >&6; }
  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

  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

      #include <cuda_runtime_api.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

#if CUDART_VERSION < 10000
#error
#endif

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
  abi_gpu_cuda_version_10="yes"
else
  abi_gpu_cuda_version_10="no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_gpu_cuda_version_10}" >&5
$as_echo "${abi_gpu_cuda_version_10}" >&6; }

  if test "${abi_gpu_markers_enable}" = "yes"; then
    if test "${abi_gpu_cuda_version_10}" = "yes"; then
      if test -e "${abi_gpu_cuda_libdir}/libnvToolsExt.${abi_so_ext}"; then
        # always add link flags to nvtx if available
        if test "${GPU_LIBS}" = ""; then
          abi_gpu_cuda_libs="-lnvToolsExt ${abi_gpu_cuda_libs}"
        else
          abi_gpu_cuda_libs="${abi_gpu_cuda_libs} -lnvToolsExt"
        fi
        abi_gpu_nvtx_v3="yes"
        abi_result="${abi_result} nvtx_v3"
      else
        as_fn_error $? "Cuda NVTX: ${abi_gpu_cuda_libdir}/libnvToolsExt.${abi_so_ext} not found" "$LINENO" 5
      fi
    else
      as_fn_error $? "Cuda NVTX was requested but is not available for CUDA < v10" "$LINENO" 5
    fi
  fi

  # Restore build environment
  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

  LIBS="${abi_saved_LIBS}"


    ABI_CPPFLAGS="${abi_env_ABI_CPPFLAGS}"

    AR="${abi_env_AR}"

    ARFLAGS="${abi_env_ARFLAGS}"

    ARFLAGS_CMD="${abi_env_ARFLAGS_CMD}"

    ARFLAGS_DEBUG="${abi_env_ARFLAGS_DEBUG}"

    ARFLAGS_EXTRA="${abi_env_ARFLAGS_EXTRA}"

    ARFLAGS_HINTS="${abi_env_ARFLAGS_HINTS}"

    ARFLAGS_OPTIM="${abi_env_ARFLAGS_OPTIM}"

    CC="${abi_env_CC}"

    CC_LDFLAGS="${abi_env_CC_LDFLAGS}"

    CC_LDFLAGS_DEBUG="${abi_env_CC_LDFLAGS_DEBUG}"

    CC_LDFLAGS_EXTRA="${abi_env_CC_LDFLAGS_EXTRA}"

    CC_LDFLAGS_GPU="${abi_env_CC_LDFLAGS_GPU}"

    CC_LDFLAGS_HINTS="${abi_env_CC_LDFLAGS_HINTS}"

    CC_LDFLAGS_OPTIM="${abi_env_CC_LDFLAGS_OPTIM}"

    CC_LIBS="${abi_env_CC_LIBS}"

    CC_LIBS_DEBUG="${abi_env_CC_LIBS_DEBUG}"

    CC_LIBS_EXTRA="${abi_env_CC_LIBS_EXTRA}"

    CC_LIBS_GPU="${abi_env_CC_LIBS_GPU}"

    CC_LIBS_HINTS="${abi_env_CC_LIBS_HINTS}"

    CC_LIBS_OPTIM="${abi_env_CC_LIBS_OPTIM}"

    CFLAGS="${abi_env_CFLAGS}"

    CFLAGS_DEBUG="${abi_env_CFLAGS_DEBUG}"

    CFLAGS_EXTRA="${abi_env_CFLAGS_EXTRA}"

    CFLAGS_GPU="${abi_env_CFLAGS_GPU}"

    CFLAGS_HINTS="${abi_env_CFLAGS_HINTS}"

    CFLAGS_OPTIM="${abi_env_CFLAGS_OPTIM}"

    CPP="${abi_env_CPP}"

    CPPFLAGS="${abi_env_CPPFLAGS}"

    CPPFLAGS_DEBUG="${abi_env_CPPFLAGS_DEBUG}"

    CPPFLAGS_EXTRA="${abi_env_CPPFLAGS_EXTRA}"

    CPPFLAGS_GPU="${abi_env_CPPFLAGS_GPU}"

    CPPFLAGS_HINTS="${abi_env_CPPFLAGS_HINTS}"

    CPPFLAGS_OPTIM="${abi_env_CPPFLAGS_OPTIM}"

    CXX="${abi_env_CXX}"

    CXXFLAGS="${abi_env_CXXFLAGS}"

    CXXFLAGS_DEBUG="${abi_env_CXXFLAGS_DEBUG}"

    CXXFLAGS_EXTRA="${abi_env_CXXFLAGS_EXTRA}"

    CXXFLAGS_GPU="${abi_env_CXXFLAGS_GPU}"

    CXXFLAGS_HINTS="${abi_env_CXXFLAGS_HINTS}"

    CXXFLAGS_OPTIM="${abi_env_CXXFLAGS_OPTIM}"

    CXX_LDFLAGS="${abi_env_CXX_LDFLAGS}"

    CXX_LDFLAGS_DEBUG="${abi_env_CXX_LDFLAGS_DEBUG}"

    CXX_LDFLAGS_EXTRA="${abi_env_CXX_LDFLAGS_EXTRA}"

    CXX_LDFLAGS_GPU="${abi_env_CXX_LDFLAGS_GPU}"

    CXX_LDFLAGS_HINTS="${abi_env_CXX_LDFLAGS_HINTS}"

    CXX_LDFLAGS_OPTIM="${abi_env_CXX_LDFLAGS_OPTIM}"

    CXX_LIBS="${abi_env_CXX_LIBS}"

    CXX_LIBS_DEBUG="${abi_env_CXX_LIBS_DEBUG}"

    CXX_LIBS_EXTRA="${abi_env_CXX_LIBS_EXTRA}"

    CXX_LIBS_GPU="${abi_env_CXX_LIBS_GPU}"

    CXX_LIBS_HINTS="${abi_env_CXX_LIBS_HINTS}"

    CXX_LIBS_OPTIM="${abi_env_CXX_LIBS_OPTIM}"

    DEFS="${abi_env_DEFS}"

    F77="${abi_env_F77}"

    FC="${abi_env_FC}"

    FCFLAGS="${abi_env_FCFLAGS}"

    FCFLAGS_DEBUG="${abi_env_FCFLAGS_DEBUG}"

    FCFLAGS_EXTRA="${abi_env_FCFLAGS_EXTRA}"

    FCFLAGS_FIXEDFORM="${abi_env_FCFLAGS_FIXEDFORM}"

    FCFLAGS_FREEFORM="${abi_env_FCFLAGS_FREEFORM}"

    FCFLAGS_HINTS="${abi_env_FCFLAGS_HINTS}"

    FCFLAGS_MODDIR="${abi_env_FCFLAGS_MODDIR}"

    FCFLAGS_OPENMP="${abi_env_FCFLAGS_OPENMP}"

    FCFLAGS_OPENMP_OFFLOAD="${abi_env_FCFLAGS_OPENMP_OFFLOAD}"

    FCFLAGS_OPTIM="${abi_env_FCFLAGS_OPTIM}"

    FC_LDFLAGS="${abi_env_FC_LDFLAGS}"

    FC_LDFLAGS_DEBUG="${abi_env_FC_LDFLAGS_DEBUG}"

    FC_LDFLAGS_EXTRA="${abi_env_FC_LDFLAGS_EXTRA}"

    FC_LDFLAGS_HINTS="${abi_env_FC_LDFLAGS_HINTS}"

    FC_LDFLAGS_OPTIM="${abi_env_FC_LDFLAGS_OPTIM}"

    FC_LIBS="${abi_env_FC_LIBS}"

    FC_LIBS_DEBUG="${abi_env_FC_LIBS_DEBUG}"

    FC_LIBS_EXTRA="${abi_env_FC_LIBS_EXTRA}"

    FC_LIBS_HINTS="${abi_env_FC_LIBS_HINTS}"

    FC_LIBS_OPTIM="${abi_env_FC_LIBS_OPTIM}"

    FFT_CFLAGS="${abi_env_FFT_CFLAGS}"

    FFT_FCFLAGS="${abi_env_FFT_FCFLAGS}"

    FPP="${abi_env_FPP}"

    FPPFLAGS="${abi_env_FPPFLAGS}"

    FPPFLAGS_DEBUG="${abi_env_FPPFLAGS_DEBUG}"

    FPPFLAGS_EXTRA="${abi_env_FPPFLAGS_EXTRA}"

    FPPFLAGS_HINTS="${abi_env_FPPFLAGS_HINTS}"

    FPPFLAGS_OPTIM="${abi_env_FPPFLAGS_OPTIM}"

    GPU_ARCH="${abi_env_GPU_ARCH}"

    LD="${abi_env_LD}"

    MODEXT="${abi_env_MODEXT}"

    NM="${abi_env_NM}"

    NVCC="${abi_env_NVCC}"

    NVCC_CFLAGS="${abi_env_NVCC_CFLAGS}"

    NVCC_CPPFLAGS="${abi_env_NVCC_CPPFLAGS}"

    NVCC_LDFLAGS="${abi_env_NVCC_LDFLAGS}"

    NVCC_LIBS="${abi_env_NVCC_LIBS}"

    PYFLAGS="${abi_env_PYFLAGS}"

    PYTHON_CPPFLAGS="${abi_env_PYTHON_CPPFLAGS}"

    RANLIB="${abi_env_RANLIB}"

    TRUE_CPP="${abi_env_TRUE_CPP}"

    XPP="${abi_env_XPP}"

    XPPFLAGS="${abi_env_XPPFLAGS}"

    XPPFLAGS_DEBUG="${abi_env_XPPFLAGS_DEBUG}"

    XPPFLAGS_EXTRA="${abi_env_XPPFLAGS_EXTRA}"

    XPPFLAGS_OPTIM="${abi_env_XPPFLAGS_OPTIM}"



        abi_gpu_serial="${abi_gpu_cuda_serial}"
        if test "${abi_gpu_serial}" = "yes"; then

$as_echo "#define HAVE_GPU_CUDA 1" >>confdefs.h

          if test "${abi_gpu_cuda_old}" = "yes"; then

$as_echo "#define HAVE_GPU_CUDA3 1" >>confdefs.h

          fi
          if test "${abi_gpu_cuda_version_10}" = "yes"; then

$as_echo "#define HAVE_GPU_CUDA10 1" >>confdefs.h

          fi
          case "${abi_gpu_precision}" in
            single)

$as_echo "#define HAVE_GPU_CUDA_SP 1" >>confdefs.h

              ;;
            double)

$as_echo "#define HAVE_GPU_CUDA_DP 1" >>confdefs.h

              ;;
          esac
          abi_gpu_fcflags="${abi_gpu_cuda_fcflags}"
          abi_gpu_ldflags="${abi_gpu_cuda_ldflags}"
          abi_gpu_incs="${abi_gpu_cuda_incs}"
          abi_gpu_libs="${abi_gpu_cuda_libs}"
        fi
        ;;

      hip*)

  # Init
  abi_gpu_hip_serial="no"
  abi_gpu_hip_old="unknown"

  # Display variables
  { $as_echo "$as_me:${as_lineno-$LINENO}: ROCm/HIP incs: ${abi_gpu_hip_incs}" >&5
$as_echo "$as_me: ROCm/HIP incs: ${abi_gpu_hip_incs}" >&6;}
  { $as_echo "$as_me:${as_lineno-$LINENO}: ROCm/HIP libs: ${abi_gpu_hip_libs}" >&5
$as_echo "$as_me: ROCm/HIP libs: ${abi_gpu_hip_libs}" >&6;}

  # Prepare environment


    abi_env_ABI_CPPFLAGS="${ABI_CPPFLAGS}"

    abi_env_AR="${AR}"

    abi_env_ARFLAGS="${ARFLAGS}"

    abi_env_ARFLAGS_CMD="${ARFLAGS_CMD}"

    abi_env_ARFLAGS_DEBUG="${ARFLAGS_DEBUG}"

    abi_env_ARFLAGS_EXTRA="${ARFLAGS_EXTRA}"

    abi_env_ARFLAGS_HINTS="${ARFLAGS_HINTS}"

    abi_env_ARFLAGS_OPTIM="${ARFLAGS_OPTIM}"

    abi_env_CC="${CC}"

    abi_env_CC_LDFLAGS="${CC_LDFLAGS}"

    abi_env_CC_LDFLAGS_DEBUG="${CC_LDFLAGS_DEBUG}"

    abi_env_CC_LDFLAGS_EXTRA="${CC_LDFLAGS_EXTRA}"

    abi_env_CC_LDFLAGS_GPU="${CC_LDFLAGS_GPU}"

    abi_env_CC_LDFLAGS_HINTS="${CC_LDFLAGS_HINTS}"

    abi_env_CC_LDFLAGS_OPTIM="${CC_LDFLAGS_OPTIM}"

    abi_env_CC_LIBS="${CC_LIBS}"

    abi_env_CC_LIBS_DEBUG="${CC_LIBS_DEBUG}"

    abi_env_CC_LIBS_EXTRA="${CC_LIBS_EXTRA}"

    abi_env_CC_LIBS_GPU="${CC_LIBS_GPU}"

    abi_env_CC_LIBS_HINTS="${CC_LIBS_HINTS}"

    abi_env_CC_LIBS_OPTIM="${CC_LIBS_OPTIM}"

    abi_env_CFLAGS="${CFLAGS}"

    abi_env_CFLAGS_DEBUG="${CFLAGS_DEBUG}"

    abi_env_CFLAGS_EXTRA="${CFLAGS_EXTRA}"

    abi_env_CFLAGS_GPU="${CFLAGS_GPU}"

    abi_env_CFLAGS_HINTS="${CFLAGS_HINTS}"

    abi_env_CFLAGS_OPTIM="${CFLAGS_OPTIM}"

    abi_env_CPP="${CPP}"

    abi_env_CPPFLAGS="${CPPFLAGS}"

    abi_env_CPPFLAGS_DEBUG="${CPPFLAGS_DEBUG}"

    abi_env_CPPFLAGS_EXTRA="${CPPFLAGS_EXTRA}"

    abi_env_CPPFLAGS_GPU="${CPPFLAGS_GPU}"

    abi_env_CPPFLAGS_HINTS="${CPPFLAGS_HINTS}"

    abi_env_CPPFLAGS_OPTIM="${CPPFLAGS_OPTIM}"

    abi_env_CXX="${CXX}"

    abi_env_CXXFLAGS="${CXXFLAGS}"

    abi_env_CXXFLAGS_DEBUG="${CXXFLAGS_DEBUG}"

    abi_env_CXXFLAGS_EXTRA="${CXXFLAGS_EXTRA}"

    abi_env_CXXFLAGS_GPU="${CXXFLAGS_GPU}"

    abi_env_CXXFLAGS_HINTS="${CXXFLAGS_HINTS}"

    abi_env_CXXFLAGS_OPTIM="${CXXFLAGS_OPTIM}"

    abi_env_CXX_LDFLAGS="${CXX_LDFLAGS}"

    abi_env_CXX_LDFLAGS_DEBUG="${CXX_LDFLAGS_DEBUG}"

    abi_env_CXX_LDFLAGS_EXTRA="${CXX_LDFLAGS_EXTRA}"

    abi_env_CXX_LDFLAGS_GPU="${CXX_LDFLAGS_GPU}"

    abi_env_CXX_LDFLAGS_HINTS="${CXX_LDFLAGS_HINTS}"

    abi_env_CXX_LDFLAGS_OPTIM="${CXX_LDFLAGS_OPTIM}"

    abi_env_CXX_LIBS="${CXX_LIBS}"

    abi_env_CXX_LIBS_DEBUG="${CXX_LIBS_DEBUG}"

    abi_env_CXX_LIBS_EXTRA="${CXX_LIBS_EXTRA}"

    abi_env_CXX_LIBS_GPU="${CXX_LIBS_GPU}"

    abi_env_CXX_LIBS_HINTS="${CXX_LIBS_HINTS}"

    abi_env_CXX_LIBS_OPTIM="${CXX_LIBS_OPTIM}"

    abi_env_DEFS="${DEFS}"

    abi_env_F77="${F77}"

    abi_env_FC="${FC}"

    abi_env_FCFLAGS="${FCFLAGS}"

    abi_env_FCFLAGS_DEBUG="${FCFLAGS_DEBUG}"

    abi_env_FCFLAGS_EXTRA="${FCFLAGS_EXTRA}"

    abi_env_FCFLAGS_FIXEDFORM="${FCFLAGS_FIXEDFORM}"

    abi_env_FCFLAGS_FREEFORM="${FCFLAGS_FREEFORM}"

    abi_env_FCFLAGS_HINTS="${FCFLAGS_HINTS}"

    abi_env_FCFLAGS_MODDIR="${FCFLAGS_MODDIR}"

    abi_env_FCFLAGS_OPENMP="${FCFLAGS_OPENMP}"

    abi_env_FCFLAGS_OPENMP_OFFLOAD="${FCFLAGS_OPENMP_OFFLOAD}"

    abi_env_FCFLAGS_OPTIM="${FCFLAGS_OPTIM}"

    abi_env_FC_LDFLAGS="${FC_LDFLAGS}"

    abi_env_FC_LDFLAGS_DEBUG="${FC_LDFLAGS_DEBUG}"

    abi_env_FC_LDFLAGS_EXTRA="${FC_LDFLAGS_EXTRA}"

    abi_env_FC_LDFLAGS_HINTS="${FC_LDFLAGS_HINTS}"

    abi_env_FC_LDFLAGS_OPTIM="${FC_LDFLAGS_OPTIM}"

    abi_env_FC_LIBS="${FC_LIBS}"

    abi_env_FC_LIBS_DEBUG="${FC_LIBS_DEBUG}"

    abi_env_FC_LIBS_EXTRA="${FC_LIBS_EXTRA}"

    abi_env_FC_LIBS_HINTS="${FC_LIBS_HINTS}"

    abi_env_FC_LIBS_OPTIM="${FC_LIBS_OPTIM}"

    abi_env_FFT_CFLAGS="${FFT_CFLAGS}"

    abi_env_FFT_FCFLAGS="${FFT_FCFLAGS}"

    abi_env_FPP="${FPP}"

    abi_env_FPPFLAGS="${FPPFLAGS}"

    abi_env_FPPFLAGS_DEBUG="${FPPFLAGS_DEBUG}"

    abi_env_FPPFLAGS_EXTRA="${FPPFLAGS_EXTRA}"

    abi_env_FPPFLAGS_HINTS="${FPPFLAGS_HINTS}"

    abi_env_FPPFLAGS_OPTIM="${FPPFLAGS_OPTIM}"

    abi_env_GPU_ARCH="${GPU_ARCH}"

    abi_env_LD="${LD}"

    abi_env_MODEXT="${MODEXT}"

    abi_env_NM="${NM}"

    abi_env_NVCC="${NVCC}"

    abi_env_NVCC_CFLAGS="${NVCC_CFLAGS}"

    abi_env_NVCC_CPPFLAGS="${NVCC_CPPFLAGS}"

    abi_env_NVCC_LDFLAGS="${NVCC_LDFLAGS}"

    abi_env_NVCC_LIBS="${NVCC_LIBS}"

    abi_env_PYFLAGS="${PYFLAGS}"

    abi_env_PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS}"

    abi_env_RANLIB="${RANLIB}"

    abi_env_TRUE_CPP="${TRUE_CPP}"

    abi_env_XPP="${XPP}"

    abi_env_XPPFLAGS="${XPPFLAGS}"

    abi_env_XPPFLAGS_DEBUG="${XPPFLAGS_DEBUG}"

    abi_env_XPPFLAGS_EXTRA="${XPPFLAGS_EXTRA}"

    abi_env_XPPFLAGS_OPTIM="${XPPFLAGS_OPTIM}"


  CPPFLAGS="${CPPFLAGS} ${abi_gpu_hip_incs}"
  LDFLAGS="${CC_LDFLAGS} ${CC_LDFLAGS_GPU}"
  abi_saved_LIBS="${LIBS}"
  LIBS="${abi_gpu_hip_libs} ${LIBS}"
  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


  # Check usability of headers
  for ac_header in hip/hip_runtime_api.h hipfft.h hipblas.h hipsolver/hipsolver.h
do :
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
  cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done


  # Look for libraries and routines
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HIP programs can be compiled" >&5
$as_echo_n "checking whether HIP programs can be compiled... " >&6; }
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#include <hip/hip_runtime_api.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

      hipError_t err;
      int *count;
      err = hipGetDeviceCount(count);

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  abi_gpu_hip_serial="yes"
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_gpu_hip_serial}" >&5
$as_echo "${abi_gpu_hip_serial}" >&6; }

  # Check ISO C Binding (Fortran)
  if test "${fc_has_iso_c_binding}" != "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: your Fortran compiler does not provide any ISO C binding module" >&5
$as_echo "$as_me: WARNING: your Fortran compiler does not provide any ISO C binding module" >&2;}
  fi

  if test "${abi_gpu_markers_enable}" = "yes"; then
    if test -e "${abi_gpu_hip_libdir}/libroctx64.${abi_so_ext}"; then
      # always add link flags to roctx if available
      if test "${GPU_LIBS}" = ""; then
        abi_gpu_hip_libs="-lroctx64 ${abi_gpu_hip_libs}"
      else
        abi_gpu_hip_libs="${abi_gpu_hip_libs} -lroctx64"
      fi
      abi_gpu_roctx="yes"
      abi_result="${abi_result} roctx"
    else
      as_fn_error $? "AMD ROCtx: ${abi_gpu_hip_libdir}/libroctx64.${abi_so_ext} not found" "$LINENO" 5
    fi
  fi

  # Restore build environment
  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

  LIBS="${abi_saved_LIBS}"


    ABI_CPPFLAGS="${abi_env_ABI_CPPFLAGS}"

    AR="${abi_env_AR}"

    ARFLAGS="${abi_env_ARFLAGS}"

    ARFLAGS_CMD="${abi_env_ARFLAGS_CMD}"

    ARFLAGS_DEBUG="${abi_env_ARFLAGS_DEBUG}"

    ARFLAGS_EXTRA="${abi_env_ARFLAGS_EXTRA}"

    ARFLAGS_HINTS="${abi_env_ARFLAGS_HINTS}"

    ARFLAGS_OPTIM="${abi_env_ARFLAGS_OPTIM}"

    CC="${abi_env_CC}"

    CC_LDFLAGS="${abi_env_CC_LDFLAGS}"

    CC_LDFLAGS_DEBUG="${abi_env_CC_LDFLAGS_DEBUG}"

    CC_LDFLAGS_EXTRA="${abi_env_CC_LDFLAGS_EXTRA}"

    CC_LDFLAGS_GPU="${abi_env_CC_LDFLAGS_GPU}"

    CC_LDFLAGS_HINTS="${abi_env_CC_LDFLAGS_HINTS}"

    CC_LDFLAGS_OPTIM="${abi_env_CC_LDFLAGS_OPTIM}"

    CC_LIBS="${abi_env_CC_LIBS}"

    CC_LIBS_DEBUG="${abi_env_CC_LIBS_DEBUG}"

    CC_LIBS_EXTRA="${abi_env_CC_LIBS_EXTRA}"

    CC_LIBS_GPU="${abi_env_CC_LIBS_GPU}"

    CC_LIBS_HINTS="${abi_env_CC_LIBS_HINTS}"

    CC_LIBS_OPTIM="${abi_env_CC_LIBS_OPTIM}"

    CFLAGS="${abi_env_CFLAGS}"

    CFLAGS_DEBUG="${abi_env_CFLAGS_DEBUG}"

    CFLAGS_EXTRA="${abi_env_CFLAGS_EXTRA}"

    CFLAGS_GPU="${abi_env_CFLAGS_GPU}"

    CFLAGS_HINTS="${abi_env_CFLAGS_HINTS}"

    CFLAGS_OPTIM="${abi_env_CFLAGS_OPTIM}"

    CPP="${abi_env_CPP}"

    CPPFLAGS="${abi_env_CPPFLAGS}"

    CPPFLAGS_DEBUG="${abi_env_CPPFLAGS_DEBUG}"

    CPPFLAGS_EXTRA="${abi_env_CPPFLAGS_EXTRA}"

    CPPFLAGS_GPU="${abi_env_CPPFLAGS_GPU}"

    CPPFLAGS_HINTS="${abi_env_CPPFLAGS_HINTS}"

    CPPFLAGS_OPTIM="${abi_env_CPPFLAGS_OPTIM}"

    CXX="${abi_env_CXX}"

    CXXFLAGS="${abi_env_CXXFLAGS}"

    CXXFLAGS_DEBUG="${abi_env_CXXFLAGS_DEBUG}"

    CXXFLAGS_EXTRA="${abi_env_CXXFLAGS_EXTRA}"

    CXXFLAGS_GPU="${abi_env_CXXFLAGS_GPU}"

    CXXFLAGS_HINTS="${abi_env_CXXFLAGS_HINTS}"

    CXXFLAGS_OPTIM="${abi_env_CXXFLAGS_OPTIM}"

    CXX_LDFLAGS="${abi_env_CXX_LDFLAGS}"

    CXX_LDFLAGS_DEBUG="${abi_env_CXX_LDFLAGS_DEBUG}"

    CXX_LDFLAGS_EXTRA="${abi_env_CXX_LDFLAGS_EXTRA}"

    CXX_LDFLAGS_GPU="${abi_env_CXX_LDFLAGS_GPU}"

    CXX_LDFLAGS_HINTS="${abi_env_CXX_LDFLAGS_HINTS}"

    CXX_LDFLAGS_OPTIM="${abi_env_CXX_LDFLAGS_OPTIM}"

    CXX_LIBS="${abi_env_CXX_LIBS}"

    CXX_LIBS_DEBUG="${abi_env_CXX_LIBS_DEBUG}"

    CXX_LIBS_EXTRA="${abi_env_CXX_LIBS_EXTRA}"

    CXX_LIBS_GPU="${abi_env_CXX_LIBS_GPU}"

    CXX_LIBS_HINTS="${abi_env_CXX_LIBS_HINTS}"

    CXX_LIBS_OPTIM="${abi_env_CXX_LIBS_OPTIM}"

    DEFS="${abi_env_DEFS}"

    F77="${abi_env_F77}"

    FC="${abi_env_FC}"

    FCFLAGS="${abi_env_FCFLAGS}"

    FCFLAGS_DEBUG="${abi_env_FCFLAGS_DEBUG}"

    FCFLAGS_EXTRA="${abi_env_FCFLAGS_EXTRA}"

    FCFLAGS_FIXEDFORM="${abi_env_FCFLAGS_FIXEDFORM}"

    FCFLAGS_FREEFORM="${abi_env_FCFLAGS_FREEFORM}"

    FCFLAGS_HINTS="${abi_env_FCFLAGS_HINTS}"

    FCFLAGS_MODDIR="${abi_env_FCFLAGS_MODDIR}"

    FCFLAGS_OPENMP="${abi_env_FCFLAGS_OPENMP}"

    FCFLAGS_OPENMP_OFFLOAD="${abi_env_FCFLAGS_OPENMP_OFFLOAD}"

    FCFLAGS_OPTIM="${abi_env_FCFLAGS_OPTIM}"

    FC_LDFLAGS="${abi_env_FC_LDFLAGS}"

    FC_LDFLAGS_DEBUG="${abi_env_FC_LDFLAGS_DEBUG}"

    FC_LDFLAGS_EXTRA="${abi_env_FC_LDFLAGS_EXTRA}"

    FC_LDFLAGS_HINTS="${abi_env_FC_LDFLAGS_HINTS}"

    FC_LDFLAGS_OPTIM="${abi_env_FC_LDFLAGS_OPTIM}"

    FC_LIBS="${abi_env_FC_LIBS}"

    FC_LIBS_DEBUG="${abi_env_FC_LIBS_DEBUG}"

    FC_LIBS_EXTRA="${abi_env_FC_LIBS_EXTRA}"

    FC_LIBS_HINTS="${abi_env_FC_LIBS_HINTS}"

    FC_LIBS_OPTIM="${abi_env_FC_LIBS_OPTIM}"

    FFT_CFLAGS="${abi_env_FFT_CFLAGS}"

    FFT_FCFLAGS="${abi_env_FFT_FCFLAGS}"

    FPP="${abi_env_FPP}"

    FPPFLAGS="${abi_env_FPPFLAGS}"

    FPPFLAGS_DEBUG="${abi_env_FPPFLAGS_DEBUG}"

    FPPFLAGS_EXTRA="${abi_env_FPPFLAGS_EXTRA}"

    FPPFLAGS_HINTS="${abi_env_FPPFLAGS_HINTS}"

    FPPFLAGS_OPTIM="${abi_env_FPPFLAGS_OPTIM}"

    GPU_ARCH="${abi_env_GPU_ARCH}"

    LD="${abi_env_LD}"

    MODEXT="${abi_env_MODEXT}"

    NM="${abi_env_NM}"

    NVCC="${abi_env_NVCC}"

    NVCC_CFLAGS="${abi_env_NVCC_CFLAGS}"

    NVCC_CPPFLAGS="${abi_env_NVCC_CPPFLAGS}"

    NVCC_LDFLAGS="${abi_env_NVCC_LDFLAGS}"

    NVCC_LIBS="${abi_env_NVCC_LIBS}"

    PYFLAGS="${abi_env_PYFLAGS}"

    PYTHON_CPPFLAGS="${abi_env_PYTHON_CPPFLAGS}"

    RANLIB="${abi_env_RANLIB}"

    TRUE_CPP="${abi_env_TRUE_CPP}"

    XPP="${abi_env_XPP}"

    XPPFLAGS="${abi_env_XPPFLAGS}"

    XPPFLAGS_DEBUG="${abi_env_XPPFLAGS_DEBUG}"

    XPPFLAGS_EXTRA="${abi_env_XPPFLAGS_EXTRA}"

    XPPFLAGS_OPTIM="${abi_env_XPPFLAGS_OPTIM}"



        abi_gpu_serial="${abi_gpu_hip_serial}"
        if test "${abi_gpu_serial}" = "yes"; then

$as_echo "#define HAVE_GPU_HIP 1" >>confdefs.h

        fi
        abi_gpu_fcflags="${abi_gpu_hip_fcflags}"
        abi_gpu_ldflags="${abi_gpu_hip_ldflags}"
        abi_gpu_incs="${abi_gpu_hip_incs}"
        abi_gpu_libs="${abi_gpu_hip_libs}"
        ;;
    esac

    if test "${abi_gpu_serial}" = "no"; then
      as_fn_error $? "GPU support is broken" "$LINENO" 5
    fi

  fi

  # Transmit serial status to the source code
  if test "${abi_gpu_serial}" = "yes"; then

$as_echo "#define HAVE_GPU 1" >>confdefs.h


$as_echo "#define HAVE_GPU_SERIAL 1" >>confdefs.h

    abi_gpu_flavor="${abi_gpu_flavor}"
  fi

  # Transmit the possible use of NVTX/ROCTX
  if test "${abi_gpu_nvtx_v3}" = "yes" -o "${abi_gpu_roctx}" = "yes"; then

$as_echo "#define HAVE_GPU_MARKERS 1" >>confdefs.h

  fi

  # Output final flavor
  if test "${abi_gpu_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the actual GPU support" >&5
$as_echo_n "checking for the actual GPU support... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_gpu_flavor}" >&5
$as_echo "${abi_gpu_flavor}" >&6; }
  fi

  # FIXME: Update GPU libraries
  sd_gpu_libs="${sd_gpu_libs} ${abi_gpu_libs}"

  # Inform Automake
   if test "${abi_gpu_flavor}" != "none"; then
  DO_BUILD_17_GPU_TOOLBOX_TRUE=
  DO_BUILD_17_GPU_TOOLBOX_FALSE='#'
else
  DO_BUILD_17_GPU_TOOLBOX_TRUE='#'
  DO_BUILD_17_GPU_TOOLBOX_FALSE=
fi

   if test "${abi_gpu_flavor}" = "cuda-double" -o "${abi_gpu_flavor}" = "cuda-single"; then
  DO_BUILD_46_MANAGE_CUDA_TRUE=
  DO_BUILD_46_MANAGE_CUDA_FALSE='#'
else
  DO_BUILD_46_MANAGE_CUDA_TRUE='#'
  DO_BUILD_46_MANAGE_CUDA_FALSE=
fi

   if test "${abi_gpu_nvtx_v3}" = "yes"; then
  DO_BUILD_NVTX_TRUE=
  DO_BUILD_NVTX_FALSE='#'
else
  DO_BUILD_NVTX_TRUE='#'
  DO_BUILD_NVTX_FALSE=
fi




# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #

#
# Optional features - Initialization
#



  abi_sec_title="Initialization of optional features"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# Init HDF5
#SD_HDF5_INIT([optional fail no-fortran])
#SD_HDF5_INIT([optional warn no-fortran])

  # Init
  sd_hdf5_h5cc=""
  sd_hdf5_h5fc=""
  sd_hdf5_cppflags=""
  sd_hdf5_cflags=""
  sd_hdf5_cxxflags=""
  sd_hdf5_fcflags=""
  sd_hdf5_ldflags=""
  sd_hdf5_libs=""
  sd_hdf5_libs_extra=""
  sd_hdf5_libs_hl=""
  sd_hdf5_prefix=""
  sd_hdf5_enable=""
  sd_hdf5_flavor=""
  sd_hdf5_init="unknown"
  sd_hdf5_has_fc="unknown"
  sd_hdf5_has_mpi="unknown"
  sd_hdf5_c_ok="unknown"
  sd_hdf5_fortran_ok="unknown"
  sd_hdf5_mpi_ok="unknown"
  sd_hdf5_ok="unknown"

  # Set adjustable parameters
  sd_hdf5_options="required no-fortran warn"
  sd_hdf5_libs_def=""
  sd_hdf5_cppflags_def=""
  sd_hdf5_cflags_def=""
  sd_hdf5_cxxflags_def=""
  sd_hdf5_fcflags_def=""
  sd_hdf5_ldflags_def=""
  sd_hdf5_enable_def=""
  sd_hdf5_enable_fc=""
  sd_hdf5_policy=""
  sd_hdf5_status=""
  sd_hdf5_cascade="no"

  # Process options
  for kwd in ${sd_hdf5_options}; do
    case "${kwd}" in
      auto)
        sd_hdf5_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_hdf5_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_hdf5_policy="${kwd}"
        ;;
      no-fortran)
        sd_hdf5_enable_fc="no"
        ;;
      mandatory)
        sd_hdf5_enable="yes"
        sd_hdf5_enable_def="yes"
        ;;
      *)
        as_fn_error $? "invalid Steredeg HDF5 option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test -z "${sd_hdf5_enable_fc}" && sd_hdf5_enable_fc="yes"
  if test "${sd_hdf5_enable_fc}" = "yes"; then
    test -z "${sd_hdf5_libs_def}" && sd_hdf5_libs_def="-lhdf5_fortran -lhdf5"
  else
    test -z "${sd_hdf5_libs_def}" && sd_hdf5_libs_def="-lhdf5"
  fi
  test -z "${sd_hdf5_policy}" && sd_hdf5_policy="fail"
  test -z "${sd_hdf5_status}" && sd_hdf5_status="optional"
  test -z "${sd_hdf5_enable_def}" && sd_hdf5_enable_def="no"
  case "${sd_hdf5_status}" in
    implicit|required)
      sd_hdf5_enable_def="yes"
      ;;
  esac

  # Declare configure option
  # TODO: make it switchable for the implicit case

# Check whether --with-hdf5 was given.
if test "${with_hdf5+set}" = set; then :
  withval=$with_hdf5;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_hdf5_enable="${withval}"
        sd_hdf5_init="yon"
      else
        sd_hdf5_prefix="${withval}"
        sd_hdf5_enable="yes"
        sd_hdf5_init="dir"
      fi
else
   sd_hdf5_enable="${sd_hdf5_enable_def}"; sd_hdf5_init="def"
fi


  # Declare environment variables









  # Detect use of HDF5-aware compiler
  if test "${sd_hdf5_init}" = "def" -a ! -z "${H5CC}"; then
    sd_hdf5_enable="yes"
    sd_hdf5_init="exe"
  fi

  # Detect use of environment variables
  if test "${sd_hdf5_enable}" != "no" -o "${sd_hdf5_init}" = "def"; then
    tmp_hdf5_vars="${HDF5_CPPFLAGS}${HDF5_CFLAGS}${HDF5_LDFLAGS}${HDF5_LIBS}"
    if test "${sd_hdf5_enable_fc}" = "yes"; then
      tmp_hdf5_vars="${tmp_hdf5_vars}${HDF5_FFLAGS}${HDF5_FCFLAGS}"
    fi
    if test ! -z "${tmp_hdf5_vars}"; then
      case "${sd_hdf5_init}" in
        def)
          sd_hdf5_enable="yes"
          sd_hdf5_init="env"
          ;;
        exe)
          sd_hdf5_cascade="yes"
          ;;
      esac
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_BYPASS_CONSISTENCY}" != "yes"; then

  # Default trigger must be yes, no, or auto
  tmp_hdf5_invalid="no"
  if test "${sd_hdf5_enable_def}" != "auto" -a \
          "${sd_hdf5_enable_def}" != "no" -a \
          "${sd_hdf5_enable_def}" != "yes"; then
    case "${sd_hdf5_policy}" in
      fail)
        as_fn_error $? "invalid default value: sd_hdf5_enable_def = '${sd_hdf5_enable_def}'" "$LINENO" 5
        ;;
      skip)
        tmp_hdf5_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid default value: sd_hdf5_enable_def = '${sd_hdf5_enable_def}'" >&5
$as_echo "$as_me: WARNING: invalid default value: sd_hdf5_enable_def = '${sd_hdf5_enable_def}'" >&2;}
        tmp_hdf5_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_hdf5_invalid}" = "yes"; then
    if test "${sd_hdf5_status}" = "required"; then
      sd_hdf5_enable_def="yes"
    else
      sd_hdf5_enable_def="no"
    fi
    tmp_hdf5_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_hdf5_enable_def to '${sd_hdf5_enable_def}'" >&5
$as_echo "$as_me: setting sd_hdf5_enable_def to '${sd_hdf5_enable_def}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_hdf5_invalid="no"
  if test "${sd_hdf5_status}" = "implicit" -o \
          "${sd_hdf5_status}" = "required"; then
    if test "${sd_hdf5_enable}" = "no"; then
      case "${sd_hdf5_policy}" in
        fail)
          as_fn_error $? "The HDF5 package is required and cannot be disabled
                  See https://tddft.org/programs/hdf5/ for details on how to
                  install it." "$LINENO" 5
          ;;
        skip)
          tmp_hdf5_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The HDF5 package is required and cannot be disabled" >&5
$as_echo "$as_me: WARNING: The HDF5 package is required and cannot be disabled" >&2;}
          tmp_hdf5_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_hdf5_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting HDF5 trigger to yes" >&5
$as_echo "$as_me: setting HDF5 trigger to yes" >&6;}
      sd_hdf5_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_hdf5_invalid}" = "yes"; then
    case "${sd_hdf5_status}" in
      implicit|required)
        sd_hdf5_enable="yes"
        ;;
      optional)
        sd_hdf5_enable="no"
        ;;
    esac
    tmp_hdf5_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_hdf5_enable to '${sd_hdf5_enable}'" >&5
$as_echo "$as_me: setting sd_hdf5_enable to '${sd_hdf5_enable}'" >&6;}
  fi

  # Environment variables conflict with --with-* options
  tmp_hdf5_vars="${HDF5_CPPFLAGS}${HDF5_CFLAGS}${HDF5_FFLAGS}${HDF5_FCFLAGS}${HDF5_LDFLAGS}${HDF5_LIBS}"
  tmp_hdf5_invalid="no"
  if test ! -z "${tmp_hdf5_vars}" -a ! -z "${sd_hdf5_prefix}"; then
    case "${sd_hdf5_policy}" in
      fail)
        # FIXME: use the new Steredeg specs
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for HDF5
                  Please use HDF5_FCFLAGS + HDF5_LIBS or --with-hdf5,
                  not both." >&5
$as_echo "$as_me: WARNING: conflicting option settings for HDF5
                  Please use HDF5_FCFLAGS + HDF5_LIBS or --with-hdf5,
                  not both." >&2;}
        ;;
      skip)
        tmp_hdf5_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for HDF5" >&5
$as_echo "$as_me: WARNING: conflicting option settings for HDF5" >&2;}
        tmp_hdf5_invalid="yes"
        ;;
    esac
  fi

  # When using environment variables, triggers must be set to yes
  if test -n "${tmp_hdf5_vars}"; then
    sd_hdf5_enable="yes"
    sd_hdf5_init="env"
    if test "${tmp_hdf5_invalid}" = "yes"; then
      tmp_hdf5_invalid="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding --with-hdf5 with HDF5_{FCFLAGS,LDFLAGS,LIBS}" >&5
$as_echo "$as_me: overriding --with-hdf5 with HDF5_{FCFLAGS,LDFLAGS,LIBS}" >&6;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_hdf5_status}" = "implicit"; then
    if test "${sd_hdf5_fcflags}" != ""; then
      sd_hdf5_fcflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting HDF5 Fortran flags (implicit package)" >&5
$as_echo "$as_me: resetting HDF5 Fortran flags (implicit package)" >&6;}
    fi
    if test "${sd_hdf5_ldflags}" != ""; then
      sd_hdf5_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting HDF5 linker flags (implicit package)" >&5
$as_echo "$as_me: resetting HDF5 linker flags (implicit package)" >&6;}
    fi
    if test "${sd_hdf5_libs}" != ""; then
      sd_hdf5_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting HDF5 library flags (implicit package)" >&5
$as_echo "$as_me: resetting HDF5 library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_hdf5_enable}" = "implicit"; then
    sd_hdf5_fcflags=""
    sd_hdf5_ldflags=""
    sd_hdf5_libs=""
  fi

  # Clean-up
  unset tmp_hdf5_invalid
  unset tmp_hdf5_vars

  fi

  # Adjust configuration depending on init type
  if test "${sd_hdf5_enable}" = "yes" -o "${sd_hdf5_enable}" = "auto"; then

    # Set HDF5-specific flags
    case "${sd_hdf5_init}" in

      def|exe|yon)
        sd_hdf5_cppflags="${sd_hdf5_cppflags_def}"
        sd_hdf5_cflags="${sd_hdf5_cflags_def}"
        sd_hdf5_cxxflags="${sd_hdf5_cxxflags_def}"
        test "${sd_hdf5_enable_fc}" = "yes" && \
          sd_hdf5_fcflags="${sd_hdf5_fcflags_def}"
        sd_hdf5_ldflags="${sd_hdf5_ldflags_def}"
        sd_hdf5_libs="${sd_hdf5_libs_def}"
        ;;

      dir)
        sd_hdf5_cppflags="-I${sd_hdf5_prefix}/include"
        sd_hdf5_cflags="${sd_hdf5_cflags_def}"
        sd_hdf5_cxxflags="${sd_hdf5_cxxflags_def}"
        test "${sd_hdf5_enable_fc}" = "yes" && \
          sd_hdf5_fcflags="${sd_hdf5_fcflags_def} -I${sd_hdf5_prefix}/include"
        sd_hdf5_ldflags="${sd_hdf5_ldflags_def}"
        sd_hdf5_libs="-L${sd_hdf5_prefix}/lib ${sd_hdf5_libs_def}"
        ;;

      env)

  sd_hdf5_cppflags="${sd_hdf5_cppflags_def}"
  sd_hdf5_cflags="${sd_hdf5_cflags_def}"
  sd_hdf5_cxxflags="${sd_hdf5_cxxflags_def}"
  test "${sd_hdf5_enable_fc}" = "yes" && \
    sd_hdf5_fcflags="${sd_hdf5_fcflags_def}"
  sd_hdf5_ldflags="${sd_hdf5_ldflags_def}"
  sd_hdf5_libs="${sd_hdf5_libs_def}"
  test ! -z "${HDF5_CPPFLAGS}" && sd_hdf5_cppflags="${HDF5_CPPFLAGS}"
  test ! -z "${HDF5_CFLAGS}" && sd_hdf5_cflags="${HDF5_CFLAGS}"
  test ! -z "${HDF5_CXXFLAGS}" && sd_hdf5_cxxflags="${HDF5_CXXFLAGS}"
  if test "${sd_hdf5_enable_fc}" = "yes"; then
    test ! -z "${HDF5_FFLAGS}" && sd_hdf5_fcflags="${HDF5_FFLAGS}"
    test ! -z "${HDF5_FCFLAGS}" && sd_hdf5_fcflags="${HDF5_FCFLAGS}"
  fi
  test ! -z "${HDF5_LDFLAGS}" && sd_hdf5_ldflags="${HDF5_LDFLAGS}"
  test ! -z "${HDF5_LIBS}" && sd_hdf5_libs="${HDF5_LIBS}"

        ;;

      *)
        as_fn_error $? "invalid init type for HDF5: '${sd_hdf5_init}'" "$LINENO" 5
        ;;

    esac

  fi

  # Override the default configuration if the ESL Bundle is available
  # Note: The setting of the build flags is done once for all
  #       ESL-bundled packages
  if test "${sd_hdf5_init}" = "def" -a ! -z "${ESL_BUNDLE_PREFIX}"; then
    sd_hdf5_init="esl"
    sd_hdf5_cppflags=""
    sd_hdf5_cflags=""
    sd_hdf5_cxxflags=""
    sd_hdf5_fcflags=""
    sd_hdf5_ldflags=""
    sd_hdf5_libs=""
  fi

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable HDF5" >&5
$as_echo_n "checking whether to enable HDF5... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_enable}" >&5
$as_echo "${sd_hdf5_enable}" >&6; }
  if test "${sd_hdf5_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how HDF5 parameters have been set" >&5
$as_echo_n "checking how HDF5 parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_init}" >&5
$as_echo "${sd_hdf5_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HDF5 C preprocessing flags" >&5
$as_echo_n "checking for HDF5 C preprocessing flags... " >&6; }
    if test "${sd_hdf5_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_cppflags}" >&5
$as_echo "${sd_hdf5_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HDF5 C flags" >&5
$as_echo_n "checking for HDF5 C flags... " >&6; }
    if test "${sd_hdf5_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_cflags}" >&5
$as_echo "${sd_hdf5_cflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HDF5 C++ flags" >&5
$as_echo_n "checking for HDF5 C++ flags... " >&6; }
    if test "${sd_hdf5_cxxflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_cxxflags}" >&5
$as_echo "${sd_hdf5_cxxflags}" >&6; }
    fi
    if test "${sd_hdf5_enable_fc}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HDF5 Fortran flags" >&5
$as_echo_n "checking for HDF5 Fortran flags... " >&6; }
      if test "${sd_hdf5_fcflags}" = ""; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_fcflags}" >&5
$as_echo "${sd_hdf5_fcflags}" >&6; }
      fi
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HDF5 linker flags" >&5
$as_echo_n "checking for HDF5 linker flags... " >&6; }
    if test "${sd_hdf5_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_ldflags}" >&5
$as_echo "${sd_hdf5_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HDF5 library flags" >&5
$as_echo_n "checking for HDF5 library flags... " >&6; }
    if test "${sd_hdf5_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_libs}" >&5
$as_echo "${sd_hdf5_libs}" >&6; }
    fi
  fi


  # Export configuration


















  # Clean-up
  unset tmp_hdf5_vars


# Init FFTW3

  # Init
  sd_fftw3_cppflags=""
  sd_fftw3_cflags=""
  sd_fftw3_cxxflags=""
  sd_fftw3_fcflags=""
  sd_fftw3_ldflags=""
  sd_fftw3_libs=""
  sd_fftw3_enable=""
  sd_fftw3_init="unknown"
  sd_fftw3_mpi_ok="unknown"
  sd_fftw3_ok="unknown"
  sd_fftw3_threads_ok="unknown"

  # Set adjustable parameters
  sd_fftw3_options="optional skip"
  sd_fftw3_libs_def=""
  sd_fftw3_cppflags_def=""
  sd_fftw3_cflags_def=""
  sd_fftw3_cxxflags_def=""
  sd_fftw3_fcflags_def=""
  sd_fftw3_ldflags_def=""
  sd_fftw3_enable_def=""
  sd_fftw3_policy=""
  sd_fftw3_status=""

  # Process options
  for kwd in ${sd_fftw3_options}; do
    case "${kwd}" in
      auto)
        sd_fftw3_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_fftw3_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_fftw3_policy="${kwd}"
        ;;
      *)
        as_fn_error $? "invalid Steredeg FFTW3 option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  if test -z "${sd_fftw3_libs_def}"; then
    sd_fftw3_libs_def="-lfftw3"
    if test "${abi_openmp_enable}" = "yes"; then
      sd_fftw3_libs_def="-lfftw3_threads ${sd_fftw3_libs_def}"
    fi
    if test "${sd_mpi_enable}" = "yes"; then
      sd_fftw3_libs_def="-lfftw3_mpi ${sd_fftw3_libs_def}"
    fi
  fi
  test -z "${sd_fftw3_policy}" && sd_fftw3_policy="fail"
  test -z "${sd_fftw3_status}" && sd_fftw3_status="optional"
  test -z "${sd_fftw3_enable_def}" && sd_fftw3_enable_def="no"
  case "${sd_fftw3_status}" in
    implicit|required)
      sd_fftw3_enable_def="yes"
      ;;
  esac

  # Declare configure option
  # TODO: make it switchable for the implicit case

# Check whether --with-fftw3 was given.
if test "${with_fftw3+set}" = set; then :
  withval=$with_fftw3;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_fftw3_enable="${withval}"
        sd_fftw3_init="yon"
      else
        sd_fftw3_enable="yes"
        sd_fftw3_init="dir"
      fi
else
   sd_fftw3_enable="${sd_fftw3_enable_def}"; sd_fftw3_init="def"
fi


  # Declare environment variables







  # Detect use of environment variables
  if test "${sd_fftw3_enable}" = "yes" -o "${sd_fftw3_enable}" = "auto"; then
    tmp_fftw3_vars="${FFTW3_CPPFLAGS}${FFTW3_CFLAGS}${FFTW3_FFLAGS}${FFTW3_FCFLAGS}${FFTW3_LDFLAGS}${FFTW3_LIBS}"
    if test "${sd_fftw3_init}" = "def" -a ! -z "${tmp_fftw3_vars}"; then
      sd_fftw3_enable="yes"
      sd_fftw3_init="env"
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_BYPASS_CONSISTENCY}" != "yes"; then

  # Default trigger must be yes, no, or auto
  tmp_fftw3_invalid="no"
  if test "${sd_fftw3_enable_def}" != "auto" -a \
          "${sd_fftw3_enable_def}" != "no" -a \
          "${sd_fftw3_enable_def}" != "yes"; then
    case "${sd_fftw3_policy}" in
      fail)
        as_fn_error $? "invalid default value: sd_fftw3_enable_def = '${sd_fftw3_enable_def}'" "$LINENO" 5
        ;;
      skip)
        tmp_fftw3_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid default value: sd_fftw3_enable_def = '${sd_fftw3_enable_def}'" >&5
$as_echo "$as_me: WARNING: invalid default value: sd_fftw3_enable_def = '${sd_fftw3_enable_def}'" >&2;}
        tmp_fftw3_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_fftw3_invalid}" = "yes"; then
    if test "${sd_fftw3_status}" = "required"; then
      sd_fftw3_enable_def="yes"
    else
      sd_fftw3_enable_def="no"
    fi
    tmp_fftw3_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_fftw3_enable_def to '${sd_fftw3_enable_def}'" >&5
$as_echo "$as_me: setting sd_fftw3_enable_def to '${sd_fftw3_enable_def}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_fftw3_invalid="no"
  if test "${sd_fftw3_status}" = "implicit" -o \
          "${sd_fftw3_status}" = "required"; then
    if test "${sd_fftw3_enable}" = "no"; then
      case "${sd_fftw3_policy}" in
        fail)
          as_fn_error $? "The FFTW3 package is required and cannot be disabled
                  See http://www.fftw.org/ for details on how to install it." "$LINENO" 5
          ;;
        skip)
          tmp_fftw3_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The FFTW3 package is required and cannot be disabled" >&5
$as_echo "$as_me: WARNING: The FFTW3 package is required and cannot be disabled" >&2;}
          tmp_fftw3_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_fftw3_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting FFTW3 trigger to yes" >&5
$as_echo "$as_me: setting FFTW3 trigger to yes" >&6;}
      sd_fftw3_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_fftw3_invalid}" = "yes"; then
    case "${sd_fftw3_status}" in
      implicit|required)
        sd_fftw3_enable="yes"
        ;;
      optional)
        sd_fftw3_enable="no"
        ;;
    esac
    tmp_fftw3_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_fftw3_enable to '${sd_fftw3_enable}'" >&5
$as_echo "$as_me: setting sd_fftw3_enable to '${sd_fftw3_enable}'" >&6;}
  fi

  # Environment variables conflict with --with-* options
  tmp_fftw3_vars="${FFTW3_CPPFLAGS}${FFTW3_CFLAGS}${FFTW3_LDFLAGS}${FFTW3_LIBS}"
  tmp_fftw3_invalid="no"
  if test ! -z "${tmp_fftw3_vars}" -a ! -z "${with_fftw3}"; then
    case "${sd_fftw3_policy}" in
      fail)
        # FIXME: use the new Steredeg specs
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for FFTW3
                  Please use FFTW3_CFLAGS + FFTW3_LIBS or --with-fftw3,
                  not both." >&5
$as_echo "$as_me: WARNING: conflicting option settings for FFTW3
                  Please use FFTW3_CFLAGS + FFTW3_LIBS or --with-fftw3,
                  not both." >&2;}
        ;;
      skip)
        tmp_fftw3_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for FFTW3" >&5
$as_echo "$as_me: WARNING: conflicting option settings for FFTW3" >&2;}
        tmp_fftw3_invalid="yes"
        ;;
    esac
  fi

  # When using environment variables, triggers must be set to yes
  if test -n "${tmp_fftw3_vars}"; then
    sd_fftw3_enable="yes"
    sd_fftw3_init="env"
    if test "${tmp_fftw3_invalid}" = "yes"; then
      tmp_fftw3_invalid="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding --with-fftw3 with FFTW3_{CPPFLAGS,CFLAGS,LDFLAGS,LIBS}" >&5
$as_echo "$as_me: overriding --with-fftw3 with FFTW3_{CPPFLAGS,CFLAGS,LDFLAGS,LIBS}" >&6;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_fftw3_status}" = "implicit"; then
    if test "${sd_fftw3_ldflags}" != ""; then
      sd_fftw3_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting FFTW3 linker flags (implicit package)" >&5
$as_echo "$as_me: resetting FFTW3 linker flags (implicit package)" >&6;}
    fi
    if test "${sd_fftw3_libs}" != ""; then
      sd_fftw3_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting FFTW3 library flags (implicit package)" >&5
$as_echo "$as_me: resetting FFTW3 library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_fftw3_enable}" = "implicit"; then
    sd_fftw3_cppflags=""
    sd_fftw3_cflags=""
    sd_fftw3_fcflags=""
    sd_fftw3_ldflags=""
    sd_fftw3_libs=""
  fi

  # Clean-up
  unset tmp_fftw3_invalid
  unset tmp_fftw3_vars

  fi

  # Adjust configuration depending on init type
  if test "${sd_fftw3_enable}" = "yes" -o "${sd_fftw3_enable}" = "auto"; then

    # Set FFTW3-specific flags
    case "${sd_fftw3_init}" in

      def|yon)
        sd_fftw3_cppflags="${sd_fftw3_cppflags_def}"
        sd_fftw3_cflags="${sd_fftw3_cflags_def}"
        sd_fftw3_fcflags="${sd_fftw3_fcflags_def}"
        sd_fftw3_ldflags="${sd_fftw3_ldflags_def}"
        sd_fftw3_libs="${sd_fftw3_libs_def}"
        ;;

      dir)
        sd_fftw3_cppflags="-I${with_fftw3}/include"
        sd_fftw3_cflags="${sd_fftw3_cflags_def}"
        sd_fftw3_fcflags="${sd_fftw3_fcflags_def}"
        sd_fftw3_ldflags="${sd_fftw3_ldflags_def}"
        sd_fftw3_libs="-L${with_fftw3}/lib ${sd_fftw3_libs_def}"
        ;;

      env)
        sd_fftw3_cppflags="${sd_fftw3_cppflags_def}"
        sd_fftw3_cflags="${sd_fftw3_cflags_def}"
        sd_fftw3_fcflags="${sd_fftw3_fcflags_def}"
        sd_fftw3_ldflags="${sd_fftw3_ldflags_def}"
        sd_fftw3_libs="${sd_fftw3_libs_def}"
        test ! -z "${FFTW3_CPPFLAGS}" && sd_fftw3_cppflags="${FFTW3_CPPFLAGS}"
        test ! -z "${FFTW3_CFLAGS}" && sd_fftw3_cflags="${FFTW3_CFLAGS}"
        test ! -z "${FFTW3_FFLAGS}" && sd_fftw3_fcflags="${FFTW3_FFLAGS}"
        test ! -z "${FFTW3_FCFLAGS}" && sd_fftw3_fcflags="${FFTW3_FCFLAGS}"
        test ! -z "${FFTW3_LDFLAGS}" && sd_fftw3_ldflags="${FFTW3_LDFLAGS}"
        test ! -z "${FFTW3_LIBS}" && sd_fftw3_libs="${FFTW3_LIBS}"
        ;;

      *)
        as_fn_error $? "invalid init type for FFTW3: '${sd_fftw3_init}'" "$LINENO" 5
        ;;

    esac

  fi

  # Override the default configuration if the ESL Bundle is available
  # Note: The setting of the build flags is done once for all
  #       ESL-bundled packages
  if test "${sd_fftw3_init}" = "def" -a ! -z "${ESL_BUNDLE_PREFIX}"; then
    sd_fftw3_init="esl"
    sd_fftw3_cppflags=""
    sd_fftw3_cflags=""
    sd_fftw3_fcflags=""
    sd_fftw3_ldflags=""
    sd_fftw3_libs=""
  fi

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable FFTW3" >&5
$as_echo_n "checking whether to enable FFTW3... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fftw3_enable}" >&5
$as_echo "${sd_fftw3_enable}" >&6; }
  if test "${sd_fftw3_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how FFTW3 parameters have been set" >&5
$as_echo_n "checking how FFTW3 parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fftw3_init}" >&5
$as_echo "${sd_fftw3_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFTW3 C preprocessing flags" >&5
$as_echo_n "checking for FFTW3 C preprocessing flags... " >&6; }
    if test "${sd_fftw3_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fftw3_cppflags}" >&5
$as_echo "${sd_fftw3_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFTW3 C flags" >&5
$as_echo_n "checking for FFTW3 C flags... " >&6; }
    if test "${sd_fftw3_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fftw3_cflags}" >&5
$as_echo "${sd_fftw3_cflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFTW3 Fortran flags" >&5
$as_echo_n "checking for FFTW3 Fortran flags... " >&6; }
    if test "${sd_fftw3_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fftw3_fcflags}" >&5
$as_echo "${sd_fftw3_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFTW3 linker flags" >&5
$as_echo_n "checking for FFTW3 linker flags... " >&6; }
    if test "${sd_fftw3_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fftw3_ldflags}" >&5
$as_echo "${sd_fftw3_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFTW3 library flags" >&5
$as_echo_n "checking for FFTW3 library flags... " >&6; }
    if test "${sd_fftw3_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fftw3_libs}" >&5
$as_echo "${sd_fftw3_libs}" >&6; }
    fi
  fi


  # Export configuration














  # Clean-up
  unset tmp_fftw3_vars


# Init Levmar

  # Init
  sd_levmar_cppflags=""
  sd_levmar_cflags=""
  sd_levmar_cxxflags=""
  sd_levmar_fcflags=""
  sd_levmar_ldflags=""
  sd_levmar_libs=""
  sd_levmar_enable=""
  sd_levmar_init="unknown"
  sd_levmar_ok="unknown"

  # Set adjustable parameters
  sd_levmar_options="optional fail"
  sd_levmar_libs_def=""
  sd_levmar_cppflags_def=""
  sd_levmar_cflags_def=""
  sd_levmar_cxxflags_def=""
  sd_levmar_fcflags_def=""
  sd_levmar_ldflags_def=""
  sd_levmar_enable_def=""
  sd_levmar_policy=""
  sd_levmar_status=""

  # Process options
  for kwd in ${sd_levmar_options}; do
    case "${kwd}" in
      auto)
        sd_levmar_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_levmar_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_levmar_policy="${kwd}"
        ;;
      *)
        as_fn_error $? "invalid Steredeg Levmar option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test -z "${sd_levmar_libs_def}" && sd_levmar_libs_def="-llevmar"
  test -z "${sd_levmar_policy}" && sd_levmar_policy="fail"
  test -z "${sd_levmar_status}" && sd_levmar_status="optional"
  test -z "${sd_levmar_enable_def}" && sd_levmar_enable_def="no"
  case "${sd_levmar_status}" in
    implicit|required)
      sd_levmar_enable_def="yes"
      ;;
  esac

  # Declare configure option
  # TODO: make it switchable for the implicit case

# Check whether --with-levmar was given.
if test "${with_levmar+set}" = set; then :
  withval=$with_levmar;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_levmar_enable="${withval}"
        sd_levmar_init="yon"
      else
        sd_levmar_enable="yes"
        sd_levmar_init="dir"
      fi
else
   sd_levmar_enable="${sd_levmar_enable_def}"; sd_levmar_init="def"
fi


  # Declare environment variables





  # Detect use of environment variables
  if test "${sd_levmar_enable}" = "yes" -o "${sd_levmar_enable}" = "auto"; then
    tmp_levmar_vars="${LEVMAR_CPPFLAGS}${LEVMAR_CFLAGS}${LEVMAR_LDFLAGS}${LEVMAR_LIBS}"
    if test "${sd_levmar_init}" = "def" -a ! -z "${tmp_levmar_vars}"; then
      sd_levmar_enable="yes"
      sd_levmar_init="env"
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_BYPASS_CONSISTENCY}" != "yes"; then

  # Default trigger must be yes, no, or auto
  tmp_levmar_invalid="no"
  if test "${sd_levmar_enable_def}" != "auto" -a \
          "${sd_levmar_enable_def}" != "no" -a \
          "${sd_levmar_enable_def}" != "yes"; then
    case "${sd_levmar_policy}" in
      fail)
        as_fn_error $? "invalid default value: sd_levmar_enable_def = '${sd_levmar_enable_def}'" "$LINENO" 5
        ;;
      skip)
        tmp_levmar_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid default value: sd_levmar_enable_def = '${sd_levmar_enable_def}'" >&5
$as_echo "$as_me: WARNING: invalid default value: sd_levmar_enable_def = '${sd_levmar_enable_def}'" >&2;}
        tmp_levmar_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_levmar_invalid}" = "yes"; then
    if test "${sd_levmar_status}" = "required"; then
      sd_levmar_enable_def="yes"
    else
      sd_levmar_enable_def="no"
    fi
    tmp_levmar_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_levmar_enable_def to '${sd_levmar_enable_def}'" >&5
$as_echo "$as_me: setting sd_levmar_enable_def to '${sd_levmar_enable_def}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_levmar_invalid="no"
  if test "${sd_levmar_status}" = "implicit" -o \
          "${sd_levmar_status}" = "required"; then
    if test "${sd_levmar_enable}" = "no"; then
      case "${sd_levmar_policy}" in
        fail)
          as_fn_error $? "The Levmar package is required and cannot be disabled
                  See http://users.ics.forth.gr/~lourakis/levmar/ for details
                  on how to install it." "$LINENO" 5
          ;;
        skip)
          tmp_levmar_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The Levmar package is required and cannot be disabled" >&5
$as_echo "$as_me: WARNING: The Levmar package is required and cannot be disabled" >&2;}
          tmp_levmar_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_levmar_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting Levmar trigger to yes" >&5
$as_echo "$as_me: setting Levmar trigger to yes" >&6;}
      sd_levmar_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_levmar_invalid}" = "yes"; then
    case "${sd_levmar_status}" in
      implicit|required)
        sd_levmar_enable="yes"
        ;;
      optional)
        sd_levmar_enable="no"
        ;;
    esac
    tmp_levmar_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_levmar_enable to '${sd_levmar_enable}'" >&5
$as_echo "$as_me: setting sd_levmar_enable to '${sd_levmar_enable}'" >&6;}
  fi

  # Environment variables conflict with --with-* options
  tmp_levmar_vars="${LEVMAR_CPPFLAGS}${LEVMAR_CFLAGS}${LEVMAR_LDFLAGS}${LEVMAR_LIBS}"
  tmp_levmar_invalid="no"
  if test ! -z "${tmp_levmar_vars}" -a ! -z "${with_levmar}"; then
    case "${sd_levmar_policy}" in
      fail)
        # FIXME: use the new Steredeg specs
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for Levmar
                  Please use LEVMAR_CFLAGS + LEVMAR_LIBS or --with-levmar,
                  not both." >&5
$as_echo "$as_me: WARNING: conflicting option settings for Levmar
                  Please use LEVMAR_CFLAGS + LEVMAR_LIBS or --with-levmar,
                  not both." >&2;}
        ;;
      skip)
        tmp_levmar_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for Levmar" >&5
$as_echo "$as_me: WARNING: conflicting option settings for Levmar" >&2;}
        tmp_levmar_invalid="yes"
        ;;
    esac
  fi

  # When using environment variables, triggers must be set to yes
  if test -n "${tmp_levmar_vars}"; then
    sd_levmar_enable="yes"
    sd_levmar_init="env"
    if test "${tmp_levmar_invalid}" = "yes"; then
      tmp_levmar_invalid="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding --with-levmar with LEVMAR_{CPPFLAGS,CFLAGS,LDFLAGS,LIBS}" >&5
$as_echo "$as_me: overriding --with-levmar with LEVMAR_{CPPFLAGS,CFLAGS,LDFLAGS,LIBS}" >&6;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_levmar_status}" = "implicit"; then
    if test "${sd_levmar_ldflags}" != ""; then
      sd_levmar_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting Levmar linker flags (implicit package)" >&5
$as_echo "$as_me: resetting Levmar linker flags (implicit package)" >&6;}
    fi
    if test "${sd_levmar_libs}" != ""; then
      sd_levmar_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting Levmar library flags (implicit package)" >&5
$as_echo "$as_me: resetting Levmar library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_levmar_enable}" = "implicit"; then
    sd_levmar_cppflags=""
    sd_levmar_cflags=""
    sd_levmar_ldflags=""
    sd_levmar_libs=""
  fi

  # Clean-up
  unset tmp_levmar_invalid
  unset tmp_levmar_vars

  fi
  # Adjust configuration depending on init type
  if test "${sd_levmar_enable}" = "yes" -o "${sd_levmar_enable}" = "auto"; then

    # Set Levmar-specific flags
    case "${sd_levmar_init}" in

      def|yon)
        sd_levmar_cppflags="${sd_levmar_cppflags_def}"
        sd_levmar_cflags="${sd_levmar_cflags_def}"
        sd_levmar_ldflags="${sd_levmar_ldflags_def}"
        sd_levmar_libs="${sd_levmar_libs_def}"
        ;;

      dir)
        sd_levmar_cppflags="-I${with_levmar}/include"
        sd_levmar_cflags="${sd_levmar_cflags_def}"
        sd_levmar_ldflags="${sd_levmar_ldflags_def}"
        sd_levmar_libs="-L${with_levmar}/lib ${sd_levmar_libs_def}"
        ;;

      env)
        sd_levmar_cppflags="${sd_levmar_cppflags_def}"
        sd_levmar_cflags="${sd_levmar_cflags_def}"
        sd_levmar_ldflags="${sd_levmar_ldflags_def}"
        sd_levmar_libs="${sd_levmar_libs_def}"
        test ! -z "${LEVMAR_CPPFLAGS}" && sd_levmar_cppflags="${LEVMAR_CPPFLAGS}"
        test ! -z "${LEVMAR_CFLAGS}" && sd_levmar_cflags="${LEVMAR_CFLAGS}"
        test ! -z "${LEVMAR_LDFLAGS}" && sd_levmar_ldflags="${LEVMAR_LDFLAGS}"
        test ! -z "${LEVMAR_LIBS}" && sd_levmar_libs="${LEVMAR_LIBS}"
        ;;

      *)
        as_fn_error $? "invalid init type for Levmar: '${sd_levmar_init}'" "$LINENO" 5
        ;;

    esac

  fi

  # Override the default configuration if the ESL Bundle is available
  # Note: The setting of the build flags is done once for all
  #       ESL-bundled packages
  if test "${sd_levmar_init}" = "def" -a ! -z "${ESL_BUNDLE_PREFIX}"; then
    sd_levmar_init="esl"
    sd_levmar_cppflags=""
    sd_levmar_cflags=""
    sd_levmar_ldflags=""
    sd_levmar_libs=""
  fi

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable Levmar" >&5
$as_echo_n "checking whether to enable Levmar... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_levmar_enable}" >&5
$as_echo "${sd_levmar_enable}" >&6; }
  if test "${sd_levmar_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how Levmar parameters have been set" >&5
$as_echo_n "checking how Levmar parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_levmar_init}" >&5
$as_echo "${sd_levmar_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Levmar C preprocessing flags" >&5
$as_echo_n "checking for Levmar C preprocessing flags... " >&6; }
    if test "${sd_levmar_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_levmar_cppflags}" >&5
$as_echo "${sd_levmar_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Levmar C flags" >&5
$as_echo_n "checking for Levmar C flags... " >&6; }
    if test "${sd_levmar_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_levmar_cflags}" >&5
$as_echo "${sd_levmar_cflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Levmar linker flags" >&5
$as_echo_n "checking for Levmar linker flags... " >&6; }
    if test "${sd_levmar_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_levmar_ldflags}" >&5
$as_echo "${sd_levmar_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Levmar library flags" >&5
$as_echo_n "checking for Levmar library flags... " >&6; }
    if test "${sd_levmar_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_levmar_libs}" >&5
$as_echo "${sd_levmar_libs}" >&6; }
    fi
  fi


  # Export configuration













  # Clean-up
  unset tmp_levmar_vars


# Init LibPSML
#SD_LIBPSML_INIT([optional fail])

  # Init
  sd_libpsml_cppflags=""
  sd_libpsml_cflags=""
  sd_libpsml_cxxflags=""
  sd_libpsml_fcflags=""
  sd_libpsml_ldflags=""
  sd_libpsml_libs=""
  sd_libpsml_enable=""
  sd_libpsml_init="unknown"
  sd_libpsml_ok="unknown"

  # Set adjustable parameters
  sd_libpsml_options="optional warn"
  sd_libpsml_libs_def=""
  sd_libpsml_cppflags_def=""
  sd_libpsml_cflags_def=""
  sd_libpsml_cxxflags_def=""
  sd_libpsml_fcflags_def=""
  sd_libpsml_ldflags_def=""
  sd_libpsml_enable_def=""
  sd_libpsml_policy=""
  sd_libpsml_status=""

  # Process options
  for kwd in ${sd_libpsml_options}; do
    case "${kwd}" in
      auto)
        sd_libpsml_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_libpsml_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_libpsml_policy="${kwd}"
        ;;
      *)
        as_fn_error $? "invalid Steredeg LibPSML option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test -z "${sd_libpsml_libs_def}" && sd_libpsml_libs_def="-lpsml"
  test -z "${sd_libpsml_policy}" && sd_libpsml_policy="fail"
  test -z "${sd_libpsml_status}" && sd_libpsml_status="optional"
  test -z "${sd_libpsml_enable_def}" && sd_libpsml_enable_def="no"
  case "${sd_libpsml_status}" in
    implicit|required)
      sd_libpsml_enable_def="yes"
      ;;
  esac

  # Declare configure option
  # TODO: make it switchable for the implicit case

# Check whether --with-libpsml was given.
if test "${with_libpsml+set}" = set; then :
  withval=$with_libpsml;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_libpsml_enable="${withval}"
        sd_libpsml_init="yon"
      else
        sd_libpsml_enable="yes"
        sd_libpsml_init="dir"
      fi
else
   sd_libpsml_enable="${sd_libpsml_enable_def}"; sd_libpsml_init="def"
fi


  # Declare environment variables






  # Detect use of environment variables
  if test "${sd_libpsml_enable}" = "yes" -o "${sd_libpsml_enable}" = "auto"; then
    tmp_libpsml_vars="${LIBPSML_CPPFLAGS}${LIBPSML_FFLAGS}${LIBPSML_FCFLAGS}${LIBPSML_LDFLAGS}${LIBPSML_LIBS}"
    if test "${sd_libpsml_init}" = "def" -a ! -z "${tmp_libpsml_vars}"; then
      sd_libpsml_enable="yes"
      sd_libpsml_init="env"
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_BYPASS_CONSISTENCY}" != "yes"; then

  # Default trigger must be yes, no, or auto
  tmp_libpsml_invalid="no"
  if test "${sd_libpsml_enable_def}" != "auto" -a \
          "${sd_libpsml_enable_def}" != "no" -a \
          "${sd_libpsml_enable_def}" != "yes"; then
    case "${sd_libpsml_policy}" in
      fail)
        as_fn_error $? "invalid default value: sd_libpsml_enable_def = '${sd_libpsml_enable_def}'" "$LINENO" 5
        ;;
      skip)
        tmp_libpsml_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid default value: sd_libpsml_enable_def = '${sd_libpsml_enable_def}'" >&5
$as_echo "$as_me: WARNING: invalid default value: sd_libpsml_enable_def = '${sd_libpsml_enable_def}'" >&2;}
        tmp_libpsml_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_libpsml_invalid}" = "yes"; then
    if test "${sd_libpsml_status}" = "required"; then
      sd_libpsml_enable_def="yes"
    else
      sd_libpsml_enable_def="no"
    fi
    tmp_libpsml_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_libpsml_enable_def to '${sd_libpsml_enable_def}'" >&5
$as_echo "$as_me: setting sd_libpsml_enable_def to '${sd_libpsml_enable_def}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_libpsml_invalid="no"
  if test "${sd_libpsml_status}" = "implicit" -o \
          "${sd_libpsml_status}" = "required"; then
    if test "${sd_libpsml_enable}" = "no"; then
      case "${sd_libpsml_policy}" in
        fail)
          as_fn_error $? "The LibPSML package is required and cannot be disabled
                  See https://launchpad.net/libpsml for details on how to
                  install it." "$LINENO" 5
          ;;
        skip)
          tmp_libpsml_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The LibPSML package is required and cannot be disabled" >&5
$as_echo "$as_me: WARNING: The LibPSML package is required and cannot be disabled" >&2;}
          tmp_libpsml_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_libpsml_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting LibPSML trigger to yes" >&5
$as_echo "$as_me: setting LibPSML trigger to yes" >&6;}
      sd_libpsml_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_libpsml_invalid}" = "yes"; then
    case "${sd_libpsml_status}" in
      implicit|required)
        sd_libpsml_enable="yes"
        ;;
      optional)
        sd_libpsml_enable="no"
        ;;
    esac
    tmp_libpsml_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_libpsml_enable to '${sd_libpsml_enable}'" >&5
$as_echo "$as_me: setting sd_libpsml_enable to '${sd_libpsml_enable}'" >&6;}
  fi

  # Environment variables conflict with --with-* options
  tmp_libpsml_vars="${LIBPSML_CPPFLAGS}${LIBPSML_FFLAGS}${LIBPSML_FCFLAGS}${LIBPSML_LDFLAGS}${LIBPSML_LIBS}"
  tmp_libpsml_invalid="no"
  if test ! -z "${tmp_libpsml_vars}" -a ! -z "${with_libpsml}"; then
    case "${sd_libpsml_policy}" in
      fail)
        # FIXME: use the new Steredeg specs
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for LibPSML
                  Please use LIBPSML_FCFLAGS + LIBPSML_LIBS or --with-libpsml,
                  not both." >&5
$as_echo "$as_me: WARNING: conflicting option settings for LibPSML
                  Please use LIBPSML_FCFLAGS + LIBPSML_LIBS or --with-libpsml,
                  not both." >&2;}
        ;;
      skip)
        tmp_libpsml_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for LibPSML" >&5
$as_echo "$as_me: WARNING: conflicting option settings for LibPSML" >&2;}
        tmp_libpsml_invalid="yes"
        ;;
    esac
  fi

  # When using environment variables, triggers must be set to yes
  if test -n "${tmp_libpsml_vars}"; then
    sd_libpsml_enable="yes"
    sd_libpsml_init="env"
    if test "${tmp_libpsml_invalid}" = "yes"; then
      tmp_libpsml_invalid="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding --with-libpsml with LIBPSML_{FCFLAGS,LDFLAGS,LIBS}" >&5
$as_echo "$as_me: overriding --with-libpsml with LIBPSML_{FCFLAGS,LDFLAGS,LIBS}" >&6;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_libpsml_status}" = "implicit"; then
    if test "${sd_libpsml_fcflags}" != ""; then
      sd_libpsml_fcflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting LibPSML Fortran flags (implicit package)" >&5
$as_echo "$as_me: resetting LibPSML Fortran flags (implicit package)" >&6;}
    fi
    if test "${sd_libpsml_ldflags}" != ""; then
      sd_libpsml_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting LibPSML linker flags (implicit package)" >&5
$as_echo "$as_me: resetting LibPSML linker flags (implicit package)" >&6;}
    fi
    if test "${sd_libpsml_libs}" != ""; then
      sd_libpsml_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting LibPSML library flags (implicit package)" >&5
$as_echo "$as_me: resetting LibPSML library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_libpsml_enable}" = "implicit"; then
    sd_libpsml_fcflags=""
    sd_libpsml_ldflags=""
    sd_libpsml_libs=""
  fi

  # Clean-up
  unset tmp_libpsml_invalid
  unset tmp_libpsml_vars

  fi
  # Adjust configuration depending on init type
  if test "${sd_libpsml_enable}" = "yes" -o "${sd_libpsml_enable}" = "auto"; then

    # Set LibPSML-specific flags
    case "${sd_libpsml_init}" in

      def|yon)
        sd_libpsml_cppflags="${sd_libpsml_cppflags_def}"
        sd_libpsml_fcflags="${sd_libpsml_fcflags_def}"
        sd_libpsml_ldflags="${sd_libpsml_ldflags_def}"
        sd_libpsml_libs="${sd_libpsml_libs_def}"
        ;;

      dir)
        sd_libpsml_cppflags="-I${with_libpsml}/include"
        sd_libpsml_fcflags="${sd_libpsml_fcflags_def} -I${with_libpsml}/include"
        sd_libpsml_ldflags="${sd_libpsml_ldflags_def}"
        sd_libpsml_libs="-L${with_libpsml}/lib ${sd_libpsml_libs_def}"
        ;;

      env)
        sd_libpsml_cppflags="${sd_libpsml_cppflags_def}"
        sd_libpsml_fcflags="${sd_libpsml_fcflags_def}"
        sd_libpsml_ldflags="${sd_libpsml_ldflags_def}"
        sd_libpsml_libs="${sd_libpsml_libs_def}"
        test ! -z "${LIBPSML_CPPFLAGS}" && sd_libpsml_cppflags="${LIBPSML_CPPFLAGS}"
        test ! -z "${LIBPSML_FFLAGS}" && sd_libpsml_fcflags="${LIBPSML_FFLAGS}"
        test ! -z "${LIBPSML_FCFLAGS}" && sd_libpsml_fcflags="${LIBPSML_FCFLAGS}"
        test ! -z "${LIBPSML_LDFLAGS}" && sd_libpsml_ldflags="${LIBPSML_LDFLAGS}"
        test ! -z "${LIBPSML_LIBS}" && sd_libpsml_libs="${LIBPSML_LIBS}"
        ;;

      *)
        as_fn_error $? "invalid init type for LibPSML: '${sd_libpsml_init}'" "$LINENO" 5
        ;;

    esac

  fi

  # Override the default configuration if the ESL Bundle is available
  # Note: The setting of the build flags is done once for all
  #       ESL-bundled packages
  if test "${sd_libpsml_init}" = "def" -a ! -z "${ESL_BUNDLE_PREFIX}"; then
    sd_libpsml_init="esl"
    sd_libpsml_cppflags=""
    sd_libpsml_fcflags=""
    sd_libpsml_ldflags=""
    sd_libpsml_libs=""
  fi

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable LibPSML" >&5
$as_echo_n "checking whether to enable LibPSML... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpsml_enable}" >&5
$as_echo "${sd_libpsml_enable}" >&6; }
  if test "${sd_libpsml_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how LibPSML parameters have been set" >&5
$as_echo_n "checking how LibPSML parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpsml_init}" >&5
$as_echo "${sd_libpsml_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibPSML C preprocessing flags" >&5
$as_echo_n "checking for LibPSML C preprocessing flags... " >&6; }
    if test "${sd_libpsml_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpsml_cppflags}" >&5
$as_echo "${sd_libpsml_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibPSML Fortran flags" >&5
$as_echo_n "checking for LibPSML Fortran flags... " >&6; }
    if test "${sd_libpsml_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpsml_fcflags}" >&5
$as_echo "${sd_libpsml_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibPSML linker flags" >&5
$as_echo_n "checking for LibPSML linker flags... " >&6; }
    if test "${sd_libpsml_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpsml_ldflags}" >&5
$as_echo "${sd_libpsml_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibPSML library flags" >&5
$as_echo_n "checking for LibPSML library flags... " >&6; }
    if test "${sd_libpsml_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpsml_libs}" >&5
$as_echo "${sd_libpsml_libs}" >&6; }
    fi
  fi


  # Export configuration













  # Clean-up
  unset tmp_libpsml_vars


# Init LibXC
#SD_LIBXC_INIT([no-fortran optional fail])

  # Init
  sd_libxc_cppflags=""
  sd_libxc_cflags=""
  sd_libxc_cxxflags=""
  sd_libxc_fcflags=""
  sd_libxc_ldflags=""
  sd_libxc_libs=""
  sd_libxc_enable=""
  sd_libxc_init="unknown"
  sd_libxc_c_ok="unknown"
  sd_libxc_fortran_ok="unknown"
  sd_libxc_kxc_ok="unknown"
  sd_libxc_ok="unknown"

  # Set adjustable parameters
  sd_libxc_options="required no-fortran warn"
  sd_libxc_libs_def=""
  sd_libxc_cppflags_def=""
  sd_libxc_cflags_def=""
  sd_libxc_cxxflags_def=""
  sd_libxc_fcflags_def=""
  sd_libxc_ldflags_def=""
  sd_libxc_enable_def=""
  sd_libxc_enable_fc=""
  sd_libxc_policy=""
  sd_libxc_status=""

  # Process options
  for kwd in ${sd_libxc_options}; do
    case "${kwd}" in
      auto)
        sd_libxc_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_libxc_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_libxc_policy="${kwd}"
        ;;
      no-fortran)
        sd_libxc_enable_fc="no"
        ;;
      mandatory)
        sd_libxc_enable="yes"
        sd_libxc_enable_def="yes"
        ;;
      *)
        as_fn_error $? "invalid Steredeg LibXC option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test -z "${sd_libxc_enable_fc}" && sd_libxc_enable_fc="yes"
  if test "${sd_libxc_enable_fc}" = "yes"; then
    test -z "${sd_libxc_libs_def}" && sd_libxc_libs_def="-lxcf90 -lxc"
  else
    test -z "${sd_libxc_libs_def}" && sd_libxc_libs_def="-lxc"
  fi
  test -z "${sd_libxc_policy}" && sd_libxc_policy="fail"
  test -z "${sd_libxc_status}" && sd_libxc_status="optional"
  test -z "${sd_libxc_enable_def}" && sd_libxc_enable_def="no"
  case "${sd_libxc_status}" in
    implicit|required)
      sd_libxc_enable_def="yes"
      ;;
  esac

  # Declare configure option
  # TODO: make it switchable for the implicit case

# Check whether --with-libxc was given.
if test "${with_libxc+set}" = set; then :
  withval=$with_libxc;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_libxc_enable="${withval}"
        sd_libxc_init="yon"
      else
        sd_libxc_enable="yes"
        sd_libxc_init="dir"
      fi
else
   sd_libxc_enable="${sd_libxc_enable_def}"; sd_libxc_init="def"
fi


  # Declare environment variables







  # Detect use of environment variables
  if test "${sd_libxc_enable}" = "yes" -o "${sd_libxc_enable}" = "auto"; then
    tmp_libxc_vars="${LIBXC_CPPFLAGS}${LIBXC_CFLAGS}${LIBXC_LDFLAGS}${LIBXC_LIBS}"
    if test "${sd_libxc_enable_fc}" = "yes"; then
      tmp_libxc_vars="${tmp_libxc_vars}${LIBXC_FFLAGS}${LIBXC_FCFLAGS}"
    fi
    if test "${sd_libxc_init}" = "def" -a ! -z "${tmp_libxc_vars}"; then
      sd_libxc_enable="yes"
      sd_libxc_init="env"
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_BYPASS_CONSISTENCY}" != "yes"; then

  # Default trigger must be yes, no, or auto
  tmp_libxc_invalid="no"
  if test "${sd_libxc_enable_def}" != "auto" -a \
          "${sd_libxc_enable_def}" != "no" -a \
          "${sd_libxc_enable_def}" != "yes"; then
    case "${sd_libxc_policy}" in
      fail)
        as_fn_error $? "invalid default value: sd_libxc_enable_def = '${sd_libxc_enable_def}'" "$LINENO" 5
        ;;
      skip)
        tmp_libxc_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid default value: sd_libxc_enable_def = '${sd_libxc_enable_def}'" >&5
$as_echo "$as_me: WARNING: invalid default value: sd_libxc_enable_def = '${sd_libxc_enable_def}'" >&2;}
        tmp_libxc_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_libxc_invalid}" = "yes"; then
    if test "${sd_libxc_status}" = "required"; then
      sd_libxc_enable_def="yes"
    else
      sd_libxc_enable_def="no"
    fi
    tmp_libxc_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_libxc_enable_def to '${sd_libxc_enable_def}'" >&5
$as_echo "$as_me: setting sd_libxc_enable_def to '${sd_libxc_enable_def}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_libxc_invalid="no"
  if test "${sd_libxc_status}" = "implicit" -o \
          "${sd_libxc_status}" = "required"; then
    if test "${sd_libxc_enable}" = "no"; then
      case "${sd_libxc_policy}" in
        fail)
          as_fn_error $? "The LibXC package is required and cannot be disabled
                  See https://tddft.org/programs/libxc/ for details on how to
                  install it." "$LINENO" 5
          ;;
        skip)
          tmp_libxc_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The LibXC package is required and cannot be disabled" >&5
$as_echo "$as_me: WARNING: The LibXC package is required and cannot be disabled" >&2;}
          tmp_libxc_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_libxc_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting LibXC trigger to yes" >&5
$as_echo "$as_me: setting LibXC trigger to yes" >&6;}
      sd_libxc_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_libxc_invalid}" = "yes"; then
    case "${sd_libxc_status}" in
      implicit|required)
        sd_libxc_enable="yes"
        ;;
      optional)
        sd_libxc_enable="no"
        ;;
    esac
    tmp_libxc_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_libxc_enable to '${sd_libxc_enable}'" >&5
$as_echo "$as_me: setting sd_libxc_enable to '${sd_libxc_enable}'" >&6;}
  fi

  # Environment variables conflict with --with-* options
  tmp_libxc_vars="${LIBXC_CPPFLAGS}${LIBXC_CFLAGS}${LIBXC_FFLAGS}${LIBXC_FCFLAGS}${LIBXC_LDFLAGS}${LIBXC_LIBS}"
  tmp_libxc_invalid="no"
  if test ! -z "${tmp_libxc_vars}" -a ! -z "${with_libxc}"; then
    case "${sd_libxc_policy}" in
      fail)
        # FIXME: use the new Steredeg specs
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for LibXC
                  Please use LIBXC_FCFLAGS + LIBXC_LIBS or --with-libxc,
                  not both." >&5
$as_echo "$as_me: WARNING: conflicting option settings for LibXC
                  Please use LIBXC_FCFLAGS + LIBXC_LIBS or --with-libxc,
                  not both." >&2;}
        ;;
      skip)
        tmp_libxc_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for LibXC" >&5
$as_echo "$as_me: WARNING: conflicting option settings for LibXC" >&2;}
        tmp_libxc_invalid="yes"
        ;;
    esac
  fi

  # When using environment variables, triggers must be set to yes
  if test -n "${tmp_libxc_vars}"; then
    sd_libxc_enable="yes"
    sd_libxc_init="env"
    if test "${tmp_libxc_invalid}" = "yes"; then
      tmp_libxc_invalid="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding --with-libxc with LIBXC_{FCFLAGS,LDFLAGS,LIBS}" >&5
$as_echo "$as_me: overriding --with-libxc with LIBXC_{FCFLAGS,LDFLAGS,LIBS}" >&6;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_libxc_status}" = "implicit"; then
    if test "${sd_libxc_fcflags}" != ""; then
      sd_libxc_fcflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting LibXC Fortran flags (implicit package)" >&5
$as_echo "$as_me: resetting LibXC Fortran flags (implicit package)" >&6;}
    fi
    if test "${sd_libxc_ldflags}" != ""; then
      sd_libxc_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting LibXC linker flags (implicit package)" >&5
$as_echo "$as_me: resetting LibXC linker flags (implicit package)" >&6;}
    fi
    if test "${sd_libxc_libs}" != ""; then
      sd_libxc_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting LibXC library flags (implicit package)" >&5
$as_echo "$as_me: resetting LibXC library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_libxc_enable}" = "implicit"; then
    sd_libxc_fcflags=""
    sd_libxc_ldflags=""
    sd_libxc_libs=""
  fi

  # Clean-up
  unset tmp_libxc_invalid
  unset tmp_libxc_vars

  fi

  # Adjust configuration depending on init type
  if test "${sd_libxc_enable}" = "yes" -o "${sd_libxc_enable}" = "auto"; then

    # Set LibXC-specific flags
    case "${sd_libxc_init}" in

      def|yon)
        sd_libxc_cppflags="${sd_libxc_cppflags_def}"
        sd_libxc_cflags="${sd_libxc_cflags_def}"
        test "${sd_libxc_enable_fc}" = "yes" && \
          sd_libxc_fcflags="${sd_libxc_fcflags_def}"
        sd_libxc_ldflags="${sd_libxc_ldflags_def}"
        sd_libxc_libs="${sd_libxc_libs_def}"
        ;;

      dir)
        sd_libxc_cppflags="-I${with_libxc}/include"
        sd_libxc_cflags="${sd_libxc_cflags_def}"
        test "${sd_libxc_enable_fc}" = "yes" && \
          sd_libxc_fcflags="${sd_libxc_fcflags_def} -I${with_libxc}/include"
        sd_libxc_ldflags="${sd_libxc_ldflags_def}"
        sd_libxc_libs="-L${with_libxc}/lib ${sd_libxc_libs_def}"
        ;;

      env)
        sd_libxc_cppflags="${sd_libxc_cppflags_def}"
        sd_libxc_cflags="${sd_libxc_cflags_def}"
        test "${sd_libxc_enable_fc}" = "yes" && \
          sd_libxc_fcflags="${sd_libxc_fcflags_def}"
        sd_libxc_ldflags="${sd_libxc_ldflags_def}"
        sd_libxc_libs="${sd_libxc_libs_def}"
        test ! -z "${LIBXC_CPPFLAGS}" && sd_libxc_cppflags="${LIBXC_CPPFLAGS}"
        test ! -z "${LIBXC_CFLAGS}" && sd_libxc_cflags="${LIBXC_CFLAGS}"
        if test "${sd_libxc_enable_fc}" = "yes"; then
          test ! -z "${LIBXC_FFLAGS}" && sd_libxc_fcflags="${LIBXC_FFLAGS}"
          test ! -z "${LIBXC_FCFLAGS}" && sd_libxc_fcflags="${LIBXC_FCFLAGS}"
        fi
        test ! -z "${LIBXC_LDFLAGS}" && sd_libxc_ldflags="${LIBXC_LDFLAGS}"
        test ! -z "${LIBXC_LIBS}" && sd_libxc_libs="${LIBXC_LIBS}"
        ;;

      *)
        as_fn_error $? "invalid init type for LibXC: '${sd_libxc_init}'" "$LINENO" 5
        ;;

    esac

  fi

  # Override the default configuration if the ESL Bundle is available
  # Note: The setting of the build flags is done once for all
  #       ESL-bundled packages
  if test "${sd_libxc_init}" = "def" -a ! -z "${ESL_BUNDLE_PREFIX}"; then
    sd_libxc_init="esl"
    sd_libxc_cppflags=""
    sd_libxc_cflags=""
    sd_libxc_fcflags=""
    sd_libxc_ldflags=""
    sd_libxc_libs=""
  fi

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable LibXC" >&5
$as_echo_n "checking whether to enable LibXC... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libxc_enable}" >&5
$as_echo "${sd_libxc_enable}" >&6; }
  if test "${sd_libxc_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how LibXC parameters have been set" >&5
$as_echo_n "checking how LibXC parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libxc_init}" >&5
$as_echo "${sd_libxc_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibXC C preprocessing flags" >&5
$as_echo_n "checking for LibXC C preprocessing flags... " >&6; }
    if test "${sd_libxc_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libxc_cppflags}" >&5
$as_echo "${sd_libxc_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibXC C flags" >&5
$as_echo_n "checking for LibXC C flags... " >&6; }
    if test "${sd_libxc_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libxc_cflags}" >&5
$as_echo "${sd_libxc_cflags}" >&6; }
    fi
    if test "${sd_libxc_enable_fc}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibXC Fortran flags" >&5
$as_echo_n "checking for LibXC Fortran flags... " >&6; }
      if test "${sd_libxc_fcflags}" = ""; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libxc_fcflags}" >&5
$as_echo "${sd_libxc_fcflags}" >&6; }
      fi
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibXC linker flags" >&5
$as_echo_n "checking for LibXC linker flags... " >&6; }
    if test "${sd_libxc_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libxc_ldflags}" >&5
$as_echo "${sd_libxc_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibXC library flags" >&5
$as_echo_n "checking for LibXC library flags... " >&6; }
    if test "${sd_libxc_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libxc_libs}" >&5
$as_echo "${sd_libxc_libs}" >&6; }
    fi
  fi


  # Export configuration















  # Clean-up
  unset tmp_libxc_vars


# Init NetCDF
#SD_NETCDF_INIT([optional fail])

  # Init
  sd_netcdf_cppflags=""
  sd_netcdf_cflags=""
  sd_netcdf_cxxflags=""
  sd_netcdf_fcflags=""
  sd_netcdf_ldflags=""
  sd_netcdf_libs=""
  sd_netcdf_prefix=""
  sd_netcdf_enable=""
  sd_netcdf_init="unknown"
  sd_netcdf_mpi_ok="unknown"
  sd_netcdf_ok="unknown"

  # Set adjustable parameters
  sd_netcdf_options="required warn"
  sd_netcdf_libs_def=""
  sd_netcdf_cppflags_def=""
  sd_netcdf_cflags_def=""
  sd_netcdf_cxxflags_def=""
  sd_netcdf_fcflags_def=""
  sd_netcdf_ldflags_def=""
  sd_netcdf_enable_def=""

  # Process options
  for kwd in ${sd_netcdf_options}; do
    case "${kwd}" in
      auto)
        sd_netcdf_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_netcdf_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_netcdf_policy="${kwd}"
        ;;
      mandatory)
        sd_netcdf_enable="yes"
        sd_netcdf_enable_def="yes"
        ;;
      *)
        as_fn_error $? "invalid Steredeg NetCDF option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test -z "${sd_netcdf_status}" && sd_netcdf_status="optional"
  test -z "${sd_netcdf_policy}" && sd_netcdf_policy="fail"
  test -z "${sd_netcdf_enable_def}" && sd_netcdf_enable_def="no"
  test -z "${sd_netcdf_libs_def}" && sd_netcdf_libs_def="-lnetcdf"
  test -z "${sd_netcdf_enable_def}" && sd_netcdf_enable_def="no"
  case "${sd_netcdf_status}" in
    implicit|required)
      sd_netcdf_enable_def="yes"
      ;;
  esac

  # Declare configure option
  # TODO: make it switchable for the implicit case

# Check whether --with-netcdf was given.
if test "${with_netcdf+set}" = set; then :
  withval=$with_netcdf;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_netcdf_enable="${withval}"
        sd_netcdf_init="yon"
      else
        sd_netcdf_enable="yes"
        sd_netcdf_init="dir"
        sd_netcdf_prefix="${withval}"
      fi
else
   sd_netcdf_enable="${sd_netcdf_enable_def}"; sd_netcdf_init="def"
fi


  # Declare environment variables








  # Detect use of environment variables
  if test "${sd_netcdf_enable}" = "yes" -o "${sd_netcdf_enable}" = "auto"; then
    tmp_netcdf_vars="${NETCDF_CPPFLAGS}${NETCDF_CFLAGS}${NETCDF_CXXFLAGS}${NETCDF_FFLAGS}${NETCDF_FCFLAGS}${NETCDF_LDFLAGS}${NETCDF_LIBS}"
    if test "${sd_netcdf_init}" = "def" -a \
            ! -z "${tmp_netcdf_vars}"; then
      sd_netcdf_enable="yes"
      sd_netcdf_init="env"
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_BYPASS_CONSISTENCY}" != "yes"; then

  # Default trigger must be yes, no, or auto
  tmp_netcdf_invalid="no"
  if test "${sd_netcdf_enable_def}" != "auto" -a \
          "${sd_netcdf_enable_def}" != "no" -a \
          "${sd_netcdf_enable_def}" != "yes"; then
    case "${sd_netcdf_policy}" in
      fail)
        as_fn_error $? "invalid default value: sd_netcdf_enable_def = '${sd_netcdf_enable_def}'" "$LINENO" 5
        ;;
      skip)
        tmp_netcdf_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid default value: sd_netcdf_enable_def = '${sd_netcdf_enable_def}'" >&5
$as_echo "$as_me: WARNING: invalid default value: sd_netcdf_enable_def = '${sd_netcdf_enable_def}'" >&2;}
        tmp_netcdf_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_netcdf_invalid}" = "yes"; then
    if test "${sd_netcdf_status}" = "required"; then
      sd_netcdf_enable_def="yes"
    else
      sd_netcdf_enable_def="no"
    fi
    tmp_netcdf_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_netcdf_enable_def to '${sd_netcdf_enable_def}'" >&5
$as_echo "$as_me: setting sd_netcdf_enable_def to '${sd_netcdf_enable_def}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_netcdf_invalid="no"
  if test "${sd_netcdf_status}" = "implicit" -o \
          "${sd_netcdf_status}" = "required"; then
    if test "${sd_netcdf_enable}" = "no"; then
      case "${sd_netcdf_policy}" in
        fail)
          as_fn_error $? "The NetCDF package is required and cannot be disabled
                  See https://www.unidata.ucar.edu/software/netcdf/ for
                  details on how to install it." "$LINENO" 5
          ;;
        skip)
          tmp_netcdf_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The NetCDF package is required and cannot be disabled" >&5
$as_echo "$as_me: WARNING: The NetCDF package is required and cannot be disabled" >&2;}
          tmp_netcdf_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_netcdf_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting NetCDF trigger to yes" >&5
$as_echo "$as_me: setting NetCDF trigger to yes" >&6;}
      sd_netcdf_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_netcdf_invalid}" = "yes"; then
    case "${sd_netcdf_status}" in
      implicit|required)
        sd_netcdf_enable="yes"
        ;;
      optional)
        sd_netcdf_enable="no"
        ;;
    esac
    tmp_netcdf_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_netcdf_enable to '${sd_netcdf_enable}'" >&5
$as_echo "$as_me: setting sd_netcdf_enable to '${sd_netcdf_enable}'" >&6;}
  fi

  # Environment variables conflict with --with-* options
  tmp_netcdf_vars="${NETCDF_CPPFLAGS}${NETCDF_CFLAGS}${NETCDF_FFLAGS}${NETCDF_FCFLAGS}${NETCDF_LDFLAGS}${NETCDF_LIBS}"
  tmp_netcdf_invalid="no"
  if test ! -z "${tmp_netcdf_vars}" -a ! -z "${sd_netcdf_prefix}"; then
    case "${sd_netcdf_policy}" in
      fail)
        # FIXME: use the new Steredeg specs
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for NetCDF
                  Please use NETCDF_FCFLAGS + NETCDF_LIBS or --with-netcdf,
                  not both." >&5
$as_echo "$as_me: WARNING: conflicting option settings for NetCDF
                  Please use NETCDF_FCFLAGS + NETCDF_LIBS or --with-netcdf,
                  not both." >&2;}
        ;;
      skip)
        tmp_netcdf_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for NetCDF" >&5
$as_echo "$as_me: WARNING: conflicting option settings for NetCDF" >&2;}
        tmp_netcdf_invalid="yes"
        ;;
    esac
  fi

  # When using environment variables, triggers must be set to yes
  if test -n "${tmp_netcdf_vars}"; then
    sd_netcdf_enable="yes"
    sd_netcdf_init="env"
    if test "${tmp_netcdf_invalid}" = "yes"; then
      tmp_netcdf_invalid="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding --with-netcdf with NETCDF_{FCFLAGS,LDFLAGS,LIBS}" >&5
$as_echo "$as_me: overriding --with-netcdf with NETCDF_{FCFLAGS,LDFLAGS,LIBS}" >&6;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_netcdf_status}" = "implicit"; then
    if test "${sd_netcdf_fcflags}" != ""; then
      sd_netcdf_fcflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting NetCDF Fortran flags (implicit package)" >&5
$as_echo "$as_me: resetting NetCDF Fortran flags (implicit package)" >&6;}
    fi
    if test "${sd_netcdf_ldflags}" != ""; then
      sd_netcdf_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting NetCDF linker flags (implicit package)" >&5
$as_echo "$as_me: resetting NetCDF linker flags (implicit package)" >&6;}
    fi
    if test "${sd_netcdf_libs}" != ""; then
      sd_netcdf_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting NetCDF library flags (implicit package)" >&5
$as_echo "$as_me: resetting NetCDF library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_netcdf_enable}" = "implicit"; then
    sd_netcdf_fcflags=""
    sd_netcdf_ldflags=""
    sd_netcdf_libs=""
  fi

  # Clean-up
  unset tmp_netcdf_invalid
  unset tmp_netcdf_vars

  fi
  # Adjust configuration depending on init type
  if test "${sd_netcdf_enable}" = "yes" -o "${sd_netcdf_enable}" = "auto"; then

    # Set NetCDF-specific flags
    case "${sd_netcdf_init}" in

      def|yon)
        sd_netcdf_cppflags="${sd_netcdf_cppflags_def}"
        sd_netcdf_cflags="${sd_netcdf_cflags_def}"
        sd_netcdf_cxxflags="${sd_netcdf_cxxflags_def}"
        sd_netcdf_fcflags="${sd_netcdf_fcflags_def}"
        sd_netcdf_ldflags="${sd_netcdf_ldflags_def}"
        sd_netcdf_libs="${sd_netcdf_libs_def}"
        ;;

      dir)
        sd_netcdf_cppflags="${sd_netcdf_cppflags_def} -I${sd_netcdf_prefix}/include"
        sd_netcdf_cflags="${sd_netcdf_cflags_def}"
        sd_netcdf_cxxflags="${sd_netcdf_cxxflags_def}"
        sd_netcdf_fcflags="${sd_netcdf_fcflags_def} -I${sd_netcdf_prefix}/include"
        sd_netcdf_ldflags="${sd_netcdf_ldflags_def}"
        sd_netcdf_libs="-L${sd_netcdf_prefix}/lib ${sd_netcdf_libs_def} ${sd_netcdf_libs}"
        ;;

      env)
        sd_netcdf_cppflags="${sd_netcdf_cppflags_def}"
        sd_netcdf_cflags="${sd_netcdf_cflags_def}"
        sd_netcdf_cxxflags="${sd_netcdf_cxxflags_def}"
        sd_netcdf_fcflags="${sd_netcdf_fcflags_def}"
        sd_netcdf_ldflags="${sd_netcdf_ldflags_def}"
        sd_netcdf_libs="${sd_netcdf_libs_def}"
        test ! -z "${NETCDF_CPPFLAGS}" && sd_netcdf_cppflags="${NETCDF_CPPFLAGS}"
        test ! -z "${NETCDF_CFLAGS}" && sd_netcdf_cflags="${NETCDF_CFLAGS}"
        test ! -z "${NETCDF_CXXFLAGS}" && sd_netcdf_cxxflags="${NETCDF_CXXFLAGS}"
        test ! -z "${NETCDF_FFLAGS}" && sd_netcdf_fcflags="${NETCDF_FFLAGS}"
        test ! -z "${NETCDF_FCFLAGS}" && sd_netcdf_fcflags="${NETCDF_FCFLAGS}"
        test ! -z "${NETCDF_LDFLAGS}" && sd_netcdf_ldflags="${NETCDF_LDFLAGS}"
        test ! -z "${NETCDF_LIBS}" && sd_netcdf_libs="${NETCDF_LIBS}"
        ;;

      *)
        as_fn_error $? "invalid init type for NetCDF: '${sd_netcdf_init}'" "$LINENO" 5
        ;;

    esac

  fi

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable NetCDF" >&5
$as_echo_n "checking whether to enable NetCDF... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_enable}" >&5
$as_echo "${sd_netcdf_enable}" >&6; }
  if test "${sd_netcdf_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how the NetCDF parameters have been set" >&5
$as_echo_n "checking how the NetCDF parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_init}" >&5
$as_echo "${sd_netcdf_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NetCDF C preprocessing flags" >&5
$as_echo_n "checking for NetCDF C preprocessing flags... " >&6; }
    if test "${sd_netcdf_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_cppflags}" >&5
$as_echo "${sd_netcdf_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NetCDF C flags" >&5
$as_echo_n "checking for NetCDF C flags... " >&6; }
    if test "${sd_netcdf_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_cflags}" >&5
$as_echo "${sd_netcdf_cflags}" >&6; }
    fi
    if test "${sd_netcdf_enable_cxx}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NetCDF C++ flags" >&5
$as_echo_n "checking for NetCDF C++ flags... " >&6; }
      if test "${sd_netcdf_cxxflags}" = ""; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_cxxflags}" >&5
$as_echo "${sd_netcdf_cxxflags}" >&6; }
      fi
    fi
    if test "${sd_netcdf_enable_fc}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NetCDF Fortran flags" >&5
$as_echo_n "checking for NetCDF Fortran flags... " >&6; }
      if test "${sd_netcdf_fcflags}" = ""; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fcflags}" >&5
$as_echo "${sd_netcdf_fcflags}" >&6; }
      fi
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NetCDF linker flags" >&5
$as_echo_n "checking for NetCDF linker flags... " >&6; }
    if test "${sd_netcdf_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_ldflags}" >&5
$as_echo "${sd_netcdf_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NetCDF library flags" >&5
$as_echo_n "checking for NetCDF library flags... " >&6; }
    if test "${sd_netcdf_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_libs}" >&5
$as_echo "${sd_netcdf_libs}" >&6; }
    fi
  fi


  # Export configuration














  # Clean-up
  unset tmp_netcdf_vars


# Init NetCDF-Fortran
#SD_NETCDF_FORTRAN_INIT([optional fail])

  # Init
  sd_netcdf_fortran_cppflags=""
  sd_netcdf_fortran_cflags=""
  sd_netcdf_fortran_cxxflags=""
  sd_netcdf_fortran_fcflags=""
  sd_netcdf_fortran_ldflags=""
  sd_netcdf_fortran_libs=""
  sd_netcdf_fortran_prefix=""
  sd_netcdf_fortran_enable=""
  sd_netcdf_fortran_init="unknown"
  sd_netcdf_fortran_mpi_ok="unknown"
  sd_netcdf_fortran_ok="unknown"

  # Set adjustable parameters
  sd_netcdf_fortran_options="required warn"
  sd_netcdf_fortran_libs_def=""
  sd_netcdf_fortran_cppflags_def=""
  sd_netcdf_fortran_cflags_def=""
  sd_netcdf_fortran_cxxflags_def=""
  sd_netcdf_fortran_fcflags_def=""
  sd_netcdf_fortran_ldflags_def=""
  sd_netcdf_fortran_enable_def=""

  # Process options
  for kwd in ${sd_netcdf_fortran_options}; do
    case "${kwd}" in
      auto)
        sd_netcdf_fortran_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_netcdf_fortran_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_netcdf_fortran_policy="${kwd}"
        ;;
      mandatory)
        sd_netcdf_fortran_enable="yes"
        sd_netcdf_fortran_enable_def="yes"
        ;;
      *)
        as_fn_error $? "invalid Steredeg NetCDF Fortran interface option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test -z "${sd_netcdf_fortran_status}" && sd_netcdf_fortran_status="optional"
  test -z "${sd_netcdf_fortran_policy}" && sd_netcdf_fortran_policy="fail"
  test -z "${sd_netcdf_fortran_enable_def}" && sd_netcdf_fortran_enable_def="no"
  test -z "${sd_netcdf_fortran_libs_def}" && sd_netcdf_fortran_libs_def="-lnetcdff"
  test -z "${sd_netcdf_fortran_enable_def}" && sd_netcdf_fortran_enable_def="no"
  case "${sd_netcdf_fortran_status}" in
    implicit|required)
      sd_netcdf_fortran_enable_def="yes"
      ;;
  esac

  # Declare configure option
  # TODO: make it switchable for the implicit case

# Check whether --with-netcdf-fortran was given.
if test "${with_netcdf_fortran+set}" = set; then :
  withval=$with_netcdf_fortran;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_netcdf_fortran_enable="${withval}"
        sd_netcdf_fortran_init="yon"
      else
        sd_netcdf_fortran_enable="yes"
        sd_netcdf_fortran_init="dir"
        sd_netcdf_fortran_prefix="${withval}"
      fi
else
   sd_netcdf_fortran_enable="${sd_netcdf_fortran_enable_def}"; sd_netcdf_fortran_init="def"
fi


  # Declare environment variables








  # Detect use of environment variables
  if test "${sd_netcdf_fortran_enable}" = "yes" -o "${sd_netcdf_fortran_enable}" = "auto"; then
    tmp_netcdf_fortran_vars="${NETCDF_FORTRAN_CPPFLAGS}${NETCDF_FORTRAN_CFLAGS}${NETCDF_FORTRAN_CXXFLAGS}${NETCDF_FORTRAN_FFLAGS}${NETCDF_FORTRAN_FCFLAGS}${NETCDF_FORTRAN_LDFLAGS}${NETCDF_FORTRAN_LIBS}"
    if test "${sd_netcdf_fortran_init}" = "def" -a \
            ! -z "${tmp_netcdf_fortran_vars}"; then
      sd_netcdf_fortran_enable="yes"
      sd_netcdf_fortran_init="env"
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_BYPASS_CONSISTENCY}" != "yes"; then

  # Default trigger must be yes, no, or auto
  tmp_netcdf_fortran_invalid="no"
  if test "${sd_netcdf_fortran_enable_def}" != "auto" -a \
          "${sd_netcdf_fortran_enable_def}" != "no" -a \
          "${sd_netcdf_fortran_enable_def}" != "yes"; then
    case "${sd_netcdf_fortran_policy}" in
      fail)
        as_fn_error $? "invalid default value: sd_netcdf_fortran_enable_def = '${sd_netcdf_fortran_enable_def}'" "$LINENO" 5
        ;;
      skip)
        tmp_netcdf_fortran_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid default value: sd_netcdf_fortran_enable_def = '${sd_netcdf_fortran_enable_def}'" >&5
$as_echo "$as_me: WARNING: invalid default value: sd_netcdf_fortran_enable_def = '${sd_netcdf_fortran_enable_def}'" >&2;}
        tmp_netcdf_fortran_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_netcdf_fortran_invalid}" = "yes"; then
    if test "${sd_netcdf_fortran_status}" = "required"; then
      sd_netcdf_fortran_enable_def="yes"
    else
      sd_netcdf_fortran_enable_def="no"
    fi
    tmp_netcdf_fortran_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_netcdf_fortran_enable_def to '${sd_netcdf_fortran_enable_def}'" >&5
$as_echo "$as_me: setting sd_netcdf_fortran_enable_def to '${sd_netcdf_fortran_enable_def}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_netcdf_fortran_invalid="no"
  if test "${sd_netcdf_fortran_status}" = "implicit" -o \
          "${sd_netcdf_fortran_status}" = "required"; then
    if test "${sd_netcdf_fortran_enable}" = "no"; then
      case "${sd_netcdf_fortran_policy}" in
        fail)
          as_fn_error $? "The NetCDF Fortran interface package is required and cannot be disabled
                  See https://www.unidata.ucar.edu/software/netcdf/ for
                  details on how to install it." "$LINENO" 5
          ;;
        skip)
          tmp_netcdf_fortran_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The NetCDF Fortran interface package is required and cannot be disabled" >&5
$as_echo "$as_me: WARNING: The NetCDF Fortran interface package is required and cannot be disabled" >&2;}
          tmp_netcdf_fortran_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_netcdf_fortran_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting NetCDF Fortran interface trigger to yes" >&5
$as_echo "$as_me: setting NetCDF Fortran interface trigger to yes" >&6;}
      sd_netcdf_fortran_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_netcdf_fortran_invalid}" = "yes"; then
    case "${sd_netcdf_fortran_status}" in
      implicit|required)
        sd_netcdf_fortran_enable="yes"
        ;;
      optional)
        sd_netcdf_fortran_enable="no"
        ;;
    esac
    tmp_netcdf_fortran_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_netcdf_fortran_enable to '${sd_netcdf_fortran_enable}'" >&5
$as_echo "$as_me: setting sd_netcdf_fortran_enable to '${sd_netcdf_fortran_enable}'" >&6;}
  fi

  # Environment variables conflict with --with-* options
  tmp_netcdf_fortran_vars="${NETCDF_FORTRAN_CPPFLAGS}${NETCDF_FORTRAN_CFLAGS}${NETCDF_FORTRAN_FFLAGS}${NETCDF_FORTRAN_FCFLAGS}${NETCDF_FORTRAN_LDFLAGS}${NETCDF_FORTRAN_LIBS}"
  tmp_netcdf_fortran_invalid="no"
  if test ! -z "${tmp_netcdf_fortran_vars}" -a ! -z "${sd_netcdf_fortran_prefix}"; then
    case "${sd_netcdf_fortran_policy}" in
      fail)
        # FIXME: use the new Steredeg specs
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for NetCDF Fortran interface
                  Please use NETCDF_FORTRAN_FCFLAGS + NETCDF_FORTRAN_LIBS or --with-netcdf,
                  not both." >&5
$as_echo "$as_me: WARNING: conflicting option settings for NetCDF Fortran interface
                  Please use NETCDF_FORTRAN_FCFLAGS + NETCDF_FORTRAN_LIBS or --with-netcdf,
                  not both." >&2;}
        ;;
      skip)
        tmp_netcdf_fortran_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for NetCDF Fortran interface" >&5
$as_echo "$as_me: WARNING: conflicting option settings for NetCDF Fortran interface" >&2;}
        tmp_netcdf_fortran_invalid="yes"
        ;;
    esac
  fi

  # When using environment variables, triggers must be set to yes
  if test -n "${tmp_netcdf_fortran_vars}"; then
    sd_netcdf_fortran_enable="yes"
    sd_netcdf_fortran_init="env"
    if test "${tmp_netcdf_fortran_invalid}" = "yes"; then
      tmp_netcdf_fortran_invalid="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding --with-netcdf with NETCDF_FORTRAN_{FCFLAGS,LDFLAGS,LIBS}" >&5
$as_echo "$as_me: overriding --with-netcdf with NETCDF_FORTRAN_{FCFLAGS,LDFLAGS,LIBS}" >&6;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_netcdf_fortran_status}" = "implicit"; then
    if test "${sd_netcdf_fortran_fcflags}" != ""; then
      sd_netcdf_fortran_fcflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting NetCDF Fortran interface Fortran flags (implicit package)" >&5
$as_echo "$as_me: resetting NetCDF Fortran interface Fortran flags (implicit package)" >&6;}
    fi
    if test "${sd_netcdf_fortran_ldflags}" != ""; then
      sd_netcdf_fortran_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting NetCDF Fortran interface linker flags (implicit package)" >&5
$as_echo "$as_me: resetting NetCDF Fortran interface linker flags (implicit package)" >&6;}
    fi
    if test "${sd_netcdf_fortran_libs}" != ""; then
      sd_netcdf_fortran_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting NetCDF Fortran interface library flags (implicit package)" >&5
$as_echo "$as_me: resetting NetCDF Fortran interface library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_netcdf_fortran_enable}" = "implicit"; then
    sd_netcdf_fortran_fcflags=""
    sd_netcdf_fortran_ldflags=""
    sd_netcdf_fortran_libs=""
  fi

  # Clean-up
  unset tmp_netcdf_fortran_invalid
  unset tmp_netcdf_fortran_vars

  fi

  # Adjust configuration depending on init type
  if test "${sd_netcdf_fortran_enable}" = "yes" -o "${sd_netcdf_fortran_enable}" = "auto"; then

    # Set NetCDF Fortran interface-specific flags
    case "${sd_netcdf_fortran_init}" in

      def|yon)
        sd_netcdf_fortran_cppflags="${sd_netcdf_fortran_cppflags_def}"
        sd_netcdf_fortran_cflags="${sd_netcdf_fortran_cflags_def}"
        sd_netcdf_fortran_cxxflags="${sd_netcdf_fortran_cxxflags_def}"
        sd_netcdf_fortran_fcflags="${sd_netcdf_fortran_fcflags_def}"
        sd_netcdf_fortran_ldflags="${sd_netcdf_fortran_ldflags_def}"
        sd_netcdf_fortran_libs="${sd_netcdf_fortran_libs_def}"
        ;;

      dir)
        sd_netcdf_fortran_cppflags="${sd_netcdf_fortran_cppflags_def} -I${sd_netcdf_fortran_prefix}/include"
        sd_netcdf_fortran_cflags="${sd_netcdf_fortran_cflags_def}"
        sd_netcdf_fortran_cxxflags="${sd_netcdf_fortran_cxxflags_def}"
        sd_netcdf_fortran_fcflags="${sd_netcdf_fortran_fcflags_def} -I${sd_netcdf_fortran_prefix}/include"
        sd_netcdf_fortran_ldflags="${sd_netcdf_fortran_ldflags_def}"
        sd_netcdf_fortran_libs="-L${sd_netcdf_fortran_prefix}/lib ${sd_netcdf_fortran_libs_def} ${sd_netcdf_fortran_libs}"
        ;;

      env)
        sd_netcdf_fortran_cppflags="${sd_netcdf_fortran_cppflags_def}"
        sd_netcdf_fortran_cflags="${sd_netcdf_fortran_cflags_def}"
        sd_netcdf_fortran_cxxflags="${sd_netcdf_fortran_cxxflags_def}"
        sd_netcdf_fortran_fcflags="${sd_netcdf_fortran_fcflags_def}"
        sd_netcdf_fortran_ldflags="${sd_netcdf_fortran_ldflags_def}"
        sd_netcdf_fortran_libs="${sd_netcdf_fortran_libs_def}"
        test ! -z "${NETCDF_FORTRAN_CPPFLAGS}" && sd_netcdf_fortran_cppflags="${NETCDF_FORTRAN_CPPFLAGS}"
        test ! -z "${NETCDF_FORTRAN_CFLAGS}" && sd_netcdf_fortran_cflags="${NETCDF_FORTRAN_CFLAGS}"
        test ! -z "${NETCDF_FORTRAN_CXXFLAGS}" && sd_netcdf_fortran_cxxflags="${NETCDF_FORTRAN_CXXFLAGS}"
        test ! -z "${NETCDF_FORTRAN_FFLAGS}" && sd_netcdf_fortran_fcflags="${NETCDF_FORTRAN_FFLAGS}"
        test ! -z "${NETCDF_FORTRAN_FCFLAGS}" && sd_netcdf_fortran_fcflags="${NETCDF_FORTRAN_FCFLAGS}"
        test ! -z "${NETCDF_FORTRAN_LDFLAGS}" && sd_netcdf_fortran_ldflags="${NETCDF_FORTRAN_LDFLAGS}"
        test ! -z "${NETCDF_FORTRAN_LIBS}" && sd_netcdf_fortran_libs="${NETCDF_FORTRAN_LIBS}"
        ;;

      *)
        as_fn_error $? "invalid init type for the NetCDF Fortran interface: '${sd_netcdf_fortran_init}'" "$LINENO" 5
        ;;

    esac

  fi

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the NetCDF Fortran interface" >&5
$as_echo_n "checking whether to enable the NetCDF Fortran interface... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fortran_enable}" >&5
$as_echo "${sd_netcdf_fortran_enable}" >&6; }
  if test "${sd_netcdf_fortran_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how the NetCDF Fortran interface parameters have been set" >&5
$as_echo_n "checking how the NetCDF Fortran interface parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fortran_init}" >&5
$as_echo "${sd_netcdf_fortran_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the NetCDF Fortran interface C preprocessing flags" >&5
$as_echo_n "checking for the NetCDF Fortran interface C preprocessing flags... " >&6; }
    if test "${sd_netcdf_fortran_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fortran_cppflags}" >&5
$as_echo "${sd_netcdf_fortran_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the NetCDF Fortran interface C flags" >&5
$as_echo_n "checking for the NetCDF Fortran interface C flags... " >&6; }
    if test "${sd_netcdf_fortran_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fortran_cflags}" >&5
$as_echo "${sd_netcdf_fortran_cflags}" >&6; }
    fi
    if test "${sd_netcdf_fortran_enable_cxx}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the NetCDF Fortran interface C++ flags" >&5
$as_echo_n "checking for the NetCDF Fortran interface C++ flags... " >&6; }
      if test "${sd_netcdf_fortran_cxxflags}" = ""; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fortran_cxxflags}" >&5
$as_echo "${sd_netcdf_fortran_cxxflags}" >&6; }
      fi
    fi
    if test "${sd_netcdf_fortran_enable_fc}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the NetCDF Fortran interface Fortran flags" >&5
$as_echo_n "checking for the NetCDF Fortran interface Fortran flags... " >&6; }
      if test "${sd_netcdf_fortran_fcflags}" = ""; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fortran_fcflags}" >&5
$as_echo "${sd_netcdf_fortran_fcflags}" >&6; }
      fi
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the NetCDF Fortran interface linker flags" >&5
$as_echo_n "checking for the NetCDF Fortran interface linker flags... " >&6; }
    if test "${sd_netcdf_fortran_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fortran_ldflags}" >&5
$as_echo "${sd_netcdf_fortran_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the NetCDF Fortran interface library flags" >&5
$as_echo_n "checking for the NetCDF Fortran interface library flags... " >&6; }
    if test "${sd_netcdf_fortran_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fortran_libs}" >&5
$as_echo "${sd_netcdf_fortran_libs}" >&6; }
    fi
  fi


  # Export configuration














  # Clean-up
  unset tmp_netcdf_fortran_vars


# Init PAPI

  # Init
  sd_papi_cppflags=""
  sd_papi_cflags=""
  sd_papi_cxxflags=""
  sd_papi_fcflags=""
  sd_papi_ldflags=""
  sd_papi_libs=""
  sd_papi_enable=""
  sd_papi_init="unknown"
  sd_papi_ok="unknown"

  # Set adjustable parameters
  sd_papi_options="optional fail"
  sd_papi_libs_def=""
  sd_papi_cppflags_def=""
  sd_papi_cflags_def=""
  sd_papi_cxxflags_def=""
  sd_papi_fcflags_def=""
  sd_papi_ldflags_def=""
  sd_papi_enable_def=""
  sd_papi_policy=""
  sd_papi_status=""

  # Process options
  for kwd in ${sd_papi_options}; do
    case "${kwd}" in
      auto)
        sd_papi_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_papi_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_papi_policy="${kwd}"
        ;;
      *)
        as_fn_error $? "invalid Steredeg PAPI option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test -z "${sd_papi_libs_def}" && sd_papi_libs_def="-lpapi"
  test -z "${sd_papi_policy}" && sd_papi_policy="fail"
  test -z "${sd_papi_status}" && sd_papi_status="optional"
  test -z "${sd_papi_enable_def}" && sd_papi_enable_def="no"
  case "${sd_papi_status}" in
    implicit|required)
      sd_papi_enable_def="yes"
      ;;
  esac

  # Declare configure option
  # TODO: make it switchable for the implicit case

# Check whether --with-papi was given.
if test "${with_papi+set}" = set; then :
  withval=$with_papi;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_papi_enable="${withval}"
        sd_papi_init="yon"
      else
        sd_papi_enable="yes"
        sd_papi_init="dir"
      fi
else
   sd_papi_enable="${sd_papi_enable_def}"; sd_papi_init="def"
fi


  # Declare environment variables





  # Detect use of environment variables
  if test "${sd_papi_enable}" = "yes" -o "${sd_papi_enable}" = "auto"; then
    tmp_papi_vars="${PAPI_CPPFLAGS}${PAPI_CFLAGS}${PAPI_LDFLAGS}${PAPI_LIBS}"
    if test "${sd_papi_init}" = "def" -a ! -z "${tmp_papi_vars}"; then
      sd_papi_enable="yes"
      sd_papi_init="env"
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_BYPASS_CONSISTENCY}" != "yes"; then

  # Default trigger must be yes, no, or auto
  tmp_papi_invalid="no"
  if test "${sd_papi_enable_def}" != "auto" -a \
          "${sd_papi_enable_def}" != "no" -a \
          "${sd_papi_enable_def}" != "yes"; then
    case "${sd_papi_policy}" in
      fail)
        as_fn_error $? "invalid default value: sd_papi_enable_def = '${sd_papi_enable_def}'" "$LINENO" 5
        ;;
      skip)
        tmp_papi_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid default value: sd_papi_enable_def = '${sd_papi_enable_def}'" >&5
$as_echo "$as_me: WARNING: invalid default value: sd_papi_enable_def = '${sd_papi_enable_def}'" >&2;}
        tmp_papi_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_papi_invalid}" = "yes"; then
    if test "${sd_papi_status}" = "required"; then
      sd_papi_enable_def="yes"
    else
      sd_papi_enable_def="no"
    fi
    tmp_papi_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_papi_enable_def to '${sd_papi_enable_def}'" >&5
$as_echo "$as_me: setting sd_papi_enable_def to '${sd_papi_enable_def}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_papi_invalid="no"
  if test "${sd_papi_status}" = "implicit" -o \
          "${sd_papi_status}" = "required"; then
    if test "${sd_papi_enable}" = "no"; then
      case "${sd_papi_policy}" in
        fail)
          as_fn_error $? "The PAPI package is required and cannot be disabled
                  See https://icl.utk.edu/papi/index.html for details on how
                  to install it." "$LINENO" 5
          ;;
        skip)
          tmp_papi_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The PAPI package is required and cannot be disabled" >&5
$as_echo "$as_me: WARNING: The PAPI package is required and cannot be disabled" >&2;}
          tmp_papi_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_papi_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting PAPI trigger to yes" >&5
$as_echo "$as_me: setting PAPI trigger to yes" >&6;}
      sd_papi_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_papi_invalid}" = "yes"; then
    case "${sd_papi_status}" in
      implicit|required)
        sd_papi_enable="yes"
        ;;
      optional)
        sd_papi_enable="no"
        ;;
    esac
    tmp_papi_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_papi_enable to '${sd_papi_enable}'" >&5
$as_echo "$as_me: setting sd_papi_enable to '${sd_papi_enable}'" >&6;}
  fi

  # Environment variables conflict with --with-* options
  tmp_papi_vars="${PAPI_CPPFLAGS}${PAPI_CFLAGS}${PAPI_LDFLAGS}${PAPI_LIBS}"
  tmp_papi_invalid="no"
  if test ! -z "${tmp_papi_vars}" -a ! -z "${with_papi}"; then
    case "${sd_papi_policy}" in
      fail)
        # FIXME: use the new Steredeg specs
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for PAPI
                  Please use PAPI_CFLAGS + PAPI_LIBS or --with-papi,
                  not both." >&5
$as_echo "$as_me: WARNING: conflicting option settings for PAPI
                  Please use PAPI_CFLAGS + PAPI_LIBS or --with-papi,
                  not both." >&2;}
        ;;
      skip)
        tmp_papi_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for PAPI" >&5
$as_echo "$as_me: WARNING: conflicting option settings for PAPI" >&2;}
        tmp_papi_invalid="yes"
        ;;
    esac
  fi

  # When using environment variables, triggers must be set to yes
  if test -n "${tmp_papi_vars}"; then
    sd_papi_enable="yes"
    sd_papi_init="env"
    if test "${tmp_papi_invalid}" = "yes"; then
      tmp_papi_invalid="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding --with-papi with PAPI_{CPPFLAGS,CFLAGS,LDFLAGS,LIBS}" >&5
$as_echo "$as_me: overriding --with-papi with PAPI_{CPPFLAGS,CFLAGS,LDFLAGS,LIBS}" >&6;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_papi_status}" = "implicit"; then
    if test "${sd_papi_ldflags}" != ""; then
      sd_papi_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting PAPI linker flags (implicit package)" >&5
$as_echo "$as_me: resetting PAPI linker flags (implicit package)" >&6;}
    fi
    if test "${sd_papi_libs}" != ""; then
      sd_papi_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting PAPI library flags (implicit package)" >&5
$as_echo "$as_me: resetting PAPI library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_papi_enable}" = "implicit"; then
    sd_papi_ldflags=""
    sd_papi_libs=""
  fi

  # Clean-up
  unset tmp_papi_invalid
  unset tmp_papi_vars

  fi
  # Adjust configuration depending on init type
  if test "${sd_papi_enable}" = "yes" -o "${sd_papi_enable}" = "auto"; then

    # Set PAPI-specific flags
    case "${sd_papi_init}" in

      def|yon)
        sd_papi_cppflags="${sd_papi_cppflags_def}"
        sd_papi_cflags="${sd_papi_cflags_def}"
        sd_papi_ldflags="${sd_papi_ldflags_def}"
        sd_papi_libs="${sd_papi_libs_def}"
        ;;

      dir)
        sd_papi_cppflags="-I${with_papi}/include"
        sd_papi_cflags="${sd_papi_cflags_def}"
        sd_papi_ldflags="${sd_papi_ldflags_def}"
        sd_papi_libs="-L${with_papi}/lib ${sd_papi_libs_def}"
        ;;

      env)
        sd_papi_cppflags="${sd_papi_cppflags_def}"
        sd_papi_cflags="${sd_papi_cflags_def}"
        sd_papi_ldflags="${sd_papi_ldflags_def}"
        sd_papi_libs="${sd_papi_libs_def}"
        test ! -z "${PAPI_CPPFLAGS}" && sd_papi_cppflags="${PAPI_CPPFLAGS}"
        test ! -z "${PAPI_CFLAGS}" && sd_papi_cflags="${PAPI_CFLAGS}"
        test ! -z "${PAPI_LDFLAGS}" && sd_papi_ldflags="${PAPI_LDFLAGS}"
        test ! -z "${PAPI_LIBS}" && sd_papi_libs="${PAPI_LIBS}"
        ;;

      *)
        as_fn_error $? "invalid init type for PAPI: '${sd_papi_init}'" "$LINENO" 5
        ;;

    esac

  fi

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable PAPI" >&5
$as_echo_n "checking whether to enable PAPI... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_papi_enable}" >&5
$as_echo "${sd_papi_enable}" >&6; }
  if test "${sd_papi_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how PAPI parameters have been set" >&5
$as_echo_n "checking how PAPI parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_papi_init}" >&5
$as_echo "${sd_papi_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PAPI C preprocessing flags" >&5
$as_echo_n "checking for PAPI C preprocessing flags... " >&6; }
    if test "${sd_papi_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_papi_cppflags}" >&5
$as_echo "${sd_papi_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PAPI C flags" >&5
$as_echo_n "checking for PAPI C flags... " >&6; }
    if test "${sd_papi_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_papi_cflags}" >&5
$as_echo "${sd_papi_cflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PAPI linker flags" >&5
$as_echo_n "checking for PAPI linker flags... " >&6; }
    if test "${sd_papi_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_papi_ldflags}" >&5
$as_echo "${sd_papi_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PAPI library flags" >&5
$as_echo_n "checking for PAPI library flags... " >&6; }
    if test "${sd_papi_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_papi_libs}" >&5
$as_echo "${sd_papi_libs}" >&6; }
    fi
  fi


  # Export configuration














  # Clean-up
  unset tmp_papi_vars


# Init PFFT

  # Init
  sd_pfft_cppflags=""
  sd_pfft_cflags=""
  sd_pfft_cxxflags=""
  sd_pfft_fcflags=""
  sd_pfft_ldflags=""
  sd_pfft_libs=""
  sd_pfft_enable=""
  sd_pfft_init="unknown"
  sd_pfft_ok="unknown"

  # Set adjustable parameters
  sd_pfft_options="optional skip"
  sd_pfft_libs_def=""
  sd_pfft_cppflags_def=""
  sd_pfft_cflags_def=""
  sd_pfft_cxxflags_def=""
  sd_pfft_fcflags_def=""
  sd_pfft_ldflags_def=""
  sd_pfft_enable_def=""
  sd_pfft_policy=""
  sd_pfft_status=""

  # Process options
  for kwd in ${sd_pfft_options}; do
    case "${kwd}" in
      auto)
        sd_pfft_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_pfft_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_pfft_policy="${kwd}"
        ;;
      *)
        as_fn_error $? "invalid Steredeg PFFT option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test -z "${sd_pfft_libs_def}" && sd_pfft_libs_def="-lpfft"
  test -z "${sd_pfft_policy}" && sd_pfft_policy="fail"
  test -z "${sd_pfft_status}" && sd_pfft_status="optional"
  test -z "${sd_pfft_enable_def}" && sd_pfft_enable_def="no"
  case "${sd_pfft_status}" in
    implicit|required)
      sd_pfft_enable_def="yes"
      ;;
  esac

  # Declare configure option
  # TODO: make it switchable for the implicit case

# Check whether --with-pfft was given.
if test "${with_pfft+set}" = set; then :
  withval=$with_pfft;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_pfft_enable="${withval}"
        sd_pfft_init="yon"
      else
        sd_pfft_enable="yes"
        sd_pfft_init="dir"
      fi
else
   sd_pfft_enable="${sd_pfft_enable_def}"; sd_pfft_init="def"
fi


  # Declare environment variables





  # Detect use of environment variables
  if test "${sd_pfft_enable}" = "yes" -o "${sd_pfft_enable}" = "auto"; then
    tmp_pfft_vars="${PFFT_CPPFLAGS}${PFFT_CFLAGS}${PFFT_LDFLAGS}${PFFT_LIBS}"
    if test "${sd_pfft_init}" = "def" -a ! -z "${tmp_pfft_vars}"; then
      sd_pfft_enable="yes"
      sd_pfft_init="env"
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_BYPASS_CONSISTENCY}" != "yes"; then

  # Default trigger must be yes, no, or auto
  tmp_pfft_invalid="no"
  if test "${sd_pfft_enable_def}" != "auto" -a \
          "${sd_pfft_enable_def}" != "no" -a \
          "${sd_pfft_enable_def}" != "yes"; then
    case "${sd_pfft_policy}" in
      fail)
        as_fn_error $? "invalid default value: sd_pfft_enable_def = '${sd_pfft_enable_def}'" "$LINENO" 5
        ;;
      skip)
        tmp_pfft_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid default value: sd_pfft_enable_def = '${sd_pfft_enable_def}'" >&5
$as_echo "$as_me: WARNING: invalid default value: sd_pfft_enable_def = '${sd_pfft_enable_def}'" >&2;}
        tmp_pfft_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_pfft_invalid}" = "yes"; then
    if test "${sd_pfft_status}" = "required"; then
      sd_pfft_enable_def="yes"
    else
      sd_pfft_enable_def="no"
    fi
    tmp_pfft_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_pfft_enable_def to '${sd_pfft_enable_def}'" >&5
$as_echo "$as_me: setting sd_pfft_enable_def to '${sd_pfft_enable_def}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_pfft_invalid="no"
  if test "${sd_pfft_status}" = "implicit" -o \
          "${sd_pfft_status}" = "required"; then
    if test "${sd_pfft_enable}" = "no"; then
      case "${sd_pfft_policy}" in
        fail)
          as_fn_error $? "The PFFT package is required and cannot be disabled
                  See https://github.com/mpip/pfft for details on how
                  to install it." "$LINENO" 5
          ;;
        skip)
          tmp_pfft_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The PFFT package is required and cannot be disabled" >&5
$as_echo "$as_me: WARNING: The PFFT package is required and cannot be disabled" >&2;}
          tmp_pfft_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_pfft_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting PFFT trigger to yes" >&5
$as_echo "$as_me: setting PFFT trigger to yes" >&6;}
      sd_pfft_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_pfft_invalid}" = "yes"; then
    case "${sd_pfft_status}" in
      implicit|required)
        sd_pfft_enable="yes"
        ;;
      optional)
        sd_pfft_enable="no"
        ;;
    esac
    tmp_pfft_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_pfft_enable to '${sd_pfft_enable}'" >&5
$as_echo "$as_me: setting sd_pfft_enable to '${sd_pfft_enable}'" >&6;}
  fi

  # Environment variables conflict with --with-* options
  tmp_pfft_vars="${PFFT_CPPFLAGS}${PFFT_CFLAGS}${PFFT_LDFLAGS}${PFFT_LIBS}"
  tmp_pfft_invalid="no"
  if test ! -z "${tmp_pfft_vars}" -a ! -z "${with_pfft}"; then
    case "${sd_pfft_policy}" in
      fail)
        # FIXME: use the new Steredeg specs
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for PFFT
                  Please use PFFT_CFLAGS + PFFT_LIBS or --with-pfft,
                  not both." >&5
$as_echo "$as_me: WARNING: conflicting option settings for PFFT
                  Please use PFFT_CFLAGS + PFFT_LIBS or --with-pfft,
                  not both." >&2;}
        ;;
      skip)
        tmp_pfft_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for PFFT" >&5
$as_echo "$as_me: WARNING: conflicting option settings for PFFT" >&2;}
        tmp_pfft_invalid="yes"
        ;;
    esac
  fi

  # When using environment variables, triggers must be set to yes
  if test -n "${tmp_pfft_vars}"; then
    sd_pfft_enable="yes"
    sd_pfft_init="env"
    if test "${tmp_pfft_invalid}" = "yes"; then
      tmp_pfft_invalid="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding --with-pfft with PFFT_{CPPFLAGS,CFLAGS,LDFLAGS,LIBS}" >&5
$as_echo "$as_me: overriding --with-pfft with PFFT_{CPPFLAGS,CFLAGS,LDFLAGS,LIBS}" >&6;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_pfft_status}" = "implicit"; then
    if test "${sd_pfft_ldflags}" != ""; then
      sd_pfft_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting PFFT linker flags (implicit package)" >&5
$as_echo "$as_me: resetting PFFT linker flags (implicit package)" >&6;}
    fi
    if test "${sd_pfft_libs}" != ""; then
      sd_pfft_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting PFFT library flags (implicit package)" >&5
$as_echo "$as_me: resetting PFFT library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_pfft_enable}" = "implicit"; then
    sd_pfft_cppflags=""
    sd_pfft_cflags=""
    sd_pfft_ldflags=""
    sd_pfft_libs=""
  fi

  # Clean-up
  unset tmp_pfft_invalid
  unset tmp_pfft_vars

  fi
  # Adjust configuration depending on init type
  if test "${sd_pfft_enable}" = "yes" -o "${sd_pfft_enable}" = "auto"; then

    # Set PFFT-specific flags
    case "${sd_pfft_init}" in

      def|yon)
        sd_pfft_cppflags="${sd_pfft_cppflags_def}"
        sd_pfft_cflags="${sd_pfft_cflags_def}"
        sd_pfft_ldflags="${sd_pfft_ldflags_def}"
        sd_pfft_libs="${sd_pfft_libs_def}"
        ;;

      dir)
        sd_pfft_cppflags="-I${with_pfft}/include"
        sd_pfft_cflags="${sd_pfft_cflags_def}"
        sd_pfft_ldflags="${sd_pfft_ldflags_def}"
        sd_pfft_libs="-L${with_pfft}/lib ${sd_pfft_libs_def}"
        ;;

      env)
        sd_pfft_cppflags="${sd_pfft_cppflags_def}"
        sd_pfft_cflags="${sd_pfft_cflags_def}"
        sd_pfft_ldflags="${sd_pfft_ldflags_def}"
        sd_pfft_libs="${sd_pfft_libs_def}"
        test ! -z "${PFFT_CPPFLAGS}" && sd_pfft_cppflags="${PFFT_CPPFLAGS}"
        test ! -z "${PFFT_CFLAGS}" && sd_pfft_cflags="${PFFT_CFLAGS}"
        test ! -z "${PFFT_LDFLAGS}" && sd_pfft_ldflags="${PFFT_LDFLAGS}"
        test ! -z "${PFFT_LIBS}" && sd_pfft_libs="${PFFT_LIBS}"
        ;;

      *)
        as_fn_error $? "invalid init type for PFFT: '${sd_pfft_init}'" "$LINENO" 5
        ;;

    esac

  fi

  # Override the default configuration if the ESL Bundle is available
  # Note: The setting of the build flags is done once for all
  #       ESL-bundled packages
  if test "${sd_pfft_init}" = "def" -a ! -z "${ESL_BUNDLE_PREFIX}"; then
    sd_pfft_init="esl"
    sd_pfft_cppflags=""
    sd_pfft_cflags=""
    sd_pfft_ldflags=""
    sd_pfft_libs=""
  fi

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable PFFT" >&5
$as_echo_n "checking whether to enable PFFT... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_pfft_enable}" >&5
$as_echo "${sd_pfft_enable}" >&6; }
  if test "${sd_pfft_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how PFFT parameters have been set" >&5
$as_echo_n "checking how PFFT parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_pfft_init}" >&5
$as_echo "${sd_pfft_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PFFT C preprocessing flags" >&5
$as_echo_n "checking for PFFT C preprocessing flags... " >&6; }
    if test "${sd_pfft_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_pfft_cppflags}" >&5
$as_echo "${sd_pfft_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PFFT C flags" >&5
$as_echo_n "checking for PFFT C flags... " >&6; }
    if test "${sd_pfft_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_pfft_cflags}" >&5
$as_echo "${sd_pfft_cflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PFFT linker flags" >&5
$as_echo_n "checking for PFFT linker flags... " >&6; }
    if test "${sd_pfft_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_pfft_ldflags}" >&5
$as_echo "${sd_pfft_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PFFT library flags" >&5
$as_echo_n "checking for PFFT library flags... " >&6; }
    if test "${sd_pfft_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_pfft_libs}" >&5
$as_echo "${sd_pfft_libs}" >&6; }
    fi
  fi


  # Export configuration













  # Clean-up
  unset tmp_pfft_vars


# Init TRIQS

  # Init
  sd_triqs_cppflags=""
  sd_triqs_cflags=""
  sd_triqs_cxxflags=""
  sd_triqs_fcflags=""
  sd_triqs_ldflags=""
  sd_triqs_libs=""
  sd_triqs_enable=""
  sd_triqs_init="unknown"
  sd_triqs_ok="unknown"
  sd_triqs_api_version="unknown"

  # Set adjustable parameters
  sd_triqs_options="optional fail"
  sd_triqs_libs_def=""
  sd_triqs_cppflags_def=""
  sd_triqs_cflags_def=""
  sd_triqs_cxxflags_def=""
  sd_triqs_fcflags_def=""
  sd_triqs_ldflags_def=""
  sd_triqs_enable_def=""
  sd_triqs_policy=""
  sd_triqs_status=""

  # Process options
  for kwd in ${sd_triqs_options}; do
    case "${kwd}" in
      auto)
        sd_triqs_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_triqs_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_triqs_policy="${kwd}"
        ;;
      *)
        as_fn_error $? "invalid Steredeg TRIQS option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test -z "${sd_triqs_libs_def}" && sd_triqs_libs_def="-ltriqs -lcthyb_c"
  test -z "${sd_triqs_policy}" && sd_triqs_policy="fail"
  test -z "${sd_triqs_status}" && sd_triqs_status="optional"
  test -z "${sd_triqs_enable_def}" && sd_triqs_enable_def="no"
  case "${sd_triqs_status}" in
    implicit|required)
      sd_triqs_enable_def="yes"
      ;;
  esac

  # Declare configure option
  # TODO: make it switchable for the implicit case

# Check whether --with-triqs was given.
if test "${with_triqs+set}" = set; then :
  withval=$with_triqs;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_triqs_enable="${withval}"
        sd_triqs_init="yon"
      else
        sd_triqs_enable="yes"
        sd_triqs_init="dir"
      fi
else
   sd_triqs_enable="${sd_triqs_enable_def}"; sd_triqs_init="def"
fi


  # Declare environment variables






  # Detect use of environment variables
  if test "${sd_triqs_enable}" = "yes" -o "${sd_triqs_enable}" = "auto"; then
    tmp_triqs_vars="${TRIQS_CPPFLAGS}${TRIQS_CFLAGS}${TRIQS_CXXFLAGS}${TRIQS_LDFLAGS}${TRIQS_LIBS}"
    if test "${sd_triqs_init}" = "def" -a ! -z "${tmp_triqs_vars}"; then
      sd_triqs_enable="yes"
      sd_triqs_init="env"
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_BYPASS_CONSISTENCY}" != "yes"; then

  # Default trigger must be yes, no, or auto
  tmp_triqs_invalid="no"
  if test "${sd_triqs_enable_def}" != "auto" -a \
          "${sd_triqs_enable_def}" != "no" -a \
          "${sd_triqs_enable_def}" != "yes"; then
    case "${sd_triqs_policy}" in
      fail)
        as_fn_error $? "invalid default value: sd_triqs_enable_def = '${sd_triqs_enable_def}'" "$LINENO" 5
        ;;
      skip)
        tmp_triqs_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid default value: sd_triqs_enable_def = '${sd_triqs_enable_def}'" >&5
$as_echo "$as_me: WARNING: invalid default value: sd_triqs_enable_def = '${sd_triqs_enable_def}'" >&2;}
        tmp_triqs_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_triqs_invalid}" = "yes"; then
    if test "${sd_triqs_status}" = "required"; then
      sd_triqs_enable_def="yes"
    else
      sd_triqs_enable_def="no"
    fi
    tmp_triqs_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_triqs_enable_def to '${sd_triqs_enable_def}'" >&5
$as_echo "$as_me: setting sd_triqs_enable_def to '${sd_triqs_enable_def}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_triqs_invalid="no"
  if test "${sd_triqs_status}" = "implicit" -o \
          "${sd_triqs_status}" = "required"; then
    if test "${sd_triqs_enable}" = "no"; then
      case "${sd_triqs_policy}" in
        fail)
          as_fn_error $? "The TRIQS package is required and cannot be disabled
                  See https://triqs.github.io/ for details on how to
                  install it." "$LINENO" 5
          ;;
        skip)
          tmp_triqs_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The TRIQS package is required and cannot be disabled" >&5
$as_echo "$as_me: WARNING: The TRIQS package is required and cannot be disabled" >&2;}
          tmp_triqs_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_triqs_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting TRIQS trigger to yes" >&5
$as_echo "$as_me: setting TRIQS trigger to yes" >&6;}
      sd_triqs_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_triqs_invalid}" = "yes"; then
    case "${sd_triqs_status}" in
      implicit|required)
        sd_triqs_enable="yes"
        ;;
      optional)
        sd_triqs_enable="no"
        ;;
    esac
    tmp_triqs_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_triqs_enable to '${sd_triqs_enable}'" >&5
$as_echo "$as_me: setting sd_triqs_enable to '${sd_triqs_enable}'" >&6;}
  fi

  # Environment variables conflict with --with-* options
  tmp_triqs_vars="${TRIQS_CPPFLAGS}${TRIQS_CFLAGS}${TRIQS_CXXFLAGS}${TRIQS_LDFLAGS}${TRIQS_LIBS}"
  tmp_triqs_invalid="no"
  if test ! -z "${tmp_triqs_vars}" -a ! -z "${with_triqs}"; then
    case "${sd_triqs_policy}" in
      fail)
        # FIXME: use the new Steredeg specs
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for TRIQS
                  Please use TRIQS_CXXFLAGS + TRIQS_LIBS or --with-triqs,
                  not both." >&5
$as_echo "$as_me: WARNING: conflicting option settings for TRIQS
                  Please use TRIQS_CXXFLAGS + TRIQS_LIBS or --with-triqs,
                  not both." >&2;}
        ;;
      skip)
        tmp_triqs_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for TRIQS" >&5
$as_echo "$as_me: WARNING: conflicting option settings for TRIQS" >&2;}
        tmp_triqs_invalid="yes"
        ;;
    esac
  fi

  # When using environment variables, triggers must be set to yes
  if test -n "${tmp_triqs_vars}"; then
    sd_triqs_enable="yes"
    sd_triqs_init="env"
    if test "${tmp_triqs_invalid}" = "yes"; then
      tmp_triqs_invalid="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding --with-triqs with TRIQS_{CXXFLAGS,LDFLAGS,LIBS}" >&5
$as_echo "$as_me: overriding --with-triqs with TRIQS_{CXXFLAGS,LDFLAGS,LIBS}" >&6;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_triqs_status}" = "implicit"; then
    if test "${sd_triqs_ldflags}" != ""; then
      sd_triqs_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting TRIQS linker flags (implicit package)" >&5
$as_echo "$as_me: resetting TRIQS linker flags (implicit package)" >&6;}
    fi
    if test "${sd_triqs_libs}" != ""; then
      sd_triqs_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting TRIQS library flags (implicit package)" >&5
$as_echo "$as_me: resetting TRIQS library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_triqs_enable}" = "implicit"; then
    sd_triqs_ldflags=""
    sd_triqs_libs=""
  fi

  # Clean-up
  unset tmp_triqs_invalid
  unset tmp_triqs_vars

  fi
  # Adjust configuration depending on init type
  if test "${sd_triqs_enable}" = "yes" -o "${sd_triqs_enable}" = "auto"; then

    # Set TRIQS-specific flags
    case "${sd_triqs_init}" in

      def|yon)
        sd_triqs_cppflags="${sd_triqs_cppflags_def}"
        sd_triqs_cflags="${sd_triqs_cflags_def}"
        sd_triqs_cxxflags="${sd_triqs_cxxflags_def}"
        sd_triqs_fcflags="${sd_triqs_fcflags_def}"
        sd_triqs_ldflags="${sd_triqs_ldflags_def}"
        sd_triqs_libs="${sd_triqs_libs_def}"
        ;;

      dir)
        sd_triqs_cppflags="-I${with_triqs}/include"
        sd_triqs_cflags="${sd_triqs_cflags_def}"
        sd_triqs_cxxflags="${sd_triqs_cxxflags_def}"
        sd_triqs_fcflags="${sd_triqs_fcflags_def}"
        sd_triqs_ldflags="${sd_triqs_ldflags_def}"
        sd_triqs_libs="-L${with_triqs}/lib ${sd_triqs_libs_def}"
        ;;

      env)
        sd_triqs_cppflags="${sd_triqs_cppflags_def}"
        sd_triqs_cflags="${sd_triqs_cflags_def}"
        sd_triqs_cxxflags="${sd_triqs_cxxflags_def}"
        sd_triqs_fcflags="${sd_triqs_fcflags_def}"
        sd_triqs_ldflags="${sd_triqs_ldflags_def}"
        sd_triqs_libs="${sd_triqs_libs_def}"
        test ! -z "${TRIQS_CPPFLAGS}" && sd_triqs_cppflags="${TRIQS_CPPFLAGS}"
        test ! -z "${TRIQS_CFLAGS}" && sd_triqs_cflags="${TRIQS_CFLAGS}"
        test ! -z "${TRIQS_CXXFLAGS}" && sd_triqs_cxxflags="${TRIQS_CXXFLAGS}"
        test ! -z "${TRIQS_FFLAGS}" && sd_triqs_fcflags="${TRIQS_FFLAGS}"
        test ! -z "${TRIQS_FCFLAGS}" && sd_triqs_fcflags="${TRIQS_FCFLAGS}"
        test ! -z "${TRIQS_LDFLAGS}" && sd_triqs_ldflags="${TRIQS_LDFLAGS}"
        test ! -z "${TRIQS_LIBS}" && sd_triqs_libs="${TRIQS_LIBS}"
        ;;

      *)
        as_fn_error $? "invalid init type for TRIQS: '${sd_triqs_init}'" "$LINENO" 5
        ;;

    esac

  fi

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable TRIQS" >&5
$as_echo_n "checking whether to enable TRIQS... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_triqs_enable}" >&5
$as_echo "${sd_triqs_enable}" >&6; }
  if test "${sd_triqs_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how TRIQS parameters have been set" >&5
$as_echo_n "checking how TRIQS parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_triqs_init}" >&5
$as_echo "${sd_triqs_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TRIQS C preprocessing flags" >&5
$as_echo_n "checking for TRIQS C preprocessing flags... " >&6; }
    if test "${sd_triqs_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_triqs_cppflags}" >&5
$as_echo "${sd_triqs_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TRIQS C flags" >&5
$as_echo_n "checking for TRIQS C flags... " >&6; }
    if test "${sd_triqs_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_triqs_cflags}" >&5
$as_echo "${sd_triqs_cflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TRIQS C++ flags" >&5
$as_echo_n "checking for TRIQS C++ flags... " >&6; }
    if test "${sd_triqs_cxxflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_triqs_cxxflags}" >&5
$as_echo "${sd_triqs_cxxflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TRIQS Fortran flags" >&5
$as_echo_n "checking for TRIQS Fortran flags... " >&6; }
    if test "${sd_triqs_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_triqs_fcflags}" >&5
$as_echo "${sd_triqs_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TRIQS linker flags" >&5
$as_echo_n "checking for TRIQS linker flags... " >&6; }
    if test "${sd_triqs_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_triqs_ldflags}" >&5
$as_echo "${sd_triqs_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TRIQS library flags" >&5
$as_echo_n "checking for TRIQS library flags... " >&6; }
    if test "${sd_triqs_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_triqs_libs}" >&5
$as_echo "${sd_triqs_libs}" >&6; }
    fi
  fi


  # Export configuration















  # Clean-up
  unset tmp_triqs_vars


# Init Wannier90
#SD_WANNIER90_INIT([optional fail], [-lwannier90])

  # Init
  sd_wannier90_cppflags=""
  sd_wannier90_cflags=""
  sd_wannier90_cxxflags=""
  sd_wannier90_fcflags=""
  sd_wannier90_ldflags=""
  sd_wannier90_libs=""
  sd_wannier90_enable=""
  sd_wannier90_init="unknown"
  sd_wannier90_ok="unknown"

  # Set adjustable parameters
  sd_wannier90_options="optional warn"
  sd_wannier90_libs_def="-lwannier90"
  sd_wannier90_cppflags_def=""
  sd_wannier90_cflags_def=""
  sd_wannier90_cxxflags_def=""
  sd_wannier90_fcflags_def=""
  sd_wannier90_ldflags_def=""
  sd_wannier90_enable_def=""
  sd_wannier90_policy=""
  sd_wannier90_status=""

  # Process options
  for kwd in ${sd_wannier90_options}; do
    case "${kwd}" in
      auto)
        sd_wannier90_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_wannier90_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_wannier90_policy="${kwd}"
        ;;
      *)
        as_fn_error $? "invalid Steredeg Wannier90 option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test -z "${sd_wannier90_libs_def}" && sd_wannier90_libs_def="-lwannier"
  test -z "${sd_wannier90_policy}" && sd_wannier90_policy="fail"
  test -z "${sd_wannier90_status}" && sd_wannier90_status="optional"
  test -z "${sd_wannier90_enable_def}" && sd_wannier90_enable_def="no"
  case "${sd_wannier90_status}" in
    implicit|required)
      sd_wannier90_enable_def="yes"
      ;;
  esac

  # Declare configure option
  # TODO: make it switchable for the implicit case

# Check whether --with-wannier90 was given.
if test "${with_wannier90+set}" = set; then :
  withval=$with_wannier90;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_wannier90_enable="${withval}"
        sd_wannier90_init="yon"
      else
        sd_wannier90_enable="yes"
        sd_wannier90_init="dir"
      fi
else
   sd_wannier90_enable="${sd_wannier90_enable_def}"; sd_wannier90_init="def"
fi


  # Declare environment variables






  # Detect use of environment variables
  if test "${sd_wannier90_enable}" = "yes" -o "${sd_wannier90_enable}" = "auto"; then
    tmp_wannier90_vars="${WANNIER90_CPPFLAGS}${WANNIER90_FFLAGS}${WANNIER90_FCFLAGS}${WANNIER90_LDFLAGS}${WANNIER90_LIBS}"
    if test "${sd_wannier90_init}" = "def" -a ! -z "${tmp_wannier90_vars}"; then
      sd_wannier90_enable="yes"
      sd_wannier90_init="env"
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_BYPASS_CONSISTENCY}" != "yes"; then

  # Default trigger must be yes, no, or auto
  tmp_wannier90_invalid="no"
  if test "${sd_wannier90_enable_def}" != "auto" -a \
          "${sd_wannier90_enable_def}" != "no" -a \
          "${sd_wannier90_enable_def}" != "yes"; then
    case "${sd_wannier90_policy}" in
      fail)
        as_fn_error $? "invalid default value: sd_wannier90_enable_def = '${sd_wannier90_enable_def}'" "$LINENO" 5
        ;;
      skip)
        tmp_wannier90_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid default value: sd_wannier90_enable_def = '${sd_wannier90_enable_def}'" >&5
$as_echo "$as_me: WARNING: invalid default value: sd_wannier90_enable_def = '${sd_wannier90_enable_def}'" >&2;}
        tmp_wannier90_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_wannier90_invalid}" = "yes"; then
    if test "${sd_wannier90_status}" = "required"; then
      sd_wannier90_enable_def="yes"
    else
      sd_wannier90_enable_def="no"
    fi
    tmp_wannier90_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_wannier90_enable_def to '${sd_wannier90_enable_def}'" >&5
$as_echo "$as_me: setting sd_wannier90_enable_def to '${sd_wannier90_enable_def}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_wannier90_invalid="no"
  if test "${sd_wannier90_status}" = "implicit" -o \
          "${sd_wannier90_status}" = "required"; then
    if test "${sd_wannier90_enable}" = "no"; then
      case "${sd_wannier90_policy}" in
        fail)
          as_fn_error $? "The Wannier90 package is required and cannot be disabled
                  See https://launchpad.net/wannier90 for details on how to
                  install it." "$LINENO" 5
          ;;
        skip)
          tmp_wannier90_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The Wannier90 package is required and cannot be disabled" >&5
$as_echo "$as_me: WARNING: The Wannier90 package is required and cannot be disabled" >&2;}
          tmp_wannier90_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_wannier90_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting Wannier90 trigger to yes" >&5
$as_echo "$as_me: setting Wannier90 trigger to yes" >&6;}
      sd_wannier90_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_wannier90_invalid}" = "yes"; then
    case "${sd_wannier90_status}" in
      implicit|required)
        sd_wannier90_enable="yes"
        ;;
      optional)
        sd_wannier90_enable="no"
        ;;
    esac
    tmp_wannier90_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_wannier90_enable to '${sd_wannier90_enable}'" >&5
$as_echo "$as_me: setting sd_wannier90_enable to '${sd_wannier90_enable}'" >&6;}
  fi

  # Environment variables conflict with --with-* options
  tmp_wannier90_vars="${WANNIER90_CPPFLAGS}${WANNIER90_FCFLAGS}${WANNIER90_LDFLAGS}${WANNIER90_LIBS}"
  tmp_wannier90_invalid="no"
  if test ! -z "${tmp_wannier90_vars}" -a ! -z "${with_wannier90}"; then
    case "${sd_wannier90_policy}" in
      fail)
        # FIXME: use the new Steredeg specs
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for Wannier90
                  Please use WANNIER90_FCFLAGS + WANNIER90_LIBS or --with-wannier90,
                  not both." >&5
$as_echo "$as_me: WARNING: conflicting option settings for Wannier90
                  Please use WANNIER90_FCFLAGS + WANNIER90_LIBS or --with-wannier90,
                  not both." >&2;}
        ;;
      skip)
        tmp_wannier90_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for Wannier90" >&5
$as_echo "$as_me: WARNING: conflicting option settings for Wannier90" >&2;}
        tmp_wannier90_invalid="yes"
        ;;
    esac
  fi

  # When using environment variables, triggers must be set to yes
  if test -n "${tmp_wannier90_vars}"; then
    sd_wannier90_enable="yes"
    sd_wannier90_init="env"
    if test "${tmp_wannier90_invalid}" = "yes"; then
      tmp_wannier90_invalid="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding --with-wannier90 with WANNIER90_{FCFLAGS,LDFLAGS,LIBS}" >&5
$as_echo "$as_me: overriding --with-wannier90 with WANNIER90_{FCFLAGS,LDFLAGS,LIBS}" >&6;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_wannier90_status}" = "implicit"; then
    if test "${sd_wannier90_fcflags}" != ""; then
      sd_wannier90_fcflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting Wannier90 Fortran flags (implicit package)" >&5
$as_echo "$as_me: resetting Wannier90 Fortran flags (implicit package)" >&6;}
    fi
    if test "${sd_wannier90_ldflags}" != ""; then
      sd_wannier90_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting Wannier90 linker flags (implicit package)" >&5
$as_echo "$as_me: resetting Wannier90 linker flags (implicit package)" >&6;}
    fi
    if test "${sd_wannier90_libs}" != ""; then
      sd_wannier90_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting Wannier90 library flags (implicit package)" >&5
$as_echo "$as_me: resetting Wannier90 library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_wannier90_enable}" = "implicit"; then
    sd_wannier90_fcflags=""
    sd_wannier90_ldflags=""
    sd_wannier90_libs=""
  fi

  # Clean-up
  unset tmp_wannier90_invalid
  unset tmp_wannier90_vars

  fi
  # Adjust configuration depending on init type
  if test "${sd_wannier90_enable}" = "yes" -o "${sd_wannier90_enable}" = "auto"; then

    # Set Wannier90-specific flags
    case "${sd_wannier90_init}" in

      def|yon)
        sd_wannier90_cppflags="${sd_wannier90_cppflags_def}"
        sd_wannier90_fcflags="${sd_wannier90_fcflags_def}"
        sd_wannier90_ldflags="${sd_wannier90_ldflags_def}"
        sd_wannier90_libs="${sd_wannier90_libs_def}"
        ;;

      dir)
        sd_wannier90_cppflags="-I${with_wannier90}/include"
        sd_wannier90_fcflags="${sd_wannier90_fcflags_def} -I${with_wannier90}/include"
        sd_wannier90_ldflags="${sd_wannier90_ldflags_def}"
        sd_wannier90_libs="-L${with_wannier90}/lib ${sd_wannier90_libs_def}"
        ;;

      env)
        sd_wannier90_cppflags="${sd_wannier90_cppflags_def}"
        sd_wannier90_fcflags="${sd_wannier90_fcflags_def}"
        sd_wannier90_ldflags="${sd_wannier90_ldflags_def}"
        sd_wannier90_libs="${sd_wannier90_libs_def}"
        test ! -z "${WANNIER90_CPPFLAGS}" && sd_wannier90_cppflags="${WANNIER90_CPPFLAGS}"
        test ! -z "${WANNIER90_FFLAGS}" && sd_wannier90_fcflags="${WANNIER90_FFLAGS}"
        test ! -z "${WANNIER90_FCFLAGS}" && sd_wannier90_fcflags="${WANNIER90_FCFLAGS}"
        test ! -z "${WANNIER90_LDFLAGS}" && sd_wannier90_ldflags="${WANNIER90_LDFLAGS}"
        test ! -z "${WANNIER90_LIBS}" && sd_wannier90_libs="${WANNIER90_LIBS}"
        ;;

      *)
        as_fn_error $? "invalid init type for Wannier90: '${sd_wannier90_init}'" "$LINENO" 5
        ;;

    esac

  fi

  # Override the default configuration if the ESL Bundle is available
  # Note: The setting of the build flags is done once for all
  #       ESL-bundled packages
  if test "${sd_wannier90_init}" = "def" -a ! -z "${ESL_BUNDLE_PREFIX}"; then
    sd_wannier90_init="esl"
    sd_wannier90_cppflags=""
    sd_wannier90_fcflags=""
    sd_wannier90_ldflags=""
    sd_wannier90_libs=""
  fi

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable Wannier90" >&5
$as_echo_n "checking whether to enable Wannier90... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_wannier90_enable}" >&5
$as_echo "${sd_wannier90_enable}" >&6; }
  if test "${sd_wannier90_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how Wannier90 parameters have been set" >&5
$as_echo_n "checking how Wannier90 parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_wannier90_init}" >&5
$as_echo "${sd_wannier90_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Wannier90 C preprocessing flags" >&5
$as_echo_n "checking for Wannier90 C preprocessing flags... " >&6; }
    if test "${sd_wannier90_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_wannier90_cppflags}" >&5
$as_echo "${sd_wannier90_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Wannier90 Fortran flags" >&5
$as_echo_n "checking for Wannier90 Fortran flags... " >&6; }
    if test "${sd_wannier90_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_wannier90_fcflags}" >&5
$as_echo "${sd_wannier90_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Wannier90 linker flags" >&5
$as_echo_n "checking for Wannier90 linker flags... " >&6; }
    if test "${sd_wannier90_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_wannier90_ldflags}" >&5
$as_echo "${sd_wannier90_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Wannier90 library flags" >&5
$as_echo_n "checking for Wannier90 library flags... " >&6; }
    if test "${sd_wannier90_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_wannier90_libs}" >&5
$as_echo "${sd_wannier90_libs}" >&6; }
    fi
  fi


  # Export configuration













  # Clean-up
  unset tmp_wannier90_vars


# Init XMLF90
#SD_XMLF90_INIT([optional fail])

  # Init
  sd_xmlf90_cppflags=""
  sd_xmlf90_cflags=""
  sd_xmlf90_cxxflags=""
  sd_xmlf90_fcflags=""
  sd_xmlf90_ldflags=""
  sd_xmlf90_libs=""
  sd_xmlf90_enable=""
  sd_xmlf90_init="unknown"
  sd_xmlf90_ok="unknown"

  # Set adjustable parameters
  sd_xmlf90_options="optional warn"
  sd_xmlf90_libs_def=""
  sd_xmlf90_cppflags_def=""
  sd_xmlf90_cflags_def=""
  sd_xmlf90_cxxflags_def=""
  sd_xmlf90_fcflags_def=""
  sd_xmlf90_ldflags_def=""
  sd_xmlf90_enable_def=""
  sd_xmlf90_policy=""
  sd_xmlf90_status=""

  # Process options
  for kwd in ${sd_xmlf90_options}; do
    case "${kwd}" in
      auto)
        sd_xmlf90_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_xmlf90_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_xmlf90_policy="${kwd}"
        ;;
      *)
        as_fn_error $? "invalid Steredeg XMLF90 option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test -z "${sd_xmlf90_libs_def}" && sd_xmlf90_libs_def="-lxmlf90"
  test -z "${sd_xmlf90_policy}" && sd_xmlf90_policy="fail"
  test -z "${sd_xmlf90_status}" && sd_xmlf90_status="optional"
  test -z "${sd_xmlf90_enable_def}" && sd_xmlf90_enable_def="no"
  case "${sd_xmlf90_status}" in
    implicit|required)
      sd_xmlf90_enable_def="yes"
      ;;
  esac

  # Declare configure option
  # TODO: make it switchable for the implicit case

# Check whether --with-xmlf90 was given.
if test "${with_xmlf90+set}" = set; then :
  withval=$with_xmlf90;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_xmlf90_enable="${withval}"
        sd_xmlf90_init="yon"
      else
        sd_xmlf90_enable="yes"
        sd_xmlf90_init="dir"
      fi
else
   sd_xmlf90_enable="${sd_xmlf90_enable_def}"; sd_xmlf90_init="def"
fi


  # Declare environment variables






  # Detect use of environment variables
  if test "${sd_xmlf90_enable}" = "yes" -o "${sd_xmlf90_enable}" = "auto"; then
    tmp_xmlf90_vars="${XMLF90_CPPFLAGS}${XMLF90_FFLAGS}${XMLF90_FCFLAGS}${XMLF90_LDFLAGS}${XMLF90_LIBS}"
    if test "${sd_xmlf90_init}" = "def" -a ! -z "${tmp_xmlf90_vars}"; then
      sd_xmlf90_enable="yes"
      sd_xmlf90_init="env"
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_BYPASS_CONSISTENCY}" != "yes"; then

  # Default trigger must be yes, no, or auto
  tmp_xmlf90_invalid="no"
  if test "${sd_xmlf90_enable_def}" != "auto" -a \
          "${sd_xmlf90_enable_def}" != "no" -a \
          "${sd_xmlf90_enable_def}" != "yes"; then
    case "${sd_xmlf90_policy}" in
      fail)
        as_fn_error $? "invalid default value: sd_xmlf90_enable_def = '${sd_xmlf90_enable_def}'" "$LINENO" 5
        ;;
      skip)
        tmp_xmlf90_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid default value: sd_xmlf90_enable_def = '${sd_xmlf90_enable_def}'" >&5
$as_echo "$as_me: WARNING: invalid default value: sd_xmlf90_enable_def = '${sd_xmlf90_enable_def}'" >&2;}
        tmp_xmlf90_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_xmlf90_invalid}" = "yes"; then
    if test "${sd_xmlf90_status}" = "required"; then
      sd_xmlf90_enable_def="yes"
    else
      sd_xmlf90_enable_def="no"
    fi
    tmp_xmlf90_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_xmlf90_enable_def to '${sd_xmlf90_enable_def}'" >&5
$as_echo "$as_me: setting sd_xmlf90_enable_def to '${sd_xmlf90_enable_def}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_xmlf90_invalid="no"
  if test "${sd_xmlf90_status}" = "implicit" -o \
          "${sd_xmlf90_status}" = "required"; then
    if test "${sd_xmlf90_enable}" = "no"; then
      case "${sd_xmlf90_policy}" in
        fail)
          as_fn_error $? "The XMLF90 package is required and cannot be disabled
                  See https://launchpad.net/xmlf90 for details on how to
                  install it." "$LINENO" 5
          ;;
        skip)
          tmp_xmlf90_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The XMLF90 package is required and cannot be disabled" >&5
$as_echo "$as_me: WARNING: The XMLF90 package is required and cannot be disabled" >&2;}
          tmp_xmlf90_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_xmlf90_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting XMLF90 trigger to yes" >&5
$as_echo "$as_me: setting XMLF90 trigger to yes" >&6;}
      sd_xmlf90_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_xmlf90_invalid}" = "yes"; then
    case "${sd_xmlf90_status}" in
      implicit|required)
        sd_xmlf90_enable="yes"
        ;;
      optional)
        sd_xmlf90_enable="no"
        ;;
    esac
    tmp_xmlf90_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_xmlf90_enable to '${sd_xmlf90_enable}'" >&5
$as_echo "$as_me: setting sd_xmlf90_enable to '${sd_xmlf90_enable}'" >&6;}
  fi

  # Environment variables conflict with --with-* options
  tmp_xmlf90_vars="${XMLF90_CPPFLAGS}${XMLF90_FCFLAGS}${XMLF90_LDFLAGS}${XMLF90_LIBS}"
  tmp_xmlf90_invalid="no"
  if test ! -z "${tmp_xmlf90_vars}" -a ! -z "${with_xmlf90}"; then
    case "${sd_xmlf90_policy}" in
      fail)
        # FIXME: use the new Steredeg specs
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for XMLF90
                  Please use XMLF90_FCFLAGS + XMLF90_LIBS or --with-xmlf90,
                  not both." >&5
$as_echo "$as_me: WARNING: conflicting option settings for XMLF90
                  Please use XMLF90_FCFLAGS + XMLF90_LIBS or --with-xmlf90,
                  not both." >&2;}
        ;;
      skip)
        tmp_xmlf90_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for XMLF90" >&5
$as_echo "$as_me: WARNING: conflicting option settings for XMLF90" >&2;}
        tmp_xmlf90_invalid="yes"
        ;;
    esac
  fi

  # When using environment variables, triggers must be set to yes
  if test -n "${tmp_xmlf90_vars}"; then
    sd_xmlf90_enable="yes"
    sd_xmlf90_init="env"
    if test "${tmp_xmlf90_invalid}" = "yes"; then
      tmp_xmlf90_invalid="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding --with-xmlf90 with XMLF90_{FCFLAGS,LDFLAGS,LIBS}" >&5
$as_echo "$as_me: overriding --with-xmlf90 with XMLF90_{FCFLAGS,LDFLAGS,LIBS}" >&6;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_xmlf90_status}" = "implicit"; then
    if test "${sd_xmlf90_fcflags}" != ""; then
      sd_xmlf90_fcflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting XMLF90 Fortran flags (implicit package)" >&5
$as_echo "$as_me: resetting XMLF90 Fortran flags (implicit package)" >&6;}
    fi
    if test "${sd_xmlf90_ldflags}" != ""; then
      sd_xmlf90_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting XMLF90 linker flags (implicit package)" >&5
$as_echo "$as_me: resetting XMLF90 linker flags (implicit package)" >&6;}
    fi
    if test "${sd_xmlf90_libs}" != ""; then
      sd_xmlf90_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting XMLF90 library flags (implicit package)" >&5
$as_echo "$as_me: resetting XMLF90 library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_xmlf90_enable}" = "implicit"; then
    sd_xmlf90_fcflags=""
    sd_xmlf90_ldflags=""
    sd_xmlf90_libs=""
  fi

  # Clean-up
  unset tmp_xmlf90_invalid
  unset tmp_xmlf90_vars

  fi
  # Adjust configuration depending on init type
  if test "${sd_xmlf90_enable}" = "yes" -o "${sd_xmlf90_enable}" = "auto"; then

    # Set XMLF90-specific flags
    case "${sd_xmlf90_init}" in

      def|yon)
        sd_xmlf90_cppflags="${sd_xmlf90_cppflags_def}"
        sd_xmlf90_fcflags="${sd_xmlf90_fcflags_def}"
        sd_xmlf90_ldflags="${sd_xmlf90_ldflags_def}"
        sd_xmlf90_libs="${sd_xmlf90_libs_def}"
        ;;

      dir)
        sd_xmlf90_cppflags="-I${with_xmlf90}/include"
        sd_xmlf90_fcflags="${sd_xmlf90_fcflags_def} -I${with_xmlf90}/include"
        sd_xmlf90_ldflags="${sd_xmlf90_ldflags_def}"
        sd_xmlf90_libs="-L${with_xmlf90}/lib ${sd_xmlf90_libs_def}"
        ;;

      env)
        sd_xmlf90_cppflags="${sd_xmlf90_cppflags_def}"
        sd_xmlf90_fcflags="${sd_xmlf90_fcflags_def}"
        sd_xmlf90_ldflags="${sd_xmlf90_ldflags_def}"
        sd_xmlf90_libs="${sd_xmlf90_libs_def}"
        test ! -z "${XMLF90_CPPFLAGS}" && sd_xmlf90_cppflags="${XMLF90_CPPFLAGS}"
        test ! -z "${XMLF90_FFLAGS}" && sd_xmlf90_fcflags="${XMLF90_FFLAGS}"
        test ! -z "${XMLF90_FCFLAGS}" && sd_xmlf90_fcflags="${XMLF90_FCFLAGS}"
        test ! -z "${XMLF90_LDFLAGS}" && sd_xmlf90_ldflags="${XMLF90_LDFLAGS}"
        test ! -z "${XMLF90_LIBS}" && sd_xmlf90_libs="${XMLF90_LIBS}"
        ;;

      *)
        as_fn_error $? "invalid init type for XMLF90: '${sd_xmlf90_init}'" "$LINENO" 5
        ;;

    esac

  fi

  # Override the default configuration if the ESL Bundle is available
  # Note: The setting of the build flags is done once for all
  #       ESL-bundled packages
  if test "${sd_xmlf90_init}" = "def" -a ! -z "${ESL_BUNDLE_PREFIX}"; then
    sd_xmlf90_init="esl"
    sd_xmlf90_cppflags=""
    sd_xmlf90_fcflags=""
    sd_xmlf90_ldflags=""
    sd_xmlf90_libs=""
  fi

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable XMLF90" >&5
$as_echo_n "checking whether to enable XMLF90... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_xmlf90_enable}" >&5
$as_echo "${sd_xmlf90_enable}" >&6; }
  if test "${sd_xmlf90_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how XMLF90 parameters have been set" >&5
$as_echo_n "checking how XMLF90 parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_xmlf90_init}" >&5
$as_echo "${sd_xmlf90_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XMLF90 C preprocessing flags" >&5
$as_echo_n "checking for XMLF90 C preprocessing flags... " >&6; }
    if test "${sd_xmlf90_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_xmlf90_cppflags}" >&5
$as_echo "${sd_xmlf90_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XMLF90 Fortran flags" >&5
$as_echo_n "checking for XMLF90 Fortran flags... " >&6; }
    if test "${sd_xmlf90_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_xmlf90_fcflags}" >&5
$as_echo "${sd_xmlf90_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XMLF90 linker flags" >&5
$as_echo_n "checking for XMLF90 linker flags... " >&6; }
    if test "${sd_xmlf90_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_xmlf90_ldflags}" >&5
$as_echo "${sd_xmlf90_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XMLF90 library flags" >&5
$as_echo_n "checking for XMLF90 library flags... " >&6; }
    if test "${sd_xmlf90_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_xmlf90_libs}" >&5
$as_echo "${sd_xmlf90_libs}" >&6; }
    fi
  fi


  # Export configuration













  # Clean-up
  unset tmp_xmlf90_vars


# Init KOKKOS

  # Init
  sd_kokkos_cppflags=""
  sd_kokkos_cxxflags=""
  sd_kokkos_ldflags=""
  sd_kokkos_libs=""
  sd_kokkos_enable=""
  sd_kokkos_init="unknown"
  sd_kokkos_cxx_ok="unknown"
  sd_kokkos_ok="unknown"

  # Set adjustable parameters
  sd_kokkos_options="optional fail"
  sd_kokkos_libs_def=""
  sd_kokkos_cppflags_def=""
  sd_kokkos_cxxflags_def=""
  sd_kokkos_ldflags_def=""
  sd_kokkos_enable_def=""
  sd_kokkos_policy=""
  sd_kokkos_status=""

  # Process options
  for kwd in ${sd_kokkos_options}; do
    case "${kwd}" in
      auto)
        sd_kokkos_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_kokkos_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_kokkos_policy="${kwd}"
        ;;
      mandatory)
        sd_kokkos_enable="yes"
        sd_kokkos_enable_def="yes"
        ;;
      *)
        as_fn_error $? "invalid Steredeg Kokkos core libraries option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test -z "${sd_kokkos_libs_def}" && sd_kokkos_libs_def="-lkokkoscore"
  test -z "${sd_kokkos_policy}" && sd_kokkos_policy="fail"
  test -z "${sd_kokkos_status}" && sd_kokkos_status="optional"
  test -z "${sd_kokkos_enable_def}" && sd_kokkos_enable_def="no"
  case "${sd_kokkos_status}" in
    implicit|required)
      sd_kokkos_enable_def="yes"
      ;;
  esac

  # Declare configure option
  # TODO: make it switchable for the implicit case

# Check whether --with-kokkos was given.
if test "${with_kokkos+set}" = set; then :
  withval=$with_kokkos;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_kokkos_enable="${withval}"
        sd_kokkos_init="yon"
      else
        sd_kokkos_enable="yes"
        sd_kokkos_init="dir"
        test -d "${withval}/lib" && sd_kokkos_libdir="${withval}/lib"
        test -d "${withval}/lib64" && sd_kokkos_libdir="${withval}/lib64"
      fi
else
   sd_kokkos_enable="${sd_kokkos_enable_def}"; sd_kokkos_init="def"
fi


  # Declare environment variables





  # Detect use of environment variables
  if test "${sd_kokkos_enable}" = "yes" -o "${sd_kokkos_enable}" = "auto"; then
    tmp_kokkos_vars="${KOKKOS_CPPFLAGS}${KOKKOS_CXXFLAGS}${KOKKOS_LDFLAGS}${KOKKOS_LIBS}"
    if test "${sd_kokkos_init}" = "def" -a ! -z "${tmp_kokkos_vars}"; then
      sd_kokkos_enable="yes"
      sd_kokkos_init="env"
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_BYPASS_CONSISTENCY}" != "yes"; then

  # Default trigger must be yes, no, or auto
  tmp_kokkos_invalid="no"
  if test "${sd_kokkos_enable_def}" != "auto" -a \
          "${sd_kokkos_enable_def}" != "no" -a \
          "${sd_kokkos_enable_def}" != "yes"; then
    case "${sd_kokkos_policy}" in
      fail)
        as_fn_error $? "invalid default value: sd_kokkos_enable_def = '${sd_kokkos_enable_def}'" "$LINENO" 5
        ;;
      skip)
        tmp_kokkos_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid default value: sd_kokkos_enable_def = '${sd_kokkos_enable_def}'" >&5
$as_echo "$as_me: WARNING: invalid default value: sd_kokkos_enable_def = '${sd_kokkos_enable_def}'" >&2;}
        tmp_kokkos_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_kokkos_invalid}" = "yes"; then
    if test "${sd_kokkos_status}" = "required"; then
      sd_kokkos_enable_def="yes"
    else
      sd_kokkos_enable_def="no"
    fi
    tmp_kokkos_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_kokkos_enable_def to '${sd_kokkos_enable_def}'" >&5
$as_echo "$as_me: setting sd_kokkos_enable_def to '${sd_kokkos_enable_def}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_kokkos_invalid="no"
  if test "${sd_kokkos_status}" = "implicit" -o \
          "${sd_kokkos_status}" = "required"; then
    if test "${sd_kokkos_enable}" = "no"; then
      case "${sd_kokkos_policy}" in
        fail)
          as_fn_error $? "The Kokkos core libraries package is required and cannot be disabled
                  See https://tddft.org/programs/kokkos/ for details on how to
                  install it." "$LINENO" 5
          ;;
        skip)
          tmp_kokkos_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The Kokkos core libraries package is required and cannot be disabled" >&5
$as_echo "$as_me: WARNING: The Kokkos core libraries package is required and cannot be disabled" >&2;}
          tmp_kokkos_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_kokkos_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting Kokkos core libraries trigger to yes" >&5
$as_echo "$as_me: setting Kokkos core libraries trigger to yes" >&6;}
      sd_kokkos_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_kokkos_invalid}" = "yes"; then
    case "${sd_kokkos_status}" in
      implicit|required)
        sd_kokkos_enable="yes"
        ;;
      optional)
        sd_kokkos_enable="no"
        ;;
    esac
    tmp_kokkos_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_kokkos_enable to '${sd_kokkos_enable}'" >&5
$as_echo "$as_me: setting sd_kokkos_enable to '${sd_kokkos_enable}'" >&6;}
  fi

  # Environment variables conflict with --with-* options
  tmp_kokkos_vars="${KOKKOS_CPPFLAGS}${KOKKOS_CFLAGS}${KOKKOS_CXXFLAGS}${KOKKOS_LDFLAGS}${KOKKOS_LIBS}"
  tmp_kokkos_invalid="no"
  if test ! -z "${tmp_kokkos_vars}" -a ! -z "${with_kokkos}"; then
    case "${sd_kokkos_policy}" in
      fail)
        # FIXME: use the new Steredeg specs
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for Kokkos core libraries
                  Please use KOKKOS_CXXFLAGS + KOKKOS_LIBS or --with-kokkos,
                  not both." >&5
$as_echo "$as_me: WARNING: conflicting option settings for Kokkos core libraries
                  Please use KOKKOS_CXXFLAGS + KOKKOS_LIBS or --with-kokkos,
                  not both." >&2;}
        ;;
      skip)
        tmp_kokkos_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for Kokkos core libraries" >&5
$as_echo "$as_me: WARNING: conflicting option settings for Kokkos core libraries" >&2;}
        tmp_kokkos_invalid="yes"
        ;;
    esac
  fi

  # When using environment variables, triggers must be set to yes
  if test -n "${tmp_kokkos_vars}"; then
    sd_kokkos_enable="yes"
    sd_kokkos_init="env"
    if test "${tmp_kokkos_invalid}" = "yes"; then
      tmp_kokkos_invalid="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding --with-kokkos with KOKKOS_{CXXFLAGS,LDFLAGS,LIBS}" >&5
$as_echo "$as_me: overriding --with-kokkos with KOKKOS_{CXXFLAGS,LDFLAGS,LIBS}" >&6;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_kokkos_status}" = "implicit"; then
    if test "${sd_kokkos_cxxflags}" != ""; then
      sd_kokkos_cxxflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting Kokkos core libraries C++ flags (implicit package)" >&5
$as_echo "$as_me: resetting Kokkos core libraries C++ flags (implicit package)" >&6;}
    fi
    if test "${sd_kokkos_ldflags}" != ""; then
      sd_kokkos_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting Kokkos core libraries linker flags (implicit package)" >&5
$as_echo "$as_me: resetting Kokkos core libraries linker flags (implicit package)" >&6;}
    fi
    if test "${sd_kokkos_libs}" != ""; then
      sd_kokkos_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting Kokkos core libraries library flags (implicit package)" >&5
$as_echo "$as_me: resetting Kokkos core libraries library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_kokkos_enable}" = "implicit"; then
    sd_kokkos_cxxflags=""
    sd_kokkos_ldflags=""
    sd_kokkos_libs=""
  fi

  # Clean-up
  unset tmp_kokkos_invalid
  unset tmp_kokkos_vars

  fi

  # Adjust configuration depending on init type
  if test "${sd_kokkos_enable}" = "yes" -o "${sd_kokkos_enable}" = "auto"; then

    # Set Kokkos core libraries-specific flags
    case "${sd_kokkos_init}" in

      def|yon)
        sd_kokkos_cppflags="${sd_kokkos_cppflags_def}"
        sd_kokkos_cxxflags="${sd_kokkos_cxxflags_def}"
        sd_kokkos_ldflags="${sd_kokkos_ldflags_def}"
        sd_kokkos_libs="${sd_kokkos_libs_def}"
        ;;

      dir)
        sd_kokkos_cppflags="-I${with_kokkos}/include"
        sd_kokkos_cxxflags="${sd_kokkos_cxxflags_def} -I${with_kokkos}/include"
        sd_kokkos_ldflags="${sd_kokkos_ldflags_def}"
        sd_kokkos_libs="-L${sd_kokkos_libdir} ${sd_kokkos_libs_def}"
        ;;

      env)
        sd_kokkos_cppflags="${sd_kokkos_cppflags_def}"
        sd_kokkos_cxxflags="${sd_kokkos_cxxflags_def}"
        sd_kokkos_ldflags="${sd_kokkos_ldflags_def}"
        sd_kokkos_libs="${sd_kokkos_libs_def}"
        test ! -z "${KOKKOS_CPPFLAGS}" && sd_kokkos_cppflags="${KOKKOS_CPPFLAGS}"
        test ! -z "${KOKKOS_LDFLAGS}" && sd_kokkos_ldflags="${KOKKOS_LDFLAGS}"
        test ! -z "${KOKKOS_LIBS}" && sd_kokkos_libs="${KOKKOS_LIBS}"
        ;;

      *)
        as_fn_error $? "invalid init type for Kokkos core libraries: '${sd_kokkos_init}'" "$LINENO" 5
        ;;

    esac

  fi

  # Override the default configuration if the ESL Bundle is available
  # Note: The setting of the build flags is done once for all
  #       ESL-bundled packages
  if test "${sd_kokkos_init}" = "def" -a ! -z "${ESL_BUNDLE_PREFIX}"; then
    sd_kokkos_init="esl"
    sd_kokkos_cppflags=""
    sd_kokkos_cxxflags=""
    sd_kokkos_ldflags=""
    sd_kokkos_libs=""
  fi

   if test "${sd_kokkos_enable}" = "yes"; then
  DO_BUILD_16_KOKKOS_TOOLBOX_TRUE=
  DO_BUILD_16_KOKKOS_TOOLBOX_FALSE='#'
else
  DO_BUILD_16_KOKKOS_TOOLBOX_TRUE='#'
  DO_BUILD_16_KOKKOS_TOOLBOX_FALSE=
fi

   if test "${sd_kokkos_enable}" = "yes"; then
  DO_BUILD_44_MANAGE_KOKKOS_TRUE=
  DO_BUILD_44_MANAGE_KOKKOS_FALSE='#'
else
  DO_BUILD_44_MANAGE_KOKKOS_TRUE='#'
  DO_BUILD_44_MANAGE_KOKKOS_FALSE=
fi


  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable Kokkos core libraries" >&5
$as_echo_n "checking whether to enable Kokkos core libraries... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_kokkos_enable}" >&5
$as_echo "${sd_kokkos_enable}" >&6; }
  if test "${sd_kokkos_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how Kokkos core libraries parameters have been set" >&5
$as_echo_n "checking how Kokkos core libraries parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_kokkos_init}" >&5
$as_echo "${sd_kokkos_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kokkos core libraries C preprocessing flags" >&5
$as_echo_n "checking for Kokkos core libraries C preprocessing flags... " >&6; }
    if test "${sd_kokkos_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_kokkos_cppflags}" >&5
$as_echo "${sd_kokkos_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kokkos core libraries C++ flags" >&5
$as_echo_n "checking for Kokkos core libraries C++ flags... " >&6; }
    if test "${sd_kokkos_cxxflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_kokkos_cxxflags}" >&5
$as_echo "${sd_kokkos_cxxflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kokkos core libraries linker flags" >&5
$as_echo_n "checking for Kokkos core libraries linker flags... " >&6; }
    if test "${sd_kokkos_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_kokkos_ldflags}" >&5
$as_echo "${sd_kokkos_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kokkos core libraries library flags" >&5
$as_echo_n "checking for Kokkos core libraries library flags... " >&6; }
    if test "${sd_kokkos_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_kokkos_libs}" >&5
$as_echo "${sd_kokkos_libs}" >&6; }
    fi
  fi


  # Export configuration













  # Clean-up
  unset tmp_kokkos_vars

#SD_KOKKOS_INIT([optional warn])

# Init YAKL

  # Init
  sd_yakl_cppflags=""
  sd_yakl_fcflags=""
  sd_yakl_ldflags=""
  sd_yakl_libs=""
  sd_yakl_enable=""
  sd_yakl_init="unknown"
  sd_yakl_fortran_ok="unknown"
  sd_yakl_ok="unknown"

  # Set adjustable parameters
  sd_yakl_options="optional fail"
  sd_yakl_libs_def=""
  sd_yakl_cppflags_def=""
  sd_yakl_fcflags_def=""
  sd_yakl_ldflags_def=""
  sd_yakl_enable_def=""
  sd_yakl_policy=""
  sd_yakl_status=""

  # Process options
  for kwd in ${sd_yakl_options}; do
    case "${kwd}" in
      auto)
        sd_yakl_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_yakl_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_yakl_policy="${kwd}"
        ;;
      mandatory)
        sd_yakl_enable="yes"
        sd_yakl_enable_def="yes"
        ;;
      *)
        as_fn_error $? "invalid Steredeg YAKL option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test -z "${sd_yakl_libs_def}" && sd_yakl_libs_def="-lyakl_fortran_interface"
  test -z "${sd_yakl_policy}" && sd_yakl_policy="fail"
  test -z "${sd_yakl_status}" && sd_yakl_status="optional"
  test -z "${sd_yakl_enable_def}" && sd_yakl_enable_def="no"
  case "${sd_yakl_status}" in
    implicit|required)
      sd_yakl_enable_def="yes"
      ;;
  esac

  # Declare configure option
  # TODO: make it switchable for the implicit case

# Check whether --with-yakl was given.
if test "${with_yakl+set}" = set; then :
  withval=$with_yakl;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_yakl_enable="${withval}"
        sd_yakl_init="yon"
      else
        sd_yakl_enable="yes"
        sd_yakl_init="dir"
        test -d "${withval}/lib" && sd_yakl_libdir="${withval}/lib"
        test -d "${withval}/lib64" && sd_yakl_libdir="${withval}/lib64"
      fi
else
   sd_yakl_enable="${sd_yakl_enable_def}"; sd_yakl_init="def"
fi


  # Declare environment variables






  # Detect use of environment variables
  if test "${sd_yakl_enable}" = "yes" -o "${sd_yakl_enable}" = "auto"; then
    tmp_yakl_vars="${YAKL_CPPFLAGS}${YAKL_FFLAGS}${YAKL_FCFLAGS}${YAKL_LDFLAGS}${YAKL_LIBS}"
    if test "${sd_yakl_init}" = "def" -a ! -z "${tmp_yakl_vars}"; then
      sd_yakl_enable="yes"
      sd_yakl_init="env"
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_BYPASS_CONSISTENCY}" != "yes"; then

  # Default trigger must be yes, no, or auto
  tmp_yakl_invalid="no"
  if test "${sd_yakl_enable_def}" != "auto" -a \
          "${sd_yakl_enable_def}" != "no" -a \
          "${sd_yakl_enable_def}" != "yes"; then
    case "${sd_yakl_policy}" in
      fail)
        as_fn_error $? "invalid default value: sd_yakl_enable_def = '${sd_yakl_enable_def}'" "$LINENO" 5
        ;;
      skip)
        tmp_yakl_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid default value: sd_yakl_enable_def = '${sd_yakl_enable_def}'" >&5
$as_echo "$as_me: WARNING: invalid default value: sd_yakl_enable_def = '${sd_yakl_enable_def}'" >&2;}
        tmp_yakl_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_yakl_invalid}" = "yes"; then
    if test "${sd_yakl_status}" = "required"; then
      sd_yakl_enable_def="yes"
    else
      sd_yakl_enable_def="no"
    fi
    tmp_yakl_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_yakl_enable_def to '${sd_yakl_enable_def}'" >&5
$as_echo "$as_me: setting sd_yakl_enable_def to '${sd_yakl_enable_def}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_yakl_invalid="no"
  if test "${sd_yakl_status}" = "implicit" -o \
          "${sd_yakl_status}" = "required"; then
    if test "${sd_yakl_enable}" = "no"; then
      case "${sd_yakl_policy}" in
        fail)
          as_fn_error $? "The YAKL package is required and cannot be disabled
                  See https://tddft.org/programs/yakl/ for details on how to
                  install it." "$LINENO" 5
          ;;
        skip)
          tmp_yakl_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The YAKL package is required and cannot be disabled" >&5
$as_echo "$as_me: WARNING: The YAKL package is required and cannot be disabled" >&2;}
          tmp_yakl_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_yakl_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting YAKL trigger to yes" >&5
$as_echo "$as_me: setting YAKL trigger to yes" >&6;}
      sd_yakl_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_yakl_invalid}" = "yes"; then
    case "${sd_yakl_status}" in
      implicit|required)
        sd_yakl_enable="yes"
        ;;
      optional)
        sd_yakl_enable="no"
        ;;
    esac
    tmp_yakl_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_yakl_enable to '${sd_yakl_enable}'" >&5
$as_echo "$as_me: setting sd_yakl_enable to '${sd_yakl_enable}'" >&6;}
  fi

  # Environment variables conflict with --with-* options
  tmp_yakl_vars="${YAKL_CPPFLAGS}${YAKL_CFLAGS}${YAKL_FFLAGS}${YAKL_FCFLAGS}${YAKL_LDFLAGS}${YAKL_LIBS}"
  tmp_yakl_invalid="no"
  if test ! -z "${tmp_yakl_vars}" -a ! -z "${with_yakl}"; then
    case "${sd_yakl_policy}" in
      fail)
        # FIXME: use the new Steredeg specs
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for YAKL
                  Please use YAKL_FCFLAGS + YAKL_LIBS or --with-yakl,
                  not both." >&5
$as_echo "$as_me: WARNING: conflicting option settings for YAKL
                  Please use YAKL_FCFLAGS + YAKL_LIBS or --with-yakl,
                  not both." >&2;}
        ;;
      skip)
        tmp_yakl_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for YAKL" >&5
$as_echo "$as_me: WARNING: conflicting option settings for YAKL" >&2;}
        tmp_yakl_invalid="yes"
        ;;
    esac
  fi

  # When using environment variables, triggers must be set to yes
  if test -n "${tmp_yakl_vars}"; then
    sd_yakl_enable="yes"
    sd_yakl_init="env"
    if test "${tmp_yakl_invalid}" = "yes"; then
      tmp_yakl_invalid="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding --with-yakl with YAKL_{FCFLAGS,LDFLAGS,LIBS}" >&5
$as_echo "$as_me: overriding --with-yakl with YAKL_{FCFLAGS,LDFLAGS,LIBS}" >&6;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_yakl_status}" = "implicit"; then
    if test "${sd_yakl_fcflags}" != ""; then
      sd_yakl_fcflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting YAKL Fortran flags (implicit package)" >&5
$as_echo "$as_me: resetting YAKL Fortran flags (implicit package)" >&6;}
    fi
    if test "${sd_yakl_ldflags}" != ""; then
      sd_yakl_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting YAKL linker flags (implicit package)" >&5
$as_echo "$as_me: resetting YAKL linker flags (implicit package)" >&6;}
    fi
    if test "${sd_yakl_libs}" != ""; then
      sd_yakl_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting YAKL library flags (implicit package)" >&5
$as_echo "$as_me: resetting YAKL library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_yakl_enable}" = "implicit"; then
    sd_yakl_fcflags=""
    sd_yakl_ldflags=""
    sd_yakl_libs=""
  fi

  # Clean-up
  unset tmp_yakl_invalid
  unset tmp_yakl_vars

  fi

  # Adjust configuration depending on init type
  if test "${sd_yakl_enable}" = "yes" -o "${sd_yakl_enable}" = "auto"; then

    # Set YAKL-specific flags
    case "${sd_yakl_init}" in

      def|yon)
        sd_yakl_cppflags="${sd_yakl_cppflags_def}"
        sd_yakl_fcflags="${sd_yakl_fcflags_def}"
        sd_yakl_ldflags="${sd_yakl_ldflags_def}"
        sd_yakl_libs="${sd_yakl_libs_def}"
        ;;

      dir)
        sd_yakl_cppflags="-I${with_yakl}/include"
        sd_yakl_fcflags="${sd_yakl_fcflags_def} -I${with_yakl}/include"
        sd_yakl_ldflags="${sd_yakl_ldflags_def}"
        sd_yakl_libs="-L${sd_yakl_libdir} ${sd_yakl_libs_def} -lstdc++ -ldl -L${with_gpu}/lib64 -lcudart"
        ;;

      env)
        sd_yakl_cppflags="${sd_yakl_cppflags_def}"
        sd_yakl_fcflags="${sd_yakl_fcflags_def}"
        sd_yakl_ldflags="${sd_yakl_ldflags_def}"
        sd_yakl_libs="${sd_yakl_libs_def}"
        test ! -z "${YAKL_CPPFLAGS}" && sd_yakl_cppflags="${YAKL_CPPFLAGS}"
        test ! -z "${YAKL_LDFLAGS}" && sd_yakl_ldflags="${YAKL_LDFLAGS}"
        test ! -z "${YAKL_LIBS}" && sd_yakl_libs="${YAKL_LIBS}"
        ;;

      *)
        as_fn_error $? "invalid init type for YAKL: '${sd_yakl_init}'" "$LINENO" 5
        ;;

    esac

  fi

  # Override the default configuration if the ESL Bundle is available
  # Note: The setting of the build flags is done once for all
  #       ESL-bundled packages
  if test "${sd_yakl_init}" = "def" -a ! -z "${ESL_BUNDLE_PREFIX}"; then
    sd_yakl_init="esl"
    sd_yakl_cppflags=""
    sd_yakl_fcflags=""
    sd_yakl_ldflags=""
    sd_yakl_libs=""
  fi

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable YAKL" >&5
$as_echo_n "checking whether to enable YAKL... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_yakl_enable}" >&5
$as_echo "${sd_yakl_enable}" >&6; }
  if test "${sd_yakl_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how YAKL parameters have been set" >&5
$as_echo_n "checking how YAKL parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_yakl_init}" >&5
$as_echo "${sd_yakl_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for YAKL C preprocessing flags" >&5
$as_echo_n "checking for YAKL C preprocessing flags... " >&6; }
    if test "${sd_yakl_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_yakl_cppflags}" >&5
$as_echo "${sd_yakl_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for YAKL Fortran flags" >&5
$as_echo_n "checking for YAKL Fortran flags... " >&6; }
    if test "${sd_yakl_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_yakl_fcflags}" >&5
$as_echo "${sd_yakl_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for YAKL linker flags" >&5
$as_echo_n "checking for YAKL linker flags... " >&6; }
    if test "${sd_yakl_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_yakl_ldflags}" >&5
$as_echo "${sd_yakl_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for YAKL library flags" >&5
$as_echo_n "checking for YAKL library flags... " >&6; }
    if test "${sd_yakl_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_yakl_libs}" >&5
$as_echo "${sd_yakl_libs}" >&6; }
    fi
  fi


  # Export configuration













  # Clean-up
  unset tmp_yakl_vars

#SD_YAKL_INIT([optional warn])

# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #

#
# Linear algebra support
#



  abi_sec_title="Linear algebra support"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


#SD_LINALG_INIT([required warn]) # This is called by ABI_LINALG_INIT now
#SD_LINALG_INIT_FLAVOR           # This is called by ABI_LINALG_INIT now


  # Delegate most of the init stage to Steredeg

  # FIXME: Importing parameters from ABINIT
  sd_fc_vendor="${abi_fc_vendor}"
  sd_fc_version="${abi_fc_version}"

  # Init build flags
  sd_linalg_cppflags=""
  sd_linalg_cflags=""
  sd_linalg_cxxflags=""
  sd_linalg_fcflags=""
  sd_linalg_ldflags=""
  sd_linalg_libdir=""
  sd_linalg_libs=""
  sd_linalg_enable=""
  sd_linalg_init="unknown"
  sd_linalg_ok="unknown"

  # Init internal variables
  sd_linalg_chk_gpu=""
  sd_linalg_chk_mpi=""
  sd_linalg_chk_mpiacc=""
  sd_linalg_chk_serial=""
  sd_linalg_has_blas="unknown"
  sd_linalg_has_lapack="unknown"
  sd_linalg_has_lapacke="unknown"
  sd_linalg_has_blacs="unknown"
  sd_linalg_has_scalapack="unknown"
  sd_linalg_has_buggy_zdot="unknown"
  sd_linalg_has_elpa="unknown"
  sd_linalg_has_elpa_2013="unknown"
  sd_linalg_has_elpa_2014="unknown"
  sd_linalg_has_elpa_2015="unknown"
  sd_linalg_has_elpa_2016="unknown"
  sd_linalg_has_plasma="unknown"
  sd_linalg_has_magma="unknown"
  sd_linalg_gpu_ok="unknown"
  sd_linalg_mpi_ok="unknown"
  sd_linalg_mpiacc_ok="unknown"
  sd_linalg_serial_ok="unknown"
  sd_linalg_provided=""

  # Set adjustable parameters
  sd_linalg_options="required warn"
  sd_linalg_libs_def=""
  sd_linalg_cppflags_def=""
  sd_linalg_cflags_def=""
  sd_linalg_cxxflags_def=""
  sd_linalg_fcflags_def=""
  sd_linalg_ldflags_def=""
  sd_linalg_enable_def=""
  sd_linalg_policy=""
  sd_linalg_status=""

  # Process options
  for kwd in ${sd_linalg_options}; do
    case "${kwd}" in
      auto)
        sd_linalg_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_linalg_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_linalg_policy="${kwd}"
        ;;
      *)
        as_fn_error $? "invalid Steredeg linear algebra option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test -z "${sd_linalg_libs}" && sd_linalg_libs="-llapack -lblas"
  test -z "${sd_linalg_policy}" && sd_linalg_policy="fail"
  test -z "${sd_linalg_status}" && sd_linalg_status="optional"
  test -z "${sd_linalg_enable_def}" && sd_linalg_enable_def="no"
  case "${sd_linalg_status}" in
    implicit|required)
      sd_linalg_enable_def="yes"
      ;;
  esac

  # Declare configure option

# Check whether --with-linalg was given.
if test "${with_linalg+set}" = set; then :
  withval=$with_linalg;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_linalg_enable="${withval}"
        sd_linalg_init="yon"
      else
        sd_linalg_enable="yes"
        sd_linalg_init="dir"
        test -d "${withval}/lib" && sd_linalg_libdir="${withval}/lib"
        test -d "${withval}/lib64" && sd_linalg_libdir="${withval}/lib64"
      fi
else
   sd_linalg_enable="${sd_linalg_enable_def}"; sd_linalg_init="def"
fi


  # Declare environment variables








  # Detect use of environment variables
  if test "${sd_linalg_enable}" = "yes" -o "${sd_linalg_enable}" = "auto"; then
    tmp_linalg_vars="${LINALG_CPPFLAGS}${LINALG_CFLAGS}${LINALG_CXXFLAGS}${LINALG_FFLAGS}${LINALG_FCFLAGS}${LINALG_LDFLAGS}${LINALG_LIBS}"
    if test "${sd_linalg_init}" = "def" -a ! -z "${tmp_linalg_vars}"; then
      sd_linalg_enable="yes"
      sd_linalg_init="env"
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_BYPASS_CONSISTENCY}" != "yes"; then

  # Default trigger must be yes, no, or auto
  tmp_linalg_invalid="no"
  if test "${sd_linalg_enable_def}" != "auto" -a \
          "${sd_linalg_enable_def}" != "no" -a \
          "${sd_linalg_enable_def}" != "yes"; then
    case "${sd_linalg_policy}" in
      fail)
        as_fn_error $? "invalid default value: sd_linalg_enable_def = '${sd_linalg_enable_def}'" "$LINENO" 5
        ;;
      skip)
        tmp_linalg_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid default value: sd_linalg_enable_def = '${sd_linalg_enable_def}'" >&5
$as_echo "$as_me: WARNING: invalid default value: sd_linalg_enable_def = '${sd_linalg_enable_def}'" >&2;}
        tmp_linalg_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_linalg_invalid}" = "yes"; then
    if test "${sd_linalg_status}" = "required"; then
      sd_linalg_enable_def="yes"
    else
      sd_linalg_enable_def="no"
    fi
    tmp_linalg_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_linalg_enable_def to '${sd_linalg_enable_def}'" >&5
$as_echo "$as_me: setting sd_linalg_enable_def to '${sd_linalg_enable_def}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_linalg_invalid="no"
  if test "${sd_linalg_status}" = "implicit" -o \
          "${sd_linalg_status}" = "required"; then
    if test "${sd_linalg_enable}" = "no"; then
      case "${sd_linalg_policy}" in
        fail)
          as_fn_error $? "The linear algebra package is required and cannot be disabled
                  See https://www.netlib.org/ for details on how to
                  install it." "$LINENO" 5
          ;;
        skip)
          tmp_linalg_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The linear algebra package is required and cannot be disabled" >&5
$as_echo "$as_me: WARNING: The linear algebra package is required and cannot be disabled" >&2;}
          tmp_linalg_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_linalg_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting linear algebra trigger to yes" >&5
$as_echo "$as_me: setting linear algebra trigger to yes" >&6;}
      sd_linalg_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_linalg_invalid}" = "yes"; then
    case "${sd_linalg_status}" in
      implicit|required)
        sd_linalg_enable="yes"
        ;;
      optional)
        sd_linalg_enable="no"
        ;;
    esac
    tmp_linalg_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_linalg_enable to '${sd_linalg_enable}'" >&5
$as_echo "$as_me: setting sd_linalg_enable to '${sd_linalg_enable}'" >&6;}
  fi

  # Implicit status overrides everything
  if test "${sd_linalg_status}" = "implicit"; then
    if test "${sd_linalg_ldflags}" != ""; then
      sd_linalg_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting linear algebra linker flags (implicit package)" >&5
$as_echo "$as_me: resetting linear algebra linker flags (implicit package)" >&6;}
    fi
    if test "${sd_linalg_libs}" != ""; then
      sd_linalg_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting linear algebra library flags (implicit package)" >&5
$as_echo "$as_me: resetting linear algebra library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_linalg_enable}" = "implicit"; then
    sd_linalg_cppflags=""
    sd_linalg_cflags=""
    sd_linalg_fcflags=""
    sd_linalg_ldflags=""
    sd_linalg_libs=""
  fi

  # Clean-up
  unset tmp_linalg_invalid
  unset tmp_linalg_vars

  fi

  # Adjust configuration depending on init type
  if test "${sd_linalg_enable}" = "yes" -o "${sd_linalg_enable}" = "auto"; then

    # Set LINALG-specific flags
    case "${sd_linalg_init}" in

      def|yon)
        if test "${sd_linalg_enable}" != "no"; then
          sd_linalg_cppflags="${sd_linalg_cppflags_def}"
          sd_linalg_cflags="${sd_linalg_cflags_def}"
          sd_linalg_cxxflags="${sd_linalg_cxxflags_def}"
          sd_linalg_fcflags="${sd_linalg_fcflags_def}"
          sd_linalg_ldflags="${sd_linalg_ldflags_def}"
          sd_linalg_libs="${sd_linalg_libs_def}"
        fi
        ;;

      dir)
        sd_linalg_cppflags="${sd_linalg_cppflags_def} -I${with_linalg}/include"
        sd_linalg_cflags="${sd_linalg_cflags_def}"
        sd_linalg_cxxflags="${sd_linalg_cxxflags_def}"
        sd_linalg_fcflags="${sd_linalg_fcflags_def} -I${with_linalg}/include"
        sd_linalg_ldflags="${sd_linalg_ldflags_def}"
        sd_linalg_libs="-L${sd_linalg_libdir} ${sd_linalg_libs_def}"
        ;;

      env)
        sd_linalg_cppflags="${sd_linalg_cppflags_def}"
        sd_linalg_cflags="${sd_linalg_cflags_def}"
        sd_linalg_cxxflags="${sd_linalg_cxxflags_def}"
        sd_linalg_fcflags="${sd_linalg_fcflags_def}"
        sd_linalg_ldflags="${sd_linalg_ldflags_def}"
        sd_linalg_libs="${sd_linalg_libs_def}"
        test ! -z "${LINALG_CPPFLAGS}" && sd_linalg_cppflags="${LINALG_CPPFLAGS}"
        test ! -z "${LINALG_CFLAGS}" && sd_linalg_cflags="${LINALG_CFLAGS}"
        test ! -z "${LINALG_CXXFLAGS}" && sd_linalg_cxxflags="${LINALG_CXXFLAGS}"
        test ! -z "${LINALG_FFLAGS}" && sd_linalg_fcflags="${LINALG_FFLAGS}"
        test ! -z "${LINALG_FCFLAGS}" && sd_linalg_fcflags="${LINALG_FCFLAGS}"
        test ! -z "${LINALG_LDFLAGS}" && sd_linalg_ldflags="${LINALG_LDFLAGS}"
        test ! -z "${LINALG_LIBS}" && sd_linalg_libs="${LINALG_LIBS}"
        ;;

      *)
        as_fn_error $? "invalid init type for linear algebra: '${sd_linalg_init}'" "$LINENO" 5
        ;;

    esac

  fi

  # Export configuration












  # Init internal parameters
  sd_linalg_valid_flavors="auto acml aocl asl atlas easybuild elpa essl magma mkl netlib none openblas plasma"
  sd_linalg_flavor=""
  sd_linalg_flavor_init="unknown"
  sd_linalg_flavor_gpu=""
  sd_linalg_flavor_mpi=""
  sd_linalg_flavor_mpiacc=""
  sd_linalg_flavor_serial=""
  sd_linalg_flavor_req=""

  # Set adjustable parameters
  sd_linalg_flavor_def=""


  # Set reasonable defaults if not provided
  test -z "${sd_linalg_flavor_def}" && sd_linalg_flavor_def="auto"

  # Declare configure option

# Check whether --with-linalg-flavor was given.
if test "${with_linalg_flavor+set}" = set; then :
  withval=$with_linalg_flavor;  tmp_linalg_iter=`echo "${withval}" | sed -e 's/+/ /g'`
      for tmp_linalg_flavor in ${tmp_linalg_iter}; do
        tmp_linalg_flavor_ok=`echo "${sd_linalg_valid_flavors}" | grep "${tmp_linalg_flavor}"`
        if test "${tmp_linalg_flavor_ok}" = ""; then
          as_fn_error $? "invalid linear algebra flavor: '${tmp_linalg_flavor}'" "$LINENO" 5
        fi
      done
      sd_linalg_flavor="${withval}"
      sd_linalg_enable="yes"
      sd_linalg_flavor_init="kwd"
      unset tmp_linalg_iter
      unset tmp_linalg_flavor
      unset tmp_linalg_flavor_ok
else
   sd_linalg_flavor="${sd_linalg_flavor_def}"
      sd_linalg_flavor_init="def"
fi


  # Check that the specified flavor is consistent

  # Display configured flavor
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the requested linear algebra flavor" >&5
$as_echo_n "checking for the requested linear algebra flavor... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_flavor}" >&5
$as_echo "${sd_linalg_flavor}" >&6; }

  if test "${sd_linalg_flavor}" = "auto"; then

    # Make sure linear algebra is enabled
    sd_linalg_enable="yes"

    # Set generic flavors first
    sd_linalg_chk_serial="netlib"
    if test "${sd_mpi_enable}" = "yes"; then
      sd_linalg_chk_mpi="netlib"
      sd_linalg_chk_mpiacc="elpa"
    fi
    if test "${sd_gpu_enable}" = "yes"; then
      sd_linalg_chk_gpu="magma"
    fi

    # Refine with vendor-specific flavors
    case "${sd_fc_vendor}" in
      gnu)
        if test "${MKLROOT}" != ""; then
          sd_linalg_chk_serial="mkl ${sd_linalg_chk_serial}"
        fi
        sd_linalg_chk_serial="openblas atlas ${sd_linalg_chk_serial}"
        ;;
      intel)
        sd_linalg_chk_serial="mkl atlas ${sd_linalg_chk_serial}"
        sd_linalg_chk_mpi="mkl netlib"
        ;;
    esac

  else

    # Reformat flavor
    tmp_linalg_netlib_explicit=`echo "${sd_linalg_flavor}" | grep "netlib"`
    sd_linalg_iter=`echo "${sd_linalg_flavor}" | tr '+' '\n' | grep -v "netlib" | sort -u | awk '{printf " %s", $1} END{printf "\n"}'`
    sd_linalg_iter=`echo "${sd_linalg_iter}" | sed -e 's/^ *//'`

    # The 'none' flavor excludes any other one
    tmp_linalg_none=`echo "${sd_linalg_iter}" | grep "none"`
    if test "${tmp_linalg_none}" != ""; then
      if test "${sd_linalg_iter}" != "none"; then
        as_fn_error $? "the linear algebra flavor cannot be 'none' and
                  something else at the same time" "$LINENO" 5
      fi
    fi
    unset tmp_linalg_none

    # Check flavor unicity for each detection sequence
    for tmp_linalg_flavor in ${sd_linalg_iter}; do
      case "${tmp_linalg_flavor}" in
        easybuild|mkl)
          if test "${sd_linalg_chk_serial}" != ""; then
            as_fn_error $? "only one serial linear algebra flavor is permitted" "$LINENO" 5
          fi
          sd_linalg_chk_serial="${tmp_linalg_flavor}"
          if test "${sd_mpi_enable}" = "yes"; then
            if test "${sd_linalg_chk_mpi}" != ""; then
              as_fn_error $? "only one MPI linear algebra flavor is permitted" "$LINENO" 5
            fi
            sd_linalg_chk_mpi="${tmp_linalg_flavor}"
          fi
          ;;
        elpa)
          if test "${sd_mpi_enable}" = "yes"; then
            if test "${sd_linalg_chk_mpiacc}" != ""; then
              as_fn_error $? "only one MPI acceleration linear algebra flavor is permitted" "$LINENO" 5
            fi
            sd_linalg_chk_mpiacc="${tmp_linalg_flavor}"
          else
            { $as_echo "$as_me:${as_lineno-$LINENO}: ignoring '${tmp_linalg_flavor}', since MPI is disabled" >&5
$as_echo "$as_me: ignoring '${tmp_linalg_flavor}', since MPI is disabled" >&6;}
          fi
          ;;
        magma)
          if test "${sd_gpu_enable}" = "yes"; then
            if test "${sd_linalg_chk_gpu}" != ""; then
              as_fn_error $? "only one GPU linear algebra flavor is permitted" "$LINENO" 5
            fi
            sd_linalg_chk_gpu="${tmp_linalg_flavor}"
          else
            { $as_echo "$as_me:${as_lineno-$LINENO}: ignoring '${tmp_linalg_flavor}', since GPU is disabled" >&5
$as_echo "$as_me: ignoring '${tmp_linalg_flavor}', since GPU is disabled" >&6;}
          fi
          ;;
        plasma)
          if test "${sd_mpi_enable}" = "yes"; then
            if test "${sd_linalg_chk_mpi}" != ""; then
              as_fn_error $? "only one MPI linear algebra flavor is permitted" "$LINENO" 5
            fi
            sd_linalg_chk_mpi="${tmp_linalg_flavor}"
          else
            { $as_echo "$as_me:${as_lineno-$LINENO}: ignoring '${tmp_linalg_flavor}', since MPI is disabled" >&5
$as_echo "$as_me: ignoring '${tmp_linalg_flavor}', since MPI is disabled" >&6;}
          fi
          ;;
        *)
          if test "${sd_linalg_chk_serial}" != ""; then
            as_fn_error $? "only one serial linear algebra flavor is permitted" "$LINENO" 5
          fi
          sd_linalg_chk_serial="${tmp_linalg_flavor}"
          ;;
      esac
    done

    # Some vendors only provide a partial serial linear algebra support
    case "${sd_linalg_chk_serial}" in
      atlas|openblas)
        if test "${tmp_linalg_netlib_explicit}" = ""; then
          sd_linalg_chk_serial="${sd_linalg_chk_serial} netlib"
        fi
        ;;
    esac

    # Handle the explicit 'netlib' case
    if test "${tmp_linalg_netlib_explicit}" != ""; then
      case "${sd_linalg_chk_serial}" in
        atlas|openblas)
          sd_linalg_chk_serial="${sd_linalg_chk_serial} netlib"
          if test "${sd_mpi_enable}" = "yes"; then
            if test "${sd_linalg_chk_mpi}" = ""; then
              sd_linalg_chk_mpi="netlib"
            fi
          fi
          ;;
        *)
          if test "${sd_linalg_chk_serial}" = ""; then
            sd_linalg_chk_serial="netlib"
          fi
          ;;
      esac
    fi
    unset tmp_linalg_netlib_explicit

    # At this point we can assume that the serial detection sequence is set,
    # unless we want to bypass linear algebra tests
    if test "${sd_linalg_flavor}" != "none"; then
      if test "${sd_linalg_chk_serial}" = ""; then
        sd_linalg_chk_serial="netlib"
      fi
    fi

  fi   # sd_linalg_flavor = auto

  # Display detection sequences
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the serial linear algebra detection sequence" >&5
$as_echo_n "checking for the serial linear algebra detection sequence... " >&6; }
  if test "${sd_linalg_chk_serial}" = ""; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_chk_serial}" >&5
$as_echo "${sd_linalg_chk_serial}" >&6; }
  fi
  if test "${sd_mpi_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the MPI linear algebra detection sequence" >&5
$as_echo_n "checking for the MPI linear algebra detection sequence... " >&6; }
    if test "${sd_linalg_chk_mpi}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_chk_mpi}" >&5
$as_echo "${sd_linalg_chk_mpi}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the MPI acceleration linear algebra detection sequence" >&5
$as_echo_n "checking for the MPI acceleration linear algebra detection sequence... " >&6; }
    if test "${sd_linalg_chk_mpiacc}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_chk_mpiacc}" >&5
$as_echo "${sd_linalg_chk_mpiacc}" >&6; }
    fi
  fi
  if test "${sd_gpu_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the GPU linear algebra detection sequence" >&5
$as_echo_n "checking for the GPU linear algebra detection sequence... " >&6; }
    if test "${sd_linalg_chk_gpu}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_chk_gpu}" >&5
$as_echo "${sd_linalg_chk_gpu}" >&6; }
    fi
  fi


  sd_linalg_flavor_req=${sd_linalg_flavor}
  # Export configuration







  # Delegate the actual detection to Steredeg

  if test "${sd_linalg_enable}" = "auto" -o "${sd_linalg_enable}" = "yes"; then

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to detect linear algebra libraries" >&5
$as_echo_n "checking how to detect linear algebra libraries... " >&6; }
    case "${sd_linalg_init}" in
      def|yon)
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: explore" >&5
$as_echo "explore" >&6; }

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"


  # Reset linear algebra build flags, i.e. discard defaults
  sd_linalg_cppflags=""
  sd_linalg_cflags=""
  sd_linalg_cxxflags=""
  sd_linalg_fcflags=""
  sd_linalg_ldflags=""
  sd_linalg_libs=""
  sd_linalg_flavor=""

  # Look for serial linear algebra support
  for tmp_linalg_vendor in ${sd_linalg_chk_serial}; do

    # Configure vendor libraries

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"

    CPPFLAGS="${CPPFLAGS} ${sd_linalg_cppflags}"
    CFLAGS="${CFLAGS} ${sd_linalg_cflags}"
    CXXFLAGS="${CXXFLAGS} ${sd_linalg_cxxflags}"
    FCFLAGS="${FCFLAGS} ${sd_linalg_fcflags}"
    LDFLAGS="${LDFLAGS} ${sd_linalg_ldflags}"
    LIBS="${sd_linalg_libs} ${LIBS}"

  # Reset components
  sd_linalg_vendor_provided=""
  sd_linalg_vendor_cppflags=""
  sd_linalg_vendor_cflags=""
  sd_linalg_vendor_cxxflags=""
  sd_linalg_vendor_fcflags=""
  sd_linalg_vendor_ldflags=""
  sd_linalg_vendor_blacs_libs=""
  sd_linalg_vendor_blacs_prqs=""
  sd_linalg_vendor_blas_libs=""
  sd_linalg_vendor_blas_prqs=""
  sd_linalg_vendor_lapack_libs=""
  sd_linalg_vendor_lapack_prqs=""
  sd_linalg_vendor_lapacke_libs=""
  sd_linalg_vendor_lapacke_prqs=""
  sd_linalg_vendor_scalapack_libs=""
  sd_linalg_vendor_scalapack_prqs=""
  sd_linalg_vendor_elpa_libs=""
  sd_linalg_vendor_elpa_prqs=""
  sd_linalg_vendor_magma_libs=""
  sd_linalg_vendor_magma_prqs=""
  sd_linalg_vendor_plasma_libs=""
  sd_linalg_vendor_plasma_prqs=""

  # Update components according to specified vendor
  case "${tmp_linalg_vendor}" in

    acml)
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      sd_linalg_vendor_blas_libs="-lacml -lacml_mv"
      ;;

    aocl|AOCL)
      sd_linalg_vendor_provided="blas lapack scalapack"
      if test "${sd_openmp_enable}" = "yes"; then
        sd_linalg_vendor_blas_libs="-lblis-mt"
      else
        sd_linalg_vendor_blas_libs="-lblis"
      fi
      sd_linalg_vendor_lapack_libs="-lflame"
      sd_linalg_vendor_scalapack_libs="-lscalapack"
      ;;

    asl)
      sd_linalg_vendor_provided="blas lapack lapacke blacs scalapack"
      sd_linalg_vendor_blas_libs="-lasl"
      ;;

    atlas)
      sd_linalg_vendor_provided="blas"
      sd_linalg_vendor_blas_libs="-lf77blas -lcblas -latlas"
      ;;

    debian-mpich)
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      sd_linalg_vendor_blas_libs="-lblas"
      sd_linalg_vendor_lapack_libs="-llapack"
      sd_linalg_vendor_blacs_libs="-lblacs-mpich -lblacsCinit-mpich -lblacsF77init-mpich"
      sd_linalg_vendor_scalapack_libs="-lscalapack-mpich"
      ;;

    debian-openmpi)
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      sd_linalg_vendor_blas_libs="-lblas"
      sd_linalg_vendor_lapack_libs="-llapack"
      sd_linalg_vendor_blacs_libs="-lblacs-openmpi -lblacsCinit-openmpi -lblacsF77init-openmpi"
      sd_linalg_vendor_scalapack_libs="-lscalapack-openmpi"
      ;;

    easybuild)
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      sd_linalg_vendor_blas_libs="-lopenblas"
      sd_linalg_vendor_blacs_libs="-lscalapack"
      ;;

    elpa)
      sd_linalg_vendor_provided="elpa"
      sd_linalg_vendor_elpa_libs="-lelpa"
      ;;

    essl)
      sd_linalg_vendor_provided="blas lapack lapacke blacs scalapack"
      sd_linalg_vendor_cflags="-qessl"
      sd_linalg_vendor_cxxflags="-qessl"
      sd_linalg_vendor_fcflags="-qessl"
      sd_linalg_vendor_ldflags="-qessl"
      sd_linalg_vendor_blas_libs="-lessl"
      ;;

    magma)
      sd_linalg_vendor_provided="magma"
      sd_linalg_vendor_magma_libs="-lmagma"
      ;;

    mkl)
      if test "${MKLROOT}" = ""; then
        as_fn_error $? "MKLROOT is not set, which means that MKL is not
                  properly configured" "$LINENO" 5
      fi
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      case "${sd_fc_vendor}" in
        gnu)
          sd_linalg_vendor_cppflags="-I${MKLROOT}/include"
          sd_linalg_vendor_cflags="-m64"
          sd_linalg_vendor_cxxflags="-m64"
          sd_linalg_vendor_fcflags="-m64 -I${MKLROOT}/include"
          sd_linalg_vendor_blas_libs="-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl"
          if test "${sd_mpi_enable}" = "yes"; then
            sd_linalg_vendor_blas_libs="-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_scalapack_lp64 -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lmkl_blacs_intelmpi_lp64 -lpthread -lm -ldl"
          fi
          ;;
        intel)
          sd_linalg_vendor_cppflags="-I${MKLROOT}/include"
          sd_linalg_vendor_fcflags="-I${MKLROOT}/include"
          if test "${sd_mpi_enable}" = "yes"; then
            sd_linalg_vendor_ldflags="-qmkl=cluster"
          else
            sd_linalg_vendor_ldflags="-qmkl"
          fi
          ;;
        *)
          as_fn_error $? "MKL is only supported with GNU and Intel compilers" "$LINENO" 5
          ;;
      esac
      ;;

    netlib)
      sd_linalg_vendor_provided="blas lapack lapacke blacs scalapack"
      sd_linalg_vendor_blas_libs="-lblas"
      sd_linalg_vendor_lapack_libs="-llapack"
      sd_linalg_vendor_lapacke_libs="-llapacke"
      sd_linalg_vendor_blacs_libs="-lblacs -lblacsCinit -lblacsF77init"
      sd_linalg_vendor_scalapack_libs="-lscalapack"
      ;;

    nvpl)
      sd_linalg_vendor_provided="blas lapack scalapack"
      sd_linalg_vendor_blas_libs="-Mnvpl=blas"
      sd_linalg_vendor_lapack_libs="-Mnvpl=lapack"
      sd_linalg_vendor_scalapack_libs="-Mscalapack"
      ;;

    openblas)
      sd_linalg_vendor_provided="blas"
      sd_linalg_vendor_blas_libs="-lopenblas -lpthread"
      ;;

    plasma)
      sd_linalg_vendor_provided="plasma"
      sd_linalg_vendor_plasma_libs="-lplasma -lcorelapack -lcoreblas"
      ;;

    *)
      as_fn_error $? "no library settings for linear algebra flavor '${tmp_linalg_vendor}'" "$LINENO" 5
      ;;

  esac


    # Look for BLAS
    tmp_linalg_blas_proceed=`echo "${sd_linalg_vendor_provided}" | grep "blas"`
    if test "${tmp_linalg_blas_proceed}" != "" -a \
            "${sd_linalg_has_blas}" != "yes"; then
      CPPFLAGS="${CPPFLAGS} ${sd_linalg_vendor_cppflags}"
      CFLAGS="${CFLAGS} ${sd_linalg_vendor_cflags}"
      CXXFLAGS="${CXXFLAGS} ${sd_linalg_vendor_cxxflags}"
      FCFLAGS="${FCFLAGS} ${sd_linalg_vendor_fcflags}"
      LDFLAGS="${LDFLAGS} ${sd_linalg_vendor_ldflags}"
      LIBS="${sd_linalg_vendor_blas_libs} ${LIBS}"
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking ${tmp_linalg_vendor} libraries for BLAS" >&5
$as_echo_n "checking ${tmp_linalg_vendor} libraries for BLAS... " >&6; }
      if test "${sd_linalg_vendor_blas_libs}" = ""; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: none required" >&5
$as_echo "none required" >&6; }
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_vendor_blas_libs}" >&5
$as_echo "${sd_linalg_vendor_blas_libs}" >&6; }
      fi

  sd_linalg_has_blas="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BLAS support in the specified libraries" >&5
$as_echo_n "checking for BLAS support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call zgemm

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_blas="yes"; sd_linalg_provided="${sd_linalg_provided} blas"
else
  sd_linalg_has_blas="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_blas}" >&5
$as_echo "${sd_linalg_has_blas}" >&6; }

      if test "${sd_linalg_has_blas}" = "yes"; then

  # AXPBY family?
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AXPBY support in the BLAS libraries" >&5
$as_echo_n "checking for AXPBY support in the BLAS libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call saxpby
      call daxpby
      call caxpby
      call zaxpby

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_axpby="yes"
else
  sd_linalg_has_axpby="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_axpby}" >&5
$as_echo "${sd_linalg_has_axpby}" >&6; }

  if test "${sd_linalg_has_axpby}" = "yes"; then

$as_echo "#define HAVE_LINALG_AXPBY 1" >>confdefs.h

  fi

  # gemm3m family
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GEMM3M in the BLAS libraries" >&5
$as_echo_n "checking for GEMM3M in the BLAS libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call cgemm3m
      call zgemm3m

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_gemm3m="yes"
else
  sd_linalg_has_gemm3m="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_gemm3m}" >&5
$as_echo "${sd_linalg_has_gemm3m}" >&6; }

  if test "${sd_linalg_has_gemm3m}" = "yes"; then

$as_echo "#define HAVE_LINALG_GEMM3M 1" >>confdefs.h

  fi

  # gemmt family
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GEMMT in the BLAS libraries" >&5
$as_echo_n "checking for GEMMT in the BLAS libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call sgemmt
      call dgemmt
      call cgemmt
      call zgemmt

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_gemmt="yes"
else
  sd_linalg_has_gemmt="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_gemmt}" >&5
$as_echo "${sd_linalg_has_gemmt}" >&6; }

  if test "${sd_linalg_has_gemmt}" = "yes"; then

$as_echo "#define HAVE_LINALG_GEMMT 1" >>confdefs.h

  fi


         if test "${tmp_linalg_vendor}" = "mkl"; then

  # mkl_imatcopy family
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mkl_imatcopy in the specified libraries" >&5
$as_echo_n "checking for mkl_imatcopy in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call mkl_simatcopy
      call mkl_dimatcopy
      call mkl_cimatcopy
      call mkl_zimatcopy

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_mkl_has_imatcopy="yes"
else
  sd_linalg_mkl_has_imatcopy="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_mkl_has_imatcopy}" >&5
$as_echo "${sd_linalg_mkl_has_imatcopy}" >&6; }

  if test "${sd_linalg_mkl_has_imatcopy}" = "yes"; then

$as_echo "#define HAVE_LINALG_MKL_IMATCOPY 1" >>confdefs.h

  fi

  # mkl_omatcopy family
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mkl_omatcopy in the specified libraries" >&5
$as_echo_n "checking for mkl_omatcopy in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call mkl_somatcopy
      call mkl_domatcopy
      call mkl_comatcopy
      call mkl_zomatcopy

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_mkl_has_omatcopy="yes"
else
  sd_linalg_mkl_has_omatcopy="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_mkl_has_omatcopy}" >&5
$as_echo "${sd_linalg_mkl_has_omatcopy}" >&6; }

  if test "${sd_linalg_mkl_has_omatcopy}" = "yes"; then

$as_echo "#define HAVE_LINALG_MKL_OMATCOPY 1" >>confdefs.h

  fi

  # mkl_omatadd family
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mkl_omatadd in the specified libraries" >&5
$as_echo_n "checking for mkl_omatadd in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call mkl_somatadd
      call mkl_comatadd
      call mkl_domatadd
      call mkl_zomatadd

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_mkl_has_omatadd="yes"
else
  sd_linalg_mkl_has_omatadd="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_mkl_has_omatadd}" >&5
$as_echo "${sd_linalg_mkl_has_omatadd}" >&6; }

  if test "${sd_linalg_mkl_has_omatadd}" = "yes"; then

$as_echo "#define HAVE_LINALG_MKL_OMATADD 1" >>confdefs.h

  fi

  # mkl_threads support functions
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mkl_set/get_threads in the specified libraries" >&5
$as_echo_n "checking for mkl_set/get_threads in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      integer :: a
      a = mkl_get_max_threads()
      call mkl_set_num_threads

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_mkl_has_threads="yes"
else
  sd_linalg_mkl_has_threads="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_mkl_has_threads}" >&5
$as_echo "${sd_linalg_mkl_has_threads}" >&6; }

  if test "${sd_linalg_mkl_has_threads}" = "yes"; then

$as_echo "#define HAVE_LINALG_MKL_THREADS 1" >>confdefs.h

  fi

         fi
         sd_linalg_flavor="${tmp_linalg_vendor}"
         sd_linalg_blas_vendor="${tmp_linalg_vendor}"
         sd_linalg_provided="${sd_linalg_provided} blas"
         sd_linalg_cppflags="${sd_linalg_vendor_cppflags}"
         sd_linalg_cflags="${sd_linalg_vendor_cflags}"
         sd_linalg_cxxflags="${sd_linalg_vendor_cxxflags}"
         sd_linalg_fcflags="${sd_linalg_vendor_fcflags}"
         sd_linalg_ldflags="${sd_linalg_vendor_ldflags}"
         sd_linalg_libs="${sd_linalg_vendor_blas_libs}"
      fi
    fi

    # Look for LAPACK
    tmp_linalg_lapack_proceed=`echo "${sd_linalg_vendor_provided}" | grep "lapack"`
    if test "${tmp_linalg_lapack_proceed}" != "" -a \
            "${sd_linalg_has_blas}" = "yes" -a \
            "${sd_linalg_has_lapack}" != "yes"; then

      { $as_echo "$as_me:${as_lineno-$LINENO}: checking ${tmp_linalg_vendor} libraries for LAPACK" >&5
$as_echo_n "checking ${tmp_linalg_vendor} libraries for LAPACK... " >&6; }
      if test "${sd_linalg_vendor_lapack_libs}" = ""; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: none required" >&5
$as_echo "none required" >&6; }
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_vendor_lapack_libs}" >&5
$as_echo "${sd_linalg_vendor_lapack_libs}" >&6; }
        LIBS="${sd_linalg_vendor_lapack_libs} ${LIBS}"
      fi

  sd_linalg_has_lapack="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LAPACK support in the specified libraries" >&5
$as_echo_n "checking for LAPACK support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call zhpev

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_lapack="yes"; sd_linalg_provided="${sd_linalg_provided} lapack"
else
  sd_linalg_has_lapack="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_lapack}" >&5
$as_echo "${sd_linalg_has_lapack}" >&6; }

      if test "${sd_linalg_has_lapack}" = "yes"; then
        sd_linalg_flavor="${sd_linalg_flavor}+${tmp_linalg_vendor}"
        sd_linalg_lapack_vendor="${tmp_linalg_vendor}"
        sd_linalg_provided="${sd_linalg_provided} lapack"
        if test "${sd_linalg_lapack_vendor}" != "${sd_linalg_blas_vendor}"; then
          test "${sd_linalg_vendor_cppflags}" != "" && \
            sd_linalg_cppflags="${sd_linalg_cppflags} ${sd_linalg_vendor_cppflags}"
          test "${sd_linalg_vendor_cflags}" != "" && \
            sd_linalg_cflags="${sd_linalg_cflags} ${sd_linalg_vendor_cflags}"
          test "${sd_linalg_vendor_cxxflags}" != "" && \
            sd_linalg_cxxflags="${sd_linalg_cxxflags} ${sd_linalg_vendor_cxxflags}"
          test "${sd_linalg_vendor_fcflags}" != "" && \
            sd_linalg_fcflags="${sd_linalg_fcflags} ${sd_linalg_vendor_fcflags}"
          test "${sd_linalg_vendor_ldflags}" != "" && \
            sd_linalg_ldflags="${sd_linalg_ldflags} ${sd_linalg_vendor_ldflags}"
        fi
        test "${sd_linalg_vendor_lapack_libs}" != "" && \
            sd_linalg_libs="${sd_linalg_vendor_lapack_libs} ${sd_linalg_libs}"
        break
      fi
    fi

  done

  # FIXME: implement LAPACKE

  # Checkpoint: validate the serial linear algebra support
  if test "${sd_linalg_has_blas}" = "yes" -a \
          "${sd_linalg_has_lapack}" = "yes"; then
    sd_linalg_serial_ok="yes"
  else
    sd_linalg_serial_ok="no"
  fi

  # Look for MPI linear algebra support
  if test "${sd_linalg_serial_ok}" = "yes" -a "${sd_mpi_enable}" = "yes"; then
    for tmp_linalg_vendor in ${sd_linalg_chk_mpi}; do

      # Configure vendor libraries

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"

      CPPFLAGS="${CPPFLAGS} ${sd_mpi_cppflags} ${sd_linalg_cppflags}"
      CFLAGS="${CFLAGS} ${sd_mpi_cflags} ${sd_linalg_cflags}"
      CXXFLAGS="${CXXFLAGS} ${sd_mpi_cxxflags} ${sd_linalg_cxxflags}"
      FCFLAGS="${FCFLAGS} ${sd_mpi_fcflags} ${sd_linalg_fcflags}"
      LDFLAGS="${LDFLAGS} ${sd_mpi_ldflags} ${sd_linalg_ldflags}"
      LIBS="${sd_linalg_libs} ${sd_mpi_libs} ${LIBS}"

  # Reset components
  sd_linalg_vendor_provided=""
  sd_linalg_vendor_cppflags=""
  sd_linalg_vendor_cflags=""
  sd_linalg_vendor_cxxflags=""
  sd_linalg_vendor_fcflags=""
  sd_linalg_vendor_ldflags=""
  sd_linalg_vendor_blacs_libs=""
  sd_linalg_vendor_blacs_prqs=""
  sd_linalg_vendor_blas_libs=""
  sd_linalg_vendor_blas_prqs=""
  sd_linalg_vendor_lapack_libs=""
  sd_linalg_vendor_lapack_prqs=""
  sd_linalg_vendor_lapacke_libs=""
  sd_linalg_vendor_lapacke_prqs=""
  sd_linalg_vendor_scalapack_libs=""
  sd_linalg_vendor_scalapack_prqs=""
  sd_linalg_vendor_elpa_libs=""
  sd_linalg_vendor_elpa_prqs=""
  sd_linalg_vendor_magma_libs=""
  sd_linalg_vendor_magma_prqs=""
  sd_linalg_vendor_plasma_libs=""
  sd_linalg_vendor_plasma_prqs=""

  # Update components according to specified vendor
  case "${tmp_linalg_vendor}" in

    acml)
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      sd_linalg_vendor_blas_libs="-lacml -lacml_mv"
      ;;

    aocl|AOCL)
      sd_linalg_vendor_provided="blas lapack scalapack"
      if test "${sd_openmp_enable}" = "yes"; then
        sd_linalg_vendor_blas_libs="-lblis-mt"
      else
        sd_linalg_vendor_blas_libs="-lblis"
      fi
      sd_linalg_vendor_lapack_libs="-lflame"
      sd_linalg_vendor_scalapack_libs="-lscalapack"
      ;;

    asl)
      sd_linalg_vendor_provided="blas lapack lapacke blacs scalapack"
      sd_linalg_vendor_blas_libs="-lasl"
      ;;

    atlas)
      sd_linalg_vendor_provided="blas"
      sd_linalg_vendor_blas_libs="-lf77blas -lcblas -latlas"
      ;;

    debian-mpich)
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      sd_linalg_vendor_blas_libs="-lblas"
      sd_linalg_vendor_lapack_libs="-llapack"
      sd_linalg_vendor_blacs_libs="-lblacs-mpich -lblacsCinit-mpich -lblacsF77init-mpich"
      sd_linalg_vendor_scalapack_libs="-lscalapack-mpich"
      ;;

    debian-openmpi)
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      sd_linalg_vendor_blas_libs="-lblas"
      sd_linalg_vendor_lapack_libs="-llapack"
      sd_linalg_vendor_blacs_libs="-lblacs-openmpi -lblacsCinit-openmpi -lblacsF77init-openmpi"
      sd_linalg_vendor_scalapack_libs="-lscalapack-openmpi"
      ;;

    easybuild)
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      sd_linalg_vendor_blas_libs="-lopenblas"
      sd_linalg_vendor_blacs_libs="-lscalapack"
      ;;

    elpa)
      sd_linalg_vendor_provided="elpa"
      sd_linalg_vendor_elpa_libs="-lelpa"
      ;;

    essl)
      sd_linalg_vendor_provided="blas lapack lapacke blacs scalapack"
      sd_linalg_vendor_cflags="-qessl"
      sd_linalg_vendor_cxxflags="-qessl"
      sd_linalg_vendor_fcflags="-qessl"
      sd_linalg_vendor_ldflags="-qessl"
      sd_linalg_vendor_blas_libs="-lessl"
      ;;

    magma)
      sd_linalg_vendor_provided="magma"
      sd_linalg_vendor_magma_libs="-lmagma"
      ;;

    mkl)
      if test "${MKLROOT}" = ""; then
        as_fn_error $? "MKLROOT is not set, which means that MKL is not
                  properly configured" "$LINENO" 5
      fi
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      case "${sd_fc_vendor}" in
        gnu)
          sd_linalg_vendor_cppflags="-I${MKLROOT}/include"
          sd_linalg_vendor_cflags="-m64"
          sd_linalg_vendor_cxxflags="-m64"
          sd_linalg_vendor_fcflags="-m64 -I${MKLROOT}/include"
          sd_linalg_vendor_blas_libs="-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl"
          if test "${sd_mpi_enable}" = "yes"; then
            sd_linalg_vendor_blas_libs="-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_scalapack_lp64 -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lmkl_blacs_intelmpi_lp64 -lpthread -lm -ldl"
          fi
          ;;
        intel)
          sd_linalg_vendor_cppflags="-I${MKLROOT}/include"
          sd_linalg_vendor_fcflags="-I${MKLROOT}/include"
          if test "${sd_mpi_enable}" = "yes"; then
            sd_linalg_vendor_ldflags="-qmkl=cluster"
          else
            sd_linalg_vendor_ldflags="-qmkl"
          fi
          ;;
        *)
          as_fn_error $? "MKL is only supported with GNU and Intel compilers" "$LINENO" 5
          ;;
      esac
      ;;

    netlib)
      sd_linalg_vendor_provided="blas lapack lapacke blacs scalapack"
      sd_linalg_vendor_blas_libs="-lblas"
      sd_linalg_vendor_lapack_libs="-llapack"
      sd_linalg_vendor_lapacke_libs="-llapacke"
      sd_linalg_vendor_blacs_libs="-lblacs -lblacsCinit -lblacsF77init"
      sd_linalg_vendor_scalapack_libs="-lscalapack"
      ;;

    nvpl)
      sd_linalg_vendor_provided="blas lapack scalapack"
      sd_linalg_vendor_blas_libs="-Mnvpl=blas"
      sd_linalg_vendor_lapack_libs="-Mnvpl=lapack"
      sd_linalg_vendor_scalapack_libs="-Mscalapack"
      ;;

    openblas)
      sd_linalg_vendor_provided="blas"
      sd_linalg_vendor_blas_libs="-lopenblas -lpthread"
      ;;

    plasma)
      sd_linalg_vendor_provided="plasma"
      sd_linalg_vendor_plasma_libs="-lplasma -lcorelapack -lcoreblas"
      ;;

    *)
      as_fn_error $? "no library settings for linear algebra flavor '${tmp_linalg_vendor}'" "$LINENO" 5
      ;;

  esac


      # Look for PLASMA
      tmp_linalg_plasma_proceed=`echo "${sd_linalg_vendor_provided}" | grep "plasma"`
      if test "${tmp_linalg_plasma_proceed}" != "" -a \
              "${sd_linalg_serial_ok}" = "yes" -a \
              "${sd_linalg_has_plasma}" != "yes"; then

        { $as_echo "$as_me:${as_lineno-$LINENO}: checking ${tmp_linalg_vendor} libraries for PLASMA" >&5
$as_echo_n "checking ${tmp_linalg_vendor} libraries for PLASMA... " >&6; }
        if test "${sd_linalg_vendor_plasma_libs}" = ""; then
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: none required" >&5
$as_echo "none required" >&6; }
        else
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_vendor_plasma_libs}" >&5
$as_echo "${sd_linalg_vendor_plasma_libs}" >&6; }
          LIBS="${sd_linalg_vendor_plasma_libs} ${LIBS}"
        fi

  sd_linalg_has_plasma="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PLASMA support in the specified libraries" >&5
$as_echo_n "checking for PLASMA support in the specified libraries... " >&6; }
  sd_linalg_chk_plasma="${sd_linalg_has_lapacke}"
  if test "${sd_linalg_chk_plasma}" = "yes"; then
    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

    cat > conftest.$ac_ext <<_ACEOF
      program main

        use plasma
        call plasma_zhegv

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_plasma="yes"; sd_linalg_provided="${sd_linalg_provided} plasma"
else
  sd_linalg_has_plasma="no"
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

  else
    sd_linalg_has_plasma="no"
  fi
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_plasma}" >&5
$as_echo "${sd_linalg_has_plasma}" >&6; }

  if test "${sd_linalg_has_plasma}" = "yes"; then

$as_echo "#define HAVE_LINALG_PLASMA 1" >>confdefs.h

  fi

        if test "${sd_linalg_has_plasma}" = "yes"; then
          sd_linalg_flavor="${sd_linalg_flavor}+${tmp_linalg_vendor}"
          sd_linalg_plasma_vendor="${tmp_linalg_vendor}"
          sd_linalg_provided="${sd_linalg_provided} plasma"
          test "${sd_linalg_vendor_cppflags}" != "" && \
            sd_linalg_cppflags="${sd_linalg_cppflags} ${sd_linalg_vendor_cppflags}"
          test "${sd_linalg_vendor_cflags}" != "" && \
            sd_linalg_cflags="${sd_linalg_cflags} ${sd_linalg_vendor_cflags}"
          test "${sd_linalg_vendor_cxxflags}" != "" && \
            sd_linalg_cxxflags="${sd_linalg_cxxflags} ${sd_linalg_vendor_cxxflags}"
          test "${sd_linalg_vendor_fcflags}" != "" && \
            sd_linalg_fcflags="${sd_linalg_fcflags} ${sd_linalg_vendor_fcflags}"
          test "${sd_linalg_vendor_ldflags}" != "" && \
            sd_linalg_ldflags="${sd_linalg_ldflags} ${sd_linalg_vendor_ldflags}"
          test "${sd_linalg_vendor_plasma_libs}" != "" && \
              sd_linalg_libs="${sd_linalg_vendor_plasma_libs} ${sd_linalg_libs}"
          break
        fi
      fi

      # Look for BLACS
      tmp_linalg_blacs_proceed=`echo "${sd_linalg_vendor_provided}" | grep "blacs"`
      if test "${tmp_linalg_blacs_proceed}" != "" -a \
              "${sd_linalg_serial_ok}" = "yes" -a \
              "${sd_linalg_has_blacs}" != "yes"; then

        { $as_echo "$as_me:${as_lineno-$LINENO}: checking ${tmp_linalg_vendor} libraries for BLACS" >&5
$as_echo_n "checking ${tmp_linalg_vendor} libraries for BLACS... " >&6; }
        if test "${sd_linalg_vendor_blacs_libs}" = ""; then
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: none required" >&5
$as_echo "none required" >&6; }
        else
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_vendor_blacs_libs}" >&5
$as_echo "${sd_linalg_vendor_blacs_libs}" >&6; }
          LIBS="${sd_linalg_vendor_blacs_libs} ${LIBS}"
        fi

  sd_linalg_has_blacs="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BLACS support in the specified libraries" >&5
$as_echo_n "checking for BLACS support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call blacs_gridinit

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_blacs="yes"; sd_linalg_provided="${sd_linalg_provided} blacs"
else
  sd_linalg_has_blacs="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_blacs}" >&5
$as_echo "${sd_linalg_has_blacs}" >&6; }

        if test "${sd_linalg_has_blacs}" = "yes"; then
          sd_linalg_flavor="${sd_linalg_flavor}+${tmp_linalg_vendor}"
          sd_linalg_blacs_vendor="${tmp_linalg_vendor}"
          sd_linalg_provided="${sd_linalg_provided} blacs"
          if test "${sd_linalg_blacs_vendor}" != "${sd_linalg_lapack_vendor}"; then
            test "${sd_linalg_vendor_cppflags}" != "" && \
              sd_linalg_cppflags="${sd_linalg_cppflags} ${sd_linalg_vendor_cppflags}"
            test "${sd_linalg_vendor_cflags}" != "" && \
              sd_linalg_cflags="${sd_linalg_cflags} ${sd_linalg_vendor_cflags}"
            test "${sd_linalg_vendor_cxxflags}" != "" && \
              sd_linalg_cxxflags="${sd_linalg_cxxflags} ${sd_linalg_vendor_cxxflags}"
            test "${sd_linalg_vendor_fcflags}" != "" && \
              sd_linalg_fcflags="${sd_linalg_fcflags} ${sd_linalg_vendor_fcflags}"
            test "${sd_linalg_vendor_ldflags}" != "" && \
              sd_linalg_ldflags="${sd_linalg_ldflags} ${sd_linalg_vendor_ldflags}"
          fi
          test "${sd_linalg_vendor_blacs_libs}" != "" && \
              sd_linalg_libs="${sd_linalg_vendor_blacs_libs} ${sd_linalg_libs}"
        fi
      fi

      # Look for ScaLAPACK
      tmp_linalg_scalapack_proceed=`echo "${sd_linalg_vendor_provided}" | grep "scalapack"`
      if test "${tmp_linalg_scalapack_proceed}" != "" -a \
              "${sd_linalg_serial_ok}" = "yes" -a \
              "${sd_linalg_has_scalapack}" != "yes"; then

        { $as_echo "$as_me:${as_lineno-$LINENO}: checking ${tmp_linalg_vendor} libraries for ScaLAPACK" >&5
$as_echo_n "checking ${tmp_linalg_vendor} libraries for ScaLAPACK... " >&6; }
        if test "${sd_linalg_vendor_scalapack_libs}" = ""; then
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: none required" >&5
$as_echo "none required" >&6; }
        else
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_vendor_scalapack_libs}" >&5
$as_echo "${sd_linalg_vendor_scalapack_libs}" >&6; }
          LIBS="${sd_linalg_vendor_scalapack_libs} ${LIBS}"
        fi

  sd_linalg_has_scalapack="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ScaLAPACK support in the specified libraries" >&5
$as_echo_n "checking for ScaLAPACK support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call pzheevx

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_scalapack="yes"; sd_linalg_provided="${sd_linalg_provided} scalapack"
else
  sd_linalg_has_scalapack="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_scalapack}" >&5
$as_echo "${sd_linalg_has_scalapack}" >&6; }

  if test "${sd_linalg_has_scalapack}" = "yes"; then

$as_echo "#define HAVE_LINALG_SCALAPACK 1" >>confdefs.h

  fi

        if test "${sd_linalg_has_scalapack}" = "yes"; then
          sd_linalg_flavor="${sd_linalg_flavor}+${tmp_linalg_vendor}"
          sd_linalg_scalapack_vendor="${tmp_linalg_vendor}"
          sd_linalg_provided="${sd_linalg_provided} scalapack"
          if test "${sd_linalg_scalapack_vendor}" != "${sd_linalg_blacs_vendor}"; then
            test "${sd_linalg_vendor_cppflags}" != "" && \
              sd_linalg_cppflags="${sd_linalg_cppflags} ${sd_linalg_vendor_cppflags}"
            test "${sd_linalg_vendor_cflags}" != "" && \
              sd_linalg_cflags="${sd_linalg_cflags} ${sd_linalg_vendor_cflags}"
            test "${sd_linalg_vendor_cxxflags}" != "" && \
              sd_linalg_cxxflags="${sd_linalg_cxxflags} ${sd_linalg_vendor_cxxflags}"
            test "${sd_linalg_vendor_fcflags}" != "" && \
              sd_linalg_fcflags="${sd_linalg_fcflags} ${sd_linalg_vendor_fcflags}"
            test "${sd_linalg_vendor_ldflags}" != "" && \
              sd_linalg_ldflags="${sd_linalg_ldflags} ${sd_linalg_vendor_ldflags}"
          fi
          test "${sd_linalg_vendor_scalapack_libs}" != "" && \
              sd_linalg_libs="${sd_linalg_vendor_scalapack_libs} ${sd_linalg_libs}"
          break
        fi
      fi

    done
  fi   # sd_mpi_enable = yes

  # Checkpoint: validate the MPI linear algebra support
  if test "${sd_mpi_enable}" = "yes"; then
    if test \( "${sd_linalg_has_blacs}" = "yes" -a \
               "${sd_linalg_has_scalapack}" = "yes" \) -o \
               "${sd_linalg_has_plasma}" = "yes"; then
      sd_linalg_mpi_ok="yes"
    else
      sd_linalg_mpi_ok="no"
    fi
  fi

  # Look for MPI acceleration linear algebra support
  if test "${sd_linalg_mpi_ok}" = "yes"; then
    for tmp_linalg_vendor in ${sd_linalg_chk_mpiacc}; do

      # Configure vendor libraries

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"

      CPPFLAGS="${CPPFLAGS} ${sd_mpi_cppflags} ${sd_linalg_cppflags}"
      CFLAGS="${CFLAGS} ${sd_mpi_cflags} ${sd_linalg_cflags}"
      CXXFLAGS="${CXXFLAGS} ${sd_mpi_cxxflags} ${sd_linalg_cxxflags}"
      FCFLAGS="${FCFLAGS} ${sd_mpi_fcflags} ${sd_linalg_fcflags}"
      LDFLAGS="${LDFLAGS} ${sd_mpi_ldflags} ${sd_linalg_ldflags}"
      LIBS="${sd_linalg_libs} ${sd_mpi_libs} ${LIBS}"

  # Reset components
  sd_linalg_vendor_provided=""
  sd_linalg_vendor_cppflags=""
  sd_linalg_vendor_cflags=""
  sd_linalg_vendor_cxxflags=""
  sd_linalg_vendor_fcflags=""
  sd_linalg_vendor_ldflags=""
  sd_linalg_vendor_blacs_libs=""
  sd_linalg_vendor_blacs_prqs=""
  sd_linalg_vendor_blas_libs=""
  sd_linalg_vendor_blas_prqs=""
  sd_linalg_vendor_lapack_libs=""
  sd_linalg_vendor_lapack_prqs=""
  sd_linalg_vendor_lapacke_libs=""
  sd_linalg_vendor_lapacke_prqs=""
  sd_linalg_vendor_scalapack_libs=""
  sd_linalg_vendor_scalapack_prqs=""
  sd_linalg_vendor_elpa_libs=""
  sd_linalg_vendor_elpa_prqs=""
  sd_linalg_vendor_magma_libs=""
  sd_linalg_vendor_magma_prqs=""
  sd_linalg_vendor_plasma_libs=""
  sd_linalg_vendor_plasma_prqs=""

  # Update components according to specified vendor
  case "${tmp_linalg_vendor}" in

    acml)
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      sd_linalg_vendor_blas_libs="-lacml -lacml_mv"
      ;;

    aocl|AOCL)
      sd_linalg_vendor_provided="blas lapack scalapack"
      if test "${sd_openmp_enable}" = "yes"; then
        sd_linalg_vendor_blas_libs="-lblis-mt"
      else
        sd_linalg_vendor_blas_libs="-lblis"
      fi
      sd_linalg_vendor_lapack_libs="-lflame"
      sd_linalg_vendor_scalapack_libs="-lscalapack"
      ;;

    asl)
      sd_linalg_vendor_provided="blas lapack lapacke blacs scalapack"
      sd_linalg_vendor_blas_libs="-lasl"
      ;;

    atlas)
      sd_linalg_vendor_provided="blas"
      sd_linalg_vendor_blas_libs="-lf77blas -lcblas -latlas"
      ;;

    debian-mpich)
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      sd_linalg_vendor_blas_libs="-lblas"
      sd_linalg_vendor_lapack_libs="-llapack"
      sd_linalg_vendor_blacs_libs="-lblacs-mpich -lblacsCinit-mpich -lblacsF77init-mpich"
      sd_linalg_vendor_scalapack_libs="-lscalapack-mpich"
      ;;

    debian-openmpi)
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      sd_linalg_vendor_blas_libs="-lblas"
      sd_linalg_vendor_lapack_libs="-llapack"
      sd_linalg_vendor_blacs_libs="-lblacs-openmpi -lblacsCinit-openmpi -lblacsF77init-openmpi"
      sd_linalg_vendor_scalapack_libs="-lscalapack-openmpi"
      ;;

    easybuild)
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      sd_linalg_vendor_blas_libs="-lopenblas"
      sd_linalg_vendor_blacs_libs="-lscalapack"
      ;;

    elpa)
      sd_linalg_vendor_provided="elpa"
      sd_linalg_vendor_elpa_libs="-lelpa"
      ;;

    essl)
      sd_linalg_vendor_provided="blas lapack lapacke blacs scalapack"
      sd_linalg_vendor_cflags="-qessl"
      sd_linalg_vendor_cxxflags="-qessl"
      sd_linalg_vendor_fcflags="-qessl"
      sd_linalg_vendor_ldflags="-qessl"
      sd_linalg_vendor_blas_libs="-lessl"
      ;;

    magma)
      sd_linalg_vendor_provided="magma"
      sd_linalg_vendor_magma_libs="-lmagma"
      ;;

    mkl)
      if test "${MKLROOT}" = ""; then
        as_fn_error $? "MKLROOT is not set, which means that MKL is not
                  properly configured" "$LINENO" 5
      fi
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      case "${sd_fc_vendor}" in
        gnu)
          sd_linalg_vendor_cppflags="-I${MKLROOT}/include"
          sd_linalg_vendor_cflags="-m64"
          sd_linalg_vendor_cxxflags="-m64"
          sd_linalg_vendor_fcflags="-m64 -I${MKLROOT}/include"
          sd_linalg_vendor_blas_libs="-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl"
          if test "${sd_mpi_enable}" = "yes"; then
            sd_linalg_vendor_blas_libs="-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_scalapack_lp64 -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lmkl_blacs_intelmpi_lp64 -lpthread -lm -ldl"
          fi
          ;;
        intel)
          sd_linalg_vendor_cppflags="-I${MKLROOT}/include"
          sd_linalg_vendor_fcflags="-I${MKLROOT}/include"
          if test "${sd_mpi_enable}" = "yes"; then
            sd_linalg_vendor_ldflags="-qmkl=cluster"
          else
            sd_linalg_vendor_ldflags="-qmkl"
          fi
          ;;
        *)
          as_fn_error $? "MKL is only supported with GNU and Intel compilers" "$LINENO" 5
          ;;
      esac
      ;;

    netlib)
      sd_linalg_vendor_provided="blas lapack lapacke blacs scalapack"
      sd_linalg_vendor_blas_libs="-lblas"
      sd_linalg_vendor_lapack_libs="-llapack"
      sd_linalg_vendor_lapacke_libs="-llapacke"
      sd_linalg_vendor_blacs_libs="-lblacs -lblacsCinit -lblacsF77init"
      sd_linalg_vendor_scalapack_libs="-lscalapack"
      ;;

    nvpl)
      sd_linalg_vendor_provided="blas lapack scalapack"
      sd_linalg_vendor_blas_libs="-Mnvpl=blas"
      sd_linalg_vendor_lapack_libs="-Mnvpl=lapack"
      sd_linalg_vendor_scalapack_libs="-Mscalapack"
      ;;

    openblas)
      sd_linalg_vendor_provided="blas"
      sd_linalg_vendor_blas_libs="-lopenblas -lpthread"
      ;;

    plasma)
      sd_linalg_vendor_provided="plasma"
      sd_linalg_vendor_plasma_libs="-lplasma -lcorelapack -lcoreblas"
      ;;

    *)
      as_fn_error $? "no library settings for linear algebra flavor '${tmp_linalg_vendor}'" "$LINENO" 5
      ;;

  esac


      # Look for ELPA
      tmp_linalg_elpa_proceed=`echo "${sd_linalg_vendor_provided}" | grep "elpa"`
      if test "${tmp_linalg_elpa_proceed}" != "" -a \
              "${sd_linalg_has_elpa}" != "yes"; then

        { $as_echo "$as_me:${as_lineno-$LINENO}: checking ${tmp_linalg_vendor} libraries for ELPA" >&5
$as_echo_n "checking ${tmp_linalg_vendor} libraries for ELPA... " >&6; }
        if test "${sd_linalg_vendor_elpa_libs}" = ""; then
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: none required" >&5
$as_echo "none required" >&6; }
        else
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_vendor_elpa_libs}" >&5
$as_echo "${sd_linalg_vendor_elpa_libs}" >&6; }
          LIBS="${sd_linalg_vendor_elpa_libs} ${LIBS}"
        fi

  sd_linalg_has_elpa="unknown"
  sd_linalg_has_elpa_f2008="unknown"
  sd_linalg_has_elpa_legacy="unknown"


  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELPA support in the specified libraries" >&5
$as_echo_n "checking for ELPA support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use elpa
      class(elpa_t),pointer :: e
      integer :: comm,err
      call e%set('mpi_comm_parent',comm,err)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_f2008="yes";sd_linalg_has_elpa="yes"
else
  sd_linalg_has_elpa_f2008="no"
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
  if test "${sd_linalg_has_elpa_f2008}" = "no"; then
    cat > conftest.$ac_ext <<_ACEOF
      program main

        use elpa1
        integer,parameter :: nrow=1,ncol=1,comm=1
        integer :: comm_r,comm_c,success
        success=get_elpa_row_col_comms(comm,nrow,ncol,comm_r,comm_c)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_legacy="yes";sd_linalg_has_elpa="yes"
else
  sd_linalg_has_elpa_legacy="unknown"
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
    if test "${sd_linalg_has_elpa_legacy}" != "yes"; then
      cat > conftest.$ac_ext <<_ACEOF
      program main

          use elpa1
          integer,parameter :: nrow=1,ncol=1,comm=1
          integer :: comm_r,comm_c
          call get_elpa_row_col_comms(comm,nrow,ncol,comm_r,comm_c)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_legacy="yes";sd_linalg_has_elpa="yes"
else
  sd_linalg_has_elpa_legacy="no" ;sd_linalg_has_elpa="no"
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
    fi
  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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_elpa}" >&5
$as_echo "${sd_linalg_has_elpa}" >&6; }

  if test "${sd_linalg_has_elpa}" = "yes"; then
    # ===== New API
    if test "${sd_linalg_has_elpa_f2008}" = "yes"; then

  sd_linalg_has_elpa_2017_f2008="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELPA 2017+ Fortran2008 API support in the specified libraries" >&5
$as_echo_n "checking for ELPA 2017+ Fortran2008 API support in the specified libraries... " >&6; }

  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use elpa
      class(elpa_t),pointer :: e
      integer,parameter :: na=1,ncol=1,nrow=1
      integer :: comm,err
      character*1 :: u
      real*8 :: ar(ncol,nrow),ev(na),qr(ncol,nrow)
      call e%set('mpi_comm_parent',comm,err)
      call e%eigenvectors(ar,ev,qr,err)
      call e%cholesky(ar,err)
      call e%invert_triangular(ar,err)
      call e%hermitian_multiply(u,u,na,ar,ar,nrow,ncol,qr,nrow,ncol,err)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_2017_f2008="yes"
else
  sd_linalg_has_elpa_2017_f2008="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_elpa_2017_f2008}" >&5
$as_echo "${sd_linalg_has_elpa_2017_f2008}" >&6; }

  if test "${sd_linalg_has_elpa_2017_f2008}" = "yes"; then

$as_echo "#define HAVE_LINALG_ELPA_2017 1" >>confdefs.h

  fi

      if test "${sd_linalg_has_elpa_2017_f2008}" != "yes"; then
        sd_linalg_has_elpa="no"
      fi
    # ===== Old API
    else

  sd_linalg_has_elpa_2017_legacy="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELPA 2017+ legacy API support in the specified libraries" >&5
$as_echo_n "checking for ELPA 2017+ legacy API support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use elpa1
      integer, parameter :: na=1,ldq=1,nev=1,nblk=1,ncb=1,nrow=1,ncol=1,comm=1
      integer :: comm_r,comm_c,err
      logical :: ok,debug
      real*8 :: ar(ncol,nrow),ev(na),qr(ldq,nrow)
      complex*16 :: ac(ncol,nrow),bc(ncol,nrow),cc(ncol,nrow)
      character*1 :: u
      err=elpa_get_communicators(comm,nrow,ncol,comm_r,comm_c)
      ok=elpa_solve_evp_real_1stage_double(na,nev,ar,nrow,ev,qr,nrow,nblk,ncol,comm_r,comm_c,comm,debug)
      ok=elpa_cholesky_complex_double(na,ac,nrow,nblk,local_ncol,comm_r,comm_c,debug)
      ok=elpa_invert_trm_real_double(na,ar,nrow,nblk,ncol,comm_r,comm_c,debug)
      ok=elpa_mult_ah_b_complex_double(u,u,na,ncb,ac,nrow,ncol,bc,nrow,ncol,nblk,comm_r,comm_c,cc,nrow,ncol)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_2017_legacy="yes"
else
  sd_linalg_has_elpa_2017_legacy="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_elpa_2017_legacy}" >&5
$as_echo "${sd_linalg_has_elpa_2017_legacy}" >&6; }

  if test "${sd_linalg_has_elpa_2017_legacy}" = "yes"; then

$as_echo "#define HAVE_LINALG_ELPA_2017 1" >>confdefs.h

  fi

      if test "${sd_linalg_has_elpa_2017_legacy}" != "yes"; then

  sd_linalg_has_elpa_2016="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELPA 2016 API support in the specified libraries" >&5
$as_echo_n "checking for ELPA 2016 API support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use elpa1
      integer, parameter :: na=1,ldq=1,nev=1,nblk=1,ncb=1,nrow=1,ncol=1,comm=1
      integer :: comm_r,comm_c,err
      logical :: ok,debug
      real*8 :: ar(ncol,nrow),ev(na),qr(ldq,nrow)
      complex*16 :: ac(ncol,nrow),bc(ncol,nrow),cc(ncol,nrow)
      character*1 :: u
      err=elpa_get_communicators(comm,nrow,ncol,comm_r,comm_c)
      ok=elpa_solve_evp_real_1stage(na,nev,ar,nrow,ev,qr,nrow,nblk,ncol,comm_r,comm_c)
      ok=elpa_cholesky_complex(na,ac,nrow,nblk,local_ncol,comm_r,comm_c,debug)
      ok=elpa_invert_trm_real(na,ar,nrow,nblk,ncol,comm_r,comm_c,debug)
      ok=elpa_mult_ah_b_complex(u,u,na,ncb,ac,nrow,ncol,bc,nrow,ncol,nblk,comm_r,comm_c,cc,nrow,ncol)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_2016="yes"
else
  sd_linalg_has_elpa_2016="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_elpa_2016}" >&5
$as_echo "${sd_linalg_has_elpa_2016}" >&6; }

  if test "${sd_linalg_has_elpa_2016}" = "yes"; then

$as_echo "#define HAVE_LINALG_ELPA_2016 1" >>confdefs.h

  fi

        if test "${sd_linalg_has_elpa_2016}" != "yes"; then

  sd_linalg_has_elpa_2015_11="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELPA 2015.11 API support in the specified libraries" >&5
$as_echo_n "checking for ELPA 2015.11 API support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use elpa1
      integer, parameter :: na=1,ldq=1,nev=1,nblk=1,ncb=1,nrow=1,ncol=1,comm=1
      integer :: comm_r,comm_c,err
      logical :: ok,debug
      real*8 :: ar(ncol,nrow),ev(na),qr(ldq,nrow)
      complex*16 :: ac(ncol,nrow),bc(ncol,nrow),cc(ncol,nrow)
      character*1 :: u
      err=get_elpa_row_col_comms(comm,nrow,ncol,comm_r,comm_c)
      ok=solve_evp_real(na,nev,ar,nrow,ev,qr,nrow,nblk,ncol,comm_r,comm_c)
      call cholesky_complex(na,ac,nrow,nblk,ncol,comm_r,comm_c,debug,ok)
      call invert_trm_real(na,ar,nrow,nblk,ncol,comm_r,comm_c,debug,ok)
      call mult_ah_b_complex(u,u,na,ncb,ac,nrow,bc,nrow,nblk,comm_r,comm_c,cc,nrow)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_2015_11="yes"
else
  sd_linalg_has_elpa_2015_11="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_elpa_2015_11}" >&5
$as_echo "${sd_linalg_has_elpa_2015_11}" >&6; }

  if test "${sd_linalg_has_elpa_2015_11}" = "yes"; then

$as_echo "#define HAVE_LINALG_ELPA_2015_11 1" >>confdefs.h

  fi

          if test "${sd_linalg_has_elpa_2015_11}" != "yes"; then

  sd_linalg_has_elpa_2015_02="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELPA 2015.02 API support in the specified libraries" >&5
$as_echo_n "checking for ELPA 2015.02 API support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use elpa1
      integer, parameter :: na=1,ldq=1,nev=1,nblk=1,ncb=1,nrow=1,ncol=1,comm=1
      integer :: comm_r,comm_c,err
      logical :: ok,debug
      real*8 :: ar(ncol,nrow),ev(na),qr(ldq,nrow)
      complex*16 :: ac(ncol,nrow),bc(ncol,nrow),cc(ncol,nrow)
      character*1 :: u
      err=get_elpa_row_col_comms(comm,nrow,ncol,comm_r,comm_c)
      ok=solve_evp_real(na,nev,ar,nrow,ev,qr,nrow,nblk,comm_r,comm_c)
      call cholesky_complex(na,ac,nrow,nblk,comm_r,comm_c,debug,ok)
      call invert_trm_real(na,ar,nrow,nblk,comm_r,comm_c,debug,ok)
      call mult_ah_b_complex(u,u,na,ncb,ac,nrow,bc,nrow,nblk,comm_r,comm_c,cc,nrow)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_2015_02="yes"
else
  sd_linalg_has_elpa_2015_02="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_elpa_2015_02}" >&5
$as_echo "${sd_linalg_has_elpa_2015_02}" >&6; }

  if test "${sd_linalg_has_elpa_2015_02}" = "yes"; then

$as_echo "#define HAVE_LINALG_ELPA_2015_02 1" >>confdefs.h

  fi

            if test "${sd_linalg_has_elpa_2015_02}" != "yes"; then

  sd_linalg_has_elpa_2014="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELPA 2014 API support in the specified libraries" >&5
$as_echo_n "checking for ELPA 2014 API support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use elpa1
      integer, parameter :: na=1,ldq=1,nev=1,nblk=1,ncb=1,nrow=1,ncol=1,comm=1
      integer :: comm_r,comm_c,err
      logical :: ok
      real*8 :: ar(ncol,nrow),ev(na),qr(ldq,nrow)
      complex*16 :: ac(ncol,nrow),bc(ncol,nrow),cc(ncol,nrow)
      character*1 :: u
      call get_elpa_row_col_comms(comm,nrow,ncol,comm_r,comm_c)
      ok=solve_evp_real(na,nev,ar,nrow,ev,qr,nrow,nblk,comm_r,comm_c)
      call cholesky_complex(na,ac,nrow,nblk,comm_r,comm_c,ok)
      call invert_trm_real(na,ar,nrow,nblk,comm_r,comm_c,ok)
      call mult_ah_b_complex(u,u,na,ncb,ac,nrow,bc,nrow,nblk,comm_r,comm_c,cc,nrow)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_2014="yes"
else
  sd_linalg_has_elpa_2014="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_elpa_2014}" >&5
$as_echo "${sd_linalg_has_elpa_2014}" >&6; }

  if test "${sd_linalg_has_elpa_2014}" = "yes"; then

$as_echo "#define HAVE_LINALG_ELPA_2014 1" >>confdefs.h

  fi

              if test "${sd_linalg_has_elpa_2014}" != "yes"; then

  sd_linalg_has_elpa_2013="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELPA 2011-13 API support in the specified libraries" >&5
$as_echo_n "checking for ELPA 2011-13 API support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use elpa1
      integer, parameter :: na=1,ldq=1,nev=1,nblk=1,ncb=1,nrow=1,ncol=1,comm=1
      integer :: comm_r,comm_c,err
      real*8 :: ar(ncol,nrow),ev(na),qr(ldq,nrow)
      complex*16 :: ac(ncol,nrow),bc(ncol,nrow),cc(ncol,nrow)
      character*1 :: u
      call get_elpa_row_col_comms(comm,nrow,ncol,comm_r,comm_c)
      call solve_evp_real(na,nev,ar,nrow,ev,qr,nrow,nblk,comm_r,comm_c)
      call cholesky_complex(na,ac,nrow,nblk,comm_r,comm_c)
      call invert_trm_real(na,ar,nrow,nblk,comm_r,comm_c)
      call mult_ah_b_complex(u,u,na,ncb,ac,nrow,bc,nrow,nblk,comm_r,comm_c,cc,nrow)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_2013="yes"
else
  sd_linalg_has_elpa_2013="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_elpa_2013}" >&5
$as_echo "${sd_linalg_has_elpa_2013}" >&6; }

  if test "${sd_linalg_has_elpa_2013}" = "yes"; then

$as_echo "#define HAVE_LINALG_ELPA_2013 1" >>confdefs.h

  fi

                if test "${sd_linalg_has_elpa_2013}" != "yes"; then
                  sd_linalg_has_elpa="no"
                fi
              fi
            fi
          fi
        fi
      fi
    fi
  fi

  if test "${sd_linalg_has_elpa}" = "yes"; then
    sd_linalg_provided="${sd_linalg_provided} elpa"

$as_echo "#define HAVE_LINALG_ELPA 1" >>confdefs.h

    if test "${sd_linalg_has_elpa_f2008}" = "yes"; then

$as_echo "#define HAVE_LINALG_ELPA_FORTRAN2008 1" >>confdefs.h

    fi
  fi

  if test "${sd_linalg_has_elpa}" != "yes"; then
     sd_linalg_has_elpa="no"
  fi


        if test "${sd_linalg_has_elpa}" = "yes"; then
          sd_linalg_flavor="${sd_linalg_flavor}+${tmp_linalg_vendor}"
          sd_linalg_elpa_vendor="${tmp_linalg_vendor}"
          sd_linalg_provided="${sd_linalg_provided} elpa"
          test "${sd_linalg_vendor_cppflags}" != "" && \
            sd_linalg_cppflags="${sd_linalg_cppflags} ${sd_linalg_vendor_cppflags}"
          test "${sd_linalg_vendor_cflags}" != "" && \
            sd_linalg_cflags="${sd_linalg_cflags} ${sd_linalg_vendor_cflags}"
          test "${sd_linalg_vendor_cxxflags}" != "" && \
            sd_linalg_cxxflags="${sd_linalg_cxxflags} ${sd_linalg_vendor_cxxflags}"
          test "${sd_linalg_vendor_fcflags}" != "" && \
            sd_linalg_fcflags="${sd_linalg_fcflags} ${sd_linalg_vendor_fcflags}"
          test "${sd_linalg_vendor_ldflags}" != "" && \
            sd_linalg_ldflags="${sd_linalg_ldflags} ${sd_linalg_vendor_ldflags}"
          test "${sd_linalg_vendor_elpa_libs}" != "" && \
              sd_linalg_libs="${sd_linalg_vendor_elpa_libs} ${sd_linalg_libs}"
          break
        fi
      fi

    done
  fi   # sd_linalg_mpi_ok = yes

  # Checkpoint: validate the MPI acceleration linear algebra support
  if test "${sd_mpi_enable}" = "yes"; then
    if test "${sd_linalg_has_elpa}" = "yes"; then
      sd_linalg_mpiacc_ok="yes"
    else
      sd_linalg_mpiacc_ok="no"
    fi
  fi

  # FIXME: Look for GPU linear algebra support
  if test "${sd_gpu_enable}" = "yes"; then
    for tmp_linalg_vendor in ${sd_linalg_chk_gpu}; do

      # Configure vendor libraries

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"

      CPPFLAGS="${CPPFLAGS} ${sd_mpi_cppflags} ${sd_gpu_cppflags} ${sd_linalg_cppflags}"
      CFLAGS="${CFLAGS} ${sd_mpi_cflags} ${sd_gpu_cflags} ${sd_linalg_cflags}"
      CXXFLAGS="${CXXFLAGS} ${sd_mpi_cxxflags} ${sd_gpu_cxxflags} ${sd_linalg_cxxflags}"
      FCFLAGS="${FCFLAGS} ${sd_mpi_fcflags} ${sd_gpu_fcflags} ${sd_linalg_fcflags}"
      LDFLAGS="${LDFLAGS} ${sd_mpi_ldflags} ${sd_gpu_ldflags} ${sd_linalg_ldflags}"
      LIBS="${sd_linalg_libs} ${sd_gpu_libs} ${sd_mpi_libs} ${LIBS}"

  # Reset components
  sd_linalg_vendor_provided=""
  sd_linalg_vendor_cppflags=""
  sd_linalg_vendor_cflags=""
  sd_linalg_vendor_cxxflags=""
  sd_linalg_vendor_fcflags=""
  sd_linalg_vendor_ldflags=""
  sd_linalg_vendor_blacs_libs=""
  sd_linalg_vendor_blacs_prqs=""
  sd_linalg_vendor_blas_libs=""
  sd_linalg_vendor_blas_prqs=""
  sd_linalg_vendor_lapack_libs=""
  sd_linalg_vendor_lapack_prqs=""
  sd_linalg_vendor_lapacke_libs=""
  sd_linalg_vendor_lapacke_prqs=""
  sd_linalg_vendor_scalapack_libs=""
  sd_linalg_vendor_scalapack_prqs=""
  sd_linalg_vendor_elpa_libs=""
  sd_linalg_vendor_elpa_prqs=""
  sd_linalg_vendor_magma_libs=""
  sd_linalg_vendor_magma_prqs=""
  sd_linalg_vendor_plasma_libs=""
  sd_linalg_vendor_plasma_prqs=""

  # Update components according to specified vendor
  case "${tmp_linalg_vendor}" in

    acml)
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      sd_linalg_vendor_blas_libs="-lacml -lacml_mv"
      ;;

    aocl|AOCL)
      sd_linalg_vendor_provided="blas lapack scalapack"
      if test "${sd_openmp_enable}" = "yes"; then
        sd_linalg_vendor_blas_libs="-lblis-mt"
      else
        sd_linalg_vendor_blas_libs="-lblis"
      fi
      sd_linalg_vendor_lapack_libs="-lflame"
      sd_linalg_vendor_scalapack_libs="-lscalapack"
      ;;

    asl)
      sd_linalg_vendor_provided="blas lapack lapacke blacs scalapack"
      sd_linalg_vendor_blas_libs="-lasl"
      ;;

    atlas)
      sd_linalg_vendor_provided="blas"
      sd_linalg_vendor_blas_libs="-lf77blas -lcblas -latlas"
      ;;

    debian-mpich)
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      sd_linalg_vendor_blas_libs="-lblas"
      sd_linalg_vendor_lapack_libs="-llapack"
      sd_linalg_vendor_blacs_libs="-lblacs-mpich -lblacsCinit-mpich -lblacsF77init-mpich"
      sd_linalg_vendor_scalapack_libs="-lscalapack-mpich"
      ;;

    debian-openmpi)
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      sd_linalg_vendor_blas_libs="-lblas"
      sd_linalg_vendor_lapack_libs="-llapack"
      sd_linalg_vendor_blacs_libs="-lblacs-openmpi -lblacsCinit-openmpi -lblacsF77init-openmpi"
      sd_linalg_vendor_scalapack_libs="-lscalapack-openmpi"
      ;;

    easybuild)
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      sd_linalg_vendor_blas_libs="-lopenblas"
      sd_linalg_vendor_blacs_libs="-lscalapack"
      ;;

    elpa)
      sd_linalg_vendor_provided="elpa"
      sd_linalg_vendor_elpa_libs="-lelpa"
      ;;

    essl)
      sd_linalg_vendor_provided="blas lapack lapacke blacs scalapack"
      sd_linalg_vendor_cflags="-qessl"
      sd_linalg_vendor_cxxflags="-qessl"
      sd_linalg_vendor_fcflags="-qessl"
      sd_linalg_vendor_ldflags="-qessl"
      sd_linalg_vendor_blas_libs="-lessl"
      ;;

    magma)
      sd_linalg_vendor_provided="magma"
      sd_linalg_vendor_magma_libs="-lmagma"
      ;;

    mkl)
      if test "${MKLROOT}" = ""; then
        as_fn_error $? "MKLROOT is not set, which means that MKL is not
                  properly configured" "$LINENO" 5
      fi
      sd_linalg_vendor_provided="blas lapack blacs scalapack"
      case "${sd_fc_vendor}" in
        gnu)
          sd_linalg_vendor_cppflags="-I${MKLROOT}/include"
          sd_linalg_vendor_cflags="-m64"
          sd_linalg_vendor_cxxflags="-m64"
          sd_linalg_vendor_fcflags="-m64 -I${MKLROOT}/include"
          sd_linalg_vendor_blas_libs="-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl"
          if test "${sd_mpi_enable}" = "yes"; then
            sd_linalg_vendor_blas_libs="-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_scalapack_lp64 -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lmkl_blacs_intelmpi_lp64 -lpthread -lm -ldl"
          fi
          ;;
        intel)
          sd_linalg_vendor_cppflags="-I${MKLROOT}/include"
          sd_linalg_vendor_fcflags="-I${MKLROOT}/include"
          if test "${sd_mpi_enable}" = "yes"; then
            sd_linalg_vendor_ldflags="-qmkl=cluster"
          else
            sd_linalg_vendor_ldflags="-qmkl"
          fi
          ;;
        *)
          as_fn_error $? "MKL is only supported with GNU and Intel compilers" "$LINENO" 5
          ;;
      esac
      ;;

    netlib)
      sd_linalg_vendor_provided="blas lapack lapacke blacs scalapack"
      sd_linalg_vendor_blas_libs="-lblas"
      sd_linalg_vendor_lapack_libs="-llapack"
      sd_linalg_vendor_lapacke_libs="-llapacke"
      sd_linalg_vendor_blacs_libs="-lblacs -lblacsCinit -lblacsF77init"
      sd_linalg_vendor_scalapack_libs="-lscalapack"
      ;;

    nvpl)
      sd_linalg_vendor_provided="blas lapack scalapack"
      sd_linalg_vendor_blas_libs="-Mnvpl=blas"
      sd_linalg_vendor_lapack_libs="-Mnvpl=lapack"
      sd_linalg_vendor_scalapack_libs="-Mscalapack"
      ;;

    openblas)
      sd_linalg_vendor_provided="blas"
      sd_linalg_vendor_blas_libs="-lopenblas -lpthread"
      ;;

    plasma)
      sd_linalg_vendor_provided="plasma"
      sd_linalg_vendor_plasma_libs="-lplasma -lcorelapack -lcoreblas"
      ;;

    *)
      as_fn_error $? "no library settings for linear algebra flavor '${tmp_linalg_vendor}'" "$LINENO" 5
      ;;

  esac


      # Look for MAGMA
      tmp_linalg_magma_proceed=`echo "${sd_linalg_vendor_provided}" | grep "magma"`
      if test "${tmp_linalg_magma_proceed}" != "" -a \
              "${sd_linalg_has_magma}" != "yes"; then

        { $as_echo "$as_me:${as_lineno-$LINENO}: checking ${tmp_linalg_vendor} libraries for MAGMA" >&5
$as_echo_n "checking ${tmp_linalg_vendor} libraries for MAGMA... " >&6; }
        if test "${sd_linalg_vendor_magma_libs}" = ""; then
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: none required" >&5
$as_echo "none required" >&6; }
        else
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_vendor_magma_libs}" >&5
$as_echo "${sd_linalg_vendor_magma_libs}" >&6; }
          LIBS="${sd_linalg_vendor_magma_libs} ${LIBS}"
        fi

  sd_linalg_has_magma_15="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAGMA (version>=1.1.0) support in the specified libraries" >&5
$as_echo_n "checking for MAGMA (version>=1.1.0) support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call magmaf_zhegvd

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_magma="yes"; sd_linalg_provided="${sd_linalg_provided} magma"
else
  sd_linalg_has_magma="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_magma}" >&5
$as_echo "${sd_linalg_has_magma}" >&6; }
  if test "${sd_linalg_has_magma}" = "yes"; then

$as_echo "#define HAVE_LINALG_MAGMA 1" >>confdefs.h


  sd_linalg_has_magma_15="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAGMA 1.5 support in the specified libraries" >&5
$as_echo_n "checking for MAGMA 1.5 support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call magmaf_init
      call magmaf_finalize

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_magma_15="yes"
else
  sd_linalg_has_magma_15="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_magma_15}" >&5
$as_echo "${sd_linalg_has_magma_15}" >&6; }

  if test "${sd_linalg_has_magma_15}" = "yes"; then

$as_echo "#define HAVE_LINALG_MAGMA_15 1" >>confdefs.h

  fi

  fi

        if test "${sd_linalg_has_magma}" = "yes"; then
          sd_linalg_flavor="${sd_linalg_flavor}+${tmp_linalg_vendor}"
          sd_linalg_magma_vendor="${tmp_linalg_vendor}"
          sd_linalg_provided="${sd_linalg_provided} magma"
          test "${sd_linalg_vendor_cppflags}" != "" && \
            sd_linalg_cppflags="${sd_linalg_cppflags} ${sd_linalg_vendor_cppflags}"
          test "${sd_linalg_vendor_cflags}" != "" && \
            sd_linalg_cflags="${sd_linalg_cflags} ${sd_linalg_vendor_cflags}"
          test "${sd_linalg_vendor_cxxflags}" != "" && \
            sd_linalg_cxxflags="${sd_linalg_cxxflags} ${sd_linalg_vendor_cxxflags}"
          test "${sd_linalg_vendor_fcflags}" != "" && \
            sd_linalg_fcflags="${sd_linalg_fcflags} ${sd_linalg_vendor_fcflags}"
          test "${sd_linalg_vendor_ldflags}" != "" && \
            sd_linalg_ldflags="${sd_linalg_ldflags} ${sd_linalg_vendor_ldflags}"
          test "${sd_linalg_vendor_magma_libs}" != "" && \
              sd_linalg_libs="${sd_linalg_vendor_magma_libs} ${sd_linalg_libs}"
          break
        fi
      fi

    done
  fi   # sd_linalg_mpi_ok = yes

  # Checkpoint: validate the GPU linear algebra support
  if test "${sd_linalg_has_magma}" = "yes"; then
    sd_linalg_gpu_ok="yes"
  else
    sd_linalg_gpu_ok="no"
  fi

  # Reformat linear algebra flavor
  tmp_linalg_iter=`echo "${sd_linalg_flavor}" | tr '+' '\n' | sort -u | awk '{printf " %s", $1} END{printf "\n"}'`
  sd_linalg_flavor=""
  for tmp_linalg_vendor in ${tmp_linalg_iter}; do
    if test "${sd_linalg_flavor}" = ""; then
      sd_linalg_flavor="${tmp_linalg_vendor}"
    else
      sd_linalg_flavor="${sd_linalg_flavor}+${tmp_linalg_vendor}"
    fi
  done

  # Clean-up

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"

  unset tmp_linalg_iter
  unset tmp_linalg_vendor

        ;;
      dir|env)
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: verify" >&5
$as_echo "verify" >&6; }

  # Init
  sd_linalg_has_blas="unknown"
  sd_linalg_has_lapack="unknown"
  sd_linalg_has_lapacke="unknown"
  sd_linalg_has_blacs="unknown"
  sd_linalg_has_scalapack="unknown"
  sd_linalg_has_buggy_zdot="unknown"
  sd_linalg_has_elpa="unknown"
  sd_linalg_has_elpa_2013="unknown"
  sd_linalg_has_elpa_2014="unknown"
  sd_linalg_has_elpa_2015_02="unknown"
  sd_linalg_has_elpa_2015_11="unknown"
  sd_linalg_has_elpa_2016="unknown"
  sd_linalg_has_elpa_2017="unknown"
  sd_linalg_has_plasma="unknown"
  sd_linalg_has_magma="unknown"
  sd_linalg_provided=""

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  CPPFLAGS="${CPPFLAGS} ${sd_linalg_cppflags}"
  CFLAGS="${CFLAGS} ${sd_linalg_cflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_linalg_cxxflags}"
  FCFLAGS="${FCFLAGS} ${sd_linalg_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_linalg_ldflags}"
  LIBS="${sd_linalg_libs} ${sd_gpu_libs} ${sd_mpi_libs} ${LIBS}"

  # BLAS?

  sd_linalg_has_blas="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BLAS support in the specified libraries" >&5
$as_echo_n "checking for BLAS support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call zgemm

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_blas="yes"; sd_linalg_provided="${sd_linalg_provided} blas"
else
  sd_linalg_has_blas="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_blas}" >&5
$as_echo "${sd_linalg_has_blas}" >&6; }


  # Buggy dot/norm BLAS functions ?

  sd_linalg_has_buggy_zdot="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for buggy dot/norm in the BLAS libraries" >&5
$as_echo_n "checking for buggy dot/norm in the BLAS libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  if test "$cross_compiling" = yes; 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 $? "cannot run test program while cross compiling
See \`config.log' for more details" "$LINENO" 5; }
else
  cat > conftest.$ac_ext <<_ACEOF
      program main

    real :: x(2)=[3.,4.], y(2)=[1.,1.]
    complex :: w(2)=[(4.,3.),(3.,4.)], z(2)=[(5.,6.),(7.,8.)]
    double complex :: zw(2)=[(4.d0,3.d0),(3.d0,4.d0)]
    double complex :: zz(2)=[(5.d0,6.d0),(7.d0,8.d0)]
    real, external :: sdot, sdsdot, snrm2, scasum
    complex, external :: cdotu, cdotc
    double complex, external :: zdotu, zdotc
    logical :: blas_ok =.true.
    if (abs(sdot(2,x,1,y,1)-real(7.0))>0.00001) blas_ok=.false.
    if (abs(sdsdot(2,0.0,x,1,y,1)-real(7.0))>0.00001) blas_ok=.false.
    if (abs(snrm2(2,x,1)-real(5.0))>0.00001) blas_ok=.false.
    if (abs(scasum(2,w,1)-real(14.0))>0.00001) blas_ok=.false.
    if (abs(real(cdotu(2,w,1,z,1))-real(-9.0))>0.00001) blas_ok=.false.
    if (abs(aimag(cdotu(2,w,1,z,1))-real(91.0))>0.00001) blas_ok=.false.
    if (abs(real(cdotc(2,w,1,z,1))-real(91.0))>0.00001) blas_ok=.false.
    if (abs(aimag(cdotc(2,w,1,z,1))-real(5.0))>0.00001) blas_ok=.false.
    if (abs(dble(zdotu(2,zw,1,zz,1))-dble(-9.0))>0.00001d0) blas_ok=.false.
    if (abs(aimag(zdotu(2,zw,1,zz,1))-dble(91.0))>0.00001d0) blas_ok=.false.
    if (abs(dble(zdotc(2,zw,1,zz,1))-dble(91.0))>0.00001d0) blas_ok=.false.
    if (abs(aimag(zdotc(2,zw,1,zz,1))-dble(5.0))>0.00001d0) blas_ok=.false.
    if (.not. blas_ok) stop 1

      end
_ACEOF
if ac_fn_fc_try_run "$LINENO"; then :
  sd_linalg_has_buggy_zdot="no"
else
  sd_linalg_has_buggy_zdot="yes"
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  conftest.$ac_objext conftest.beam conftest.$ac_ext
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_buggy_zdot}" >&5
$as_echo "${sd_linalg_has_buggy_zdot}" >&6; }



  # BLAS extensions?

  # AXPBY family?
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AXPBY support in the BLAS libraries" >&5
$as_echo_n "checking for AXPBY support in the BLAS libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call saxpby
      call daxpby
      call caxpby
      call zaxpby

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_axpby="yes"
else
  sd_linalg_has_axpby="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_axpby}" >&5
$as_echo "${sd_linalg_has_axpby}" >&6; }

  if test "${sd_linalg_has_axpby}" = "yes"; then

$as_echo "#define HAVE_LINALG_AXPBY 1" >>confdefs.h

  fi

  # gemm3m family
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GEMM3M in the BLAS libraries" >&5
$as_echo_n "checking for GEMM3M in the BLAS libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call cgemm3m
      call zgemm3m

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_gemm3m="yes"
else
  sd_linalg_has_gemm3m="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_gemm3m}" >&5
$as_echo "${sd_linalg_has_gemm3m}" >&6; }

  if test "${sd_linalg_has_gemm3m}" = "yes"; then

$as_echo "#define HAVE_LINALG_GEMM3M 1" >>confdefs.h

  fi

  # gemmt family
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GEMMT in the BLAS libraries" >&5
$as_echo_n "checking for GEMMT in the BLAS libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call sgemmt
      call dgemmt
      call cgemmt
      call zgemmt

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_gemmt="yes"
else
  sd_linalg_has_gemmt="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_gemmt}" >&5
$as_echo "${sd_linalg_has_gemmt}" >&6; }

  if test "${sd_linalg_has_gemmt}" = "yes"; then

$as_echo "#define HAVE_LINALG_GEMMT 1" >>confdefs.h

  fi



  # MKL BLAS extensions?

  # mkl_imatcopy family
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mkl_imatcopy in the specified libraries" >&5
$as_echo_n "checking for mkl_imatcopy in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call mkl_simatcopy
      call mkl_dimatcopy
      call mkl_cimatcopy
      call mkl_zimatcopy

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_mkl_has_imatcopy="yes"
else
  sd_linalg_mkl_has_imatcopy="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_mkl_has_imatcopy}" >&5
$as_echo "${sd_linalg_mkl_has_imatcopy}" >&6; }

  if test "${sd_linalg_mkl_has_imatcopy}" = "yes"; then

$as_echo "#define HAVE_LINALG_MKL_IMATCOPY 1" >>confdefs.h

  fi

  # mkl_omatcopy family
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mkl_omatcopy in the specified libraries" >&5
$as_echo_n "checking for mkl_omatcopy in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call mkl_somatcopy
      call mkl_domatcopy
      call mkl_comatcopy
      call mkl_zomatcopy

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_mkl_has_omatcopy="yes"
else
  sd_linalg_mkl_has_omatcopy="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_mkl_has_omatcopy}" >&5
$as_echo "${sd_linalg_mkl_has_omatcopy}" >&6; }

  if test "${sd_linalg_mkl_has_omatcopy}" = "yes"; then

$as_echo "#define HAVE_LINALG_MKL_OMATCOPY 1" >>confdefs.h

  fi

  # mkl_omatadd family
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mkl_omatadd in the specified libraries" >&5
$as_echo_n "checking for mkl_omatadd in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call mkl_somatadd
      call mkl_comatadd
      call mkl_domatadd
      call mkl_zomatadd

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_mkl_has_omatadd="yes"
else
  sd_linalg_mkl_has_omatadd="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_mkl_has_omatadd}" >&5
$as_echo "${sd_linalg_mkl_has_omatadd}" >&6; }

  if test "${sd_linalg_mkl_has_omatadd}" = "yes"; then

$as_echo "#define HAVE_LINALG_MKL_OMATADD 1" >>confdefs.h

  fi

  # mkl_threads support functions
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mkl_set/get_threads in the specified libraries" >&5
$as_echo_n "checking for mkl_set/get_threads in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      integer :: a
      a = mkl_get_max_threads()
      call mkl_set_num_threads

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_mkl_has_threads="yes"
else
  sd_linalg_mkl_has_threads="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_mkl_has_threads}" >&5
$as_echo "${sd_linalg_mkl_has_threads}" >&6; }

  if test "${sd_linalg_mkl_has_threads}" = "yes"; then

$as_echo "#define HAVE_LINALG_MKL_THREADS 1" >>confdefs.h

  fi


  # openBLAS BLAS extensions?


  # openblas_threads support functions
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openBLAS_set/get_threads/get_parallel in the specified libraries" >&5
$as_echo_n "checking for openBLAS_set/get_threads/get_parallel in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      integer :: a
      call openblas_set_num_threads
      a = openblas_get_num_threads()
      if (openblas_get_parallel()==0) stop "openBLAS doesnt support threads"

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_openblas_has_threads="yes"
else
  sd_linalg_openblas_has_threads="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_openblas_has_threads}" >&5
$as_echo "${sd_linalg_openblas_has_threads}" >&6; }

  if test "${sd_linalg_openblas_has_threads}" = "yes"; then

$as_echo "#define HAVE_LINALG_OPENBLAS_THREADS 1" >>confdefs.h

  fi


  # NVPL BLAS/LAPACK extensions?


  # NVPL support functions
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NVPL_set/get_threads in the specified libraries" >&5
$as_echo_n "checking for NVPL_set/get_threads in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      integer :: a
      call nvpl_blas_set_num_threads
      a = nvpl_blas_get_max_threads()

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_nvpl_has_threads="yes"
else
  sd_linalg_nvpl_has_threads="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_nvpl_has_threads}" >&5
$as_echo "${sd_linalg_nvpl_has_threads}" >&6; }

  if test "${sd_linalg_nvpl_has_threads}" = "yes"; then

$as_echo "#define HAVE_LINALG_NVPL_THREADS 1" >>confdefs.h

  fi


  # LAPACK?
  if test "${sd_linalg_has_blas}" = "yes"; then

  sd_linalg_has_lapack="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LAPACK support in the specified libraries" >&5
$as_echo_n "checking for LAPACK support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call zhpev

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_lapack="yes"; sd_linalg_provided="${sd_linalg_provided} lapack"
else
  sd_linalg_has_lapack="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_lapack}" >&5
$as_echo "${sd_linalg_has_lapack}" >&6; }

  fi

  # LAPACKE?
  if test "${sd_linalg_has_lapack}" = "yes"; then

  sd_linalg_has_lapacke="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LAPACKE C API support in the specified libraries" >&5
$as_echo_n "checking for LAPACKE C API support in the specified libraries... " >&6; }
  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

  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */
#include <lapacke.h>
#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

      zhpev_;

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  sd_linalg_has_lapacke="yes"; sd_linalg_provided="${sd_linalg_provided} lapacke"
else
  sd_linalg_has_lapacke="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_lapacke}" >&5
$as_echo "${sd_linalg_has_lapacke}" >&6; }

  fi

  # Validate the serial linear algebra support
  if test "${sd_linalg_has_blas}" = "yes" -a \
          "${sd_linalg_has_lapack}" = "yes"; then
    sd_linalg_serial_ok="yes"
  else
    sd_linalg_serial_ok="no"
  fi

  if test "${sd_mpi_enable}" = "yes"; then

    # PLASMA?

  sd_linalg_has_plasma="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PLASMA support in the specified libraries" >&5
$as_echo_n "checking for PLASMA support in the specified libraries... " >&6; }
  sd_linalg_chk_plasma="${sd_linalg_has_lapacke}"
  if test "${sd_linalg_chk_plasma}" = "yes"; then
    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

    cat > conftest.$ac_ext <<_ACEOF
      program main

        use plasma
        call plasma_zhegv

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_plasma="yes"; sd_linalg_provided="${sd_linalg_provided} plasma"
else
  sd_linalg_has_plasma="no"
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

  else
    sd_linalg_has_plasma="no"
  fi
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_plasma}" >&5
$as_echo "${sd_linalg_has_plasma}" >&6; }

  if test "${sd_linalg_has_plasma}" = "yes"; then

$as_echo "#define HAVE_LINALG_PLASMA 1" >>confdefs.h

  fi


    if test "${sd_linalg_has_plasma}" != "yes"; then

      # BLACS?

  sd_linalg_has_blacs="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BLACS support in the specified libraries" >&5
$as_echo_n "checking for BLACS support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call blacs_gridinit

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_blacs="yes"; sd_linalg_provided="${sd_linalg_provided} blacs"
else
  sd_linalg_has_blacs="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_blacs}" >&5
$as_echo "${sd_linalg_has_blacs}" >&6; }


      # ScaLAPACK?
      if test "${sd_linalg_has_blacs}" = "yes"; then

  sd_linalg_has_scalapack="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ScaLAPACK support in the specified libraries" >&5
$as_echo_n "checking for ScaLAPACK support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call pzheevx

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_scalapack="yes"; sd_linalg_provided="${sd_linalg_provided} scalapack"
else
  sd_linalg_has_scalapack="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_scalapack}" >&5
$as_echo "${sd_linalg_has_scalapack}" >&6; }

  if test "${sd_linalg_has_scalapack}" = "yes"; then

$as_echo "#define HAVE_LINALG_SCALAPACK 1" >>confdefs.h

  fi

      else
         sd_linalg_has_scalapack="no"
      fi

    fi

    # ELPA

  sd_linalg_has_elpa="unknown"
  sd_linalg_has_elpa_f2008="unknown"
  sd_linalg_has_elpa_legacy="unknown"


  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELPA support in the specified libraries" >&5
$as_echo_n "checking for ELPA support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use elpa
      class(elpa_t),pointer :: e
      integer :: comm,err
      call e%set('mpi_comm_parent',comm,err)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_f2008="yes";sd_linalg_has_elpa="yes"
else
  sd_linalg_has_elpa_f2008="no"
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
  if test "${sd_linalg_has_elpa_f2008}" = "no"; then
    cat > conftest.$ac_ext <<_ACEOF
      program main

        use elpa1
        integer,parameter :: nrow=1,ncol=1,comm=1
        integer :: comm_r,comm_c,success
        success=get_elpa_row_col_comms(comm,nrow,ncol,comm_r,comm_c)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_legacy="yes";sd_linalg_has_elpa="yes"
else
  sd_linalg_has_elpa_legacy="unknown"
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
    if test "${sd_linalg_has_elpa_legacy}" != "yes"; then
      cat > conftest.$ac_ext <<_ACEOF
      program main

          use elpa1
          integer,parameter :: nrow=1,ncol=1,comm=1
          integer :: comm_r,comm_c
          call get_elpa_row_col_comms(comm,nrow,ncol,comm_r,comm_c)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_legacy="yes";sd_linalg_has_elpa="yes"
else
  sd_linalg_has_elpa_legacy="no" ;sd_linalg_has_elpa="no"
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
    fi
  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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_elpa}" >&5
$as_echo "${sd_linalg_has_elpa}" >&6; }

  if test "${sd_linalg_has_elpa}" = "yes"; then
    # ===== New API
    if test "${sd_linalg_has_elpa_f2008}" = "yes"; then

  sd_linalg_has_elpa_2017_f2008="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELPA 2017+ Fortran2008 API support in the specified libraries" >&5
$as_echo_n "checking for ELPA 2017+ Fortran2008 API support in the specified libraries... " >&6; }

  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use elpa
      class(elpa_t),pointer :: e
      integer,parameter :: na=1,ncol=1,nrow=1
      integer :: comm,err
      character*1 :: u
      real*8 :: ar(ncol,nrow),ev(na),qr(ncol,nrow)
      call e%set('mpi_comm_parent',comm,err)
      call e%eigenvectors(ar,ev,qr,err)
      call e%cholesky(ar,err)
      call e%invert_triangular(ar,err)
      call e%hermitian_multiply(u,u,na,ar,ar,nrow,ncol,qr,nrow,ncol,err)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_2017_f2008="yes"
else
  sd_linalg_has_elpa_2017_f2008="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_elpa_2017_f2008}" >&5
$as_echo "${sd_linalg_has_elpa_2017_f2008}" >&6; }

  if test "${sd_linalg_has_elpa_2017_f2008}" = "yes"; then

$as_echo "#define HAVE_LINALG_ELPA_2017 1" >>confdefs.h

  fi

      if test "${sd_linalg_has_elpa_2017_f2008}" != "yes"; then
        sd_linalg_has_elpa="no"
      fi
    # ===== Old API
    else

  sd_linalg_has_elpa_2017_legacy="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELPA 2017+ legacy API support in the specified libraries" >&5
$as_echo_n "checking for ELPA 2017+ legacy API support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use elpa1
      integer, parameter :: na=1,ldq=1,nev=1,nblk=1,ncb=1,nrow=1,ncol=1,comm=1
      integer :: comm_r,comm_c,err
      logical :: ok,debug
      real*8 :: ar(ncol,nrow),ev(na),qr(ldq,nrow)
      complex*16 :: ac(ncol,nrow),bc(ncol,nrow),cc(ncol,nrow)
      character*1 :: u
      err=elpa_get_communicators(comm,nrow,ncol,comm_r,comm_c)
      ok=elpa_solve_evp_real_1stage_double(na,nev,ar,nrow,ev,qr,nrow,nblk,ncol,comm_r,comm_c,comm,debug)
      ok=elpa_cholesky_complex_double(na,ac,nrow,nblk,local_ncol,comm_r,comm_c,debug)
      ok=elpa_invert_trm_real_double(na,ar,nrow,nblk,ncol,comm_r,comm_c,debug)
      ok=elpa_mult_ah_b_complex_double(u,u,na,ncb,ac,nrow,ncol,bc,nrow,ncol,nblk,comm_r,comm_c,cc,nrow,ncol)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_2017_legacy="yes"
else
  sd_linalg_has_elpa_2017_legacy="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_elpa_2017_legacy}" >&5
$as_echo "${sd_linalg_has_elpa_2017_legacy}" >&6; }

  if test "${sd_linalg_has_elpa_2017_legacy}" = "yes"; then

$as_echo "#define HAVE_LINALG_ELPA_2017 1" >>confdefs.h

  fi

      if test "${sd_linalg_has_elpa_2017_legacy}" != "yes"; then

  sd_linalg_has_elpa_2016="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELPA 2016 API support in the specified libraries" >&5
$as_echo_n "checking for ELPA 2016 API support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use elpa1
      integer, parameter :: na=1,ldq=1,nev=1,nblk=1,ncb=1,nrow=1,ncol=1,comm=1
      integer :: comm_r,comm_c,err
      logical :: ok,debug
      real*8 :: ar(ncol,nrow),ev(na),qr(ldq,nrow)
      complex*16 :: ac(ncol,nrow),bc(ncol,nrow),cc(ncol,nrow)
      character*1 :: u
      err=elpa_get_communicators(comm,nrow,ncol,comm_r,comm_c)
      ok=elpa_solve_evp_real_1stage(na,nev,ar,nrow,ev,qr,nrow,nblk,ncol,comm_r,comm_c)
      ok=elpa_cholesky_complex(na,ac,nrow,nblk,local_ncol,comm_r,comm_c,debug)
      ok=elpa_invert_trm_real(na,ar,nrow,nblk,ncol,comm_r,comm_c,debug)
      ok=elpa_mult_ah_b_complex(u,u,na,ncb,ac,nrow,ncol,bc,nrow,ncol,nblk,comm_r,comm_c,cc,nrow,ncol)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_2016="yes"
else
  sd_linalg_has_elpa_2016="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_elpa_2016}" >&5
$as_echo "${sd_linalg_has_elpa_2016}" >&6; }

  if test "${sd_linalg_has_elpa_2016}" = "yes"; then

$as_echo "#define HAVE_LINALG_ELPA_2016 1" >>confdefs.h

  fi

        if test "${sd_linalg_has_elpa_2016}" != "yes"; then

  sd_linalg_has_elpa_2015_11="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELPA 2015.11 API support in the specified libraries" >&5
$as_echo_n "checking for ELPA 2015.11 API support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use elpa1
      integer, parameter :: na=1,ldq=1,nev=1,nblk=1,ncb=1,nrow=1,ncol=1,comm=1
      integer :: comm_r,comm_c,err
      logical :: ok,debug
      real*8 :: ar(ncol,nrow),ev(na),qr(ldq,nrow)
      complex*16 :: ac(ncol,nrow),bc(ncol,nrow),cc(ncol,nrow)
      character*1 :: u
      err=get_elpa_row_col_comms(comm,nrow,ncol,comm_r,comm_c)
      ok=solve_evp_real(na,nev,ar,nrow,ev,qr,nrow,nblk,ncol,comm_r,comm_c)
      call cholesky_complex(na,ac,nrow,nblk,ncol,comm_r,comm_c,debug,ok)
      call invert_trm_real(na,ar,nrow,nblk,ncol,comm_r,comm_c,debug,ok)
      call mult_ah_b_complex(u,u,na,ncb,ac,nrow,bc,nrow,nblk,comm_r,comm_c,cc,nrow)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_2015_11="yes"
else
  sd_linalg_has_elpa_2015_11="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_elpa_2015_11}" >&5
$as_echo "${sd_linalg_has_elpa_2015_11}" >&6; }

  if test "${sd_linalg_has_elpa_2015_11}" = "yes"; then

$as_echo "#define HAVE_LINALG_ELPA_2015_11 1" >>confdefs.h

  fi

          if test "${sd_linalg_has_elpa_2015_11}" != "yes"; then

  sd_linalg_has_elpa_2015_02="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELPA 2015.02 API support in the specified libraries" >&5
$as_echo_n "checking for ELPA 2015.02 API support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use elpa1
      integer, parameter :: na=1,ldq=1,nev=1,nblk=1,ncb=1,nrow=1,ncol=1,comm=1
      integer :: comm_r,comm_c,err
      logical :: ok,debug
      real*8 :: ar(ncol,nrow),ev(na),qr(ldq,nrow)
      complex*16 :: ac(ncol,nrow),bc(ncol,nrow),cc(ncol,nrow)
      character*1 :: u
      err=get_elpa_row_col_comms(comm,nrow,ncol,comm_r,comm_c)
      ok=solve_evp_real(na,nev,ar,nrow,ev,qr,nrow,nblk,comm_r,comm_c)
      call cholesky_complex(na,ac,nrow,nblk,comm_r,comm_c,debug,ok)
      call invert_trm_real(na,ar,nrow,nblk,comm_r,comm_c,debug,ok)
      call mult_ah_b_complex(u,u,na,ncb,ac,nrow,bc,nrow,nblk,comm_r,comm_c,cc,nrow)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_2015_02="yes"
else
  sd_linalg_has_elpa_2015_02="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_elpa_2015_02}" >&5
$as_echo "${sd_linalg_has_elpa_2015_02}" >&6; }

  if test "${sd_linalg_has_elpa_2015_02}" = "yes"; then

$as_echo "#define HAVE_LINALG_ELPA_2015_02 1" >>confdefs.h

  fi

            if test "${sd_linalg_has_elpa_2015_02}" != "yes"; then

  sd_linalg_has_elpa_2014="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELPA 2014 API support in the specified libraries" >&5
$as_echo_n "checking for ELPA 2014 API support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use elpa1
      integer, parameter :: na=1,ldq=1,nev=1,nblk=1,ncb=1,nrow=1,ncol=1,comm=1
      integer :: comm_r,comm_c,err
      logical :: ok
      real*8 :: ar(ncol,nrow),ev(na),qr(ldq,nrow)
      complex*16 :: ac(ncol,nrow),bc(ncol,nrow),cc(ncol,nrow)
      character*1 :: u
      call get_elpa_row_col_comms(comm,nrow,ncol,comm_r,comm_c)
      ok=solve_evp_real(na,nev,ar,nrow,ev,qr,nrow,nblk,comm_r,comm_c)
      call cholesky_complex(na,ac,nrow,nblk,comm_r,comm_c,ok)
      call invert_trm_real(na,ar,nrow,nblk,comm_r,comm_c,ok)
      call mult_ah_b_complex(u,u,na,ncb,ac,nrow,bc,nrow,nblk,comm_r,comm_c,cc,nrow)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_2014="yes"
else
  sd_linalg_has_elpa_2014="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_elpa_2014}" >&5
$as_echo "${sd_linalg_has_elpa_2014}" >&6; }

  if test "${sd_linalg_has_elpa_2014}" = "yes"; then

$as_echo "#define HAVE_LINALG_ELPA_2014 1" >>confdefs.h

  fi

              if test "${sd_linalg_has_elpa_2014}" != "yes"; then

  sd_linalg_has_elpa_2013="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELPA 2011-13 API support in the specified libraries" >&5
$as_echo_n "checking for ELPA 2011-13 API support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      use elpa1
      integer, parameter :: na=1,ldq=1,nev=1,nblk=1,ncb=1,nrow=1,ncol=1,comm=1
      integer :: comm_r,comm_c,err
      real*8 :: ar(ncol,nrow),ev(na),qr(ldq,nrow)
      complex*16 :: ac(ncol,nrow),bc(ncol,nrow),cc(ncol,nrow)
      character*1 :: u
      call get_elpa_row_col_comms(comm,nrow,ncol,comm_r,comm_c)
      call solve_evp_real(na,nev,ar,nrow,ev,qr,nrow,nblk,comm_r,comm_c)
      call cholesky_complex(na,ac,nrow,nblk,comm_r,comm_c)
      call invert_trm_real(na,ar,nrow,nblk,comm_r,comm_c)
      call mult_ah_b_complex(u,u,na,ncb,ac,nrow,bc,nrow,nblk,comm_r,comm_c,cc,nrow)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_elpa_2013="yes"
else
  sd_linalg_has_elpa_2013="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_elpa_2013}" >&5
$as_echo "${sd_linalg_has_elpa_2013}" >&6; }

  if test "${sd_linalg_has_elpa_2013}" = "yes"; then

$as_echo "#define HAVE_LINALG_ELPA_2013 1" >>confdefs.h

  fi

                if test "${sd_linalg_has_elpa_2013}" != "yes"; then
                  sd_linalg_has_elpa="no"
                fi
              fi
            fi
          fi
        fi
      fi
    fi
  fi

  if test "${sd_linalg_has_elpa}" = "yes"; then
    sd_linalg_provided="${sd_linalg_provided} elpa"

$as_echo "#define HAVE_LINALG_ELPA 1" >>confdefs.h

    if test "${sd_linalg_has_elpa_f2008}" = "yes"; then

$as_echo "#define HAVE_LINALG_ELPA_FORTRAN2008 1" >>confdefs.h

    fi
  fi

  if test "${sd_linalg_has_elpa}" != "yes"; then
     sd_linalg_has_elpa="no"
  fi



  else
    sd_linalg_has_scalapack="no"
  fi


  # Validate the MPI linear algebra support
  if test "${sd_mpi_enable}" = "yes"; then
    if test \( "${sd_linalg_has_blacs}" = "yes" -a \
               "${sd_linalg_has_scalapack}" = "yes" \) -o \
               "${sd_linalg_has_plasma}" = "yes"; then
      sd_linalg_mpi_ok="yes"
    else
      sd_linalg_mpi_ok="no"
    fi
    if test "${sd_linalg_has_elpa}" = "yes"; then
      sd_linalg_mpiacc_ok="yes"
    else
      sd_linalg_mpiacc_ok="no"
    fi
  fi

  if test "${sd_gpu_enable}" = "yes"; then

    # MAGMA?

  sd_linalg_has_magma_15="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAGMA (version>=1.1.0) support in the specified libraries" >&5
$as_echo_n "checking for MAGMA (version>=1.1.0) support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call magmaf_zhegvd

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_magma="yes"; sd_linalg_provided="${sd_linalg_provided} magma"
else
  sd_linalg_has_magma="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_magma}" >&5
$as_echo "${sd_linalg_has_magma}" >&6; }
  if test "${sd_linalg_has_magma}" = "yes"; then

$as_echo "#define HAVE_LINALG_MAGMA 1" >>confdefs.h


  sd_linalg_has_magma_15="unknown"

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAGMA 1.5 support in the specified libraries" >&5
$as_echo_n "checking for MAGMA 1.5 support in the specified libraries... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

      call magmaf_init
      call magmaf_finalize

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_linalg_has_magma_15="yes"
else
  sd_linalg_has_magma_15="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_has_magma_15}" >&5
$as_echo "${sd_linalg_has_magma_15}" >&6; }

  if test "${sd_linalg_has_magma_15}" = "yes"; then

$as_echo "#define HAVE_LINALG_MAGMA_15 1" >>confdefs.h

  fi

  fi


  fi

  # Validate the GPU linear algebra support
  if test "${sd_linalg_has_magma}" = "yes"; then
    sd_linalg_gpu_ok="yes"
  else
    sd_linalg_gpu_ok="no"
  fi

  # Compose a flavor from the identified components
  if test "${sd_linalg_flavor_init}" = "def"; then
    if test "${sd_linalg_serial_ok}" = "yes"; then
      if test "${sd_linalg_mkl_has_imatcopy}" = "yes" -o \
              "${sd_linalg_mkl_has_omatcopy}" = "yes" -o \
              "${sd_linalg_mkl_has_omatadd}" = "yes"; then
        sd_linalg_flavor="mkl"
      else
        sd_linalg_flavor="netlib"
      fi
      if test "${sd_linalg_mpi_ok}" = "yes"; then
        if test "${sd_linalg_has_plasma}" = "yes"; then
          sd_linalg_flavor="${sd_linalg_flavor}+plasma"
        fi
      fi
      if test "${sd_linalg_mpiacc_ok}" = "yes"; then
        if test "${sd_linalg_has_elpa}" = "yes"; then
          sd_linalg_flavor="${sd_linalg_flavor}+elpa"
        fi
      fi
      if test "${sd_linalg_gpu_ok}" = "yes"; then
        if test "${sd_linalg_has_magma}" = "yes"; then
          sd_linalg_flavor="${sd_linalg_flavor}+magma"
        fi
      fi
    else
      sd_linalg_flavor="none"
    fi
  fi

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"


        ;;
      *)
        as_fn_error $? "unsupported linear algebra init type: '${sd_linalg_init}'" "$LINENO" 5
        ;;
    esac

  if test "${sd_linalg_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how linear algebra parameters have been set" >&5
$as_echo_n "checking how linear algebra parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_init} (flavor: ${sd_linalg_flavor_init})" >&5
$as_echo "${sd_linalg_init} (flavor: ${sd_linalg_flavor_init})" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the actual linear algebra flavor" >&5
$as_echo_n "checking for the actual linear algebra flavor... " >&6; }
    if test "${sd_linalg_flavor}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_flavor}" >&5
$as_echo "${sd_linalg_flavor}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linear algebra C preprocessing flags" >&5
$as_echo_n "checking for linear algebra C preprocessing flags... " >&6; }
    if test "${sd_linalg_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_cppflags}" >&5
$as_echo "${sd_linalg_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linear algebra C flags" >&5
$as_echo_n "checking for linear algebra C flags... " >&6; }
    if test "${sd_linalg_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_cflags}" >&5
$as_echo "${sd_linalg_cflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linear algebra C++ flags" >&5
$as_echo_n "checking for linear algebra C++ flags... " >&6; }
    if test "${sd_linalg_cxxflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_cxxflags}" >&5
$as_echo "${sd_linalg_cxxflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linear algebra Fortran flags" >&5
$as_echo_n "checking for linear algebra Fortran flags... " >&6; }
    if test "${sd_linalg_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_fcflags}" >&5
$as_echo "${sd_linalg_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linear algebra linker flags" >&5
$as_echo_n "checking for linear algebra linker flags... " >&6; }
    if test "${sd_linalg_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_ldflags}" >&5
$as_echo "${sd_linalg_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linear algebra library flags" >&5
$as_echo_n "checking for linear algebra library flags... " >&6; }
    if test "${sd_linalg_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_linalg_libs}" >&5
$as_echo "${sd_linalg_libs}" >&6; }
    fi
  fi


    # Check if minimum requirements are fulfilled
    if test "${sd_linalg_serial_ok}" != "yes"; then
      case "${sd_linalg_policy}" in
        fail)
          if test "${sd_linalg_enable}" = "auto"; then
            sd_linalg_enable="no"
          else
            as_fn_error $? "linear algebra does not work" "$LINENO" 5
          fi
          ;;
        skip)
          sd_linalg_enable="no"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: linear algebra does not work" >&5
$as_echo "$as_me: WARNING: linear algebra does not work" >&2;}
          ;;
      esac
    fi

  fi   # sd_linalg_enable = auto | yes

  # Wipe-out configuration if linear algebra is finally disabled
  if test "${sd_linalg_enable}" = "no"; then
    sd_linalg_flavor="none"
    sd_linalg_cppflags=""
    sd_linalg_cflags=""
    sd_linalg_fcflags=""
    sd_linalg_ldflags=""
    sd_linalg_libs=""
  fi

  # Check that parallel minimum requirements are fulfilled, when relevant
  if test "${sd_linalg_serial_ok}" = "yes" -a "${sd_mpi_ok}" = "yes"; then
    if test "${sd_linalg_mpi_ok}" != "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: parallel linear algebra is not available" >&5
$as_echo "$as_me: WARNING: parallel linear algebra is not available" >&2;}
    fi
  fi

  # Define vendor-specific C preprocessing options
  tmp_linalg_iter=`echo "${sd_linalg_flavor}" | sed -e 's/+/ /g'`
  for tmp_linalg_vendor in ${tmp_linalg_iter}; do
    case "${tmp_linalg_vendor}" in
      asl)

$as_echo "#define HAVE_LINALG_ASL 1" >>confdefs.h

        ;;
      essl)

$as_echo "#define HAVE_LINALG_ESSL 1" >>confdefs.h

        ;;
    esac
  done
  unset tmp_linalg_iter
  unset tmp_linalg_vendor

  abi_linalg_ok="${sd_linalg_enable}"

  if test "${abi_linalg_ok}" = "yes"; then

	# Test if BLAS library has buggy dot/norm interfaces
	if test "${abi_zdot_bugfix_enable}" = "no" -o "${abi_zdot_bugfix_enable}" = "auto"; then
	  abi_zdot_bugfix="${sd_linalg_has_buggy_zdot}"
	  if test "${abi_zdot_bugfix}" = "yes" -a "${abi_zdot_bugfix_enable}" = "no"; then
		as_fn_error $? "--enable-zdot-bugfix option is deactivated but the BLAS library has buggy interfaces!" "$LINENO" 5
	  fi
	  if test "${abi_zdot_bugfix_enable}" = "auto"; then
		abi_zdot_bugfix_enable="${abi_zdot_bugfix}"
	  fi
	fi

	if test "${abi_zdot_bugfix_enable}" = "yes"; then

$as_echo "#define HAVE_LINALG_ZDOTC_BUG 1" >>confdefs.h


$as_echo "#define HAVE_LINALG_ZDOTU_BUG 1" >>confdefs.h

    fi

  fi # abi_linalg_ok





# the minimum needed to declare linalg working...
sd_linalg_ok="no"
test "${sd_linalg_has_blas}" = "yes" -a "${sd_linalg_has_lapack}" = "yes" && sd_linalg_ok="yes"

# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #

#
# Optimized FFT support (must be done after linear algebra is fully configured)
#



  abi_sec_title="Optimized FFT support"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


if test "${sd_linalg_enable}" = "yes"; then

  # Init
  sd_fft_cppflags=""
  sd_fft_cflags=""
  sd_fft_cxxflags=""
  sd_fft_fcflags=""
  sd_fft_ldflags=""
  sd_fft_libs=""
  sd_fft_enable=""
  sd_fft_flavor=""
  sd_fft_init="unknown"
  sd_fft_ok="unknown"
  sd_fft_selected_flavors=""

  # Set adjustable parameters

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking which FFT flavors to enable" >&5
$as_echo_n "checking which FFT flavors to enable... " >&6; }

  # Start from the internal implementation
  sd_fft_selected_flavors="goedecker"
  tmp_fft_has_fftw3=""
  tmp_linalg_has_mkl=`echo "${sd_linalg_flavor}" | grep "mkl"`

  # Prepend PFFT if available
  if test "${sd_pfft_init}" != "" -a "${sd_pfft_enable}" != "no"; then
    if test "${sd_mpi_ok}" = "yes"; then
      sd_fft_selected_flavors="pfft ${sd_fft_selected_flavors}"
    fi
  fi

  # Prepend FFTW3 if available
  if test "${sd_fftw3_init}" != "" -a "${sd_fftw3_enable}" != "no"; then
    if test "${tmp_linalg_has_mkl}" = ""; then
      sd_fft_selected_flavors="fftw3-threads fftw3 ${sd_fft_selected_flavors}"
    fi
  fi

  # Prepend DFTI if linear algebra is MKL
  if test "${tmp_linalg_has_mkl}" != ""; then
    sd_fft_selected_flavors="dfti ${sd_fft_selected_flavors}"
  fi

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fft_selected_flavors}" >&5
$as_echo "${sd_fft_selected_flavors}" >&6; }

  # Warn about incompatibilities
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: MKL is incompatible with FFTW3

                    Please use DFTI instead and consult
                    https://software.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-fortran/top/fourier-transform-functions.html

                    If you set the FFT flavor to fftw3, the configure script
                    will abort. Otherwise, your FFTW3 settings will be ignored.

" >&5
$as_echo "$as_me: WARNING: MKL is incompatible with FFTW3

                    Please use DFTI instead and consult
                    https://software.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-fortran/top/fourier-transform-functions.html

                    If you set the FFT flavor to fftw3, the configure script
                    will abort. Otherwise, your FFTW3 settings will be ignored.

" >&2;}

  # Clean-up the mess
  unset tmp_fft_has_fftw3
  unset tmp_linalg_has_mkl


  # FIXME: policy and status are hard-coded for now
  sd_fft_policy="skip"
  sd_fft_status="optional"

  # Set reasonable defaults if not provided
  test -z "${sd_fft_policy}" && sd_fft_policy="fail"
  test -z "${sd_fft_status}" && sd_fft_status="optional"

  # Declare configure option

# Check whether --with-fft-flavor was given.
if test "${with_fft_flavor+set}" = set; then :
  withval=$with_fft_flavor;  tmp_fft_flavor_ok=`echo "${sd_fft_selected_flavors}" | grep "${withval}"`
      if test "${tmp_fft_flavor_ok}" = ""; then
        as_fn_error $? "invalid FFT flavor: '${withval}'" "$LINENO" 5
      fi
      sd_fft_flavor="${withval}"
      sd_fft_enable="yes"
      sd_fft_init="kwd"
      sd_fft_selected_flavors="${sd_fft_flavor}"
      unset tmp_fft_flavor_ok
else
   sd_fft_enable="unknown"; sd_fft_flavor="unknown"; sd_fft_init="def"
fi


  # Make sure configuration is correct
  if test "${STEREDEG_BYPASS_CONSISTENCY}" != "yes"; then

  # Check consistency between trigger value and package status
  tmp_fft_invalid="no"
  tmp_fft_flavor_chk=`echo "${sd_fft_choices}" | grep "${sd_fft_flavor}"`
  if test "${sd_fft_status}" = "implicit" -o \
          "${sd_fft_status}" = "required"; then
    if test "${tmp_fft_flavor_chk}" = ""; then
      case "${sd_fft_policy}" in
        fail)
          as_fn_error $? "invalid FFT flavor: sd_fft_flavor = '${sd_fft_flavor}'" "$LINENO" 5
          ;;
        skip)
          tmp_fft_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The FFT package is required and cannot be disabled" >&5
$as_echo "$as_me: WARNING: The FFT package is required and cannot be disabled" >&2;}
          tmp_fft_invalid="yes"
          ;;
      esac
    fi
  fi

  # Fix wrong flavor value
  if test "${tmp_fft_invalid}" = "yes"; then
    sd_fft_flavor="${sd_fft_flavor_def}"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_fft_flavor to '${sd_fft_flavor}'" >&5
$as_echo "$as_me: setting sd_fft_flavor to '${sd_fft_flavor}'" >&6;}
  fi

  # Implicit status overrides everything
  if test "${sd_fft_status}" = "implicit"; then
    if test "${sd_fft_cppflags}" != ""; then
      sd_fft_cppflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting FFT C preprocessing flags (implicit package)" >&5
$as_echo "$as_me: resetting FFT C preprocessing flags (implicit package)" >&6;}
    fi
    if test "${sd_fft_cflags}" != ""; then
      sd_fft_cflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting FFT C flags (implicit package)" >&5
$as_echo "$as_me: resetting FFT C flags (implicit package)" >&6;}
    fi
    if test "${sd_fft_fcflags}" != ""; then
      sd_fft_fcflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting FFT Fortran flags (implicit package)" >&5
$as_echo "$as_me: resetting FFT Fortran flags (implicit package)" >&6;}
    fi
    if test "${sd_fft_ldflags}" != ""; then
      sd_fft_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting FFT linker flags (implicit package)" >&5
$as_echo "$as_me: resetting FFT linker flags (implicit package)" >&6;}
    fi
    if test "${sd_fft_libs}" != ""; then
      sd_fft_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting FFT library flags (implicit package)" >&5
$as_echo "$as_me: resetting FFT library flags (implicit package)" >&6;}
    fi
  fi

  # Clean-up
  unset tmp_fft_flavor_chk
  unset tmp_fft_invalid

  fi

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFT flavor" >&5
$as_echo_n "checking for FFT flavor... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fft_flavor}" >&5
$as_echo "${sd_fft_flavor}" >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFT C preprocessing flags" >&5
$as_echo_n "checking for FFT C preprocessing flags... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fft_cppflags}" >&5
$as_echo "${sd_fft_cppflags}" >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFT C flags" >&5
$as_echo_n "checking for FFT C flags... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fft_cflags}" >&5
$as_echo "${sd_fft_cflags}" >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFT Fortran flags" >&5
$as_echo_n "checking for FFT Fortran flags... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fft_fcflags}" >&5
$as_echo "${sd_fft_fcflags}" >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFT linker flags" >&5
$as_echo_n "checking for FFT linker flags... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fft_ldflags}" >&5
$as_echo "${sd_fft_ldflags}" >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFT library flags" >&5
$as_echo_n "checking for FFT library flags... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fft_libs}" >&5
$as_echo "${sd_fft_libs}" >&6; }


  # Export configuration















  for sd_fft_flavor in ${sd_fft_selected_flavors}; do

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the FFT flavor to try" >&5
$as_echo_n "checking for the FFT flavor to try... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fft_flavor}" >&5
$as_echo "${sd_fft_flavor}" >&6; }
    case "${sd_fft_flavor}" in
      dfti)

  # Init
  sd_dfti_cppflags="${sd_linalg_cppflags}"
  sd_dfti_cflags="${sd_linalg_cflags}"
  sd_dfti_cxxflags="${sd_linalg_cxxflags}"
  sd_dfti_fcflags="${sd_linalg_fcflags}"
  sd_dfti_ldflags="${sd_linalg_ldflags}"
  sd_dfti_libs="${sd_linalg_libs}"
  sd_dfti_enable="yes"
  sd_dfti_init="mkl"
  sd_dfti_ok="unknown"

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable DFTI" >&5
$as_echo_n "checking whether to enable DFTI... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_dfti_enable}" >&5
$as_echo "${sd_dfti_enable}" >&6; }
  if test "${sd_dfti_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how DFTI parameters have been set" >&5
$as_echo_n "checking how DFTI parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_dfti_init}" >&5
$as_echo "${sd_dfti_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DFTI C preprocessing flags" >&5
$as_echo_n "checking for DFTI C preprocessing flags... " >&6; }
    if test "${sd_dfti_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_dfti_cppflags}" >&5
$as_echo "${sd_dfti_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DFTI C flags" >&5
$as_echo_n "checking for DFTI C flags... " >&6; }
    if test "${sd_dfti_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_dfti_cflags}" >&5
$as_echo "${sd_dfti_cflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DFTI Fortran flags" >&5
$as_echo_n "checking for DFTI Fortran flags... " >&6; }
    if test "${sd_dfti_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_dfti_fcflags}" >&5
$as_echo "${sd_dfti_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DFTI linker flags" >&5
$as_echo_n "checking for DFTI linker flags... " >&6; }
    if test "${sd_dfti_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_dfti_ldflags}" >&5
$as_echo "${sd_dfti_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DFTI library flags" >&5
$as_echo_n "checking for DFTI library flags... " >&6; }
    if test "${sd_dfti_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_dfti_libs}" >&5
$as_echo "${sd_dfti_libs}" >&6; }
    fi
  fi


  # Check whether we can compile and link a simple program
  # and update build flags if successful
  if test "${sd_dfti_enable}" = "auto" -o "${sd_dfti_enable}" = "yes"; then

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  if test "${sd_dfti_init}" = "esl"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: will look for DFTI in the installed ESL Bundle" >&5
$as_echo "$as_me: will look for DFTI in the installed ESL Bundle" >&6;}

  CPPFLAGS="${CPPFLAGS} ${sd_esl_bundle_cppflags}"
  CFLAGS="${CFLAGS} ${sd_esl_bundle_cflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_esl_bundle_cxxflags}"
  FCFLAGS="${FCFLAGS} ${sd_esl_bundle_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_esl_bundle_ldflags}"
  if test ! -z ""; then
    CPPFLAGS="${CPPFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
    FCFLAGS="${FCFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
  fi
  FCFLAGS="${FCFLAGS} -I/usr/include"


  LIBS="${sd_esl_bundle_libdirs} ${sd_dfti_libs_def} ${sd_esl_bundle_libs} ${LIBS}"

  else
    CPPFLAGS="${CPPFLAGS} ${sd_dfti_cppflags}"
    CFLAGS="${CFLAGS} ${sd_dfti_cflags}"
    FCFLAGS="${FCFLAGS} ${sd_dfti_fcflags}"
    LDFLAGS="${LDFLAGS} ${sd_dfti_ldflags}"
    LIBS="${sd_dfti_libs} ${LIBS}"
  fi

  # Check DFTI C API
  # FIXME: Very complex to have it work properly, would need a replacement
  #        of AC_LINK_IFELSE accepting prologues, because of the included
  #        mkl_dfti.f90 file.
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the DFTI library works" >&5
$as_echo_n "checking whether the DFTI library works... " >&6; }
  sd_dfti_ok="yes"
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_dfti_ok}" >&5
$as_echo "${sd_dfti_ok}" >&6; }

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"



    if test "${sd_dfti_ok}" = "yes"; then
      if test "${sd_dfti_init}" = "esl"; then
        sd_esl_bundle_libs="${sd_dfti_libs_def} ${sd_esl_bundle_libs}"
      else
        LIBS="${sd_dfti_libs} ${LIBS}"
      fi
      LDFLAGS="${LDFLAGS} ${sd_dfti_ldflags}"


$as_echo "#define HAVE_DFTI 1" >>confdefs.h

    else
      if test "${sd_dfti_status}" = "optional" -a \
              "${sd_dfti_init}" = "def"; then
        sd_dfti_enable="no"
        sd_dfti_cppflags=""
        sd_dfti_cflags=""
        sd_dfti_fcflags=""
        sd_dfti_ldflags=""
        sd_dfti_libs=""
      else
        { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "invalid DFTI configuration
See \`config.log' for more details" "$LINENO" 5; }
      fi
    fi
  else
    sd_dfti_enable="no"
    sd_dfti_cppflags=""
    sd_dfti_cflags=""
    sd_dfti_fcflags=""
    sd_dfti_ldflags=""
    sd_dfti_libs=""
  fi

        if test "${sd_dfti_ok}" = "yes"; then
          sd_fft_cppflags="${sd_dfti_cppflags}"
          sd_fft_cflags="${sd_dfti_cflags}"
          sd_fft_fcflags="${sd_dfti_fcflags}"
          sd_fft_ldflags="${sd_dfti_ldflags}"
          sd_fft_libs="${sd_dfti_libs}"
          sd_fft_ok="yes"
        fi
        ;;
      fftw3|fftw3-threads|aocl|AOCL|nvpl)
        if test "${sd_fft_flavor}" = "nvpl"; then
          sd_fftw3_cppflags="${sd_fftw3_cppflags} -Mnvpl=fft"
          sd_fftw3_cflags="${sd_fftw3_cflags} -Mnvpl=fft"
          sd_fftw3_fcflags="${sd_fftw3_fcflags} -Mnvpl=fft"
          sd_fftw3_ldflags="${sd_fftw3_ldflags} -Mnvpl=fft"
          sd_fftw3_libs="${sd_fftw3_libs} -Mnvpl=fft"
        fi

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable FFTW3" >&5
$as_echo_n "checking whether to enable FFTW3... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fftw3_enable}" >&5
$as_echo "${sd_fftw3_enable}" >&6; }
  if test "${sd_fftw3_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how FFTW3 parameters have been set" >&5
$as_echo_n "checking how FFTW3 parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fftw3_init}" >&5
$as_echo "${sd_fftw3_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFTW3 C preprocessing flags" >&5
$as_echo_n "checking for FFTW3 C preprocessing flags... " >&6; }
    if test "${sd_fftw3_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fftw3_cppflags}" >&5
$as_echo "${sd_fftw3_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFTW3 C flags" >&5
$as_echo_n "checking for FFTW3 C flags... " >&6; }
    if test "${sd_fftw3_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fftw3_cflags}" >&5
$as_echo "${sd_fftw3_cflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFTW3 Fortran flags" >&5
$as_echo_n "checking for FFTW3 Fortran flags... " >&6; }
    if test "${sd_fftw3_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fftw3_fcflags}" >&5
$as_echo "${sd_fftw3_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFTW3 linker flags" >&5
$as_echo_n "checking for FFTW3 linker flags... " >&6; }
    if test "${sd_fftw3_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fftw3_ldflags}" >&5
$as_echo "${sd_fftw3_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFTW3 library flags" >&5
$as_echo_n "checking for FFTW3 library flags... " >&6; }
    if test "${sd_fftw3_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fftw3_libs}" >&5
$as_echo "${sd_fftw3_libs}" >&6; }
    fi
  fi


  # Check whether we can compile and link a simple program
  # and update build flags if successful
  if test "${sd_fftw3_enable}" = "auto" -o "${sd_fftw3_enable}" = "yes"; then

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  if test "${sd_fftw3_init}" = "esl"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: will look for FFTW3 in the installed ESL Bundle" >&5
$as_echo "$as_me: will look for FFTW3 in the installed ESL Bundle" >&6;}

  CPPFLAGS="${CPPFLAGS} ${sd_esl_bundle_cppflags}"
  CFLAGS="${CFLAGS} ${sd_esl_bundle_cflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_esl_bundle_cxxflags}"
  FCFLAGS="${FCFLAGS} ${sd_esl_bundle_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_esl_bundle_ldflags}"
  if test ! -z ""; then
    CPPFLAGS="${CPPFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
    FCFLAGS="${FCFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
  fi
  FCFLAGS="${FCFLAGS} -I/usr/include"


  LIBS="${sd_esl_bundle_libdirs} ${sd_fftw3_libs_def} ${sd_esl_bundle_libs} ${LIBS}"

  else
    CPPFLAGS="${CPPFLAGS} ${sd_fftw3_cppflags}"
    CFLAGS="${CFLAGS} ${sd_fftw3_cflags}"
    FCFLAGS="${FCFLAGS} ${sd_fftw3_fcflags}"
    LDFLAGS="${LDFLAGS} ${sd_fftw3_ldflags}"
    LIBS="${sd_fftw3_libs} ${LIBS}"
  fi

  # Check FFTW3 API
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the FFTW3 library works" >&5
$as_echo_n "checking whether the FFTW3 library works... " >&6; }

  # ===== Fortran support
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

        integer(8) :: plan
        complex(8) :: ff(10)
        call dfftw_execute_dft(plan,ff,ff)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_fftw3_ok="yes"
else
  sd_fftw3_ok="no"
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


  # ===== C support
  # AC_LANG_PUSH([C])
  # AC_LINK_IFELSE([AC_LANG_PROGRAM(
  #   [[
  #   #include <fftw3.h>
  #   ]],
  #   [[
  #     fftw_plan *plan;
  #     fftw_complex *a1, *a2;
  #     fftw_execute_dft(*plan, a1, a2);
  #   ]])], [sd_fftw3_ok="yes"], [sd_fftw3_ok="no"])
  # AC_LANG_POP([C])

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fftw3_ok}" >&5
$as_echo "${sd_fftw3_ok}" >&6; }

  # Check for FFTW3 threads support
  if test "${sd_fftw3_ok}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the FFTW3 library supports threads" >&5
$as_echo_n "checking whether the FFTW3 library supports threads... " >&6; }

    # ===== Fortran support
    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

    cat > conftest.$ac_ext <<_ACEOF
      program main

        call dfftw_init_threads(2)
        call dfftw_plan_with_nthreads(8)
        call dfftw_cleanup_threads()

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_fftw3_threads_ok="yes"
else
  sd_fftw3_threads_ok="no"
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


    # ===== C support
    # AC_LANG_PUSH([C])
    # AC_LINK_IFELSE([AC_LANG_PROGRAM(
    #    [[
    #    #include <fftw3.h>
    #    ]],
    #    [[
    #    fftw_init_threads;
    #    ]])], [sd_fftw3_ok="yes"], [sd_fftw3_ok="no"])
    # AC_LANG_POP([C])

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fftw3_threads_ok}" >&5
$as_echo "${sd_fftw3_threads_ok}" >&6; }
  fi

  # Check for FFTW3 MPI support
  if test "${sd_fftw3_ok}" = "yes" -a "${sd_mpi_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the FFTW3 MPI library works" >&5
$as_echo_n "checking whether the FFTW3 MPI library works... " >&6; }

    # ===== Fortran support
    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

    cat > conftest.$ac_ext <<_ACEOF
      program main

        use,intrinsic :: iso_c_binding
        include 'fftw3-mpi.f03'
        call fftw_mpi_init()

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_fftw3_mpi_ok="yes"
else
  sd_fftw3_mpi_ok="no"
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


    # ===== C support
    # AC_LANG_PUSH([C])
    # AC_LINK_IFELSE([AC_LANG_PROGRAM(
    #   [[
    #   #include <fftw3-mpi.h>
    #   ]],
    #   [[
    #     fftw_mpi_init();
    #   ]])], [sd_fftw3_mpi_ok="yes"], [sd_fftw3_mpi_ok="no"])
    # AC_LANG_POP([C])

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fftw3_mpi_ok}" >&5
$as_echo "${sd_fftw3_mpi_ok}" >&6; }
  else
    sd_fftw3_mpi_ok="no"
  fi

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"



    if test "${sd_fftw3_ok}" = "yes"; then
      if test "${sd_fftw3_init}" = "esl"; then
        sd_esl_bundle_libs="${sd_fftw3_libs_def} ${sd_esl_bundle_libs}"
      else
        LIBS="${sd_fftw3_libs} ${LIBS}"
      fi
      LDFLAGS="${LDFLAGS} ${sd_fftw3_ldflags}"


$as_echo "#define HAVE_FFTW3 1" >>confdefs.h

    else
      if test "${sd_fftw3_status}" = "optional" -a \
              "${sd_fftw3_init}" = "def"; then
        sd_fftw3_enable="no"
        sd_fftw3_cppflags=""
        sd_fftw3_cflags=""
        sd_fftw3_fcflags=""
        sd_fftw3_ldflags=""
        sd_fftw3_libs=""
      else
        { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "invalid FFTW3 configuration
See \`config.log' for more details" "$LINENO" 5; }
      fi
    fi
  else
    sd_fftw3_enable="no"
    sd_fftw3_cppflags=""
    sd_fftw3_cflags=""
    sd_fftw3_fcflags=""
    sd_fftw3_ldflags=""
    sd_fftw3_libs=""
  fi

        if test "${sd_fft_flavor}" = "fftw3-threads" -a "${sd_fftw3_threads_ok}" != "yes"; then
          as_fn_error $? "invalid FFT configuration
                  Selected FFT flavor is fftw3-threads but FFTW3 implementation
                  does not provide multi-threading!
                  Check your environment." "$LINENO" 5
        fi
        if test "${sd_fftw3_ok}" = "yes"; then
          sd_fft_cppflags="${sd_fftw3_cppflags}"
          sd_fft_cflags="${sd_fftw3_cflags}"
          sd_fft_fcflags="${sd_fftw3_fcflags}"
          sd_fft_ldflags="${sd_fftw3_ldflags}"
          sd_fft_libs="${sd_fftw3_libs}"
          sd_fft_ok="yes"
          if test "${sd_mpi_ok}" = "yes" -a "${sd_fftw3_mpi_ok}" = "yes"; then

$as_echo "#define HAVE_FFTW3_MPI 1" >>confdefs.h

          fi
          if test "${sd_fftw3_threads_ok}" = "yes" ; then

$as_echo "#define HAVE_FFTW3_THREADS 1" >>confdefs.h

          fi
        fi
        ;;
      goedecker)
        { $as_echo "$as_me:${as_lineno-$LINENO}: selecting the internal Goedecker FFT implementation" >&5
$as_echo "$as_me: selecting the internal Goedecker FFT implementation" >&6;}
        sd_fft_ok="yes"
        ;;
      pfft)

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable PFFT" >&5
$as_echo_n "checking whether to enable PFFT... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_pfft_enable}" >&5
$as_echo "${sd_pfft_enable}" >&6; }
  if test "${sd_pfft_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how PFFT parameters have been set" >&5
$as_echo_n "checking how PFFT parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_pfft_init}" >&5
$as_echo "${sd_pfft_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PFFT C preprocessing flags" >&5
$as_echo_n "checking for PFFT C preprocessing flags... " >&6; }
    if test "${sd_pfft_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_pfft_cppflags}" >&5
$as_echo "${sd_pfft_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PFFT C flags" >&5
$as_echo_n "checking for PFFT C flags... " >&6; }
    if test "${sd_pfft_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_pfft_cflags}" >&5
$as_echo "${sd_pfft_cflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PFFT linker flags" >&5
$as_echo_n "checking for PFFT linker flags... " >&6; }
    if test "${sd_pfft_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_pfft_ldflags}" >&5
$as_echo "${sd_pfft_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PFFT library flags" >&5
$as_echo_n "checking for PFFT library flags... " >&6; }
    if test "${sd_pfft_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_pfft_libs}" >&5
$as_echo "${sd_pfft_libs}" >&6; }
    fi
  fi


  # Check whether we can compile and link a simple program
  # and update build flags if successful
  if test "${sd_pfft_enable}" = "auto" -o "${sd_pfft_enable}" = "yes"; then

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  if test "${sd_pfft_init}" = "esl"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: will look for PFFT in the installed ESL Bundle" >&5
$as_echo "$as_me: will look for PFFT in the installed ESL Bundle" >&6;}

  CPPFLAGS="${CPPFLAGS} ${sd_esl_bundle_cppflags}"
  CFLAGS="${CFLAGS} ${sd_esl_bundle_cflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_esl_bundle_cxxflags}"
  FCFLAGS="${FCFLAGS} ${sd_esl_bundle_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_esl_bundle_ldflags}"
  if test ! -z ""; then
    CPPFLAGS="${CPPFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
    FCFLAGS="${FCFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
  fi
  FCFLAGS="${FCFLAGS} -I/usr/include"


  LIBS="${sd_esl_bundle_libdirs} ${sd_pfft_libs_def} ${sd_esl_bundle_libs} ${LIBS}"

  else
    CPPFLAGS="${CPPFLAGS} ${sd_fftw3_cppflags} ${sd_pfft_cppflags}"
    CFLAGS="${CFLAGS} ${sd_fftw3_cflags} ${sd_pfft_cflags}"
    LDFLAGS="${LDFLAGS} ${sd_fftw3_ldflags} ${sd_pfft_ldflags}"
    LIBS="${sd_pfft_libs} ${sd_fftw3_libs} ${LIBS}"
  fi

  # Check PFFT MPI C API
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the PFFT library works" >&5
$as_echo_n "checking whether the PFFT library works... " >&6; }
  if test "${sd_mpi_enable}" = "yes" -a "${sd_fftw3_mpi_ok}" = "yes"; 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

    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#       include <pfft.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

        pfft_init();

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  sd_pfft_ok="yes"
else
  sd_pfft_ok="no"
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

  else
    sd_pfft_ok="no"
  fi
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_pfft_ok}" >&5
$as_echo "${sd_pfft_ok}" >&6; }

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"



    if test "${sd_pfft_ok}" = "yes"; then
      if test "${sd_pfft_init}" = "esl"; then
        sd_esl_bundle_libs="${sd_pfft_libs_def} ${sd_esl_bundle_libs}"
      else
        LIBS="${sd_pfft_libs} ${LIBS}"
      fi
      LDFLAGS="${LDFLAGS} ${sd_pfft_ldflags}"


$as_echo "#define HAVE_PFFT 1" >>confdefs.h

    else
      if test "${sd_pfft_status}" = "optional" -a \
              "${sd_pfft_init}" = "def"; then
        sd_pfft_enable="no"
        sd_pfft_cppflags=""
        sd_pfft_cflags=""
        sd_pfft_ldflags=""
        sd_pfft_libs=""
      else
        { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "invalid PFFT configuration
See \`config.log' for more details" "$LINENO" 5; }
      fi
    fi
  else
    sd_pfft_enable="no"
    sd_pfft_cppflags=""
    sd_pfft_cflags=""
    sd_pfft_ldflags=""
    sd_pfft_libs=""
  fi

        if test "${sd_pfft_ok}" = "yes"; then
          sd_fft_cppflags="${sd_pfft_cppflags}"
          sd_fft_cflags="${sd_pfft_cflags}"
          sd_fft_fcflags="${sd_pfft_fcflags}"
          sd_fft_ldflags="${sd_pfft_ldflags}"
          sd_fft_libs="${sd_pfft_libs}"
          sd_fft_ok="yes"
        fi
        ;;
      *)
        as_fn_error $? "unsupported FFT flavor: '${sd_fft_flavor}'" "$LINENO" 5
        ;;
    esac

    test "${sd_fft_ok}" = "yes" && break

  done

  # Check that a working FFT implementation has been found
  if test "${sd_fft_ok}" = "yes"; then
    sd_fft_enable="yes"
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the actual FFT flavor to use" >&5
$as_echo_n "checking for the actual FFT flavor to use... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_fft_flavor}" >&5
$as_echo "${sd_fft_flavor}" >&6; }
  else
    as_fn_error $? "invalid FFT configuration
                  Please adjust configure options to point to a working FFT
                  installation or change the requested FFT flavor through the
                  --with-fft-flavor option." "$LINENO" 5
  fi

else
  echo "Skip FFT setting : linalg not enabled..."
fi

# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #

#
# Profiling and performance analysis
#

#ABI_MSG_SECTION([Profiling and performance analysis])

# ---------------------------------------------------------------------------- #

#
# Feature triggers (optional features)
#



  abi_sec_title="Feature triggers"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# VERY IMPORTANT: THE ORDER IS CRITICAL - DO NOT CHANGE IT!

# Note: some of the following packages are mandatory to run Abinit with
#       full capabilities, although internal implementations may provide
#       limited functionality in some cases

                       # ------------------------------ #

# PAPI library support

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable PAPI" >&5
$as_echo_n "checking whether to enable PAPI... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_papi_enable}" >&5
$as_echo "${sd_papi_enable}" >&6; }
  if test "${sd_papi_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how PAPI parameters have been set" >&5
$as_echo_n "checking how PAPI parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_papi_init}" >&5
$as_echo "${sd_papi_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PAPI C preprocessing flags" >&5
$as_echo_n "checking for PAPI C preprocessing flags... " >&6; }
    if test "${sd_papi_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_papi_cppflags}" >&5
$as_echo "${sd_papi_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PAPI C flags" >&5
$as_echo_n "checking for PAPI C flags... " >&6; }
    if test "${sd_papi_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_papi_cflags}" >&5
$as_echo "${sd_papi_cflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PAPI linker flags" >&5
$as_echo_n "checking for PAPI linker flags... " >&6; }
    if test "${sd_papi_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_papi_ldflags}" >&5
$as_echo "${sd_papi_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PAPI library flags" >&5
$as_echo_n "checking for PAPI library flags... " >&6; }
    if test "${sd_papi_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_papi_libs}" >&5
$as_echo "${sd_papi_libs}" >&6; }
    fi
  fi


  # Check whether we can compile and link a simple program
  # and update build flags if successful
  if test "${sd_papi_enable}" = "auto" -o "${sd_papi_enable}" = "yes"; then

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  if test "${sd_papi_init}" = "esl"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: will look for PAPI in the installed ESL Bundle" >&5
$as_echo "$as_me: will look for PAPI in the installed ESL Bundle" >&6;}

  CPPFLAGS="${CPPFLAGS} ${sd_esl_bundle_cppflags}"
  CFLAGS="${CFLAGS} ${sd_esl_bundle_cflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_esl_bundle_cxxflags}"
  FCFLAGS="${FCFLAGS} ${sd_esl_bundle_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_esl_bundle_ldflags}"
  if test ! -z ""; then
    CPPFLAGS="${CPPFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
    FCFLAGS="${FCFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
  fi
  FCFLAGS="${FCFLAGS} -I/usr/include"


  LIBS="${sd_esl_bundle_libdirs} ${sd_papi_libs_def} ${sd_esl_bundle_libs} ${LIBS}"

  else
    CPPFLAGS="${CPPFLAGS} ${sd_papi_cppflags}"
    CFLAGS="${CFLAGS} ${sd_papi_cflags}"
    LDFLAGS="${LDFLAGS} ${sd_papi_ldflags}"
    LIBS="${sd_papi_libs} ${LIBS}"
  fi

  # Add rt support if available on the machine
  if test "${PAPI_LIBS}" = ""; 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

    for ac_header in time.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "time.h" "ac_cv_header_time_h" "$ac_includes_default"
if test "x$ac_cv_header_time_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_TIME_H 1
_ACEOF

fi

done

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
if ${ac_cv_lib_rt_clock_gettime+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lrt  $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.  */
#ifdef __cplusplus
extern "C"
#endif
char clock_gettime ();
#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{
return clock_gettime ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_rt_clock_gettime=yes
else
  ac_cv_lib_rt_clock_gettime=no
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
  sd_papi_rt_libs="-lrt"
else
  sd_papi_rt_libs=""
fi

    for ac_func in clock_gettime
do :
  ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime"
if test "x$ac_cv_func_clock_gettime" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_CLOCK_GETTIME 1
_ACEOF

fi
done

    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

    sd_papi_libs="${sd_papi_rt_libs} ${sd_papi_libs}"
  fi

  # Check C headers
  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

  for ac_header in papi.h f90papi.h
do :
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
  cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
 sd_papi_has_hdrs="yes"
else
  sd_papi_has_hdrs="no"
fi

done

  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


  # Check Fortran support
  if test "${sd_papi_has_hdrs}" = "yes"; then
    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the specified PAPI library works" >&5
$as_echo_n "checking whether the specified PAPI library works... " >&6; }
    cat > conftest.$ac_ext <<_ACEOF
      program main

#       if defined HAVE_F90PAPI_H
#       include "f90papi.h"
#       endif
        call PAPIf_library_init

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_papi_ok="yes"
else
  sd_papi_ok="no"
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_papi_ok}" >&5
$as_echo "${sd_papi_ok}" >&6; }
    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

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"



    if test "${sd_papi_ok}" = "yes"; then
      if test "${sd_papi_init}" = "esl"; then
        sd_esl_bundle_libs="${sd_papi_libs_def} ${sd_esl_bundle_libs}"
      else
        LIBS="${sd_papi_libs} ${LIBS}"
      fi
      LDFLAGS="${LDFLAGS} ${sd_papi_ldflags}"


$as_echo "#define HAVE_PAPI 1" >>confdefs.h

    else
      if test "${sd_papi_status}" = "optional" -a \
              "${sd_papi_init}" = "def"; then
        sd_papi_enable="no"
        sd_papi_cppflags=""
        sd_papi_cflags=""
        sd_papi_ldflags=""
        sd_papi_libs=""
      else
        { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "invalid PAPI configuration
See \`config.log' for more details" "$LINENO" 5; }
      fi
    fi
  else
    sd_papi_enable="no"
    sd_papi_cppflags=""
    sd_papi_cflags=""
    sd_papi_ldflags=""
    sd_papi_libs=""
  fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the internal Abinit timer" >&5
$as_echo_n "checking whether to enable the internal Abinit timer... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_timer_enable}" >&5
$as_echo "${abi_timer_enable}" >&6; }
if test "${sd_papi_ok}" != "yes"; then
  if test "${abi_timer_enable}" = "yes"; then

$as_echo "#define HAVE_TIMER_ABINIT 1" >>confdefs.h

  fi
fi

                       # ------------------------------ #

# HDF5 library support

  # Check whether we can compile and link a simple program
  # and update build flags if successful
  if test "${sd_hdf5_enable}" = "auto" -o "${sd_hdf5_enable}" = "yes"; then
    if test "${sd_hdf5_init}" != "env"; then

  if test "${H5CC}" = ""; then
    tmp_h5cc_search="h5cc"
    if test "${sd_mpi_ok}" = "yes"; then
      tmp_h5cc_search="h5pcc ${tmp_h5cc_search}"
    fi
    case "${sd_hdf5_init}" in
      dir)
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a HDF5-aware compiler" >&5
$as_echo_n "checking for a HDF5-aware compiler... " >&6; }
        for tmp_h5cc in ${tmp_h5cc_search}; do
          if test -x "${sd_hdf5_prefix}/bin/${tmp_h5cc}"; then
            sd_hdf5_h5cc="${sd_hdf5_prefix}/bin/${tmp_h5cc}"
            break
          fi
        done
        if test "${sd_hdf5_h5cc}" = ""; then
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
        else
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_h5cc}" >&5
$as_echo "${sd_hdf5_h5cc}" >&6; }
        fi
        ;;
      *)
        for ac_prog in ${tmp_h5cc_search}
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_prog_sd_hdf5_h5cc+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$sd_hdf5_h5cc"; then
  ac_cv_prog_sd_hdf5_h5cc="$sd_hdf5_h5cc" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_sd_hdf5_h5cc="$ac_prog"
    $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

fi
fi
sd_hdf5_h5cc=$ac_cv_prog_sd_hdf5_h5cc
if test -n "$sd_hdf5_h5cc"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sd_hdf5_h5cc" >&5
$as_echo "$sd_hdf5_h5cc" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$sd_hdf5_h5cc" && break
done

        ;;
    esac
    unset tmp_h5cc_search
    unset tmp_h5cc
  else
    ${H5CC} -show >/dev/null 2>&1
    if test "${?}" != "0"; then
      as_fn_error $? "invalid HDF5-aware compiler:
                  H5CC = '${H5CC}'" "$LINENO" 5
    fi
    sd_hdf5_h5cc="${H5CC}"
  fi   # H5CC = ""

  if test "${sd_hdf5_h5cc}" != ""; then

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the HDF5 install prefix" >&5
$as_echo_n "checking for the HDF5 install prefix... " >&6; }
    if test "${sd_hdf5_prefix}" = ""; then
      sd_hdf5_prefix=`${sd_hdf5_h5cc} -showconfig | grep 'Installation point:' | awk '{print $NF}'`
    fi
    if test "${sd_hdf5_prefix}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_prefix}" >&5
$as_echo "${sd_hdf5_prefix}" >&6; }
    fi

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the HDF5 build flavor" >&5
$as_echo_n "checking for the HDF5 build flavor... " >&6; }
    sd_hdf5_flavor=`${sd_hdf5_h5cc} -showconfig | grep 'Flavor name:' | awk '{print $NF}'`
    if test "${sd_hdf5_flavor}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_flavor}" >&5
$as_echo "${sd_hdf5_flavor}" >&6; }
    fi

    if test "${sd_hdf5_enable_fc}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HDF5 supports Fortran" >&5
$as_echo_n "checking whether HDF5 supports Fortran... " >&6; }
      sd_hdf5_has_fc=`${sd_hdf5_h5cc} -showconfig | grep 'Fortran:' | awk '{print $NF}'`
      test "${sd_hdf5_has_fc}" = "" && sd_hdf5_has_fc="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_has_fc}" >&5
$as_echo "${sd_hdf5_has_fc}" >&6; }
    else
      sd_hdf5_has_fc="no"
    fi

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HDF5 high-level libraries" >&5
$as_echo_n "checking for HDF5 high-level libraries... " >&6; }
    tmp_hdf5_hl=`${sd_hdf5_h5cc} -showconfig | grep 'High[ \-][Ll]evel library:' | awk '{print $NF}'`
    if test "${tmp_hdf5_hl}" = "yes"; then
      sd_hdf5_libs_hl="-lhdf5_hl"
      test "${sd_hdf5_enable_fc}" = "yes" -a "${sd_hdf5_has_fc}" = "yes" && \
        sd_hdf5_libs_hl="-lhdf5hl_fortran ${sd_hdf5_libs_hl}"
    fi
    if test "${sd_hdf5_libs_hl}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_libs_hl}" >&5
$as_echo "${sd_hdf5_libs_hl}" >&6; }
    fi
    unset tmp_hdf5_hl

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HDF5 extra dependencies" >&5
$as_echo_n "checking for HDF5 extra dependencies... " >&6; }
    sd_hdf5_libs_extra=`${sd_hdf5_h5cc} -showconfig | grep 'Extra libraries: ' | sed -e 's/.*Extra libraries: //' -e 's/m\;dl\;//' -e 's/m\;dl//'`
    if test "${sd_hdf5_libs_extra}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_libs_extra}" >&5
$as_echo "${sd_hdf5_libs_extra}" >&6; }
    fi

    if test "${sd_mpi_ok}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HDF5 supports MPI" >&5
$as_echo_n "checking whether HDF5 supports MPI... " >&6; }
      sd_hdf5_has_mpi=`${sd_hdf5_h5cc} -showconfig | grep 'Parallel HDF5:' | awk '{print $NF}' | sed 's/ON/yes/'`
      test "${sd_hdf5_has_mpi}" = "" && sd_hdf5_has_mpi="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_has_mpi}" >&5
$as_echo "${sd_hdf5_has_mpi}" >&6; }
    else
      sd_hdf5_has_mpi="no"
    fi

    tmp_hdf5_incs=""
    tmp_hdf5_libdirs=""
    for arg in `${sd_hdf5_h5cc} -show`; do
      case ${arg} in
        -I*)
          tmp_hdf5_incs="${tmp_hdf5_incs} ${arg}"
          ;;
        -L*)
          tmp_hdf5_libdirs="${tmp_hdf5_libdirs} ${arg}"
        ;;
      esac
    done
    sd_hdf5_cppflags="${sd_hdf5_cppflags} ${tmp_hdf5_incs}"
    test "${sd_hdf5_enable_fc}" = "yes" && \
      sd_hdf5_fcflags="${sd_hdf5_fcflags} ${tmp_hdf5_incs}"
    sd_hdf5_libs="${tmp_hdf5_libdirs} ${sd_hdf5_libs_hl} ${sd_hdf5_libs} ${sd_hdf5_libs_extra}"
    unset arg
    unset tmp_hdf5_incs
    unset tmp_hdf5_libdirs

  fi   # sd_hdf5_cc != ""

    fi
    if test "${sd_hdf5_h5cc}" = ""; then
      if test "${sd_hdf5_cascade}" = "yes"; then

  sd_hdf5_cppflags="${sd_hdf5_cppflags_def}"
  sd_hdf5_cflags="${sd_hdf5_cflags_def}"
  sd_hdf5_cxxflags="${sd_hdf5_cxxflags_def}"
  test "${sd_hdf5_enable_fc}" = "yes" && \
    sd_hdf5_fcflags="${sd_hdf5_fcflags_def}"
  sd_hdf5_ldflags="${sd_hdf5_ldflags_def}"
  sd_hdf5_libs="${sd_hdf5_libs_def}"
  test ! -z "${HDF5_CPPFLAGS}" && sd_hdf5_cppflags="${HDF5_CPPFLAGS}"
  test ! -z "${HDF5_CFLAGS}" && sd_hdf5_cflags="${HDF5_CFLAGS}"
  test ! -z "${HDF5_CXXFLAGS}" && sd_hdf5_cxxflags="${HDF5_CXXFLAGS}"
  if test "${sd_hdf5_enable_fc}" = "yes"; then
    test ! -z "${HDF5_FFLAGS}" && sd_hdf5_fcflags="${HDF5_FFLAGS}"
    test ! -z "${HDF5_FCFLAGS}" && sd_hdf5_fcflags="${HDF5_FCFLAGS}"
  fi
  test ! -z "${HDF5_LDFLAGS}" && sd_hdf5_ldflags="${HDF5_LDFLAGS}"
  test ! -z "${HDF5_LIBS}" && sd_hdf5_libs="${HDF5_LIBS}"

      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find the HDF5 C compiler
                    Please set the H5CC environment variable to a valid HDF5
                    C compiler (usually called 'h5cc' or 'h5pcc'), so that
                    essential information about your HDF5 installation will be
                    exposed to the build system of ABINIT." >&5
$as_echo "$as_me: WARNING: could not find the HDF5 C compiler
                    Please set the H5CC environment variable to a valid HDF5
                    C compiler (usually called 'h5cc' or 'h5pcc'), so that
                    essential information about your HDF5 installation will be
                    exposed to the build system of ABINIT." >&2;}
      fi
    fi


  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable HDF5" >&5
$as_echo_n "checking whether to enable HDF5... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_enable}" >&5
$as_echo "${sd_hdf5_enable}" >&6; }
  if test "${sd_hdf5_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how HDF5 parameters have been set" >&5
$as_echo_n "checking how HDF5 parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_init}" >&5
$as_echo "${sd_hdf5_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HDF5 C preprocessing flags" >&5
$as_echo_n "checking for HDF5 C preprocessing flags... " >&6; }
    if test "${sd_hdf5_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_cppflags}" >&5
$as_echo "${sd_hdf5_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HDF5 C flags" >&5
$as_echo_n "checking for HDF5 C flags... " >&6; }
    if test "${sd_hdf5_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_cflags}" >&5
$as_echo "${sd_hdf5_cflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HDF5 C++ flags" >&5
$as_echo_n "checking for HDF5 C++ flags... " >&6; }
    if test "${sd_hdf5_cxxflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_cxxflags}" >&5
$as_echo "${sd_hdf5_cxxflags}" >&6; }
    fi
    if test "${sd_hdf5_enable_fc}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HDF5 Fortran flags" >&5
$as_echo_n "checking for HDF5 Fortran flags... " >&6; }
      if test "${sd_hdf5_fcflags}" = ""; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_fcflags}" >&5
$as_echo "${sd_hdf5_fcflags}" >&6; }
      fi
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HDF5 linker flags" >&5
$as_echo_n "checking for HDF5 linker flags... " >&6; }
    if test "${sd_hdf5_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_ldflags}" >&5
$as_echo "${sd_hdf5_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HDF5 library flags" >&5
$as_echo_n "checking for HDF5 library flags... " >&6; }
    if test "${sd_hdf5_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_libs}" >&5
$as_echo "${sd_hdf5_libs}" >&6; }
    fi
  fi


  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  CPPFLAGS="${CPPFLAGS} ${sd_hdf5_cppflags}"
  CFLAGS="${CFLAGS} ${sd_hdf5_cflags}"
  CXXFLAGS="${CFLAGS} ${sd_hdf5_cxxflags}"
  FCFLAGS="${FCFLAGS} ${sd_hdf5_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_hdf5_ldflags}"
  LIBS="${sd_hdf5_libs} ${LIBS}"

  # Look for hdf5.h
  for ac_header in hdf5.h
do :
  ac_fn_c_check_header_mongrel "$LINENO" "hdf5.h" "ac_cv_header_hdf5_h" "$ac_includes_default"
if test "x$ac_cv_header_hdf5_h" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_HDF5_H 1
_ACEOF
 sd_hdf5_hdr_ok="yes"
else
  sd_hdf5_hdr_ok="no"
fi

done

  if test "${sd_hdf5_hdr_ok}" != "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find the HDF5 C header
                  Detecting HDF5 is a complex task due to the very high number
                  of possible configurations. If you do want to use HDF5,
                  please help the build system by pointing correctly the
                  HDF5_CPPFLAGS, HDF5_FCFLAGS and HDF5_LIBS parameters to
                  where the desired hdf5.h and libhdf5.* files are installed." >&5
$as_echo "$as_me: WARNING: could not find the HDF5 C header
                  Detecting HDF5 is a complex task due to the very high number
                  of possible configurations. If you do want to use HDF5,
                  please help the build system by pointing correctly the
                  HDF5_CPPFLAGS, HDF5_FCFLAGS and HDF5_LIBS parameters to
                  where the desired hdf5.h and libhdf5.* files are installed." >&2;}
  fi

  # Check HDF5 C API
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the HDF5 C interface works" >&5
$as_echo_n "checking whether the HDF5 C interface works... " >&6; }
  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

  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#include <hdf5.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

      hid_t file_id;
      file_id = H5Fcreate("conftest.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  sd_hdf5_c_ok="yes"
else
  sd_hdf5_c_ok="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_c_ok}" >&5
$as_echo "${sd_hdf5_c_ok}" >&6; }

  # Check HDF5 Fortran API
  if test "${sd_hdf5_c_ok}" = "yes" -a "${sd_hdf5_enable_fc}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the HDF5 Fortran interface works" >&5
$as_echo_n "checking whether the HDF5 Fortran interface works... " >&6; }
    for tmp_incs in "" "-I/usr/include"; do
      FCFLAGS="${FCFLAGS} ${tmp_incs}"
      ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

      cat > conftest.$ac_ext <<_ACEOF
      program main

          use hdf5
          integer(hid_t) :: file_id
          integer :: ierr
          call h5open_f(ierr)
          call h5fcreate_f("conftest.h5f", H5F_ACC_TRUNC_F, file_id, ierr)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_hdf5_fortran_ok="yes"
else
  sd_hdf5_fortran_ok="no"
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 "${sd_hdf5_fortran_ok}" = "yes"; then
        test "${sd_fc_sys_incpath}" = "" && sd_fc_sys_incpath="${tmp_incs}"
        break
      fi
    done
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_fortran_ok}" >&5
$as_echo "${sd_hdf5_fortran_ok}" >&6; }
  fi
  unset tmp_incs

  # Check HDF5 parallel API
  if test "${sd_hdf5_c_ok}" = "yes" -a "${sd_mpi_ok}" = "yes" -a \
          "${sd_hdf5_has_mpi}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the parallel HDF5 API works" >&5
$as_echo_n "checking whether the parallel HDF5 API works... " >&6; }
    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

    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#include <mpi.h>
#include <hdf5.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

        hid_t acc_tpl, file_id;
        herr_t ret;
        MPI_Comm comm = MPI_COMM_WORLD;
        MPI_Info info = MPI_INFO_NULL;
        acc_tpl = H5Pcreate(H5P_FILE_ACCESS);
        ret = H5Pset_fapl_mpio(acc_tpl, comm, info);
        file_id = H5Fcreate("conftest.h5", H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl);

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  sd_hdf5_mpi_ok="yes"
else
  sd_hdf5_mpi_ok="no"
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

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_hdf5_mpi_ok}" >&5
$as_echo "${sd_hdf5_mpi_ok}" >&6; }
  else
    sd_hdf5_has_mpi="no"
    sd_hdf5_mpi_ok="no"
  fi

  # Combine the available results
  sd_hdf5_ok="no"
  if test "${sd_hdf5_enable_fc}" = "yes"; then
    if test "${sd_hdf5_c_ok}" = "yes" -a \
            "${sd_hdf5_fortran_ok}" = "yes"; then
      sd_hdf5_ok="yes"
    fi
  else
    if test "${sd_hdf5_c_ok}" = "yes"; then
      sd_hdf5_ok="yes"
    fi
  fi

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"



    if test "${sd_hdf5_ok}" = "yes"; then
      CPPFLAGS="${CPPFLAGS} ${sd_hdf5_cppflags}"
      CFLAGS="${CFLAGS} ${sd_hdf5_cflags}"
      CXXFLAGS="${CXXFLAGS} ${sd_hdf5_cxxflags}"
      FCFLAGS="${FCFLAGS} ${sd_hdf5_fcflags}"
      LDFLAGS="${LDFLAGS} ${sd_hdf5_ldflags}"
      LIBS="${sd_hdf5_libs} ${LIBS}"


$as_echo "#define HAVE_HDF5 1" >>confdefs.h

      if test "${sd_hdf5_mpi_ok}" = "yes"; then

$as_echo "#define HAVE_HDF5_MPI 1" >>confdefs.h

      fi
    else
      if test "${sd_hdf5_status}" = "optional" -a \
              "${sd_hdf5_init}" = "def"; then
        sd_hdf5_enable="no"
        sd_hdf5_cppflags=""
        sd_hdf5_cflags=""
        sd_hdf5_cxxflags=""
        sd_hdf5_fcflags=""
        sd_hdf5_ldflags=""
        sd_hdf5_libs=""
      else
        if test "${sd_hdf5_policy}" = "fail"; 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 $? "invalid HDF5 configuration
See \`config.log' for more details" "$LINENO" 5; }
        else
              { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid HDF5 configuration" >&5
$as_echo "$as_me: WARNING: invalid HDF5 configuration" >&2;}
        fi
      fi
    fi
  else
    sd_hdf5_enable="no"
    sd_hdf5_cppflags=""
    sd_hdf5_cflags=""
    sd_hdf5_cxxflags=""
    sd_hdf5_fcflags=""
    sd_hdf5_ldflags=""
    sd_hdf5_libs=""
  fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: dumping HDF5 parameters for diagnostics" >&5
$as_echo "$as_me: dumping HDF5 parameters for diagnostics" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: ---------------------------------------" >&5
$as_echo "$as_me: ---------------------------------------" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}:    * sd_hdf5_enable = ${sd_hdf5_enable}" >&5
$as_echo "$as_me:    * sd_hdf5_enable = ${sd_hdf5_enable}" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}:    * sd_hdf5_status = ${sd_hdf5_status}" >&5
$as_echo "$as_me:    * sd_hdf5_status = ${sd_hdf5_status}" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}:    * sd_hdf5_h5cc = ${sd_hdf5_h5cc}" >&5
$as_echo "$as_me:    * sd_hdf5_h5cc = ${sd_hdf5_h5cc}" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}:    * sd_hdf5_has_mpi = ${sd_hdf5_has_mpi}" >&5
$as_echo "$as_me:    * sd_hdf5_has_mpi = ${sd_hdf5_has_mpi}" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}

## Parallel NetCDF requires a few conditions to work
# TODO abi_netcdf_mpi_enable not defined
#if test "${abi_netcdf_mpi_enable}" = "yes"; then
#  if test "${sd_mpi_ok}" != "yes"; then
#    AC_MSG_ERROR([parallel NetCDF requested but MPI is not available])
#  fi
#  if test "${abi_mpi_io_enable}" != "yes"; then
#    AC_MSG_ERROR([parallel NetCDF requested but MPI I/O is disabled])
#  fi
#  if test "${sd_hdf5_mpi_ok}" != "yes"; then
#    AC_MSG_ERROR([parallel NetCDF requested but parallel HDF5 is not available])
#  fi
#fi

# NetCDF library support (must be done after HDF5)

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable NetCDF" >&5
$as_echo_n "checking whether to enable NetCDF... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_enable}" >&5
$as_echo "${sd_netcdf_enable}" >&6; }
  if test "${sd_netcdf_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how the NetCDF parameters have been set" >&5
$as_echo_n "checking how the NetCDF parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_init}" >&5
$as_echo "${sd_netcdf_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NetCDF C preprocessing flags" >&5
$as_echo_n "checking for NetCDF C preprocessing flags... " >&6; }
    if test "${sd_netcdf_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_cppflags}" >&5
$as_echo "${sd_netcdf_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NetCDF C flags" >&5
$as_echo_n "checking for NetCDF C flags... " >&6; }
    if test "${sd_netcdf_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_cflags}" >&5
$as_echo "${sd_netcdf_cflags}" >&6; }
    fi
    if test "${sd_netcdf_enable_cxx}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NetCDF C++ flags" >&5
$as_echo_n "checking for NetCDF C++ flags... " >&6; }
      if test "${sd_netcdf_cxxflags}" = ""; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_cxxflags}" >&5
$as_echo "${sd_netcdf_cxxflags}" >&6; }
      fi
    fi
    if test "${sd_netcdf_enable_fc}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NetCDF Fortran flags" >&5
$as_echo_n "checking for NetCDF Fortran flags... " >&6; }
      if test "${sd_netcdf_fcflags}" = ""; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fcflags}" >&5
$as_echo "${sd_netcdf_fcflags}" >&6; }
      fi
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NetCDF linker flags" >&5
$as_echo_n "checking for NetCDF linker flags... " >&6; }
    if test "${sd_netcdf_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_ldflags}" >&5
$as_echo "${sd_netcdf_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NetCDF library flags" >&5
$as_echo_n "checking for NetCDF library flags... " >&6; }
    if test "${sd_netcdf_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_libs}" >&5
$as_echo "${sd_netcdf_libs}" >&6; }
    fi
  fi


  # Check whether we can compile and link a simple program
  # and update build flags if successful
  if test "${sd_netcdf_enable}" = "auto" -o "${sd_netcdf_enable}" = "yes"; then

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  CPPFLAGS="${CPPFLAGS} ${sd_netcdf_cppflags}"
  CFLAGS="${CFLAGS} ${sd_netcdf_cflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_netcdf_cxxflags}"
  FCFLAGS="${FCFLAGS} ${sd_netcdf_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_netcdf_ldflags}"
  LIBS="${sd_netcdf_libs} ${LIBS}"

  # Check NetCDF C API
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the NetCDF C interface works" >&5
$as_echo_n "checking whether the NetCDF C interface works... " >&6; }
  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

  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#     include <netcdf.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

      const char fname[12] = "conftest.nc\0";
      int ierr, ncid;
      ierr = nc_open(fname, NC_WRITE, &ncid);

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  sd_netcdf_ok="yes"
else
  sd_netcdf_ok="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_ok}" >&5
$as_echo "${sd_netcdf_ok}" >&6; }

  # Check if we can do parallel I/O
  #echo "netcdf-c : Check if we can do parallel I/O"
  if test "${sd_netcdf_ok}" = "yes" -a "${sd_mpi_ok}" = "yes"; then
    #echo -e "\r JMB Check // IO netcdf-c"
    if test "${sd_hdf5_mpi_ok}" = "yes"; then
      #echo " sd_hdf5_mpi_ok = yes"
      #echo " whether NetCDF has parallel I/O"
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NetCDF has parallel I/O" >&5
$as_echo_n "checking whether NetCDF has parallel I/O... " >&6; }
      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

      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#         include <mpi.h>
#         include <netcdf.h>
#         include <netcdf_par.h>
#         include <stdio.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

          MPI_Init(NULL,NULL);
          MPI_Comm comm = MPI_COMM_WORLD;
          MPI_Info info = MPI_INFO_NULL;

          int ierr, ncid;
          ierr = nc_create_par("conftest.nc", NC_MPIIO | NC_NETCDF4, comm, info, &ncid);
          printf("  nc_create_par : ierr= %d\n",ierr);
          ierr = nc_close(ncid);
          printf("  nc_close : ierr= %d\n",ierr);
          MPI_Finalize();

          if(ierr != 0) return 1;


  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  sd_netcdf_mpi_ok="yes"
else
  sd_netcdf_mpi_ok="no"
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

      echo "  sd_netcdf_mpi_ok = ${sd_netcdf_mpi_ok}"
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_mpi_ok}" >&5
$as_echo "${sd_netcdf_mpi_ok}" >&6; }
    else
      sd_netcdf_mpi_ok="no"
    fi
  fi

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"



    if test "${sd_netcdf_ok}" = "yes"; then
      CPPFLAGS="${CPPFLAGS} ${sd_netcdf_cppflags}"
      CFLAGS="${CFLAGS} ${sd_netcdf_cflags}"
      CXXFLAGS="${CXXFLAGS} ${sd_netcdf_cxxflags}"
      FCFLAGS="${FCFLAGS} ${sd_netcdf_fcflags}"
      LDFLAGS="${LDFLAGS} ${sd_netcdf_ldflags}"
      LIBS="${sd_netcdf_libs} ${LIBS}"


$as_echo "#define HAVE_NETCDF 1" >>confdefs.h


      if test "${sd_mpi_ok}" = "yes" -a "${sd_netcdf_mpi_ok}" = "yes"; then

$as_echo "#define HAVE_NETCDF_MPI 1" >>confdefs.h

      fi
    else
      if test "${sd_netcdf_status}" = "optional" -a \
              "${sd_netcdf_init}" = "def"; then
        sd_netcdf_enable="no"
        sd_netcdf_cppflags=""
        sd_netcdf_cflags=""
        sd_netcdf_cxxflags=""
        sd_netcdf_fcflags=""
        sd_netcdf_ldflags=""
        sd_netcdf_libs=""
      else
        if test "${sd_netcdf_policy}" = "fail"; 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 $? "invalid NetCDF configuration
See \`config.log' for more details" "$LINENO" 5; }
        else
              { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid NetCDF configuration" >&5
$as_echo "$as_me: WARNING: invalid NetCDF configuration" >&2;}
        fi
      fi
    fi
  else
    sd_netcdf_enable="no"
    sd_netcdf_cppflags=""
    sd_netcdf_cflags=""
    sd_netcdf_cxxflags=""
    sd_netcdf_fcflags=""
    sd_netcdf_ldflags=""
    sd_netcdf_libs=""
  fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: dumping NetCDF parameters for diagnostics" >&5
$as_echo "$as_me: dumping NetCDF parameters for diagnostics" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: -----------------------------------------" >&5
$as_echo "$as_me: -----------------------------------------" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}:    * sd_netcdf_ok = ${sd_netcdf_ok}" >&5
$as_echo "$as_me:    * sd_netcdf_ok = ${sd_netcdf_ok}" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}:    * sd_netcdf_mpi_ok = ${sd_netcdf_mpi_ok}" >&5
$as_echo "$as_me:    * sd_netcdf_mpi_ok = ${sd_netcdf_mpi_ok}" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}:    * sd_netcdf_enable = ${sd_netcdf_enable}" >&5
$as_echo "$as_me:    * sd_netcdf_enable = ${sd_netcdf_enable}" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}:    * sd_netcdf_prefix = ${sd_netcdf_prefix}" >&5
$as_echo "$as_me:    * sd_netcdf_prefix = ${sd_netcdf_prefix}" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}


# NetCDF library support (must be done after HDF5)

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the NetCDF Fortran interface" >&5
$as_echo_n "checking whether to enable the NetCDF Fortran interface... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fortran_enable}" >&5
$as_echo "${sd_netcdf_fortran_enable}" >&6; }
  if test "${sd_netcdf_fortran_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how the NetCDF Fortran interface parameters have been set" >&5
$as_echo_n "checking how the NetCDF Fortran interface parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fortran_init}" >&5
$as_echo "${sd_netcdf_fortran_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the NetCDF Fortran interface C preprocessing flags" >&5
$as_echo_n "checking for the NetCDF Fortran interface C preprocessing flags... " >&6; }
    if test "${sd_netcdf_fortran_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fortran_cppflags}" >&5
$as_echo "${sd_netcdf_fortran_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the NetCDF Fortran interface C flags" >&5
$as_echo_n "checking for the NetCDF Fortran interface C flags... " >&6; }
    if test "${sd_netcdf_fortran_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fortran_cflags}" >&5
$as_echo "${sd_netcdf_fortran_cflags}" >&6; }
    fi
    if test "${sd_netcdf_fortran_enable_cxx}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the NetCDF Fortran interface C++ flags" >&5
$as_echo_n "checking for the NetCDF Fortran interface C++ flags... " >&6; }
      if test "${sd_netcdf_fortran_cxxflags}" = ""; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fortran_cxxflags}" >&5
$as_echo "${sd_netcdf_fortran_cxxflags}" >&6; }
      fi
    fi
    if test "${sd_netcdf_fortran_enable_fc}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the NetCDF Fortran interface Fortran flags" >&5
$as_echo_n "checking for the NetCDF Fortran interface Fortran flags... " >&6; }
      if test "${sd_netcdf_fortran_fcflags}" = ""; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fortran_fcflags}" >&5
$as_echo "${sd_netcdf_fortran_fcflags}" >&6; }
      fi
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the NetCDF Fortran interface linker flags" >&5
$as_echo_n "checking for the NetCDF Fortran interface linker flags... " >&6; }
    if test "${sd_netcdf_fortran_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fortran_ldflags}" >&5
$as_echo "${sd_netcdf_fortran_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the NetCDF Fortran interface library flags" >&5
$as_echo_n "checking for the NetCDF Fortran interface library flags... " >&6; }
    if test "${sd_netcdf_fortran_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fortran_libs}" >&5
$as_echo "${sd_netcdf_fortran_libs}" >&6; }
    fi
  fi


  # Check if NetCDF has been enabled
  if test "${sd_netcdf_fortran_enable}" != "no" -a "${sd_netcdf_ok}" != "yes"; then
    if test "${sd_netcdf_fortran_init}" = "def"; then
      sd_netcdf_fortran_enable="no"
    else
      #AC_MSG_ERROR([NetCDF is not available])
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: NetCDF is not available" >&5
$as_echo "$as_me: WARNING: NetCDF is not available" >&2;}
    fi
  fi

  # Check whether we can compile and link a simple program
  # and update build flags if successful
  if test "${sd_netcdf_fortran_enable}" = "auto" -o "${sd_netcdf_fortran_enable}" = "yes"; then

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  CPPFLAGS="${CPPFLAGS} ${sd_netcdf_fortran_cppflags}"
  CFLAGS="${CFLAGS} ${sd_netcdf_fortran_cflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_netcdf_fortran_cxxflags}"
  FCFLAGS="${FCFLAGS} ${sd_netcdf_fortran_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_netcdf_fortran_ldflags}"
  LIBS="${sd_netcdf_fortran_libs} ${LIBS}"

  # Check NetCDF Fortran API
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the NetCDF Fortran interface works" >&5
$as_echo_n "checking whether the NetCDF Fortran interface works... " >&6; }
  if test "${sd_netcdf_ok}" = "yes"; then
    for tmp_incs in "" "-I/usr/include"; do
      FCFLAGS="${FCFLAGS} ${tmp_incs}"
      ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

      cat > conftest.$ac_ext <<_ACEOF
      program main

          use netcdf
          character(len=*), parameter :: path = "dummy"
          integer :: mode, ncerr, ncid
          ncerr = nf90_open(path,mode,ncid)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_netcdf_fortran_ok="yes"
else
  sd_netcdf_fortran_ok="no"
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 "${sd_netcdf_fortran_ok}" = "yes"; then
        test "${sd_sys_fcflags}" = "" && sd_sys_fcflags="${tmp_incs}"
        break
      fi
    done
  else
    sd_netcdf_fortran_ok="no"
  fi
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fortran_ok}" >&5
$as_echo "${sd_netcdf_fortran_ok}" >&6; }
  unset tmp_incs

  # Check if we can do parallel I/O
  if test "${sd_netcdf_fortran_ok}" = "yes" -a "${sd_mpi_ok}" = "yes"; then
    if test "${sd_hdf5_mpi_ok}" = "yes" -a "${sd_netcdf_mpi_ok}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the NetCDF Fortran interface has parallel I/O" >&5
$as_echo_n "checking whether the NetCDF Fortran interface has parallel I/O... " >&6; }
      ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

      cat > conftest.$ac_ext <<_ACEOF
      program main

          use mpi
          use netcdf

          integer :: process_Rank, size_Of_Cluster, ierror
          integer :: ierr, ierr2, ncid
          size_Of_Cluster = 1

          call MPI_INIT(ierror)
          call MPI_COMM_SIZE(MPI_COMM_WORLD, size_Of_Cluster, ierror)
          call MPI_COMM_RANK(MPI_COMM_WORLD, process_Rank, ierror)

          ierr = nf90_create("conftest.nc", ior(NF90_NETCDF4, NF90_MPIPOSIX), &
                              ncid, comm=MPI_COMM_WORLD, info=MPI_INFO_NULL)

          ! DEBUG
          !write(*,*) "JMB netcdf-f nfcreate -> ierr= ", ierr

          ierr2 = nf90_close(ncid)
          ! DEBUG
          !write(*,*) "JMB netcdf-f nfclose -> ierr2= ", ierr2

          call MPI_FINALIZE(ierror)

          if(ierr /= 0) stop 1;


      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_netcdf_fortran_mpi_ok="yes"
else
  sd_netcdf_fortran_mpi_ok="no"
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

      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_netcdf_fortran_mpi_ok}" >&5
$as_echo "${sd_netcdf_fortran_mpi_ok}" >&6; }
    else
      sd_netcdf_fortran_mpi_ok="no"
    fi
  fi

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"



    if test "${sd_netcdf_fortran_ok}" = "yes"; then
      CPPFLAGS="${CPPFLAGS} ${sd_netcdf_fortran_cppflags}"
      CFLAGS="${CFLAGS} ${sd_netcdf_fortran_cflags}"
      CXXFLAGS="${CXXFLAGS} ${sd_netcdf_fortran_cxxflags}"
      FCFLAGS="${FCFLAGS} ${sd_netcdf_fortran_fcflags}"
      LDFLAGS="${LDFLAGS} ${sd_netcdf_fortran_ldflags}"
      LIBS="${sd_netcdf_fortran_libs} ${LIBS}"


$as_echo "#define HAVE_NETCDF_FORTRAN 1" >>confdefs.h


      if test "${sd_mpi_ok}" = "yes" -a "${sd_netcdf_fortran_mpi_ok}" = "yes"; then

$as_echo "#define HAVE_NETCDF_FORTRAN_MPI 1" >>confdefs.h

      fi
    else
      if test "${sd_netcdf_fortran_status}" = "optional" -a \
              "${sd_netcdf_fortran_init}" = "def"; then
        sd_netcdf_fortran_enable="no"
        sd_netcdf_fortran_cppflags=""
        sd_netcdf_fortran_cflags=""
        sd_netcdf_fortran_cxxflags=""
        sd_netcdf_fortran_fcflags=""
        sd_netcdf_fortran_ldflags=""
        sd_netcdf_fortran_libs=""
      else
        if test "${sd_netcdf_policy}" = "fail"; 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 $? "invalid NetCDF Fortran interface configuration
See \`config.log' for more details" "$LINENO" 5; }
        else
              { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid NetCDF Fortran interface configuration" >&5
$as_echo "$as_me: WARNING: invalid NetCDF Fortran interface configuration" >&2;}
        fi
      fi
    fi
  else
    sd_netcdf_fortran_enable="no"
    sd_netcdf_fortran_cppflags=""
    sd_netcdf_fortran_cflags=""
    sd_netcdf_fortran_cxxflags=""
    sd_netcdf_fortran_fcflags=""
    sd_netcdf_fortran_ldflags=""
    sd_netcdf_fortran_libs=""
  fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: dumping NetCDFF parameters for diagnostics" >&5
$as_echo "$as_me: dumping NetCDFF parameters for diagnostics" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: ------------------------------------------" >&5
$as_echo "$as_me: ------------------------------------------" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}:    * sd_netcdf_fortran_ok = ${sd_netcdf_fortran_ok}" >&5
$as_echo "$as_me:    * sd_netcdf_fortran_ok = ${sd_netcdf_fortran_ok}" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}:    * sd_netcdf_fortran_mpi_ok = ${sd_netcdf_fortran_mpi_ok}" >&5
$as_echo "$as_me:    * sd_netcdf_fortran_mpi_ok = ${sd_netcdf_fortran_mpi_ok}" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}:    * sd_netcdf_fortran_enable = ${sd_netcdf_fortran_enable}" >&5
$as_echo "$as_me:    * sd_netcdf_fortran_enable = ${sd_netcdf_fortran_enable}" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}:    * sd_netcdf_fortran_prefix = ${sd_netcdf_fortran_prefix}" >&5
$as_echo "$as_me:    * sd_netcdf_fortran_prefix = ${sd_netcdf_fortran_prefix}" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
$as_echo "$as_me: " >&6;}


# XMLF90 library support

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable XMLF90" >&5
$as_echo_n "checking whether to enable XMLF90... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_xmlf90_enable}" >&5
$as_echo "${sd_xmlf90_enable}" >&6; }
  if test "${sd_xmlf90_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how XMLF90 parameters have been set" >&5
$as_echo_n "checking how XMLF90 parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_xmlf90_init}" >&5
$as_echo "${sd_xmlf90_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XMLF90 C preprocessing flags" >&5
$as_echo_n "checking for XMLF90 C preprocessing flags... " >&6; }
    if test "${sd_xmlf90_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_xmlf90_cppflags}" >&5
$as_echo "${sd_xmlf90_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XMLF90 Fortran flags" >&5
$as_echo_n "checking for XMLF90 Fortran flags... " >&6; }
    if test "${sd_xmlf90_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_xmlf90_fcflags}" >&5
$as_echo "${sd_xmlf90_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XMLF90 linker flags" >&5
$as_echo_n "checking for XMLF90 linker flags... " >&6; }
    if test "${sd_xmlf90_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_xmlf90_ldflags}" >&5
$as_echo "${sd_xmlf90_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XMLF90 library flags" >&5
$as_echo_n "checking for XMLF90 library flags... " >&6; }
    if test "${sd_xmlf90_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_xmlf90_libs}" >&5
$as_echo "${sd_xmlf90_libs}" >&6; }
    fi
  fi


  # Check whether we can compile and link a simple program
  # and update build flags if successful
  if test "${sd_xmlf90_enable}" = "auto" -o "${sd_xmlf90_enable}" = "yes"; then

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  if test "${sd_xmlf90_init}" = "esl"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: will look for XMLF90 in the installed ESL Bundle" >&5
$as_echo "$as_me: will look for XMLF90 in the installed ESL Bundle" >&6;}

  CPPFLAGS="${CPPFLAGS} ${sd_esl_bundle_cppflags}"
  CFLAGS="${CFLAGS} ${sd_esl_bundle_cflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_esl_bundle_cxxflags}"
  FCFLAGS="${FCFLAGS} ${sd_esl_bundle_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_esl_bundle_ldflags}"
  if test ! -z ""; then
    CPPFLAGS="${CPPFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
    FCFLAGS="${FCFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
  fi
  FCFLAGS="${FCFLAGS} -I/usr/include"


  LIBS="${sd_esl_bundle_libdirs} ${sd_xmlf90_libs_def} ${sd_esl_bundle_libs} ${LIBS}"

  else
    CPPFLAGS="${CPPFLAGS} ${sd_xmlf90_cppflags}"
    FCFLAGS="${FCFLAGS} ${sd_xmlf90_fcflags}"
    LDFLAGS="${LDFLAGS} ${sd_xmlf90_ldflags}"
    LIBS="${sd_xmlf90_libs} ${LIBS}"
  fi

  # Check XMLF90 Fortran API
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the XMLF90 Fortran interface works" >&5
$as_echo_n "checking whether the XMLF90 Fortran interface works... " >&6; }
  for tmp_incs in "" "-I/usr/include"; do
    FCFLAGS="${FCFLAGS} ${tmp_incs}"
    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

    cat > conftest.$ac_ext <<_ACEOF
      program main

        use xmlf90_sax
        character(len=80) :: fname
        type(xml_t) :: fxml
        integer :: iostat
        call open_xmlfile(fname,fxml,iostat)
        call close_xmlfile(fxml)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_xmlf90_ok="yes"
else
  sd_xmlf90_ok="no"
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 "${sd_xmlf90_ok}" = "yes"; then
      test "${sd_sys_fcflags}" = "" && sd_sys_fcflags="${tmp_incs}"
      break
    fi
  done
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_xmlf90_ok}" >&5
$as_echo "${sd_xmlf90_ok}" >&6; }
  unset tmp_incs

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"



    if test "${sd_xmlf90_ok}" = "yes"; then
      if test "${sd_xmlf90_init}" = "esl"; then
        sd_esl_bundle_libs="${sd_xmlf90_libs_def} ${sd_esl_bundle_libs}"
      else
        FCFLAGS="${FCFLAGS} ${sd_xmlf90_fcflags}"
        LIBS="${sd_xmlf90_libs} ${LIBS}"
      fi
      LDFLAGS="${LDFLAGS} ${sd_xmlf90_ldflags}"


$as_echo "#define HAVE_XMLF90 1" >>confdefs.h

    else
      if test "${sd_xmlf90_status}" = "optional" -a \
              "${sd_xmlf90_init}" = "def"; then
        sd_xmlf90_enable="no"
        sd_xmlf90_cppflags=""
        sd_xmlf90_fcflags=""
        sd_xmlf90_ldflags=""
        sd_xmlf90_libs=""
      else
        if test "${sd_netcdf_policy}" = "fail"; 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 $? "invalid XMLF90 configuration
See \`config.log' for more details" "$LINENO" 5; }
        else
              { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid XMLF90 configuration" >&5
$as_echo "$as_me: WARNING: invalid XMLF90 configuration" >&2;}
        fi
      fi
    fi
  else
    sd_xmlf90_enable="no"
    sd_xmlf90_cppflags=""
    sd_xmlf90_fcflags=""
    sd_xmlf90_ldflags=""
    sd_xmlf90_libs=""
  fi


# LibPSML library support
if test "${sd_xmlf90_ok}" = "yes"; then

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable LibPSML" >&5
$as_echo_n "checking whether to enable LibPSML... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpsml_enable}" >&5
$as_echo "${sd_libpsml_enable}" >&6; }
  if test "${sd_libpsml_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how LibPSML parameters have been set" >&5
$as_echo_n "checking how LibPSML parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpsml_init}" >&5
$as_echo "${sd_libpsml_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibPSML C preprocessing flags" >&5
$as_echo_n "checking for LibPSML C preprocessing flags... " >&6; }
    if test "${sd_libpsml_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpsml_cppflags}" >&5
$as_echo "${sd_libpsml_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibPSML Fortran flags" >&5
$as_echo_n "checking for LibPSML Fortran flags... " >&6; }
    if test "${sd_libpsml_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpsml_fcflags}" >&5
$as_echo "${sd_libpsml_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibPSML linker flags" >&5
$as_echo_n "checking for LibPSML linker flags... " >&6; }
    if test "${sd_libpsml_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpsml_ldflags}" >&5
$as_echo "${sd_libpsml_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibPSML library flags" >&5
$as_echo_n "checking for LibPSML library flags... " >&6; }
    if test "${sd_libpsml_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpsml_libs}" >&5
$as_echo "${sd_libpsml_libs}" >&6; }
    fi
  fi


  # Check whether we can compile and link a simple program
  # and update build flags if successful
  if test "${sd_libpsml_enable}" = "auto" -o "${sd_libpsml_enable}" = "yes"; then

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  if test "${sd_libpsml_init}" = "esl"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: will look for LibPSML in the installed ESL Bundle" >&5
$as_echo "$as_me: will look for LibPSML in the installed ESL Bundle" >&6;}

  CPPFLAGS="${CPPFLAGS} ${sd_esl_bundle_cppflags}"
  CFLAGS="${CFLAGS} ${sd_esl_bundle_cflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_esl_bundle_cxxflags}"
  FCFLAGS="${FCFLAGS} ${sd_esl_bundle_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_esl_bundle_ldflags}"
  if test ! -z ""; then
    CPPFLAGS="${CPPFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
    FCFLAGS="${FCFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
  fi
  FCFLAGS="${FCFLAGS} -I/usr/include"


  LIBS="${sd_esl_bundle_libdirs} ${sd_libpsml_libs_def} ${sd_esl_bundle_libs} ${LIBS}"

  else
    CPPFLAGS="${CPPFLAGS} ${sd_xmlf90_cppflags} ${sd_libpsml_cppflags}"
    FCFLAGS="${FCFLAGS} ${sd_xmlf90_fcflags} ${sd_libpsml_fcflags}"
    LDFLAGS="${LDFLAGS} ${sd_xmlf90_ldflags} ${sd_libpsml_ldflags}"
    LIBS="${sd_libpsml_libs} ${sd_xmlf90_libs} ${LIBS}"
  fi

  # Check LibPSML Fortran API
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the LibPSML Fortran interface works" >&5
$as_echo_n "checking whether the LibPSML Fortran interface works... " >&6; }
  for tmp_incs in "" "-I/usr/include"; do
    FCFLAGS="${FCFLAGS} ${tmp_incs}"
    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

    cat > conftest.$ac_ext <<_ACEOF

      subroutine psml_die(str)
        character(len=*), intent(in) :: str
        write(0,"(a)") str
        stop
      end subroutine
      program main
        use m_psml
        use m_psml_api
        interface
          subroutine psml_die(str)
            character(len=*), intent(in) :: str
          end subroutine
        end interface
        type(ps_t) :: psxml
        call ps_destroy(psxml)
      end program

_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_libpsml_ok="yes"
else
  sd_libpsml_ok="no"
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 "${sd_libpsml_ok}" = "yes"; then
      test "${sd_sys_fcflags}" = "" && sd_sys_fcflags="${tmp_incs}"
      break
    fi
  done
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpsml_ok}" >&5
$as_echo "${sd_libpsml_ok}" >&6; }
  unset tmp_incs

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"



    if test "${sd_libpsml_ok}" = "yes"; then
      if test "${sd_libpsml_init}" = "esl"; then
        sd_esl_bundle_libs="${sd_libpsml_libs_def} ${sd_esl_bundle_libs}"
      else
        FCFLAGS="${FCFLAGS} ${sd_libpsml_fcflags}"
        LIBS="${sd_libpsml_libs} ${LIBS}"
      fi
      LDFLAGS="${LDFLAGS} ${sd_libpsml_ldflags}"


$as_echo "#define HAVE_LIBPSML 1" >>confdefs.h

    else
      if test "${sd_libpsml_status}" = "optional" -a \
              "${sd_libpsml_init}" = "def"; then
        sd_libpsml_enable="no"
        sd_libpsml_cppflags=""
        sd_libpsml_fcflags=""
        sd_libpsml_ldflags=""
        sd_libpsml_libs=""
      else
        if test "${sd_netcdf_policy}" = "fail"; 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 $? "invalid LibPSML configuration
See \`config.log' for more details" "$LINENO" 5; }
        else
              { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid LibPSML configuration" >&5
$as_echo "$as_me: WARNING: invalid LibPSML configuration" >&2;}
        fi
      fi
    fi
  else
    sd_libpsml_enable="no"
    sd_libpsml_cppflags=""
    sd_libpsml_fcflags=""
    sd_libpsml_ldflags=""
    sd_libpsml_libs=""
  fi

else
  if test "${sd_libpsml_enable}" = "auto"; then
    sd_libpsml_enable="no"
  else
    if test "${sd_libpsml_enable}" != "no"; then
      #AC_MSG_ERROR([LibPSML support has been requested but XMLF90 does not work
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: LibPSML support has been requested but XMLF90 does not work
                  Please point the configuration to a working XMLF90
                  installation or disable LibPSML support" >&5
$as_echo "$as_me: WARNING: LibPSML support has been requested but XMLF90 does not work
                  Please point the configuration to a working XMLF90
                  installation or disable LibPSML support" >&2;}
    fi
  fi
fi
 if test "${sd_libpsml_enable}" = "yes " -a "${sd_libpsml_ok}" = "yes"; then
  DO_BUILD_PSML_TRUE=
  DO_BUILD_PSML_FALSE='#'
else
  DO_BUILD_PSML_TRUE='#'
  DO_BUILD_PSML_FALSE=
fi


                       # ------------------------------ #

# Levmar library support

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable Levmar" >&5
$as_echo_n "checking whether to enable Levmar... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_levmar_enable}" >&5
$as_echo "${sd_levmar_enable}" >&6; }
  if test "${sd_levmar_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how Levmar parameters have been set" >&5
$as_echo_n "checking how Levmar parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_levmar_init}" >&5
$as_echo "${sd_levmar_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Levmar C preprocessing flags" >&5
$as_echo_n "checking for Levmar C preprocessing flags... " >&6; }
    if test "${sd_levmar_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_levmar_cppflags}" >&5
$as_echo "${sd_levmar_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Levmar C flags" >&5
$as_echo_n "checking for Levmar C flags... " >&6; }
    if test "${sd_levmar_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_levmar_cflags}" >&5
$as_echo "${sd_levmar_cflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Levmar linker flags" >&5
$as_echo_n "checking for Levmar linker flags... " >&6; }
    if test "${sd_levmar_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_levmar_ldflags}" >&5
$as_echo "${sd_levmar_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Levmar library flags" >&5
$as_echo_n "checking for Levmar library flags... " >&6; }
    if test "${sd_levmar_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_levmar_libs}" >&5
$as_echo "${sd_levmar_libs}" >&6; }
    fi
  fi


  # Check whether we can compile and link a simple program
  # and update build flags if successful
  if test "${sd_levmar_enable}" = "auto" -o "${sd_levmar_enable}" = "yes"; then

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  if test "${sd_levmar_init}" = "esl"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: will look for Levmar in the installed ESL Bundle" >&5
$as_echo "$as_me: will look for Levmar in the installed ESL Bundle" >&6;}

  CPPFLAGS="${CPPFLAGS} ${sd_esl_bundle_cppflags}"
  CFLAGS="${CFLAGS} ${sd_esl_bundle_cflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_esl_bundle_cxxflags}"
  FCFLAGS="${FCFLAGS} ${sd_esl_bundle_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_esl_bundle_ldflags}"
  if test ! -z ""; then
    CPPFLAGS="${CPPFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
    FCFLAGS="${FCFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
  fi
  FCFLAGS="${FCFLAGS} -I/usr/include"


  LIBS="${sd_esl_bundle_libdirs} ${sd_levmar_libs_def} ${sd_esl_bundle_libs} ${LIBS}"

  else
    CPPFLAGS="${CPPFLAGS} ${sd_levmar_cppflags}"
    CFLAGS="${CFLAGS} ${sd_levmar_cflags}"
    LDFLAGS="${LDFLAGS} ${sd_levmar_ldflags}"
    LIBS="${sd_levmar_libs} ${LIBS}"
  fi

  # Check Levmar API
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Levmar library works" >&5
$as_echo_n "checking whether the Levmar library works... " >&6; }
  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

  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#     include <levmar.h>

      void dfit_function(double *p, double *y, int m, int n, void *adata)
      {
        p = 0;
      }

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

      int ret;
      int c_npoles = 1;
      int c_nvals  = 1;
      int nparam   = 1;

      double adata[1];
      double p[1];
      double yvals[1];

      double opts[LM_OPTS_SZ], info[LM_INFO_SZ];

      ret=dlevmar_dif(dfit_function, p, yvals, nparam, c_nvals, 5000, \
        opts, info, NULL, NULL, (void *)&adata);

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  sd_levmar_ok="yes"
else
  sd_levmar_ok="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_levmar_ok}" >&5
$as_echo "${sd_levmar_ok}" >&6; }

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"



    if test "${sd_levmar_ok}" = "yes"; then
      if test "${sd_levmar_init}" = "esl"; then
        sd_esl_bundle_libs="${sd_levmar_libs_def} ${sd_esl_bundle_libs}"
      else
        LIBS="${sd_levmar_libs} ${LIBS}"
      fi
      LDFLAGS="${LDFLAGS} ${sd_levmar_ldflags}"


$as_echo "#define HAVE_LEVMAR 1" >>confdefs.h

    else
      if test "${sd_levmar_status}" = "optional" -a \
              "${sd_levmar_init}" = "def"; then
        sd_levmar_enable="no"
        sd_levmar_cppflags=""
        sd_levmar_cflags=""
        sd_levmar_ldflags=""
        sd_levmar_libs=""
      else
        { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "invalid Levmar configuration
See \`config.log' for more details" "$LINENO" 5; }
      fi
    fi
  else
    sd_levmar_enable="no"
    sd_levmar_cppflags=""
    sd_levmar_cflags=""
    sd_levmar_ldflags=""
    sd_levmar_libs=""
  fi


                       # ------------------------------ #

# LibXC library support
#ABI_LIBXC_DETECT(2, 2)

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable LibXC" >&5
$as_echo_n "checking whether to enable LibXC... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libxc_enable}" >&5
$as_echo "${sd_libxc_enable}" >&6; }
  if test "${sd_libxc_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how LibXC parameters have been set" >&5
$as_echo_n "checking how LibXC parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libxc_init}" >&5
$as_echo "${sd_libxc_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibXC C preprocessing flags" >&5
$as_echo_n "checking for LibXC C preprocessing flags... " >&6; }
    if test "${sd_libxc_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libxc_cppflags}" >&5
$as_echo "${sd_libxc_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibXC C flags" >&5
$as_echo_n "checking for LibXC C flags... " >&6; }
    if test "${sd_libxc_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libxc_cflags}" >&5
$as_echo "${sd_libxc_cflags}" >&6; }
    fi
    if test "${sd_libxc_enable_fc}" = "yes"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibXC Fortran flags" >&5
$as_echo_n "checking for LibXC Fortran flags... " >&6; }
      if test "${sd_libxc_fcflags}" = ""; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libxc_fcflags}" >&5
$as_echo "${sd_libxc_fcflags}" >&6; }
      fi
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibXC linker flags" >&5
$as_echo_n "checking for LibXC linker flags... " >&6; }
    if test "${sd_libxc_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libxc_ldflags}" >&5
$as_echo "${sd_libxc_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibXC library flags" >&5
$as_echo_n "checking for LibXC library flags... " >&6; }
    if test "${sd_libxc_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libxc_libs}" >&5
$as_echo "${sd_libxc_libs}" >&6; }
    fi
  fi


  # Check whether we can compile and link a simple program
  # and update build flags if successful
  if test "${sd_libxc_enable}" = "auto" -o "${sd_libxc_enable}" = "yes"; then

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  if test "${sd_libxc_init}" = "esl"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: will look for LibXC in the installed ESL Bundle" >&5
$as_echo "$as_me: will look for LibXC in the installed ESL Bundle" >&6;}

  CPPFLAGS="${CPPFLAGS} ${sd_esl_bundle_cppflags}"
  CFLAGS="${CFLAGS} ${sd_esl_bundle_cflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_esl_bundle_cxxflags}"
  FCFLAGS="${FCFLAGS} ${sd_esl_bundle_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_esl_bundle_ldflags}"
  if test ! -z ""; then
    CPPFLAGS="${CPPFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
    FCFLAGS="${FCFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
  fi
  FCFLAGS="${FCFLAGS} -I/usr/include"


  LIBS="${sd_esl_bundle_libdirs} ${sd_libxc_libs_def} ${sd_esl_bundle_libs} ${LIBS}"

  else
    CPPFLAGS="${CPPFLAGS} ${sd_libxc_cppflags}"
    CFLAGS="${CFLAGS} ${sd_libxc_cflags}"
    FCFLAGS="${FCFLAGS} ${sd_libxc_fcflags}"
    LDFLAGS="${LDFLAGS} ${sd_libxc_ldflags}"
    LIBS="${sd_libxc_libs} ${LIBS}"
  fi

  # Check LibXC C API
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the LibXC library works" >&5
$as_echo_n "checking whether the LibXC library works... " >&6; }
  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

  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#include <xc.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

      int ma, mi, mu;
      xc_version(&ma, &mi, &mu);

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  sd_libxc_c_ok="yes"
else
  sd_libxc_c_ok="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libxc_c_ok}" >&5
$as_echo "${sd_libxc_c_ok}" >&6; }

  # Check old LibXC C API
  if test "${sd_libxc_c_ok}" != "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the LibXC library has an old API" >&5
$as_echo_n "checking whether the LibXC library has an old API... " >&6; }
    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

    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#include <xc.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

        int ma, mi;
        xc_version(&ma, &mi);

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  sd_libxc_c_ok="yes"
else
  sd_libxc_c_ok="no"
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

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libxc_c_ok}" >&5
$as_echo "${sd_libxc_c_ok}" >&6; }
  fi

  # Check LibXC Fortran API
  if test "${sd_libxc_c_ok}" = "yes" -a "${sd_libxc_enable_fc}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the LibXC Fortran interface works" >&5
$as_echo_n "checking whether the LibXC Fortran interface works... " >&6; }
    for tmp_incs in "" "-I/usr/include"; do
      FCFLAGS="${FCFLAGS} ${tmp_incs}"
      ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

      cat > conftest.$ac_ext <<_ACEOF
      program main

          use libxc_m
          implicit none
          integer :: ma, mi, mu
          call xc_f90_version(ma, mi, mu)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_libxc_fortran_ok="yes"
else
  sd_libxc_fortran_ok="no"
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 "${sd_libxc_fortran_ok}" = "yes"; then
        test "${sd_fc_sys_incpath}" = "" && sd_fc_sys_incpath="${tmp_incs}"
        break
      fi
    done
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libxc_fortran_ok}" >&5
$as_echo "${sd_libxc_fortran_ok}" >&6; }
  fi
  unset tmp_incs

  # Check old LibXC C API
  if test "${sd_libxc_c_ok}" != "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the LibXC library has an old API" >&5
$as_echo_n "checking whether the LibXC library has an old API... " >&6; }
    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

    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#include <xc.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

        int ma, mi;
        xc_version(&ma, &mi);

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  sd_libxc_c_ok="yes"
else
  sd_libxc_c_ok="no"
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

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libxc_c_ok}" >&5
$as_echo "${sd_libxc_c_ok}" >&6; }
  fi

  # Check if LibXC was compiled with KXC
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the LibXC was compiled with Kxc derivatives" >&5
$as_echo_n "checking whether the LibXC was compiled with Kxc derivatives... " >&6; }
  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 "$cross_compiling" = yes; 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 $? "cannot run test program while cross compiling
See \`config.log' for more details" "$LINENO" 5; }
else
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#include <stdlib.h>
#include <xc.h>

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

  xc_func_type func;
  int has_kxc = 1, func_id = 1;
  if (XC_MAJOR_VERSION >4) {
    xc_func_init(&func, func_id, XC_UNPOLARIZED);
    has_kxc=(XC_FLAGS_HAVE_KXC & func.info->flags)>0;
    xc_func_end(&func);
  }
  if (! has_kxc) {exit(EXIT_FAILURE);}

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
  sd_libxc_kxc_ok="yes"
else
  sd_libxc_kxc_ok="no"
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  conftest.$ac_objext conftest.beam conftest.$ac_ext
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libxc_kxc_ok}" >&5
$as_echo "${sd_libxc_kxc_ok}" >&6; }
  if test "${sd_libxc_kxc_ok}" = "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The LibXC package does not provide the
     3rd derivatives of energy! You should recompile it
     using --enable-kxc configure option." >&5
$as_echo "$as_me: WARNING: The LibXC package does not provide the
     3rd derivatives of energy! You should recompile it
     using --enable-kxc configure option." >&2;}
  fi

  # Combine the available results
  sd_libxc_ok="no"
  if test "${sd_libxc_enable_fc}" = "yes"; then
    if test "${sd_libxc_c_ok}" = "yes" -a \
            "${sd_libxc_fortran_ok}" = "yes" -a \
            "${sd_libxc_kxc_ok}" = "yes"; then
      sd_libxc_ok="yes"
    fi
  else
    if test "${sd_libxc_c_ok}" = "yes"; then
      sd_libxc_ok="yes"
    fi
  fi

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"



    if test "${sd_libxc_ok}" = "yes"; then
      if test "${sd_libxc_init}" = "esl"; then
        sd_esl_bundle_libs="${sd_libxc_libs_def} ${sd_esl_bundle_libs}"
      else
        CPPFLAGS="${CPPFLAGS} ${sd_libxc_cppflags}"
        CFLAGS="${CFLAGS} ${sd_libxc_cflags}"
        CXXFLAGS="${CXXFLAGS} ${sd_libxc_cxxflags}"
        FCFLAGS="${FCFLAGS} ${sd_libxc_fcflags}"
        LIBS="${sd_libxc_libs} ${LIBS}"
      fi
      LDFLAGS="${LDFLAGS} ${sd_libxc_ldflags}"


$as_echo "#define HAVE_LIBXC 1" >>confdefs.h

    else
      if test "${sd_libxc_status}" = "optional" -a \
              "${sd_libxc_init}" = "def"; then
        sd_libxc_enable="no"
        sd_libxc_cppflags=""
        sd_libxc_cflags=""
        sd_libxc_fcflags=""
        sd_libxc_ldflags=""
        sd_libxc_libs=""
      else
        if test "${sd_netcdf_policy}" = "fail"; 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 $? "invalid LibXC configuration
See \`config.log' for more details" "$LINENO" 5; }
        else
              { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid LibXC configuration" >&5
$as_echo "$as_me: WARNING: invalid LibXC configuration" >&2;}
        fi
      fi
    fi
  else
    sd_libxc_enable="no"
    sd_libxc_cppflags=""
    sd_libxc_cflags=""
    sd_libxc_fcflags=""
    sd_libxc_ldflags=""
    sd_libxc_libs=""
  fi

 if test "${sd_libxc_ok}" = "yes"; then
  DO_BUILD_01_LIBXC_EXT_TRUE=
  DO_BUILD_01_LIBXC_EXT_FALSE='#'
else
  DO_BUILD_01_LIBXC_EXT_TRUE='#'
  DO_BUILD_01_LIBXC_EXT_FALSE=
fi


# TRIQS support

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable TRIQS" >&5
$as_echo_n "checking whether to enable TRIQS... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_triqs_enable}" >&5
$as_echo "${sd_triqs_enable}" >&6; }
  if test "${sd_triqs_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how TRIQS parameters have been set" >&5
$as_echo_n "checking how TRIQS parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_triqs_init}" >&5
$as_echo "${sd_triqs_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TRIQS C preprocessing flags" >&5
$as_echo_n "checking for TRIQS C preprocessing flags... " >&6; }
    if test "${sd_triqs_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_triqs_cppflags}" >&5
$as_echo "${sd_triqs_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TRIQS C flags" >&5
$as_echo_n "checking for TRIQS C flags... " >&6; }
    if test "${sd_triqs_cflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_triqs_cflags}" >&5
$as_echo "${sd_triqs_cflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TRIQS C++ flags" >&5
$as_echo_n "checking for TRIQS C++ flags... " >&6; }
    if test "${sd_triqs_cxxflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_triqs_cxxflags}" >&5
$as_echo "${sd_triqs_cxxflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TRIQS Fortran flags" >&5
$as_echo_n "checking for TRIQS Fortran flags... " >&6; }
    if test "${sd_triqs_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_triqs_fcflags}" >&5
$as_echo "${sd_triqs_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TRIQS linker flags" >&5
$as_echo_n "checking for TRIQS linker flags... " >&6; }
    if test "${sd_triqs_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_triqs_ldflags}" >&5
$as_echo "${sd_triqs_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TRIQS library flags" >&5
$as_echo_n "checking for TRIQS library flags... " >&6; }
    if test "${sd_triqs_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_triqs_libs}" >&5
$as_echo "${sd_triqs_libs}" >&6; }
    fi
  fi


  # Check whether we can compile and link a simple program
  # and update build flags if successful
  if test "${sd_triqs_enable}" = "auto" -o "${sd_triqs_enable}" = "yes"; then

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  CPPFLAGS="${CPPFLAGS} ${sd_triqs_cppflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_triqs_cxxflags}"
  LDFLAGS="${LDFLAGS} ${sd_triqs_ldflags}"
  LIBS="${sd_triqs_libs} ${LIBS}"

  # Check TRIQS C++ API
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the TRIQS library works" >&5
$as_echo_n "checking whether the TRIQS library works... " >&6; }
  ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu

  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#     include <solver_core.hpp>
#     include <triqs/h5.hpp>
      using namespace std;
      using namespace triqs_cthyb;

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

      std::vector<std::pair<std::string, indices_type>> gf_struct;

  ;
  return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
  sd_triqs_ok="yes"; sd_triqs_api_version="2.0"
else
  sd_triqs_ok="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_triqs_ok}" >&5
$as_echo "${sd_triqs_ok}" >&6; }

  # Check old TRIQS C++ API
  if test "${sd_triqs_ok}" != "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the TRIQS library has an old API" >&5
$as_echo_n "checking whether the TRIQS library has an old API... " >&6; }
    ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu

    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#       include <triqs/gfs.hpp>
        using namespace triqs::gfs;
        using triqs::clef::placeholder;

#ifdef FC_DUMMY_MAIN
#ifndef FC_DUMMY_MAIN_EQ_F77
#  ifdef __cplusplus
     extern "C"
#  endif
   int FC_DUMMY_MAIN() { return 1; }
#endif
#endif
int
main ()
{

        double beta = 1;
        int nw      = 100;
        auto g      = gf<imfreq>{{beta, Fermion, nw}, {1, 1}};
        placeholder<0> w_;
        g(w_) << 1 / (w_ - 3);

  ;
  return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
  sd_triqs_ok="yes"; sd_triqs_api_version="1.4"
else
  sd_triqs_ok="no"
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

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_triqs_ok}" >&5
$as_echo "${sd_triqs_ok}" >&6; }
  fi

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"



    if test "${sd_triqs_ok}" = "yes"; then
      CPPFLAGS="${CPPFLAGS} ${sd_triqs_cppflags}"
      CFLAGS="${CFLAGS} ${sd_triqs_cflags}"
      CXXFLAGS="${CXXFLAGS} ${sd_triqs_cxxflags}"
      FCFLAGS="${FCFLAGS} ${sd_triqs_fcflags}"
      LDFLAGS="${LDFLAGS} ${sd_triqs_ldflags}"
      LIBS="${sd_triqs_libs} ${LIBS}"


$as_echo "#define HAVE_TRIQS 1" >>confdefs.h


      case "${sd_triqs_api_version}" in
        1.4)

$as_echo "#define HAVE_TRIQS_v1_4 1" >>confdefs.h

          ;;
        2.0)

$as_echo "#define HAVE_TRIQS_v2_0 1" >>confdefs.h

          ;;
        *)
          as_fn_error $? "TRIQS API version ${sd_triqs_api_version} not implemented in the build system" "$LINENO" 5
          ;;
      esac
    else
      if test "${sd_triqs_status}" = "optional" -a \
              "${sd_triqs_init}" = "def"; then
        sd_triqs_enable="no"
        sd_triqs_cppflags=""
        sd_triqs_cflags=""
        sd_triqs_cxxflags=""
        sd_triqs_fcflags=""
        sd_triqs_ldflags=""
        sd_triqs_libs=""
      else
        { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "invalid TRIQS configuration
See \`config.log' for more details" "$LINENO" 5; }
      fi
    fi
  else
    sd_triqs_enable="no"
    sd_triqs_cppflags=""
    sd_triqs_cflags=""
    sd_triqs_cxxflags=""
    sd_triqs_fcflags=""
    sd_triqs_ldflags=""
    sd_triqs_libs=""
  fi

 if test "${sd_triqs_enable}" = "yes" -a "${sd_triqs_ok}" = "yes"; then
  DO_BUILD_67_TRIQS_EXT_TRUE=
  DO_BUILD_67_TRIQS_EXT_FALSE='#'
else
  DO_BUILD_67_TRIQS_EXT_TRUE='#'
  DO_BUILD_67_TRIQS_EXT_FALSE=
fi


# Wannier90 library support

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable Wannier90" >&5
$as_echo_n "checking whether to enable Wannier90... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_wannier90_enable}" >&5
$as_echo "${sd_wannier90_enable}" >&6; }
  if test "${sd_wannier90_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how Wannier90 parameters have been set" >&5
$as_echo_n "checking how Wannier90 parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_wannier90_init}" >&5
$as_echo "${sd_wannier90_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Wannier90 C preprocessing flags" >&5
$as_echo_n "checking for Wannier90 C preprocessing flags... " >&6; }
    if test "${sd_wannier90_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_wannier90_cppflags}" >&5
$as_echo "${sd_wannier90_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Wannier90 Fortran flags" >&5
$as_echo_n "checking for Wannier90 Fortran flags... " >&6; }
    if test "${sd_wannier90_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_wannier90_fcflags}" >&5
$as_echo "${sd_wannier90_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Wannier90 linker flags" >&5
$as_echo_n "checking for Wannier90 linker flags... " >&6; }
    if test "${sd_wannier90_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_wannier90_ldflags}" >&5
$as_echo "${sd_wannier90_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Wannier90 library flags" >&5
$as_echo_n "checking for Wannier90 library flags... " >&6; }
    if test "${sd_wannier90_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_wannier90_libs}" >&5
$as_echo "${sd_wannier90_libs}" >&6; }
    fi
  fi


  # Check whether we can compile and link a simple program
  # and update build flags if successful
  if test "${sd_wannier90_enable}" = "auto" -o "${sd_wannier90_enable}" = "yes"; then

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  if test "${sd_wannier90_init}" = "esl"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: will look for Wannier90 in the installed ESL Bundle" >&5
$as_echo "$as_me: will look for Wannier90 in the installed ESL Bundle" >&6;}

  CPPFLAGS="${CPPFLAGS} ${sd_esl_bundle_cppflags}"
  CFLAGS="${CFLAGS} ${sd_esl_bundle_cflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_esl_bundle_cxxflags}"
  FCFLAGS="${FCFLAGS} ${sd_esl_bundle_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_esl_bundle_ldflags}"
  if test ! -z ""; then
    CPPFLAGS="${CPPFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
    FCFLAGS="${FCFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
  fi
  FCFLAGS="${FCFLAGS} -I/usr/include"


  LIBS="${sd_esl_bundle_libdirs} ${sd_wannier90_libs_def} ${sd_esl_bundle_libs} ${LIBS}"

  else
    CPPFLAGS="${CPPFLAGS} ${sd_wannier90_cppflags}"
    FCFLAGS="${FCFLAGS} ${sd_wannier90_fcflags}"
    LDFLAGS="${LDFLAGS} ${sd_wannier90_ldflags}"
    LIBS="${sd_wannier90_libs} ${sd_linalg_libs} ${LIBS}"
  fi

  # Check Wannier90 API
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Wannier90 Fortran interface works" >&5
$as_echo_n "checking whether the Wannier90 Fortran interface works... " >&6; }
  for tmp_incs in "" "-I/usr/include"; do
    FCFLAGS="${FCFLAGS} ${tmp_incs}"
    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

    cat > conftest.$ac_ext <<_ACEOF
      program main

        call wannier_run

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_wannier90_ok="yes"
else
  sd_wannier90_ok="no"
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 "${sd_wannier90_ok}" = "yes"; then
      test "${sd_sys_fcflags}" = "" && sd_sys_fcflags="${tmp_incs}"
      break
    fi
  done
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_wannier90_ok}" >&5
$as_echo "${sd_wannier90_ok}" >&6; }
  unset tmp_incs

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"



    if test "${sd_wannier90_ok}" = "yes"; then
      if test "${sd_wannier90_init}" = "esl"; then
        sd_esl_bundle_libs="${sd_wannier90_libs_def} ${sd_esl_bundle_libs}"
      else
        FCFLAGS="${FCFLAGS} ${sd_wannier90_fcflags}"
        LIBS="${sd_wannier90_libs} ${LIBS}"
      fi
      LDFLAGS="${LDFLAGS} ${sd_wannier90_ldflags}"


$as_echo "#define HAVE_WANNIER90 1" >>confdefs.h

    else
      if test "${sd_wannier90_status}" = "optional" -a \
              "${sd_wannier90_init}" = "def"; then
        sd_wannier90_enable="no"
        sd_wannier90_cppflags=""
        sd_wannier90_fcflags=""
        sd_wannier90_ldflags=""
        sd_wannier90_libs=""
      else
        if test "${sd_netcdf_policy}" = "fail"; 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 $? "invalid Wannier90 configuration
See \`config.log' for more details" "$LINENO" 5; }
        else
              { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid Wannier90 configuration" >&5
$as_echo "$as_me: WARNING: invalid Wannier90 configuration" >&2;}
        fi
      fi
    fi
  else
    sd_wannier90_enable="no"
    sd_wannier90_cppflags=""
    sd_wannier90_fcflags=""
    sd_wannier90_ldflags=""
    sd_wannier90_libs=""
  fi


# AtomPAW integration support


    for ac_prog in atompaw
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_prog_ATOMPAW_BIN+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$ATOMPAW_BIN"; then
  ac_cv_prog_ATOMPAW_BIN="$ATOMPAW_BIN" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_ATOMPAW_BIN="$ac_prog"
    $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

fi
fi
ATOMPAW_BIN=$ac_cv_prog_ATOMPAW_BIN
if test -n "$ATOMPAW_BIN"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ATOMPAW_BIN" >&5
$as_echo "$ATOMPAW_BIN" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$ATOMPAW_BIN" && break
done

  for ac_prog in graphatom
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_prog_GRAPHATOM_BIN+:} false; then :
  $as_echo_n "(cached) " >&6
else
  if test -n "$GRAPHATOM_BIN"; then
  ac_cv_prog_GRAPHATOM_BIN="$GRAPHATOM_BIN" # Let the user override the test.
else
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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_GRAPHATOM_BIN="$ac_prog"
    $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

fi
fi
GRAPHATOM_BIN=$ac_cv_prog_GRAPHATOM_BIN
if test -n "$GRAPHATOM_BIN"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GRAPHATOM_BIN" >&5
$as_echo "$GRAPHATOM_BIN" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


  test -n "$GRAPHATOM_BIN" && break
done

  if test "${ATOMPAW_BIN}" != "" -a "${GRAPHATOM_BIN}" != ""; then

$as_echo "#define HAVE_ATOMPAW 1" >>confdefs.h

  fi




# KOKKOS library support

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable Kokkos core libraries" >&5
$as_echo_n "checking whether to enable Kokkos core libraries... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_kokkos_enable}" >&5
$as_echo "${sd_kokkos_enable}" >&6; }
  if test "${sd_kokkos_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how Kokkos core libraries parameters have been set" >&5
$as_echo_n "checking how Kokkos core libraries parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_kokkos_init}" >&5
$as_echo "${sd_kokkos_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kokkos core libraries C preprocessing flags" >&5
$as_echo_n "checking for Kokkos core libraries C preprocessing flags... " >&6; }
    if test "${sd_kokkos_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_kokkos_cppflags}" >&5
$as_echo "${sd_kokkos_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kokkos core libraries C++ flags" >&5
$as_echo_n "checking for Kokkos core libraries C++ flags... " >&6; }
    if test "${sd_kokkos_cxxflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_kokkos_cxxflags}" >&5
$as_echo "${sd_kokkos_cxxflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kokkos core libraries linker flags" >&5
$as_echo_n "checking for Kokkos core libraries linker flags... " >&6; }
    if test "${sd_kokkos_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_kokkos_ldflags}" >&5
$as_echo "${sd_kokkos_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Kokkos core libraries library flags" >&5
$as_echo_n "checking for Kokkos core libraries library flags... " >&6; }
    if test "${sd_kokkos_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_kokkos_libs}" >&5
$as_echo "${sd_kokkos_libs}" >&6; }
    fi
  fi


  # Check whether we can compile and link a simple program
  # and update build flags if successful
  if test "${sd_kokkos_enable}" = "auto" -o "${sd_kokkos_enable}" = "yes"; then

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  if test "${sd_kokkos_init}" = "esl"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: will look for Kokkos core libraries in the installed ESL Bundle" >&5
$as_echo "$as_me: will look for Kokkos core libraries in the installed ESL Bundle" >&6;}

  CPPFLAGS="${CPPFLAGS} ${sd_esl_bundle_cppflags}"
  CFLAGS="${CFLAGS} ${sd_esl_bundle_cflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_esl_bundle_cxxflags}"
  FCFLAGS="${FCFLAGS} ${sd_esl_bundle_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_esl_bundle_ldflags}"
  if test ! -z ""; then
    CPPFLAGS="${CPPFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
    FCFLAGS="${FCFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
  fi
  FCFLAGS="${FCFLAGS} -I/usr/include"


  LIBS="${sd_esl_bundle_libdirs} ${sd_kokkos_libs_def} ${sd_esl_bundle_libs} ${LIBS}"

  else
    CPPFLAGS="${CPPFLAGS} ${sd_kokkos_cppflags}"
    CXXFLAGS="${CXXFLAGS} ${sd_kokkos_cxxflags}"
    LDFLAGS="${LDFLAGS} ${sd_kokkos_ldflags}"
    LIBS="${sd_kokkos_libs} ${LIBS}"
  fi

  # Check Kokkos core libraries C++ API
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Kokkos core library works" >&5
$as_echo_n "checking whether the Kokkos core library works... " >&6; }
#  AC_LANG_PUSH([C++])
#  AC_LINK_IFELSE([AC_LANG_PROGRAM(
#    [[
##include <Kokkos_Core.hpp>
#    ]],
#    [[
#      Kokkos::abort("Testing purposes");
#    ]])], [sd_kokkos_cxx_ok="yes"], [sd_kokkos_cxx_ok="no"])
#  AC_LANG_POP([C++])
#  FIXME Kokkos is actually used with a wrapper on NVCC and C++ compiler.
#  It's complicate, hence we only check for library presence and run no link check (WCGW?).
  sd_kokkos_cxx_ok="no"
  if test -e "${sd_kokkos_libdir}/libkokkoscore.${abi_so_ext}" -o -e "${sd_kokkos_libdir}/libkokkoscore.a"; then
    sd_kokkos_cxx_ok="yes"
  fi
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_kokkos_cxx_ok}" >&5
$as_echo "${sd_kokkos_cxx_ok}" >&6; }

  # Combine the available results
  sd_kokkos_ok="no"
  if test "${sd_kokkos_cxx_ok}" = "yes"; then
    sd_kokkos_ok="yes"
  fi

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"



    if test "${sd_kokkos_ok}" = "yes"; then
      if test "${sd_kokkos_init}" = "esl"; then
        sd_esl_bundle_libs="${sd_kokkos_libs_def} ${sd_esl_bundle_libs}"
      else
        CPPFLAGS="${CPPFLAGS} ${sd_kokkos_cppflags}"
        CXXFLAGS="${CXXFLAGS} ${sd_kokkos_cxxflags}"
        CXXFLAGS="${CXXFLAGS} ${sd_kokkos_cxxflags}"
        LIBS="${sd_kokkos_libs} ${LIBS}"
      fi
      LDFLAGS="${LDFLAGS} ${sd_kokkos_ldflags}"


$as_echo "#define HAVE_KOKKOS 1" >>confdefs.h

    else
      if test "${sd_kokkos_status}" = "optional" -a \
              "${sd_kokkos_init}" = "def"; then
        sd_kokkos_enable="no"
        sd_kokkos_cppflags=""
        sd_kokkos_cxxflags=""
        sd_kokkos_ldflags=""
        sd_kokkos_libs=""
      else
        if test "${sd_kokkos_policy}" = "fail"; 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 $? "invalid Kokkos core libraries configuration
See \`config.log' for more details" "$LINENO" 5; }
        else
              { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid Kokkos core libraries configuration" >&5
$as_echo "$as_me: WARNING: invalid Kokkos core libraries configuration" >&2;}
        fi
      fi
    fi
  else
    sd_kokkos_enable="no"
    sd_kokkos_cppflags=""
    sd_kokkos_cxxflags=""
    sd_kokkos_ldflags=""
    sd_kokkos_libs=""
  fi


# YAKL library support

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable YAKL" >&5
$as_echo_n "checking whether to enable YAKL... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_yakl_enable}" >&5
$as_echo "${sd_yakl_enable}" >&6; }
  if test "${sd_yakl_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how YAKL parameters have been set" >&5
$as_echo_n "checking how YAKL parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_yakl_init}" >&5
$as_echo "${sd_yakl_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for YAKL C preprocessing flags" >&5
$as_echo_n "checking for YAKL C preprocessing flags... " >&6; }
    if test "${sd_yakl_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_yakl_cppflags}" >&5
$as_echo "${sd_yakl_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for YAKL Fortran flags" >&5
$as_echo_n "checking for YAKL Fortran flags... " >&6; }
    if test "${sd_yakl_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_yakl_fcflags}" >&5
$as_echo "${sd_yakl_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for YAKL linker flags" >&5
$as_echo_n "checking for YAKL linker flags... " >&6; }
    if test "${sd_yakl_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_yakl_ldflags}" >&5
$as_echo "${sd_yakl_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for YAKL library flags" >&5
$as_echo_n "checking for YAKL library flags... " >&6; }
    if test "${sd_yakl_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_yakl_libs}" >&5
$as_echo "${sd_yakl_libs}" >&6; }
    fi
  fi


  # Check whether we can compile and link a simple program
  # and update build flags if successful
  if test "${sd_yakl_enable}" = "auto" -o "${sd_yakl_enable}" = "yes"; then

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  if test "${sd_yakl_init}" = "esl"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: will look for YAKL in the installed ESL Bundle" >&5
$as_echo "$as_me: will look for YAKL in the installed ESL Bundle" >&6;}

  CPPFLAGS="${CPPFLAGS} ${sd_esl_bundle_cppflags}"
  CFLAGS="${CFLAGS} ${sd_esl_bundle_cflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_esl_bundle_cxxflags}"
  FCFLAGS="${FCFLAGS} ${sd_esl_bundle_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_esl_bundle_ldflags}"
  if test ! -z ""; then
    CPPFLAGS="${CPPFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
    FCFLAGS="${FCFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
  fi
  FCFLAGS="${FCFLAGS} -I/usr/include"


  LIBS="${sd_esl_bundle_libdirs} ${sd_yakl_libs_def} ${sd_esl_bundle_libs} ${LIBS}"

  else
    CPPFLAGS="${CPPFLAGS} ${sd_yakl_cppflags}"
    FCFLAGS="${FCFLAGS} ${sd_yakl_fcflags}"
    LDFLAGS="${LDFLAGS} ${sd_yakl_ldflags}"
    LIBS="${sd_yakl_libs} ${LIBS}"
  fi

  # Check YAKL CXX API
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the YAKL Fortran module works" >&5
$as_echo_n "checking whether the YAKL Fortran module works... " >&6; }
  ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

  cat > conftest.$ac_ext <<_ACEOF
      program main

       use gator_mod
       call gator_init()

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_yakl_fortran_ok="yes"
else
  sd_yakl_fortran_ok="no"
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

  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_yakl_fortran_ok}" >&5
$as_echo "${sd_yakl_fortran_ok}" >&6; }

  # Combine the available results
  sd_yakl_ok="no"
  if test "${sd_yakl_fortran_ok}" = "yes"; then
    sd_yakl_ok="yes"
  fi

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"



    if test "${sd_yakl_ok}" = "yes"; then
      if test "${sd_yakl_init}" = "esl"; then
        sd_esl_bundle_libs="${sd_yakl_libs_def} ${sd_esl_bundle_libs}"
      else
        CPPFLAGS="${CPPFLAGS} ${sd_yakl_cppflags}"
        FCFLAGS="${FCFLAGS} ${sd_yakl_fcflags}"
        FCFLAGS="${FCFLAGS} ${sd_yakl_fcflags}"
        LIBS="${sd_yakl_libs} ${LIBS}"
      fi
      LDFLAGS="${LDFLAGS} ${sd_yakl_ldflags}"


$as_echo "#define HAVE_YAKL 1" >>confdefs.h

    else
      if test "${sd_yakl_policy}" = "fail"; 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 $? "invalid YAKL configuration
See \`config.log' for more details" "$LINENO" 5; }
      fi
      if test "${sd_yakl_status}" = "optional" -a \
              "${sd_yakl_init}" = "def"; then
        sd_yakl_enable="no"
        sd_yakl_cppflags=""
        sd_yakl_fcflags=""
        sd_yakl_ldflags=""
        sd_yakl_libs=""
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid YAKL configuration" >&5
$as_echo "$as_me: WARNING: invalid YAKL configuration" >&2;}
      fi
    fi
  else
    sd_yakl_enable="no"
    sd_yakl_cppflags=""
    sd_yakl_fcflags=""
    sd_yakl_ldflags=""
    sd_yakl_libs=""
  fi


# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #

#
# Build workflow
#



  abi_sec_title="Build workflow"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# Initialize the low-level routines of ABINIT as an external component

  # Init
  sd_abinit_common_cppflags=""
  sd_abinit_common_cflags=""
  sd_abinit_common_cxxflags=""
  sd_abinit_common_fcflags=""
  sd_abinit_common_ldflags=""
  sd_abinit_common_libs=""
  sd_abinit_common_enable=""
  sd_abinit_common_init="unknown"
  sd_abinit_common_ok="unknown"

  # Set adjustable parameters
  sd_abinit_common_options="optional skip"
  sd_abinit_common_libs_def=""
  sd_abinit_common_cppflags_def=""
  sd_abinit_common_cflags_def=""
  sd_abinit_common_cxxflags_def=""
  sd_abinit_common_fcflags_def=""
  sd_abinit_common_ldflags_def=""
  sd_abinit_common_enable_def=""
  sd_abinit_common_policy=""
  sd_abinit_common_status=""

  # Process options
  for kwd in ${sd_abinit_common_options}; do
    case "${kwd}" in
      auto)
        sd_abinit_common_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_abinit_common_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_abinit_common_policy="${kwd}"
        ;;
      *)
        as_fn_error $? "invalid Steredeg ABINIT Common option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test -z "${sd_abinit_common_libs_def}" && sd_abinit_common_libs_def="-labinit_common"
  test -z "${sd_abinit_common_policy}" && sd_abinit_common_policy="fail"
  test -z "${sd_abinit_common_status}" && sd_abinit_common_status="optional"
  test -z "${sd_abinit_common_enable_def}" && sd_abinit_common_enable_def="no"
  case "${sd_abinit_common_status}" in
    implicit|required)
      sd_abinit_common_enable_def="yes"
      ;;
  esac

  # Declare configure option
  # TODO: make it switchable for the implicit case

# Check whether --with-abinit_common was given.
if test "${with_abinit_common+set}" = set; then :
  withval=$with_abinit_common;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_abinit_common_enable="${withval}"
        sd_abinit_common_init="yon"
      else
        sd_abinit_common_enable="yes"
        sd_abinit_common_init="dir"
      fi
else
   sd_abinit_common_enable="${sd_abinit_common_enable_def}"; sd_abinit_common_init="def"
fi


  # Declare environment variables






  # Detect use of environment variables
  if test "${sd_abinit_common_enable}" = "yes" -o "${sd_abinit_common_enable}" = "auto"; then
    tmp_abinit_common_vars="${ABINIT_COMMON_CPPFLAGS}${ABINIT_COMMON_FFLAGS}${ABINIT_COMMON_FCFLAGS}${ABINIT_COMMON_LDFLAGS}${ABINIT_COMMON_LIBS}"
    if test "${sd_abinit_common_init}" = "def" -a ! -z "${tmp_abinit_common_vars}"; then
      sd_abinit_common_enable="yes"
      sd_abinit_common_init="env"
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_BYPASS_CONSISTENCY}" != "yes"; then

  # Default trigger must be yes, no, or auto
  tmp_abinit_common_invalid="no"
  if test "${sd_abinit_common_enable_def}" != "auto" -a \
          "${sd_abinit_common_enable_def}" != "no" -a \
          "${sd_abinit_common_enable_def}" != "yes"; then
    case "${sd_abinit_common_policy}" in
      fail)
        as_fn_error $? "invalid default value: sd_abinit_common_enable_def = '${sd_abinit_common_enable_def}'" "$LINENO" 5
        ;;
      skip)
        tmp_abinit_common_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid default value: sd_abinit_common_enable_def = '${sd_abinit_common_enable_def}'" >&5
$as_echo "$as_me: WARNING: invalid default value: sd_abinit_common_enable_def = '${sd_abinit_common_enable_def}'" >&2;}
        tmp_abinit_common_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_abinit_common_invalid}" = "yes"; then
    if test "${sd_abinit_common_status}" = "required"; then
      sd_abinit_common_enable_def="yes"
    else
      sd_abinit_common_enable_def="no"
    fi
    tmp_abinit_common_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_abinit_common_enable_def to '${sd_abinit_common_enable_def}'" >&5
$as_echo "$as_me: setting sd_abinit_common_enable_def to '${sd_abinit_common_enable_def}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_abinit_common_invalid="no"
  if test "${sd_abinit_common_status}" = "implicit" -o \
          "${sd_abinit_common_status}" = "required"; then
    if test "${sd_abinit_common_enable}" = "no"; then
      case "${sd_abinit_common_policy}" in
        fail)
          as_fn_error $? "The ABINIT Common package is required and cannot be disabled
                  See https://launchpad.net/abinit_common for details on how to
                  install it." "$LINENO" 5
          ;;
        skip)
          tmp_abinit_common_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The ABINIT Common package is required and cannot be disabled" >&5
$as_echo "$as_me: WARNING: The ABINIT Common package is required and cannot be disabled" >&2;}
          tmp_abinit_common_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_abinit_common_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting ABINIT Common trigger to yes" >&5
$as_echo "$as_me: setting ABINIT Common trigger to yes" >&6;}
      sd_abinit_common_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_abinit_common_invalid}" = "yes"; then
    case "${sd_abinit_common_status}" in
      implicit|required)
        sd_abinit_common_enable="yes"
        ;;
      optional)
        sd_abinit_common_enable="no"
        ;;
    esac
    tmp_abinit_common_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_abinit_common_enable to '${sd_abinit_common_enable}'" >&5
$as_echo "$as_me: setting sd_abinit_common_enable to '${sd_abinit_common_enable}'" >&6;}
  fi

  # Environment variables conflict with --with-* options
  tmp_abinit_common_vars="${ABINIT_COMMON_CPPFLAGS}${ABINIT_COMMON_FFLAGS}${ABINIT_COMMON_FCFLAGS}${ABINIT_COMMON_LDFLAGS}${ABINIT_COMMON_LIBS}"
  tmp_abinit_common_invalid="no"
  if test ! -z "${tmp_abinit_common_vars}" -a ! -z "${with_abinit_common}"; then
    case "${sd_abinit_common_policy}" in
      fail)
        # FIXME: use the new Steredeg specs
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for ABINIT Common
                  Please use ABINIT_COMMON_FCFLAGS + ABINIT_COMMON_LIBS or --with-abinit_common,
                  not both." >&5
$as_echo "$as_me: WARNING: conflicting option settings for ABINIT Common
                  Please use ABINIT_COMMON_FCFLAGS + ABINIT_COMMON_LIBS or --with-abinit_common,
                  not both." >&2;}
        ;;
      skip)
        tmp_abinit_common_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for ABINIT Common" >&5
$as_echo "$as_me: WARNING: conflicting option settings for ABINIT Common" >&2;}
        tmp_abinit_common_invalid="yes"
        ;;
    esac
  fi

  # When using environment variables, triggers must be set to yes
  if test -n "${tmp_abinit_common_vars}"; then
    sd_abinit_common_enable="yes"
    sd_abinit_common_init="env"
    if test "${tmp_abinit_common_invalid}" = "yes"; then
      tmp_abinit_common_invalid="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding --with-abinit_common with ABINIT_COMMON_{FCFLAGS,LDFLAGS,LIBS}" >&5
$as_echo "$as_me: overriding --with-abinit_common with ABINIT_COMMON_{FCFLAGS,LDFLAGS,LIBS}" >&6;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_abinit_common_status}" = "implicit"; then
    if test "${sd_abinit_common_fcflags}" != ""; then
      sd_abinit_common_fcflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting ABINIT Common Fortran flags (implicit package)" >&5
$as_echo "$as_me: resetting ABINIT Common Fortran flags (implicit package)" >&6;}
    fi
    if test "${sd_abinit_common_ldflags}" != ""; then
      sd_abinit_common_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting ABINIT Common linker flags (implicit package)" >&5
$as_echo "$as_me: resetting ABINIT Common linker flags (implicit package)" >&6;}
    fi
    if test "${sd_abinit_common_libs}" != ""; then
      sd_abinit_common_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting ABINIT Common library flags (implicit package)" >&5
$as_echo "$as_me: resetting ABINIT Common library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_abinit_common_enable}" = "implicit"; then
    sd_abinit_common_fcflags=""
    sd_abinit_common_ldflags=""
    sd_abinit_common_libs=""
  fi

  # Clean-up
  unset tmp_abinit_common_invalid
  unset tmp_abinit_common_vars

  fi

  # Adjust configuration depending on init type
  if test "${sd_abinit_common_enable}" = "yes" -o "${sd_abinit_common_enable}" = "auto"; then

    # Set ABINIT Common-specific flags
    case "${sd_abinit_common_init}" in

      def|yon)
        sd_abinit_common_cppflags="${sd_abinit_common_cppflags_def}"
        sd_abinit_common_fcflags="${sd_abinit_common_fcflags_def}"
        sd_abinit_common_ldflags="${sd_abinit_common_ldflags_def}"
        sd_abinit_common_libs="${sd_abinit_common_libs_def}"
        ;;

      dir)
        sd_abinit_common_cppflags="-I${with_abinit_common}/include"
        sd_abinit_common_fcflags="${sd_abinit_common_fcflags_def} -I${with_abinit_common}/include"
        sd_abinit_common_ldflags="${sd_abinit_common_ldflags_def}"
        sd_abinit_common_libs="-L${with_abinit_common}/lib ${sd_abinit_common_libs_def}"
        ;;

      env)
        sd_abinit_common_cppflags="${sd_abinit_common_cppflags_def}"
        sd_abinit_common_fcflags="${sd_abinit_common_fcflags_def}"
        sd_abinit_common_ldflags="${sd_abinit_common_ldflags_def}"
        sd_abinit_common_libs="${sd_abinit_common_libs_def}"
        test ! -z "${ABINIT_COMMON_CPPFLAGS}" && sd_abinit_common_cppflags="${ABINIT_COMMON_CPPFLAGS}"
        test ! -z "${ABINIT_COMMON_FFLAGS}" && sd_abinit_common_fcflags="${ABINIT_COMMON_FFLAGS}"
        test ! -z "${ABINIT_COMMON_FCFLAGS}" && sd_abinit_common_fcflags="${ABINIT_COMMON_FCFLAGS}"
        test ! -z "${ABINIT_COMMON_LDFLAGS}" && sd_abinit_common_ldflags="${ABINIT_COMMON_LDFLAGS}"
        test ! -z "${ABINIT_COMMON_LIBS}" && sd_abinit_common_libs="${ABINIT_COMMON_LIBS}"
        ;;

      *)
        as_fn_error $? "invalid init type for ABINIT Common: '${sd_abinit_common_init}'" "$LINENO" 5
        ;;

    esac

  fi

  # Override the default configuration if the ESL Bundle is available
  # Note: The setting of the build flags is done once for all
  #       ESL-bundled packages
  if test "${sd_abinit_common_init}" = "def" -a ! -z "${ESL_BUNDLE_PREFIX}"; then
    sd_abinit_common_init="esl"
    sd_abinit_common_cppflags=""
    sd_abinit_common_fcflags=""
    sd_abinit_common_ldflags=""
    sd_abinit_common_libs=""
  fi

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable ABINIT Common" >&5
$as_echo_n "checking whether to enable ABINIT Common... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_abinit_common_enable}" >&5
$as_echo "${sd_abinit_common_enable}" >&6; }
  if test "${sd_abinit_common_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how ABINIT Common parameters have been set" >&5
$as_echo_n "checking how ABINIT Common parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_abinit_common_init}" >&5
$as_echo "${sd_abinit_common_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ABINIT Common C preprocessing flags" >&5
$as_echo_n "checking for ABINIT Common C preprocessing flags... " >&6; }
    if test "${sd_abinit_common_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_abinit_common_cppflags}" >&5
$as_echo "${sd_abinit_common_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ABINIT Common Fortran flags" >&5
$as_echo_n "checking for ABINIT Common Fortran flags... " >&6; }
    if test "${sd_abinit_common_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_abinit_common_fcflags}" >&5
$as_echo "${sd_abinit_common_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ABINIT Common linker flags" >&5
$as_echo_n "checking for ABINIT Common linker flags... " >&6; }
    if test "${sd_abinit_common_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_abinit_common_ldflags}" >&5
$as_echo "${sd_abinit_common_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ABINIT Common library flags" >&5
$as_echo_n "checking for ABINIT Common library flags... " >&6; }
    if test "${sd_abinit_common_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_abinit_common_libs}" >&5
$as_echo "${sd_abinit_common_libs}" >&6; }
    fi
  fi


  # Export configuration













  # Clean-up
  unset tmp_abinit_common_vars



  # Check whether we can compile and link a simple program
  # and update build flags if successful
  if test "${sd_abinit_common_enable}" = "auto" -o "${sd_abinit_common_enable}" = "yes"; then

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  if test "${sd_abinit_common_init}" = "esl"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: will look for ABINIT Common in the installed ESL Bundle" >&5
$as_echo "$as_me: will look for ABINIT Common in the installed ESL Bundle" >&6;}

  CPPFLAGS="${CPPFLAGS} ${sd_esl_bundle_cppflags}"
  CFLAGS="${CFLAGS} ${sd_esl_bundle_cflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_esl_bundle_cxxflags}"
  FCFLAGS="${FCFLAGS} ${sd_esl_bundle_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_esl_bundle_ldflags}"
  if test ! -z ""; then
    CPPFLAGS="${CPPFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
    FCFLAGS="${FCFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
  fi
  FCFLAGS="${FCFLAGS} -I/usr/include"


  LIBS="${sd_esl_bundle_libdirs} ${sd_abinit_common_libs_def} ${sd_esl_bundle_libs} ${LIBS}"

  else
    CPPFLAGS="${CPPFLAGS} ${sd_abinit_common_cppflags}"
    FCFLAGS="${FCFLAGS} ${sd_abinit_common_fcflags}"
    LDFLAGS="${LDFLAGS} ${sd_abinit_common_ldflags}"
    LIBS="${sd_abinit_common_libs} ${sd_linalg_libs} ${LIBS}"
  fi

  # Check ABINIT Common API
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the ABINIT Common Fortran interface works" >&5
$as_echo_n "checking whether the ABINIT Common Fortran interface works... " >&6; }
  for tmp_incs in "" "-I/usr/include"; do
    FCFLAGS="${FCFLAGS} ${tmp_incs}"
    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

    cat > conftest.$ac_ext <<_ACEOF
      program main

        use defs_basis

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_abinit_common_ok="yes"
else
  sd_abinit_common_ok="no"
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 "${sd_abinit_common_ok}" = "yes"; then
      test "${sd_sys_fcflags}" = "" && sd_sys_fcflags="${tmp_incs}"
      break
    fi
  done
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_abinit_common_ok}" >&5
$as_echo "${sd_abinit_common_ok}" >&6; }
  unset tmp_incs

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"



    if test "${sd_abinit_common_ok}" = "yes"; then
      if test "${sd_abinit_common_init}" = "esl"; then
        sd_esl_bundle_libs="${sd_abinit_common_libs_def} ${sd_esl_bundle_libs}"
      else
        FCFLAGS="${FCFLAGS} ${sd_abinit_common_fcflags}"
        LIBS="${sd_abinit_common_libs} ${LIBS}"
      fi
      LDFLAGS="${LDFLAGS} ${sd_abinit_common_ldflags}"


$as_echo "#define HAVE_ABINIT_COMMON 1" >>confdefs.h



  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable ABINIT Common" >&5
$as_echo_n "checking whether to enable ABINIT Common... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_abinit_common_enable}" >&5
$as_echo "${sd_abinit_common_enable}" >&6; }
  if test "${sd_abinit_common_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how ABINIT Common parameters have been set" >&5
$as_echo_n "checking how ABINIT Common parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_abinit_common_init}" >&5
$as_echo "${sd_abinit_common_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ABINIT Common C preprocessing flags" >&5
$as_echo_n "checking for ABINIT Common C preprocessing flags... " >&6; }
    if test "${sd_abinit_common_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_abinit_common_cppflags}" >&5
$as_echo "${sd_abinit_common_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ABINIT Common Fortran flags" >&5
$as_echo_n "checking for ABINIT Common Fortran flags... " >&6; }
    if test "${sd_abinit_common_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_abinit_common_fcflags}" >&5
$as_echo "${sd_abinit_common_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ABINIT Common linker flags" >&5
$as_echo_n "checking for ABINIT Common linker flags... " >&6; }
    if test "${sd_abinit_common_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_abinit_common_ldflags}" >&5
$as_echo "${sd_abinit_common_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ABINIT Common library flags" >&5
$as_echo_n "checking for ABINIT Common library flags... " >&6; }
    if test "${sd_abinit_common_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_abinit_common_libs}" >&5
$as_echo "${sd_abinit_common_libs}" >&6; }
    fi
  fi

    else
      if test "${sd_abinit_common_status}" = "optional" -a \
              "${sd_abinit_common_init}" = "def"; then
        sd_abinit_common_enable="no"
        sd_abinit_common_cppflags=""
        sd_abinit_common_fcflags=""
        sd_abinit_common_ldflags=""
        sd_abinit_common_libs=""
      else
        { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "invalid ABINIT Common configuration
See \`config.log' for more details" "$LINENO" 5; }
      fi
    fi
  else
    sd_abinit_common_enable="no"
    sd_abinit_common_cppflags=""
    sd_abinit_common_fcflags=""
    sd_abinit_common_ldflags=""
    sd_abinit_common_libs=""
  fi


# Initialize the LibPAW routines as an external component

  # Init
  sd_libpaw_cppflags=""
  sd_libpaw_cflags=""
  sd_libpaw_cxxflags=""
  sd_libpaw_fcflags=""
  sd_libpaw_ldflags=""
  sd_libpaw_libs=""
  sd_libpaw_enable=""
  sd_libpaw_init="unknown"
  sd_libpaw_ok="unknown"

  # Set adjustable parameters
  sd_libpaw_options="optional skip"
  sd_libpaw_libs_def=""
  sd_libpaw_cppflags_def=""
  sd_libpaw_cflags_def=""
  sd_libpaw_cxxflags_def=""
  sd_libpaw_fcflags_def=""
  sd_libpaw_ldflags_def=""
  sd_libpaw_enable_def=""
  sd_libpaw_policy=""
  sd_libpaw_status=""

  # Process options
  for kwd in ${sd_libpaw_options}; do
    case "${kwd}" in
      auto)
        sd_libpaw_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_libpaw_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_libpaw_policy="${kwd}"
        ;;
      *)
        as_fn_error $? "invalid Steredeg LibPAW option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test -z "${sd_libpaw_libs_def}" && sd_libpaw_libs_def="-lpaw"
  test -z "${sd_libpaw_policy}" && sd_libpaw_policy="fail"
  test -z "${sd_libpaw_status}" && sd_libpaw_status="optional"
  test -z "${sd_libpaw_enable_def}" && sd_libpaw_enable_def="no"
  case "${sd_libpaw_status}" in
    implicit|required)
      sd_libpaw_enable_def="yes"
      ;;
  esac

  # Declare configure option
  # TODO: make it switchable for the implicit case

# Check whether --with-libpaw was given.
if test "${with_libpaw+set}" = set; then :
  withval=$with_libpaw;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_libpaw_enable="${withval}"
        sd_libpaw_init="yon"
      else
        sd_libpaw_enable="yes"
        sd_libpaw_init="dir"
      fi
else
   sd_libpaw_enable="${sd_libpaw_enable_def}"; sd_libpaw_init="def"
fi


  # Declare environment variables






  # Detect use of environment variables
  if test "${sd_libpaw_enable}" = "yes" -o "${sd_libpaw_enable}" = "auto"; then
    tmp_libpaw_vars="${LIBPAW_CPPFLAGS}${LIBPAW_FFLAGS}${LIBPAW_FCFLAGS}${LIBPAW_LDFLAGS}${LIBPAW_LIBS}"
    if test "${sd_libpaw_init}" = "def" -a ! -z "${tmp_libpaw_vars}"; then
      sd_libpaw_enable="yes"
      sd_libpaw_init="env"
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_BYPASS_CONSISTENCY}" != "yes"; then

  # Default trigger must be yes, no, or auto
  tmp_libpaw_invalid="no"
  if test "${sd_libpaw_enable_def}" != "auto" -a \
          "${sd_libpaw_enable_def}" != "no" -a \
          "${sd_libpaw_enable_def}" != "yes"; then
    case "${sd_libpaw_policy}" in
      fail)
        as_fn_error $? "invalid default value: sd_libpaw_enable_def = '${sd_libpaw_enable_def}'" "$LINENO" 5
        ;;
      skip)
        tmp_libpaw_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid default value: sd_libpaw_enable_def = '${sd_libpaw_enable_def}'" >&5
$as_echo "$as_me: WARNING: invalid default value: sd_libpaw_enable_def = '${sd_libpaw_enable_def}'" >&2;}
        tmp_libpaw_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_libpaw_invalid}" = "yes"; then
    if test "${sd_libpaw_status}" = "required"; then
      sd_libpaw_enable_def="yes"
    else
      sd_libpaw_enable_def="no"
    fi
    tmp_libpaw_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_libpaw_enable_def to '${sd_libpaw_enable_def}'" >&5
$as_echo "$as_me: setting sd_libpaw_enable_def to '${sd_libpaw_enable_def}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_libpaw_invalid="no"
  if test "${sd_libpaw_status}" = "implicit" -o \
          "${sd_libpaw_status}" = "required"; then
    if test "${sd_libpaw_enable}" = "no"; then
      case "${sd_libpaw_policy}" in
        fail)
          as_fn_error $? "The LibPAW package is required and cannot be disabled
                  See https://launchpad.net/libpaw for details on how to
                  install it." "$LINENO" 5
          ;;
        skip)
          tmp_libpaw_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The LibPAW package is required and cannot be disabled" >&5
$as_echo "$as_me: WARNING: The LibPAW package is required and cannot be disabled" >&2;}
          tmp_libpaw_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_libpaw_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting LibPAW trigger to yes" >&5
$as_echo "$as_me: setting LibPAW trigger to yes" >&6;}
      sd_libpaw_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_libpaw_invalid}" = "yes"; then
    case "${sd_libpaw_status}" in
      implicit|required)
        sd_libpaw_enable="yes"
        ;;
      optional)
        sd_libpaw_enable="no"
        ;;
    esac
    tmp_libpaw_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_libpaw_enable to '${sd_libpaw_enable}'" >&5
$as_echo "$as_me: setting sd_libpaw_enable to '${sd_libpaw_enable}'" >&6;}
  fi

  # Environment variables conflict with --with-* options
  tmp_libpaw_vars="${LIBPAW_CPPFLAGS}${LIBPAW_FFLAGS}${LIBPAW_FCFLAGS}${LIBPAW_LDFLAGS}${LIBPAW_LIBS}"
  tmp_libpaw_invalid="no"
  if test ! -z "${tmp_libpaw_vars}" -a ! -z "${with_libpaw}"; then
    case "${sd_libpaw_policy}" in
      fail)
        # FIXME: use the new Steredeg specs
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for LibPAW
                  Please use LIBPAW_FCFLAGS + LIBPAW_LIBS or --with-libpaw,
                  not both." >&5
$as_echo "$as_me: WARNING: conflicting option settings for LibPAW
                  Please use LIBPAW_FCFLAGS + LIBPAW_LIBS or --with-libpaw,
                  not both." >&2;}
        ;;
      skip)
        tmp_libpaw_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for LibPAW" >&5
$as_echo "$as_me: WARNING: conflicting option settings for LibPAW" >&2;}
        tmp_libpaw_invalid="yes"
        ;;
    esac
  fi

  # When using environment variables, triggers must be set to yes
  if test -n "${tmp_libpaw_vars}"; then
    sd_libpaw_enable="yes"
    sd_libpaw_init="env"
    if test "${tmp_libpaw_invalid}" = "yes"; then
      tmp_libpaw_invalid="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding --with-libpaw with LIBPAW_{FCFLAGS,LDFLAGS,LIBS}" >&5
$as_echo "$as_me: overriding --with-libpaw with LIBPAW_{FCFLAGS,LDFLAGS,LIBS}" >&6;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_libpaw_status}" = "implicit"; then
    if test "${sd_libpaw_fcflags}" != ""; then
      sd_libpaw_fcflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting LibPAW Fortran flags (implicit package)" >&5
$as_echo "$as_me: resetting LibPAW Fortran flags (implicit package)" >&6;}
    fi
    if test "${sd_libpaw_ldflags}" != ""; then
      sd_libpaw_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting LibPAW linker flags (implicit package)" >&5
$as_echo "$as_me: resetting LibPAW linker flags (implicit package)" >&6;}
    fi
    if test "${sd_libpaw_libs}" != ""; then
      sd_libpaw_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting LibPAW library flags (implicit package)" >&5
$as_echo "$as_me: resetting LibPAW library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_libpaw_enable}" = "implicit"; then
    sd_libpaw_fcflags=""
    sd_libpaw_ldflags=""
    sd_libpaw_libs=""
  fi

  # Clean-up
  unset tmp_libpaw_invalid
  unset tmp_libpaw_vars

  fi

  # Adjust configuration depending on init type
  if test "${sd_libpaw_enable}" = "yes" -o "${sd_libpaw_enable}" = "auto"; then

    # Set LibPAW-specific flags
    case "${sd_libpaw_init}" in

      def|yon)
        sd_libpaw_cppflags="${sd_libpaw_cppflags_def}"
        sd_libpaw_fcflags="${sd_libpaw_fcflags_def}"
        sd_libpaw_ldflags="${sd_libpaw_ldflags_def}"
        sd_libpaw_libs="${sd_libpaw_libs_def}"
        ;;

      dir)
        sd_libpaw_cppflags="-I${with_libpaw}/include"
        sd_libpaw_fcflags="${sd_libpaw_fcflags_def} -I${with_libpaw}/include"
        sd_libpaw_ldflags="${sd_libpaw_ldflags_def}"
        sd_libpaw_libs="-L${with_libpaw}/lib ${sd_libpaw_libs_def}"
        ;;

      env)
        sd_libpaw_cppflags="${sd_libpaw_cppflags_def}"
        sd_libpaw_fcflags="${sd_libpaw_fcflags_def}"
        sd_libpaw_ldflags="${sd_libpaw_ldflags_def}"
        sd_libpaw_libs="${sd_libpaw_libs_def}"
        test ! -z "${LIBPAW_CPPFLAGS}" && sd_libpaw_cppflags="${LIBPAW_CPPFLAGS}"
        test ! -z "${LIBPAW_FFLAGS}" && sd_libpaw_fcflags="${LIBPAW_FFLAGS}"
        test ! -z "${LIBPAW_FCFLAGS}" && sd_libpaw_fcflags="${LIBPAW_FCFLAGS}"
        test ! -z "${LIBPAW_LDFLAGS}" && sd_libpaw_ldflags="${LIBPAW_LDFLAGS}"
        test ! -z "${LIBPAW_LIBS}" && sd_libpaw_libs="${LIBPAW_LIBS}"
        ;;

      *)
        as_fn_error $? "invalid init type for LibPAW: '${sd_libpaw_init}'" "$LINENO" 5
        ;;

    esac

  fi

  # Override the default configuration if the ESL Bundle is available
  # Note: The setting of the build flags is done once for all
  #       ESL-bundled packages
  if test "${sd_libpaw_init}" = "def" -a ! -z "${ESL_BUNDLE_PREFIX}"; then
    sd_libpaw_init="esl"
    sd_libpaw_cppflags=""
    sd_libpaw_fcflags=""
    sd_libpaw_ldflags=""
    sd_libpaw_libs=""
  fi

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable LibPAW" >&5
$as_echo_n "checking whether to enable LibPAW... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpaw_enable}" >&5
$as_echo "${sd_libpaw_enable}" >&6; }
  if test "${sd_libpaw_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how LibPAW parameters have been set" >&5
$as_echo_n "checking how LibPAW parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpaw_init}" >&5
$as_echo "${sd_libpaw_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibPAW C preprocessing flags" >&5
$as_echo_n "checking for LibPAW C preprocessing flags... " >&6; }
    if test "${sd_libpaw_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpaw_cppflags}" >&5
$as_echo "${sd_libpaw_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibPAW Fortran flags" >&5
$as_echo_n "checking for LibPAW Fortran flags... " >&6; }
    if test "${sd_libpaw_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpaw_fcflags}" >&5
$as_echo "${sd_libpaw_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibPAW linker flags" >&5
$as_echo_n "checking for LibPAW linker flags... " >&6; }
    if test "${sd_libpaw_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpaw_ldflags}" >&5
$as_echo "${sd_libpaw_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibPAW library flags" >&5
$as_echo_n "checking for LibPAW library flags... " >&6; }
    if test "${sd_libpaw_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpaw_libs}" >&5
$as_echo "${sd_libpaw_libs}" >&6; }
    fi
  fi


  # Export configuration













  # Clean-up
  unset tmp_libpaw_vars



  # Check whether we can compile and link a simple program
  # and update build flags if successful
  if test "${sd_libpaw_enable}" = "auto" -o "${sd_libpaw_enable}" = "yes"; then

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  if test "${sd_libpaw_init}" = "esl"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: will look for LibPAW in the installed ESL Bundle" >&5
$as_echo "$as_me: will look for LibPAW in the installed ESL Bundle" >&6;}

  CPPFLAGS="${CPPFLAGS} ${sd_esl_bundle_cppflags}"
  CFLAGS="${CFLAGS} ${sd_esl_bundle_cflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_esl_bundle_cxxflags}"
  FCFLAGS="${FCFLAGS} ${sd_esl_bundle_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_esl_bundle_ldflags}"
  if test ! -z ""; then
    CPPFLAGS="${CPPFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
    FCFLAGS="${FCFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
  fi
  FCFLAGS="${FCFLAGS} -I/usr/include"


  LIBS="${sd_esl_bundle_libdirs} ${sd_libpaw_libs_def} ${sd_esl_bundle_libs} ${LIBS}"

  else
    CPPFLAGS="${CPPFLAGS} ${sd_libpaw_cppflags}"
    FCFLAGS="${FCFLAGS} ${sd_libpaw_fcflags}"
    LDFLAGS="${LDFLAGS} ${sd_libpaw_ldflags}"
    LIBS="${sd_libpaw_libs} ${sd_linalg_libs} ${LIBS}"
  fi

  # Check LibPAW API
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the LibPAW Fortran interface works" >&5
$as_echo_n "checking whether the LibPAW Fortran interface works... " >&6; }
  for tmp_incs in "" "-I/usr/include"; do
    FCFLAGS="${FCFLAGS} ${tmp_incs}"
    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

    cat > conftest.$ac_ext <<_ACEOF
      program main

        use m_libpaw_defs

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_libpaw_ok="yes"
else
  sd_libpaw_ok="no"
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 "${sd_libpaw_ok}" = "yes"; then
      test "${sd_sys_fcflags}" = "" && sd_sys_fcflags="${tmp_incs}"
      break
    fi
  done
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpaw_ok}" >&5
$as_echo "${sd_libpaw_ok}" >&6; }
  unset tmp_incs

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"



    if test "${sd_libpaw_ok}" = "yes"; then
      if test "${sd_libpaw_init}" = "esl"; then
        sd_esl_bundle_libs="${sd_libpaw_libs_def} ${sd_esl_bundle_libs}"
      else
        FCFLAGS="${FCFLAGS} ${sd_libpaw_fcflags}"
        LIBS="${sd_libpaw_libs} ${LIBS}"
      fi
      LDFLAGS="${LDFLAGS} ${sd_libpaw_ldflags}"


$as_echo "#define HAVE_LIBPAW 1" >>confdefs.h



  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable LibPAW" >&5
$as_echo_n "checking whether to enable LibPAW... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpaw_enable}" >&5
$as_echo "${sd_libpaw_enable}" >&6; }
  if test "${sd_libpaw_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how LibPAW parameters have been set" >&5
$as_echo_n "checking how LibPAW parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpaw_init}" >&5
$as_echo "${sd_libpaw_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibPAW C preprocessing flags" >&5
$as_echo_n "checking for LibPAW C preprocessing flags... " >&6; }
    if test "${sd_libpaw_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpaw_cppflags}" >&5
$as_echo "${sd_libpaw_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibPAW Fortran flags" >&5
$as_echo_n "checking for LibPAW Fortran flags... " >&6; }
    if test "${sd_libpaw_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpaw_fcflags}" >&5
$as_echo "${sd_libpaw_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibPAW linker flags" >&5
$as_echo_n "checking for LibPAW linker flags... " >&6; }
    if test "${sd_libpaw_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpaw_ldflags}" >&5
$as_echo "${sd_libpaw_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LibPAW library flags" >&5
$as_echo_n "checking for LibPAW library flags... " >&6; }
    if test "${sd_libpaw_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_libpaw_libs}" >&5
$as_echo "${sd_libpaw_libs}" >&6; }
    fi
  fi

    else
      if test "${sd_libpaw_status}" = "optional" -a \
              "${sd_libpaw_init}" = "def"; then
        sd_libpaw_enable="no"
        sd_libpaw_cppflags=""
        sd_libpaw_fcflags=""
        sd_libpaw_ldflags=""
        sd_libpaw_libs=""
      else
        { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "invalid LibPAW configuration
See \`config.log' for more details" "$LINENO" 5; }
      fi
    fi
  else
    sd_libpaw_enable="no"
    sd_libpaw_cppflags=""
    sd_libpaw_fcflags=""
    sd_libpaw_ldflags=""
    sd_libpaw_libs=""
  fi


                       # ------------------------------ #

# Init BigDFT (requires knowledge about ABINIT Common and LibPAW)
if test "${sd_libxc_enable}" = "yes" -a "${sd_linalg_enable}" = "yes"; then
  #SD_BIGDFT_INIT([optional fail])

  # Init
  sd_bigdft_cppflags=""
  sd_bigdft_cflags=""
  sd_bigdft_cxxflags=""
  sd_bigdft_fcflags=""
  sd_bigdft_ldflags=""
  sd_bigdft_libs=""
  sd_bigdft_enable=""
  sd_bigdft_init="unknown"
  sd_bigdft_ok="unknown"

  # Set adjustable parameters
  sd_bigdft_options="optional warn"
  sd_bigdft_libs_def=""
  sd_bigdft_cppflags_def=""
  sd_bigdft_cflags_def=""
  sd_bigdft_cxxflags_def=""
  sd_bigdft_fcflags_def=""
  sd_bigdft_ldflags_def=""
  sd_bigdft_enable_def=""
  sd_bigdft_policy=""
  sd_bigdft_status=""

  # Process options
  for kwd in ${sd_bigdft_options}; do
    case "${kwd}" in
      auto)
        sd_bigdft_enable_def="${kwd}"
        ;;
      implicit|required|optional)
        sd_bigdft_status="${kwd}"
        ;;
      fail|skip|warn)
        sd_bigdft_policy="${kwd}"
        ;;
      *)
        as_fn_error $? "invalid Steredeg BigDFT option: '${kwd}'" "$LINENO" 5
        ;;
    esac
  done

  # Set reasonable defaults if not provided
  test -z "${sd_bigdft_libs_def}" && sd_bigdft_libs_def="-lbigdft-1 -labinit -lpaw_bigdft -lyaml"
  test -z "${sd_bigdft_policy}" && sd_bigdft_policy="fail"
  test -z "${sd_bigdft_status}" && sd_bigdft_status="optional"
  test -z "${sd_bigdft_enable_def}" && sd_bigdft_enable_def="no"
  case "${sd_bigdft_status}" in
    implicit|required)
      sd_bigdft_enable_def="yes"
      ;;
  esac

  # Declare configure option
  # TODO: make it switchable for the implicit case

# Check whether --with-bigdft was given.
if test "${with_bigdft+set}" = set; then :
  withval=$with_bigdft;  if test "${withval}" = "no" -o "${withval}" = "yes"; then
        sd_bigdft_enable="${withval}"
        sd_bigdft_init="yon"
      else
        sd_bigdft_enable="yes"
        sd_bigdft_init="dir"
      fi
else
   sd_bigdft_enable="${sd_bigdft_enable_def}"; sd_bigdft_init="def"
fi


  # Declare environment variables






  # Detect use of environment variables
  if test "${sd_bigdft_enable}" = "yes" -o "${sd_bigdft_enable}" = "auto"; then
    tmp_bigdft_vars="${BIGDFT_CPPFLAGS}${BIGDFT_FFLAGS}${BIGDFT_FCFLAGS}${BIGDFT_LDFLAGS}${BIGDFT_LIBS}"
    if test "${sd_bigdft_init}" = "def" -a ! -z "${tmp_bigdft_vars}"; then
      sd_bigdft_enable="yes"
      sd_bigdft_init="env"
    fi
  fi

  # Make sure configuration is correct
  if test "${STEREDEG_BYPASS_CONSISTENCY}" != "yes"; then

  # Default trigger must be yes, no, or auto
  tmp_bigdft_invalid="no"
  if test "${sd_bigdft_enable_def}" != "auto" -a \
          "${sd_bigdft_enable_def}" != "no" -a \
          "${sd_bigdft_enable_def}" != "yes"; then
    case "${sd_bigdft_policy}" in
      fail)
        as_fn_error $? "invalid default value: sd_bigdft_enable_def = '${sd_bigdft_enable_def}'" "$LINENO" 5
        ;;
      skip)
        tmp_bigdft_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid default value: sd_bigdft_enable_def = '${sd_bigdft_enable_def}'" >&5
$as_echo "$as_me: WARNING: invalid default value: sd_bigdft_enable_def = '${sd_bigdft_enable_def}'" >&2;}
        tmp_bigdft_invalid="yes"
        ;;
    esac
  fi

  # Fix wrong trigger default
  if test "${tmp_bigdft_invalid}" = "yes"; then
    if test "${sd_bigdft_status}" = "required"; then
      sd_bigdft_enable_def="yes"
    else
      sd_bigdft_enable_def="no"
    fi
    tmp_bigdft_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_bigdft_enable_def to '${sd_bigdft_enable_def}'" >&5
$as_echo "$as_me: setting sd_bigdft_enable_def to '${sd_bigdft_enable_def}'" >&6;}
  fi

  # Check consistency between trigger value and package status
  tmp_bigdft_invalid="no"
  if test "${sd_bigdft_status}" = "implicit" -o \
          "${sd_bigdft_status}" = "required"; then
    if test "${sd_bigdft_enable}" = "no"; then
      case "${sd_bigdft_policy}" in
        fail)
          as_fn_error $? "The BigDFT package is required and cannot be disabled
                  See https://launchpad.net/bigdft for details on how to
                  install it." "$LINENO" 5
          ;;
        skip)
          tmp_bigdft_invalid="yes"
          ;;
        warn)
          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The BigDFT package is required and cannot be disabled" >&5
$as_echo "$as_me: WARNING: The BigDFT package is required and cannot be disabled" >&2;}
          tmp_bigdft_invalid="yes"
          ;;
      esac
    fi
    if test "${sd_bigdft_enable}" = "auto"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: setting BigDFT trigger to yes" >&5
$as_echo "$as_me: setting BigDFT trigger to yes" >&6;}
      sd_bigdft_enable="yes"
    fi
  fi

  # Fix wrong trigger value
  if test "${tmp_bigdft_invalid}" = "yes"; then
    case "${sd_bigdft_status}" in
      implicit|required)
        sd_bigdft_enable="yes"
        ;;
      optional)
        sd_bigdft_enable="no"
        ;;
    esac
    tmp_bigdft_invalid="no"
    { $as_echo "$as_me:${as_lineno-$LINENO}: setting sd_bigdft_enable to '${sd_bigdft_enable}'" >&5
$as_echo "$as_me: setting sd_bigdft_enable to '${sd_bigdft_enable}'" >&6;}
  fi

  # Environment variables conflict with --with-* options
  tmp_bigdft_vars="${BIGDFT_CPPFLAGS}${BIGDFT_FFLAGS}${BIGDFT_FCFLAGS}${BIGDFT_LDFLAGS}${BIGDFT_LIBS}"
  tmp_bigdft_invalid="no"
  if test ! -z "${tmp_bigdft_vars}" -a ! -z "${with_bigdft}"; then
    case "${sd_bigdft_policy}" in
      fail)
        # FIXME: use the new Steredeg specs
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for BigDFT
                  Please use BIGDFT_FCFLAGS + BIGDFT_LIBS or --with-bigdft,
                  not both." >&5
$as_echo "$as_me: WARNING: conflicting option settings for BigDFT
                  Please use BIGDFT_FCFLAGS + BIGDFT_LIBS or --with-bigdft,
                  not both." >&2;}
        ;;
      skip)
        tmp_bigdft_invalid="yes"
        ;;
      warn)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: conflicting option settings for BigDFT" >&5
$as_echo "$as_me: WARNING: conflicting option settings for BigDFT" >&2;}
        tmp_bigdft_invalid="yes"
        ;;
    esac
  fi

  # When using environment variables, triggers must be set to yes
  if test -n "${tmp_bigdft_vars}"; then
    sd_bigdft_enable="yes"
    sd_bigdft_init="env"
    if test "${tmp_bigdft_invalid}" = "yes"; then
      tmp_bigdft_invalid="no"
      { $as_echo "$as_me:${as_lineno-$LINENO}: overriding --with-bigdft with BIGDFT_{FCFLAGS,LDFLAGS,LIBS}" >&5
$as_echo "$as_me: overriding --with-bigdft with BIGDFT_{FCFLAGS,LDFLAGS,LIBS}" >&6;}
    fi
  fi

  # Implicit status overrides everything
  if test "${sd_bigdft_status}" = "implicit"; then
    if test "${sd_bigdft_fcflags}" != ""; then
      sd_bigdft_fcflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting BigDFT Fortran flags (implicit package)" >&5
$as_echo "$as_me: resetting BigDFT Fortran flags (implicit package)" >&6;}
    fi
    if test "${sd_bigdft_ldflags}" != ""; then
      sd_bigdft_ldflags=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting BigDFT linker flags (implicit package)" >&5
$as_echo "$as_me: resetting BigDFT linker flags (implicit package)" >&6;}
    fi
    if test "${sd_bigdft_libs}" != ""; then
      sd_bigdft_libs=""
      { $as_echo "$as_me:${as_lineno-$LINENO}: resetting BigDFT library flags (implicit package)" >&5
$as_echo "$as_me: resetting BigDFT library flags (implicit package)" >&6;}
    fi
  fi

  # Reset build parameters if disabled
  if test "${sd_bigdft_enable}" = "implicit"; then
    sd_bigdft_fcflags=""
    sd_bigdft_ldflags=""
    sd_bigdft_libs=""
  fi

  # Clean-up
  unset tmp_bigdft_invalid
  unset tmp_bigdft_vars

  fi
  # Adjust configuration depending on init type
  if test "${sd_bigdft_enable}" = "yes" -o "${sd_bigdft_enable}" = "auto"; then

    # Set BigDFT-specific flags
    case "${sd_bigdft_init}" in

      def|yon)
        sd_bigdft_cppflags="${sd_bigdft_cppflags_def}"
        sd_bigdft_fcflags="${sd_bigdft_fcflags_def}"
        sd_bigdft_ldflags="${sd_bigdft_ldflags_def}"
        sd_bigdft_libs="${sd_bigdft_libs_def}"
        ;;

      dir)
        sd_bigdft_cppflags="-I${with_bigdft}/include"
        sd_bigdft_fcflags="${sd_bigdft_fcflags_def} -I${with_bigdft}/include"
        sd_bigdft_ldflags="${sd_bigdft_ldflags_def}"
        sd_bigdft_libs="-L${with_bigdft}/lib ${sd_bigdft_libs_def}"
        ;;

      env)
        sd_bigdft_cppflags="${sd_bigdft_cppflags_def}"
        sd_bigdft_fcflags="${sd_bigdft_fcflags_def}"
        sd_bigdft_ldflags="${sd_bigdft_ldflags_def}"
        sd_bigdft_libs="${sd_bigdft_libs_def}"
        test ! -z "${BIGDFT_CPPFLAGS}" && sd_bigdft_cppflags="${BIGDFT_CPPFLAGS}"
        test ! -z "${BIGDFT_FFLAGS}" && sd_bigdft_fcflags="${BIGDFT_FFLAGS}"
        test ! -z "${BIGDFT_FCFLAGS}" && sd_bigdft_fcflags="${BIGDFT_FCFLAGS}"
        test ! -z "${BIGDFT_LDFLAGS}" && sd_bigdft_ldflags="${BIGDFT_LDFLAGS}"
        test ! -z "${BIGDFT_LIBS}" && sd_bigdft_libs="${BIGDFT_LIBS}"
        ;;

      *)
        as_fn_error $? "invalid init type for BigDFT: '${sd_bigdft_init}'" "$LINENO" 5
        ;;

    esac

  fi

  # Override the default configuration if the ESL Bundle is available
  # Note: The setting of the build flags is done once for all
  #       ESL-bundled packages
  if test "${sd_bigdft_init}" = "def" -a ! -z "${ESL_BUNDLE_PREFIX}"; then
    sd_bigdft_init="esl"
    sd_bigdft_cppflags=""
    sd_bigdft_fcflags=""
    sd_bigdft_ldflags=""
    sd_bigdft_libs=""
  fi

  # Display configuration

  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable BigDFT" >&5
$as_echo_n "checking whether to enable BigDFT... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_bigdft_enable}" >&5
$as_echo "${sd_bigdft_enable}" >&6; }
  if test "${sd_bigdft_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how BigDFT parameters have been set" >&5
$as_echo_n "checking how BigDFT parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_bigdft_init}" >&5
$as_echo "${sd_bigdft_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BigDFT C preprocessing flags" >&5
$as_echo_n "checking for BigDFT C preprocessing flags... " >&6; }
    if test "${sd_bigdft_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_bigdft_cppflags}" >&5
$as_echo "${sd_bigdft_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BigDFT Fortran flags" >&5
$as_echo_n "checking for BigDFT Fortran flags... " >&6; }
    if test "${sd_bigdft_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_bigdft_fcflags}" >&5
$as_echo "${sd_bigdft_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BigDFT linker flags" >&5
$as_echo_n "checking for BigDFT linker flags... " >&6; }
    if test "${sd_bigdft_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_bigdft_ldflags}" >&5
$as_echo "${sd_bigdft_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BigDFT library flags" >&5
$as_echo_n "checking for BigDFT library flags... " >&6; }
    if test "${sd_bigdft_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_bigdft_libs}" >&5
$as_echo "${sd_bigdft_libs}" >&6; }
    fi
  fi


  # Export configuration













  # Clean-up
  unset tmp_bigdft_vars


  # BigDFT library support (requires linear algebra and LibXC)

  # Check whether we can compile and link a simple program
  # and update build flags if successful
  if test "${sd_bigdft_enable}" = "auto" -o "${sd_bigdft_enable}" = "yes"; then

  # Prepare environment

  sd_esl_saved_CPPFLAGS="${CPPFLAGS}"
  sd_esl_saved_CFLAGS="${CFLAGS}"
  sd_esl_saved_CXXFLAGS="${CXXFLAGS}"
  sd_esl_saved_FCFLAGS="${FCFLAGS}"
  sd_esl_saved_LDFLAGS="${LDFLAGS}"
  sd_esl_saved_LIBS="${LIBS}"

  if test "${sd_bigdft_init}" = "esl"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: will look for BigDFT in the installed ESL Bundle" >&5
$as_echo "$as_me: will look for BigDFT in the installed ESL Bundle" >&6;}

  CPPFLAGS="${CPPFLAGS} ${sd_esl_bundle_cppflags}"
  CFLAGS="${CFLAGS} ${sd_esl_bundle_cflags}"
  CXXFLAGS="${CXXFLAGS} ${sd_esl_bundle_cxxflags}"
  FCFLAGS="${FCFLAGS} ${sd_esl_bundle_fcflags}"
  LDFLAGS="${LDFLAGS} ${sd_esl_bundle_ldflags}"
  if test ! -z ""; then
    CPPFLAGS="${CPPFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
    FCFLAGS="${FCFLAGS} -I${ESL_BUNDLE_PREFIX}/include/"
  fi
  FCFLAGS="${FCFLAGS} -I/usr/include"


  LIBS="${sd_esl_bundle_libdirs} ${sd_bigdft_libs_def} ${sd_esl_bundle_libs} ${LIBS}"

  else
    CPPFLAGS="${CPPFLAGS} ${sd_linalg_cppflags} ${sd_libxc_cppflags} ${sd_bigdft_cppflags}"
    FCFLAGS="${FCFLAGS} ${sd_linalg_fcflags} ${sd_libxc_fcflags} ${sd_bigdft_fcflags}"
    LDFLAGS="${LDFLAGS} ${sd_linalg_ldflags} ${sd_libxc_ldflags} ${sd_bigdft_ldflags}"
    LIBS="${sd_bigdft_libs} ${sd_libxc_libs} ${sd_linalg_libs} ${LIBS}"
  fi

  # Check BigDFT Fortran API
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the BigDFT Fortran interface works" >&5
$as_echo_n "checking whether the BigDFT Fortran interface works... " >&6; }
  for tmp_incs in "" "-I/usr/include"; do
    FCFLAGS="${FCFLAGS} ${tmp_incs}"
    ac_ext=${ac_fc_srcext-f}
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu

    cat > conftest.$ac_ext <<_ACEOF
      program main

          use bigdft_api
          implicit none
          integer iproc
          type(input_variables) :: inputs
          type(atoms_data) :: atoms
          type(restart_objects) :: rst
          call init_restart_objects(iproc, inputs, atoms, rst)

      end
_ACEOF
if ac_fn_fc_try_link "$LINENO"; then :
  sd_bigdft_ok="yes"
else
  sd_bigdft_ok="no"
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 "${sd_bigdft_ok}" = "yes"; then
      test "${sd_sys_fcflags}" = "" && sd_sys_fcflags="${tmp_incs}"
      break
    fi
  done
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_bigdft_ok}" >&5
$as_echo "${sd_bigdft_ok}" >&6; }
  unset tmp_incs

  # Restore environment

  CPPFLAGS="${sd_esl_saved_CPPFLAGS}"
  CFLAGS="${sd_esl_saved_CFLAGS}"
  CXXFLAGS="${sd_esl_saved_CXXFLAGS}"
  FCFLAGS="${sd_esl_saved_FCFLAGS}"
  LDFLAGS="${sd_esl_saved_LDFLAGS}"
  LIBS="${sd_esl_saved_LIBS}"



    if test "${sd_bigdft_ok}" = "yes"; then
      if test "${sd_bigdft_init}" = "esl"; then
        sd_esl_bundle_libs="${sd_bigdft_libs_def} ${sd_esl_bundle_libs}"
      else
        FCFLAGS="${FCFLAGS} ${sd_bigdft_fcflags}"
        LIBS="${sd_bigdft_libs} ${LIBS}"
      fi
      LDFLAGS="${LDFLAGS} ${sd_bigdft_ldflags}"


$as_echo "#define HAVE_BIGDFT 1" >>confdefs.h



  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable BigDFT" >&5
$as_echo_n "checking whether to enable BigDFT... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_bigdft_enable}" >&5
$as_echo "${sd_bigdft_enable}" >&6; }
  if test "${sd_bigdft_enable}" != "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how BigDFT parameters have been set" >&5
$as_echo_n "checking how BigDFT parameters have been set... " >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_bigdft_init}" >&5
$as_echo "${sd_bigdft_init}" >&6; }
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BigDFT C preprocessing flags" >&5
$as_echo_n "checking for BigDFT C preprocessing flags... " >&6; }
    if test "${sd_bigdft_cppflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_bigdft_cppflags}" >&5
$as_echo "${sd_bigdft_cppflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BigDFT Fortran flags" >&5
$as_echo_n "checking for BigDFT Fortran flags... " >&6; }
    if test "${sd_bigdft_fcflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_bigdft_fcflags}" >&5
$as_echo "${sd_bigdft_fcflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BigDFT linker flags" >&5
$as_echo_n "checking for BigDFT linker flags... " >&6; }
    if test "${sd_bigdft_ldflags}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_bigdft_ldflags}" >&5
$as_echo "${sd_bigdft_ldflags}" >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BigDFT library flags" >&5
$as_echo_n "checking for BigDFT library flags... " >&6; }
    if test "${sd_bigdft_libs}" = ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${sd_bigdft_libs}" >&5
$as_echo "${sd_bigdft_libs}" >&6; }
    fi
  fi

    else
      if test "${sd_bigdft_status}" = "optional" -a \
              "${sd_bigdft_init}" = "def"; then
        sd_bigdft_enable="no"
        sd_bigdft_cppflags=""
        sd_bigdft_fcflags=""
        sd_bigdft_ldflags=""
        sd_bigdft_libs=""
      else
        if test "${sd_bigdft_policy}" = "fail"; 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 $? "invalid BigDFT configuration
See \`config.log' for more details" "$LINENO" 5; }
        else
              { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid BigDFT configuration" >&5
$as_echo "$as_me: WARNING: invalid BigDFT configuration" >&2;}
        fi
      fi
    fi
  else
    sd_bigdft_enable="no"
    sd_bigdft_cppflags=""
    sd_bigdft_fcflags=""
    sd_bigdft_ldflags=""
    sd_bigdft_libs=""
  fi

else
  echo "Skip BIGDFT setting : libxc not enabled..."
fi

                       # ------------------------------ #

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build the components of ABINIT" >&5
$as_echo_n "checking how to build the components of ABINIT... " >&6; }
abi_build_steps=""
if test "${sd_abinit_common_ok}" = "yes"; then
  test "${abi_build_steps}" = "" || abi_build_steps="${abi_build_steps}+"
  abi_build_steps="${abi_build_steps}common"
fi
if test "${sd_libpaw_ok}" = "yes"; then
  test "${abi_build_steps}" = "" || abi_build_steps="${abi_build_steps}+"
  abi_build_steps="${abi_build_steps}libpaw"
fi
if test "${sd_bigdft_ok}" = "yes"; then
  test "${abi_build_steps}" = "" || abi_build_steps="${abi_build_steps}+"
  abi_build_steps="${abi_build_steps}bigdft"
fi
if test "${abi_build_steps}" = ""; then
  abi_build_steps="monolith"
else
  abi_build_steps="${abi_build_steps}+core"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_build_steps}" >&5
$as_echo "${abi_build_steps}" >&6; }

# Allow the separate build of ABINIT Common
 if test "{sd_abinit_common_ok}" != "yes"; then
  DO_BUILD_SHARED_COMMON_TRUE=
  DO_BUILD_SHARED_COMMON_FALSE='#'
else
  DO_BUILD_SHARED_COMMON_TRUE='#'
  DO_BUILD_SHARED_COMMON_FALSE=
fi


# Allow the separate build of LibPAW
 if test "{sd_libpaw_ok}" != "yes"; then
  DO_BUILD_SHARED_LIBPAW_TRUE=
  DO_BUILD_SHARED_LIBPAW_FALSE='#'
else
  DO_BUILD_SHARED_LIBPAW_TRUE='#'
  DO_BUILD_SHARED_LIBPAW_FALSE=
fi


# FIXME: Let LibPAW know it is embedded in ABINIT

$as_echo "#define HAVE_LIBPAW_ABINIT 1" >>confdefs.h


# Warn the user if support for wavelets is ill-configured
if test "${abi_build_steps}" = "monolith" -a "${abi_bigdft_enable}" = "yes"; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: BigDFT will soon require the separate installation of ABINIT Common and LibPAW" >&5
$as_echo "$as_me: WARNING: BigDFT will soon require the separate installation of ABINIT Common and LibPAW" >&2;}
fi

# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #

#
# Final check of feature triggers
#



  abi_sec_title="Feature triggers summary"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# Display summary table

  tmp_e_abinit_common=`echo "${sd_abinit_common_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_abinit_common=`echo "${sd_abinit_common_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_abinit_common=`echo "${sd_abinit_common_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_abinit_common=`echo "${abi_fbk_abinit_common_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_bigdft=`echo "${sd_bigdft_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_bigdft=`echo "${sd_bigdft_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_bigdft=`echo "${sd_bigdft_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_bigdft=`echo "${abi_fbk_bigdft_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_fft=`echo "${sd_fft_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_fft=`echo "${sd_fft_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_fft=`echo "${sd_fft_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_fft=`echo "${abi_fbk_fft_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_fftw3=`echo "${sd_fftw3_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_fftw3=`echo "${sd_fftw3_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_fftw3=`echo "${sd_fftw3_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_fftw3=`echo "${abi_fbk_fftw3_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_gpu=`echo "${sd_gpu_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_gpu=`echo "${sd_gpu_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_gpu=`echo "${sd_gpu_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_gpu=`echo "${abi_fbk_gpu_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_hdf5=`echo "${sd_hdf5_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_hdf5=`echo "${sd_hdf5_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_hdf5=`echo "${sd_hdf5_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_hdf5=`echo "${abi_fbk_hdf5_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_kokkos=`echo "${sd_kokkos_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_kokkos=`echo "${sd_kokkos_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_kokkos=`echo "${sd_kokkos_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_kokkos=`echo "${abi_fbk_kokkos_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_levmar=`echo "${sd_levmar_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_levmar=`echo "${sd_levmar_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_levmar=`echo "${sd_levmar_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_levmar=`echo "${abi_fbk_levmar_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_libpaw=`echo "${sd_libpaw_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_libpaw=`echo "${sd_libpaw_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_libpaw=`echo "${sd_libpaw_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_libpaw=`echo "${abi_fbk_libpaw_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_libpsml=`echo "${sd_libpsml_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_libpsml=`echo "${sd_libpsml_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_libpsml=`echo "${sd_libpsml_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_libpsml=`echo "${abi_fbk_libpsml_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_libxc=`echo "${sd_libxc_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_libxc=`echo "${sd_libxc_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_libxc=`echo "${sd_libxc_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_libxc=`echo "${abi_fbk_libxc_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_libxml2=`echo "${abi_libxml2_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_libxml2=`echo "${abi_libxml2_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_libxml2=`echo "${abi_libxml2_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_libxml2=`echo "${abi_fbk_libxml2_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_linalg=`echo "${sd_linalg_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_linalg=`echo "${sd_linalg_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_linalg=`echo "${sd_linalg_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_linalg=`echo "${abi_fbk_linalg_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_mpi=`echo "${sd_mpi_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_mpi=`echo "${sd_mpi_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_mpi=`echo "${sd_mpi_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_mpi=`echo "${abi_fbk_mpi_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_netcdf=`echo "${sd_netcdf_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_netcdf=`echo "${sd_netcdf_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_netcdf=`echo "${sd_netcdf_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_netcdf=`echo "${abi_fbk_netcdf_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_netcdf_fortran=`echo "${sd_netcdf_fortran_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_netcdf_fortran=`echo "${sd_netcdf_fortran_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_netcdf_fortran=`echo "${sd_netcdf_fortran_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_netcdf_fortran=`echo "${abi_fbk_netcdf_fortran_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_papi=`echo "${sd_papi_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_papi=`echo "${sd_papi_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_papi=`echo "${sd_papi_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_papi=`echo "${abi_fbk_papi_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_pfft=`echo "${sd_pfft_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_pfft=`echo "${sd_pfft_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_pfft=`echo "${sd_pfft_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_pfft=`echo "${abi_fbk_pfft_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_triqs=`echo "${sd_triqs_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_triqs=`echo "${sd_triqs_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_triqs=`echo "${sd_triqs_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_triqs=`echo "${abi_fbk_triqs_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_wannier90=`echo "${sd_wannier90_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_wannier90=`echo "${sd_wannier90_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_wannier90=`echo "${sd_wannier90_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_wannier90=`echo "${abi_fbk_wannier90_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_xmlf90=`echo "${sd_xmlf90_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_xmlf90=`echo "${sd_xmlf90_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_xmlf90=`echo "${sd_xmlf90_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_xmlf90=`echo "${abi_fbk_xmlf90_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_e_yakl=`echo "${sd_yakl_enable}" | awk '{printf("%-8s",$1);}'`
  tmp_i_yakl=`echo "${sd_yakl_init}" | awk '{printf("%-8s",$1);}'`
  tmp_w_yakl=`echo "${sd_yakl_ok}" | awk '{printf("%-8s",$1);}'`
  tmp_f_yakl=`echo "${abi_fbk_yakl_ok}" | awk '{printf("%-8s",$1);}'`

  # Display configuration
  cat <<EOF

Abinit feature triggers status
==============================

The following summary table indicates the status of the feature triggers,
whether they are available and working, how they have been initialized
and whether there are fallbacks to substitute broken ones.

  +----------------+--------+--------+--------+--------+
  |Feature         |Enabled |Init    |Working |Fallback|
  +----------------+--------+--------+--------+--------+
  |abinit_common   |${tmp_e_abinit_common}|${tmp_i_abinit_common}|${tmp_w_abinit_common}|${tmp_f_abinit_common}|
  |bigdft          |${tmp_e_bigdft}|${tmp_i_bigdft}|${tmp_w_bigdft}|${tmp_f_bigdft}|
  |fft             |${tmp_e_fft}|${tmp_i_fft}|${tmp_w_fft}|${tmp_f_fft}|
  |fftw3           |${tmp_e_fftw3}|${tmp_i_fftw3}|${tmp_w_fftw3}|${tmp_f_fftw3}|
  |gpu             |${tmp_e_gpu}|${tmp_i_gpu}|${tmp_w_gpu}|${tmp_f_gpu}|
  |hdf5            |${tmp_e_hdf5}|${tmp_i_hdf5}|${tmp_w_hdf5}|${tmp_f_hdf5}|
  |kokkos          |${tmp_e_kokkos}|${tmp_i_kokkos}|${tmp_w_kokkos}|${tmp_f_kokkos}|
  |levmar          |${tmp_e_levmar}|${tmp_i_levmar}|${tmp_w_levmar}|${tmp_f_levmar}|
  |libpaw          |${tmp_e_libpaw}|${tmp_i_libpaw}|${tmp_w_libpaw}|${tmp_f_libpaw}|
  |libpsml         |${tmp_e_libpsml}|${tmp_i_libpsml}|${tmp_w_libpsml}|${tmp_f_libpsml}|
  |libxc           |${tmp_e_libxc}|${tmp_i_libxc}|${tmp_w_libxc}|${tmp_f_libxc}|
  |libxml2         |${tmp_e_libxml2}|${tmp_i_libxml2}|${tmp_w_libxml2}|${tmp_f_libxml2}|
  |linalg          |${tmp_e_linalg}|${tmp_i_linalg}|${tmp_w_linalg}|${tmp_f_linalg}|
  |mpi             |${tmp_e_mpi}|${tmp_i_mpi}|${tmp_w_mpi}|${tmp_f_mpi}|
  |netcdf          |${tmp_e_netcdf}|${tmp_i_netcdf}|${tmp_w_netcdf}|${tmp_f_netcdf}|
  |netcdf_fortran  |${tmp_e_netcdf_fortran}|${tmp_i_netcdf_fortran}|${tmp_w_netcdf_fortran}|${tmp_f_netcdf_fortran}|
  |papi            |${tmp_e_papi}|${tmp_i_papi}|${tmp_w_papi}|${tmp_f_papi}|
  |pfft            |${tmp_e_pfft}|${tmp_i_pfft}|${tmp_w_pfft}|${tmp_f_pfft}|
  |triqs           |${tmp_e_triqs}|${tmp_i_triqs}|${tmp_w_triqs}|${tmp_f_triqs}|
  |wannier90       |${tmp_e_wannier90}|${tmp_i_wannier90}|${tmp_w_wannier90}|${tmp_f_wannier90}|
  |xmlf90          |${tmp_e_xmlf90}|${tmp_i_xmlf90}|${tmp_w_xmlf90}|${tmp_f_xmlf90}|
  |yakl            |${tmp_e_yakl}|${tmp_i_yakl}|${tmp_w_yakl}|${tmp_f_yakl}|
  +----------------+--------+--------+--------+--------+

EOF


#------------------------ START JMB --------------------------------------#
# Check status of mandatory fallbacks

status=""
mandatory=""

# Check linalg
if test "${sd_linalg_flavor_req}" != "auto"; then
   if test "${sd_linalg_flavor}" != "${sd_linalg_flavor_req}"; then


    abi_msg_file="${abinit_srcdir}/config/messages/linalg-flavor.msg"
  abi_msg_title="__INFO__ : the linalg flavor is not the one requested!"

  TPUT_BOLD="\$(tput bold)"
  TPUT_OFF="\$(tput sgr0)"

  let spacer=64
  let tput_spacer=0
  while test "`echo $abi_msg_title | grep __`" ; do
     abi_msg_title=$(echo "$abi_msg_title" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
     let tput_spacer=tput_spacer+10
  done
  abi_msg_title=`eval echo ${abi_msg_title}`

    let titlel=${#abi_msg_title}
  let Fill=spacer-titlel+tput_spacer
  abi_msg_title=`printf "${abi_msg_title}";printf ' %.0s' $(seq 1 $Fill)`

  if test -s "${abi_msg_file}"; then

        echo ""
    echo "  +------------------------------------------------------------------+"
    echo "  | ${abi_msg_title} |"
    echo "  +------------------------------------------------------------------+"


    while read abi_msg_line; do

      let tput_spacer=0
      while test "`echo $abi_msg_line | grep __`" ; do
          abi_msg_line=$(echo "$abi_msg_line" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
          let tput_spacer=tput_spacer+10
      done
      abi_msg_line=`eval echo ${abi_msg_line}`

            let linel=${#abi_msg_line}
      let Fill=spacer-linel+tput_spacer
            abi_msg_line=`printf "${abi_msg_line}";printf ' %.0s' $(seq 1 $Fill)`

      echo "  | ${abi_msg_line} |"
    done <"${abi_msg_file}"

        echo "  +------------------------------------------------------------------+"
    echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

   fi
fi

if test "${sd_linalg_enable}" != "yes"; then


    abi_msg_file="${abinit_srcdir}/config/messages/linalg-mandatory.msg"
  abi_msg_title="__CAUTION__ : linalg is __MANDATORY__ !"

  TPUT_BOLD="\$(tput bold)"
  TPUT_OFF="\$(tput sgr0)"

  let spacer=64
  let tput_spacer=0
  while test "`echo $abi_msg_title | grep __`" ; do
     abi_msg_title=$(echo "$abi_msg_title" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
     let tput_spacer=tput_spacer+10
  done
  abi_msg_title=`eval echo ${abi_msg_title}`

    let titlel=${#abi_msg_title}
  let Fill=spacer-titlel+tput_spacer
  abi_msg_title=`printf "${abi_msg_title}";printf ' %.0s' $(seq 1 $Fill)`

  if test -s "${abi_msg_file}"; then

        echo ""
    echo "  +------------------------------------------------------------------+"
    echo "  | ${abi_msg_title} |"
    echo "  +------------------------------------------------------------------+"


    while read abi_msg_line; do

      let tput_spacer=0
      while test "`echo $abi_msg_line | grep __`" ; do
          abi_msg_line=$(echo "$abi_msg_line" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
          let tput_spacer=tput_spacer+10
      done
      abi_msg_line=`eval echo ${abi_msg_line}`

            let linel=${#abi_msg_line}
      let Fill=spacer-linel+tput_spacer
            abi_msg_line=`printf "${abi_msg_line}";printf ' %.0s' $(seq 1 $Fill)`

      echo "  | ${abi_msg_line} |"
    done <"${abi_msg_file}"

        echo "  +------------------------------------------------------------------+"
    echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

      mandatory="#"
fi

# Check HDF5 serial
if test "${sd_hdf5_enable}" = "no"; then


    abi_msg_file="${abinit_srcdir}/config/messages/hdf5-mandatory.msg"
  abi_msg_title="__CAUTION__ : HDF5 is __MANDATORY__ !"

  TPUT_BOLD="\$(tput bold)"
  TPUT_OFF="\$(tput sgr0)"

  let spacer=64
  let tput_spacer=0
  while test "`echo $abi_msg_title | grep __`" ; do
     abi_msg_title=$(echo "$abi_msg_title" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
     let tput_spacer=tput_spacer+10
  done
  abi_msg_title=`eval echo ${abi_msg_title}`

    let titlel=${#abi_msg_title}
  let Fill=spacer-titlel+tput_spacer
  abi_msg_title=`printf "${abi_msg_title}";printf ' %.0s' $(seq 1 $Fill)`

  if test -s "${abi_msg_file}"; then

        echo ""
    echo "  +------------------------------------------------------------------+"
    echo "  | ${abi_msg_title} |"
    echo "  +------------------------------------------------------------------+"


    while read abi_msg_line; do

      let tput_spacer=0
      while test "`echo $abi_msg_line | grep __`" ; do
          abi_msg_line=$(echo "$abi_msg_line" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
          let tput_spacer=tput_spacer+10
      done
      abi_msg_line=`eval echo ${abi_msg_line}`

            let linel=${#abi_msg_line}
      let Fill=spacer-linel+tput_spacer
            abi_msg_line=`printf "${abi_msg_line}";printf ' %.0s' $(seq 1 $Fill)`

      echo "  | ${abi_msg_line} |"
    done <"${abi_msg_file}"

        echo "  +------------------------------------------------------------------+"
    echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

      mandatory="#"
else
  if test "${sd_hdf5_ok}" != "yes";then


    abi_msg_file="${abinit_srcdir}/config/messages/hdf5-nw.msg"
  abi_msg_title="__WARNING__ : HDF5 is not __WORKING__ !"

  TPUT_BOLD="\$(tput bold)"
  TPUT_OFF="\$(tput sgr0)"

  let spacer=64
  let tput_spacer=0
  while test "`echo $abi_msg_title | grep __`" ; do
     abi_msg_title=$(echo "$abi_msg_title" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
     let tput_spacer=tput_spacer+10
  done
  abi_msg_title=`eval echo ${abi_msg_title}`

    let titlel=${#abi_msg_title}
  let Fill=spacer-titlel+tput_spacer
  abi_msg_title=`printf "${abi_msg_title}";printf ' %.0s' $(seq 1 $Fill)`

  if test -s "${abi_msg_file}"; then

        echo ""
    echo "  +------------------------------------------------------------------+"
    echo "  | ${abi_msg_title} |"
    echo "  +------------------------------------------------------------------+"


    while read abi_msg_line; do

      let tput_spacer=0
      while test "`echo $abi_msg_line | grep __`" ; do
          abi_msg_line=$(echo "$abi_msg_line" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
          let tput_spacer=tput_spacer+10
      done
      abi_msg_line=`eval echo ${abi_msg_line}`

            let linel=${#abi_msg_line}
      let Fill=spacer-linel+tput_spacer
            abi_msg_line=`printf "${abi_msg_line}";printf ' %.0s' $(seq 1 $Fill)`

      echo "  | ${abi_msg_line} |"
    done <"${abi_msg_file}"

        echo "  +------------------------------------------------------------------+"
    echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

      status="#"
  fi
fi

if test "${sd_hdf5_ok}" = "yes";then
# Check NetCDF
  if test "${sd_netcdf_enable}" = "no"; then


    abi_msg_file="${abinit_srcdir}/config/messages/netcdf-mandatory.msg"
  abi_msg_title="__CAUTION__ : NetCDF is __MANDATORY__ !"

  TPUT_BOLD="\$(tput bold)"
  TPUT_OFF="\$(tput sgr0)"

  let spacer=64
  let tput_spacer=0
  while test "`echo $abi_msg_title | grep __`" ; do
     abi_msg_title=$(echo "$abi_msg_title" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
     let tput_spacer=tput_spacer+10
  done
  abi_msg_title=`eval echo ${abi_msg_title}`

    let titlel=${#abi_msg_title}
  let Fill=spacer-titlel+tput_spacer
  abi_msg_title=`printf "${abi_msg_title}";printf ' %.0s' $(seq 1 $Fill)`

  if test -s "${abi_msg_file}"; then

        echo ""
    echo "  +------------------------------------------------------------------+"
    echo "  | ${abi_msg_title} |"
    echo "  +------------------------------------------------------------------+"


    while read abi_msg_line; do

      let tput_spacer=0
      while test "`echo $abi_msg_line | grep __`" ; do
          abi_msg_line=$(echo "$abi_msg_line" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
          let tput_spacer=tput_spacer+10
      done
      abi_msg_line=`eval echo ${abi_msg_line}`

            let linel=${#abi_msg_line}
      let Fill=spacer-linel+tput_spacer
            abi_msg_line=`printf "${abi_msg_line}";printf ' %.0s' $(seq 1 $Fill)`

      echo "  | ${abi_msg_line} |"
    done <"${abi_msg_file}"

        echo "  +------------------------------------------------------------------+"
    echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

      mandatory="#"
  else
     if test "${sd_netcdf_ok}" != "yes";then


    abi_msg_file="${abinit_srcdir}/config/messages/netcdf-nw.msg"
  abi_msg_title="__WARNING__ : NetCDF is not __WORKING__ !"

  TPUT_BOLD="\$(tput bold)"
  TPUT_OFF="\$(tput sgr0)"

  let spacer=64
  let tput_spacer=0
  while test "`echo $abi_msg_title | grep __`" ; do
     abi_msg_title=$(echo "$abi_msg_title" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
     let tput_spacer=tput_spacer+10
  done
  abi_msg_title=`eval echo ${abi_msg_title}`

    let titlel=${#abi_msg_title}
  let Fill=spacer-titlel+tput_spacer
  abi_msg_title=`printf "${abi_msg_title}";printf ' %.0s' $(seq 1 $Fill)`

  if test -s "${abi_msg_file}"; then

        echo ""
    echo "  +------------------------------------------------------------------+"
    echo "  | ${abi_msg_title} |"
    echo "  +------------------------------------------------------------------+"


    while read abi_msg_line; do

      let tput_spacer=0
      while test "`echo $abi_msg_line | grep __`" ; do
          abi_msg_line=$(echo "$abi_msg_line" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
          let tput_spacer=tput_spacer+10
      done
      abi_msg_line=`eval echo ${abi_msg_line}`

            let linel=${#abi_msg_line}
      let Fill=spacer-linel+tput_spacer
            abi_msg_line=`printf "${abi_msg_line}";printf ' %.0s' $(seq 1 $Fill)`

      echo "  | ${abi_msg_line} |"
    done <"${abi_msg_file}"

        echo "  +------------------------------------------------------------------+"
    echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

        status="#"
     fi
  fi

# Check NetCDF_fortran
  if test "${sd_netcdf_fortran_enable}" = "no"; then


    abi_msg_file="${abinit_srcdir}/config/messages/netcdf_fortran-mandatory.msg"
  abi_msg_title="__CAUTION__ : NetCDF Fortran is __MANDATORY__ !"

  TPUT_BOLD="\$(tput bold)"
  TPUT_OFF="\$(tput sgr0)"

  let spacer=64
  let tput_spacer=0
  while test "`echo $abi_msg_title | grep __`" ; do
     abi_msg_title=$(echo "$abi_msg_title" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
     let tput_spacer=tput_spacer+10
  done
  abi_msg_title=`eval echo ${abi_msg_title}`

    let titlel=${#abi_msg_title}
  let Fill=spacer-titlel+tput_spacer
  abi_msg_title=`printf "${abi_msg_title}";printf ' %.0s' $(seq 1 $Fill)`

  if test -s "${abi_msg_file}"; then

        echo ""
    echo "  +------------------------------------------------------------------+"
    echo "  | ${abi_msg_title} |"
    echo "  +------------------------------------------------------------------+"


    while read abi_msg_line; do

      let tput_spacer=0
      while test "`echo $abi_msg_line | grep __`" ; do
          abi_msg_line=$(echo "$abi_msg_line" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
          let tput_spacer=tput_spacer+10
      done
      abi_msg_line=`eval echo ${abi_msg_line}`

            let linel=${#abi_msg_line}
      let Fill=spacer-linel+tput_spacer
            abi_msg_line=`printf "${abi_msg_line}";printf ' %.0s' $(seq 1 $Fill)`

      echo "  | ${abi_msg_line} |"
    done <"${abi_msg_file}"

        echo "  +------------------------------------------------------------------+"
    echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

      mandatory="#"
  else
    if test "${sd_netcdf_fortran_ok}" != "yes";then


    abi_msg_file="${abinit_srcdir}/config/messages/netcdf_fortran-nw.msg"
  abi_msg_title="__WARNING__ : NetCDF Fortran is not __WORKING__ !"

  TPUT_BOLD="\$(tput bold)"
  TPUT_OFF="\$(tput sgr0)"

  let spacer=64
  let tput_spacer=0
  while test "`echo $abi_msg_title | grep __`" ; do
     abi_msg_title=$(echo "$abi_msg_title" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
     let tput_spacer=tput_spacer+10
  done
  abi_msg_title=`eval echo ${abi_msg_title}`

    let titlel=${#abi_msg_title}
  let Fill=spacer-titlel+tput_spacer
  abi_msg_title=`printf "${abi_msg_title}";printf ' %.0s' $(seq 1 $Fill)`

  if test -s "${abi_msg_file}"; then

        echo ""
    echo "  +------------------------------------------------------------------+"
    echo "  | ${abi_msg_title} |"
    echo "  +------------------------------------------------------------------+"


    while read abi_msg_line; do

      let tput_spacer=0
      while test "`echo $abi_msg_line | grep __`" ; do
          abi_msg_line=$(echo "$abi_msg_line" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
          let tput_spacer=tput_spacer+10
      done
      abi_msg_line=`eval echo ${abi_msg_line}`

            let linel=${#abi_msg_line}
      let Fill=spacer-linel+tput_spacer
            abi_msg_line=`printf "${abi_msg_line}";printf ' %.0s' $(seq 1 $Fill)`

      echo "  | ${abi_msg_line} |"
    done <"${abi_msg_file}"

        echo "  +------------------------------------------------------------------+"
    echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

      status="#"
    fi
  fi
fi

# Check LibXC
if test "${sd_libxc_enable}" = "no"; then


    abi_msg_file="${abinit_srcdir}/config/messages/libxc-mandatory.msg"
  abi_msg_title="__CAUTION__ : LibXC is __MANDATORY__ !"

  TPUT_BOLD="\$(tput bold)"
  TPUT_OFF="\$(tput sgr0)"

  let spacer=64
  let tput_spacer=0
  while test "`echo $abi_msg_title | grep __`" ; do
     abi_msg_title=$(echo "$abi_msg_title" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
     let tput_spacer=tput_spacer+10
  done
  abi_msg_title=`eval echo ${abi_msg_title}`

    let titlel=${#abi_msg_title}
  let Fill=spacer-titlel+tput_spacer
  abi_msg_title=`printf "${abi_msg_title}";printf ' %.0s' $(seq 1 $Fill)`

  if test -s "${abi_msg_file}"; then

        echo ""
    echo "  +------------------------------------------------------------------+"
    echo "  | ${abi_msg_title} |"
    echo "  +------------------------------------------------------------------+"


    while read abi_msg_line; do

      let tput_spacer=0
      while test "`echo $abi_msg_line | grep __`" ; do
          abi_msg_line=$(echo "$abi_msg_line" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
          let tput_spacer=tput_spacer+10
      done
      abi_msg_line=`eval echo ${abi_msg_line}`

            let linel=${#abi_msg_line}
      let Fill=spacer-linel+tput_spacer
            abi_msg_line=`printf "${abi_msg_line}";printf ' %.0s' $(seq 1 $Fill)`

      echo "  | ${abi_msg_line} |"
    done <"${abi_msg_file}"

        echo "  +------------------------------------------------------------------+"
    echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

      mandatory="#"
else
  if test "${sd_libxc_ok}" != "yes";then


    abi_msg_file="${abinit_srcdir}/config/messages/libxc-nw.msg"
  abi_msg_title="__WARNING__ : LibXC is not __WORKING__ !"

  TPUT_BOLD="\$(tput bold)"
  TPUT_OFF="\$(tput sgr0)"

  let spacer=64
  let tput_spacer=0
  while test "`echo $abi_msg_title | grep __`" ; do
     abi_msg_title=$(echo "$abi_msg_title" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
     let tput_spacer=tput_spacer+10
  done
  abi_msg_title=`eval echo ${abi_msg_title}`

    let titlel=${#abi_msg_title}
  let Fill=spacer-titlel+tput_spacer
  abi_msg_title=`printf "${abi_msg_title}";printf ' %.0s' $(seq 1 $Fill)`

  if test -s "${abi_msg_file}"; then

        echo ""
    echo "  +------------------------------------------------------------------+"
    echo "  | ${abi_msg_title} |"
    echo "  +------------------------------------------------------------------+"


    while read abi_msg_line; do

      let tput_spacer=0
      while test "`echo $abi_msg_line | grep __`" ; do
          abi_msg_line=$(echo "$abi_msg_line" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
          let tput_spacer=tput_spacer+10
      done
      abi_msg_line=`eval echo ${abi_msg_line}`

            let linel=${#abi_msg_line}
      let Fill=spacer-linel+tput_spacer
            abi_msg_line=`printf "${abi_msg_line}";printf ' %.0s' $(seq 1 $Fill)`

      echo "  | ${abi_msg_line} |"
    done <"${abi_msg_file}"

        echo "  +------------------------------------------------------------------+"
    echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

      status="#"
  fi
fi

# Check Wannier90
if test "${sd_wannier90_enable}" = "yes"; then
   if test "${sd_wannier90_ok}" != "yes"; then


    abi_msg_title="__CAUTION__ : Wannier90 is not __WORKING__ !"

  TPUT_BOLD="\$(tput bold)"
  TPUT_OFF="\$(tput sgr0)"

  test "${abi_msg_title}" = "" && abi_msg_title="\$(tput bold)IMPORTANT NOTE\$(tput sgr0)"

  let spacer=64
  let tput_spacer=0
  while test "`echo $abi_msg_title | grep __`" ; do
     abi_msg_title=$(echo "$abi_msg_title" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
     let tput_spacer=tput_spacer+10
  done
  abi_msg_title=`eval echo ${abi_msg_title}`

    titlel=${#abi_msg_title}
  let Fill=spacer-titlel+tput_spacer
  abi_msg_title=`printf "${abi_msg_title}";printf ' %.0s' $(seq 1 $Fill)`

    echo ""
  echo "  +------------------------------------------------------------------+"
  echo "  | ${abi_msg_title} |"
  echo "  +------------------------------------------------------------------+"

    abi_msg_line="   Action : check your Wannier90 installation"
  if test "${abi_msg_line}" != ""; then
      let spacer=64
      let tput_spacer=0
      while test "`echo $abi_msg_line | grep __`" ; do
          abi_msg_line=$(echo "$abi_msg_line" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
          let tput_spacer=tput_spacer+10
      done
      abi_msg_line=`eval echo ${abi_msg_line}`

            linel=${#abi_msg_line}
      let Fill=spacer-linel+tput_spacer
            abi_msg_line=`printf "${abi_msg_line}";printf ' %.0s' $(seq 1 $Fill)`

      echo "  | ${abi_msg_line} |"
      echo "  +------------------------------------------------------------------+"
  fi

  echo ""


      status="#"
   fi
fi

# Check libPSML
if test "${sd_libpsml_enable}" = "yes"; then
   if test "${sd_libpsml_ok}" != "yes"; then


    abi_msg_title="__CAUTION__ : libPSML is not __WORKING__ !"

  TPUT_BOLD="\$(tput bold)"
  TPUT_OFF="\$(tput sgr0)"

  test "${abi_msg_title}" = "" && abi_msg_title="\$(tput bold)IMPORTANT NOTE\$(tput sgr0)"

  let spacer=64
  let tput_spacer=0
  while test "`echo $abi_msg_title | grep __`" ; do
     abi_msg_title=$(echo "$abi_msg_title" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
     let tput_spacer=tput_spacer+10
  done
  abi_msg_title=`eval echo ${abi_msg_title}`

    titlel=${#abi_msg_title}
  let Fill=spacer-titlel+tput_spacer
  abi_msg_title=`printf "${abi_msg_title}";printf ' %.0s' $(seq 1 $Fill)`

    echo ""
  echo "  +------------------------------------------------------------------+"
  echo "  | ${abi_msg_title} |"
  echo "  +------------------------------------------------------------------+"

    abi_msg_line="   Action : check your libPSML installation"
  if test "${abi_msg_line}" != ""; then
      let spacer=64
      let tput_spacer=0
      while test "`echo $abi_msg_line | grep __`" ; do
          abi_msg_line=$(echo "$abi_msg_line" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
          let tput_spacer=tput_spacer+10
      done
      abi_msg_line=`eval echo ${abi_msg_line}`

            linel=${#abi_msg_line}
      let Fill=spacer-linel+tput_spacer
            abi_msg_line=`printf "${abi_msg_line}";printf ' %.0s' $(seq 1 $Fill)`

      echo "  | ${abi_msg_line} |"
      echo "  +------------------------------------------------------------------+"
  fi

  echo ""


      status="#"
   fi
fi

# Check xmlf90
if test "${sd_xmlf90_enable}" = "yes"; then
   if test "${sd_xmlf90_ok}" != "yes"; then


    abi_msg_title="__CAUTION__ : xmlf90 is not __WORKING__ !"

  TPUT_BOLD="\$(tput bold)"
  TPUT_OFF="\$(tput sgr0)"

  test "${abi_msg_title}" = "" && abi_msg_title="\$(tput bold)IMPORTANT NOTE\$(tput sgr0)"

  let spacer=64
  let tput_spacer=0
  while test "`echo $abi_msg_title | grep __`" ; do
     abi_msg_title=$(echo "$abi_msg_title" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
     let tput_spacer=tput_spacer+10
  done
  abi_msg_title=`eval echo ${abi_msg_title}`

    titlel=${#abi_msg_title}
  let Fill=spacer-titlel+tput_spacer
  abi_msg_title=`printf "${abi_msg_title}";printf ' %.0s' $(seq 1 $Fill)`

    echo ""
  echo "  +------------------------------------------------------------------+"
  echo "  | ${abi_msg_title} |"
  echo "  +------------------------------------------------------------------+"

    abi_msg_line="   Action : check your xmlf90 installation"
  if test "${abi_msg_line}" != ""; then
      let spacer=64
      let tput_spacer=0
      while test "`echo $abi_msg_line | grep __`" ; do
          abi_msg_line=$(echo "$abi_msg_line" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
          let tput_spacer=tput_spacer+10
      done
      abi_msg_line=`eval echo ${abi_msg_line}`

            linel=${#abi_msg_line}
      let Fill=spacer-linel+tput_spacer
            abi_msg_line=`printf "${abi_msg_line}";printf ' %.0s' $(seq 1 $Fill)`

      echo "  | ${abi_msg_line} |"
      echo "  +------------------------------------------------------------------+"
  fi

  echo ""


      status="#"
   fi
fi

# Help to produce libraires
if test ! -z "${mandatory}"; then


    abi_msg_file="${abinit_srcdir}/config/messages/help-fb.msg"
  abi_msg_title="We can __help__ you !"

  TPUT_BOLD="\$(tput bold)"
  TPUT_OFF="\$(tput sgr0)"

  let spacer=64
  let tput_spacer=0
  while test "`echo $abi_msg_title | grep __`" ; do
     abi_msg_title=$(echo "$abi_msg_title" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
     let tput_spacer=tput_spacer+10
  done
  abi_msg_title=`eval echo ${abi_msg_title}`

    let titlel=${#abi_msg_title}
  let Fill=spacer-titlel+tput_spacer
  abi_msg_title=`printf "${abi_msg_title}";printf ' %.0s' $(seq 1 $Fill)`

  if test -s "${abi_msg_file}"; then

        echo ""
    echo "  +------------------------------------------------------------------+"
    echo "  | ${abi_msg_title} |"
    echo "  +------------------------------------------------------------------+"


    while read abi_msg_line; do

      let tput_spacer=0
      while test "`echo $abi_msg_line | grep __`" ; do
          abi_msg_line=$(echo "$abi_msg_line" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
          let tput_spacer=tput_spacer+10
      done
      abi_msg_line=`eval echo ${abi_msg_line}`

            let linel=${#abi_msg_line}
      let Fill=spacer-linel+tput_spacer
            abi_msg_line=`printf "${abi_msg_line}";printf ' %.0s' $(seq 1 $Fill)`

      echo "  | ${abi_msg_line} |"
    done <"${abi_msg_file}"

        echo "  +------------------------------------------------------------------+"
    echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

fi

if test ! -z "${status}" -o ! -z "${mandatory}"; then


    abi_msg_title=" __Problems must be solved before continuing__ "

  TPUT_BOLD="\$(tput bold)"
  TPUT_OFF="\$(tput sgr0)"

  test "${abi_msg_title}" = "" && abi_msg_title="\$(tput bold)IMPORTANT NOTE\$(tput sgr0)"

  let spacer=64
  let tput_spacer=0
  while test "`echo $abi_msg_title | grep __`" ; do
     abi_msg_title=$(echo "$abi_msg_title" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
     let tput_spacer=tput_spacer+10
  done
  abi_msg_title=`eval echo ${abi_msg_title}`

    titlel=${#abi_msg_title}
  let Fill=spacer-titlel+tput_spacer
  abi_msg_title=`printf "${abi_msg_title}";printf ' %.0s' $(seq 1 $Fill)`

    echo ""
  echo "  +------------------------------------------------------------------+"
  echo "  | ${abi_msg_title} |"
  echo "  +------------------------------------------------------------------+"

    abi_msg_line=""
  if test "${abi_msg_line}" != ""; then
      let spacer=64
      let tput_spacer=0
      while test "`echo $abi_msg_line | grep __`" ; do
          abi_msg_line=$(echo "$abi_msg_line" | sed "s/__/$TPUT_BOLD/;s/__/$TPUT_OFF/")
          let tput_spacer=tput_spacer+10
      done
      abi_msg_line=`eval echo ${abi_msg_line}`

            linel=${#abi_msg_line}
      let Fill=spacer-linel+tput_spacer
            abi_msg_line=`printf "${abi_msg_line}";printf ' %.0s' $(seq 1 $Fill)`

      echo "  | ${abi_msg_line} |"
      echo "  +------------------------------------------------------------------+"
  fi

  echo ""


fi

# Always generate a build script for required fallbacks
#AC_CONFIG_FILES([fallbacks/INSTALL fallbacks/README])
# AC_CONFIG_FILES([fallbacks/build-abinit-fallbacks.sh])
#AC_CONFIG_COMMANDS([chmod +x fallbacks/build-abinit-fallbacks.sh])
#AC_OUTPUT
# Old formulation: AC_OUTPUT([fallbacks/INSTALL fallbacks/README fallbacks/build-abinit-fallbacks.sh],[chmod +x fallbacks/build-abinit-fallbacks.sh])
ac_config_files="$ac_config_files fallbacks/INSTALL fallbacks/README fallbacks/build-abinit-fallbacks.sh"

ac_config_commands="$ac_config_commands default"

cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs, see configure's option --config-cache.
# It is not useful on other systems.  If it contains results you don't
# want to keep, you may remove or edit it.
#
# config.status only pays attention to the cache file if you give it
# the --recheck option to rerun configure.
#
# `ac_cv_env_foo' variables (set or unset) will be overridden when
# loading this file, other *unset* `ac_cv_foo' will be assigned the
# following values.

_ACEOF

# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, we kill variables containing newlines.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(
  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
    eval ac_val=\$$ac_var
    case $ac_val in #(
    *${as_nl}*)
      case $ac_var in #(
      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
      esac
      case $ac_var in #(
      _ | IFS | as_nl) ;; #(
      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
      *) { eval $ac_var=; unset $ac_var;} ;;
      esac ;;
    esac
  done

  (set) 2>&1 |
    case $as_nl`(ac_space=' '; set) 2>&1` in #(
    *${as_nl}ac_space=\ *)
      # `set' does not quote correctly, so add quotes: double-quote
      # substitution turns \\\\ into \\, and sed turns \\ into \.
      sed -n \
	"s/'/'\\\\''/g;
	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
      ;; #(
    *)
      # `set' quotes correctly as required by POSIX, so do not add quotes.
      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
      ;;
    esac |
    sort
) |
  sed '
     /^ac_cv_env_/b end
     t clear
     :clear
     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
     t end
     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
     :end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
  if test -w "$cache_file"; then
    if test "x$cache_file" != "x/dev/null"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
$as_echo "$as_me: updating cache $cache_file" >&6;}
      if test ! -f "$cache_file" || test -h "$cache_file"; then
	cat confcache >"$cache_file"
      else
        case $cache_file in #(
        */* | ?:*)
	  mv -f confcache "$cache_file"$$ &&
	  mv -f "$cache_file"$$ "$cache_file" ;; #(
        *)
	  mv -f confcache "$cache_file" ;;
	esac
      fi
    fi
  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
  fi
fi
rm -f confcache

test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'

DEFS=-DHAVE_CONFIG_H

ac_libobjs=
ac_ltlibobjs=
U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
  # 1. Remove the extension, and $U if already installed.
  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
  #    will be set to the directory where LIBOBJS objects are built.
  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs

LTLIBOBJS=$ac_ltlibobjs


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
$as_echo_n "checking that generated files are newer than configure... " >&6; }
   if test -n "$am_sleep_pid"; then
     # Hide warnings about reused PIDs.
     wait $am_sleep_pid 2>/dev/null
   fi
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
$as_echo "done" >&6; }
 if test -n "$EXEEXT"; then
  am__EXEEXT_TRUE=
  am__EXEEXT_FALSE='#'
else
  am__EXEEXT_TRUE='#'
  am__EXEEXT_FALSE=
fi

if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
  as_fn_error $? "conditional \"AMDEP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_32_CONTRACT_TRUE}" && test -z "${DO_BUILD_32_CONTRACT_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_32_CONTRACT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi

if test -z "${DO_BUILD_CCLOCK_TRUE}" && test -z "${DO_BUILD_CCLOCK_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_CCLOCK\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_17_GPU_TOOLBOX_TRUE}" && test -z "${DO_BUILD_17_GPU_TOOLBOX_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_17_GPU_TOOLBOX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_46_MANAGE_CUDA_TRUE}" && test -z "${DO_BUILD_46_MANAGE_CUDA_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_46_MANAGE_CUDA\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_NVTX_TRUE}" && test -z "${DO_BUILD_NVTX_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_NVTX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_16_KOKKOS_TOOLBOX_TRUE}" && test -z "${DO_BUILD_16_KOKKOS_TOOLBOX_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_16_KOKKOS_TOOLBOX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_44_MANAGE_KOKKOS_TRUE}" && test -z "${DO_BUILD_44_MANAGE_KOKKOS_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_44_MANAGE_KOKKOS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_PSML_TRUE}" && test -z "${DO_BUILD_PSML_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_PSML\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_01_LIBXC_EXT_TRUE}" && test -z "${DO_BUILD_01_LIBXC_EXT_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_01_LIBXC_EXT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_67_TRIQS_EXT_TRUE}" && test -z "${DO_BUILD_67_TRIQS_EXT_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_67_TRIQS_EXT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_SHARED_COMMON_TRUE}" && test -z "${DO_BUILD_SHARED_COMMON_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_SHARED_COMMON\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_SHARED_LIBPAW_TRUE}" && test -z "${DO_BUILD_SHARED_LIBPAW_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_SHARED_LIBPAW\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi

: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
as_write_fail=0
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.

debug=false
ac_cs_recheck=false
ac_cs_silent=false

SHELL=\${CONFIG_SHELL-$SHELL}
export SHELL
_ASEOF
cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##

# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
  emulate sh
  NULLCMD=:
  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '${1+"$@"}'='"$@"'
  setopt NO_GLOB_SUBST
else
  case `(set -o) 2>/dev/null` in #(
  *posix*) :
    set -o posix ;; #(
  *) :
     ;;
esac
fi


as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
  as_echo='print -r --'
  as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
  as_echo='printf %s\n'
  as_echo_n='printf %s'
else
  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
    as_echo_n='/usr/ucb/echo -n'
  else
    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
    as_echo_n_body='eval
      arg=$1;
      case $arg in #(
      *"$as_nl"*)
	expr "X$arg" : "X\\(.*\\)$as_nl";
	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
      esac;
      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
    '
    export as_echo_n_body
    as_echo_n='sh -c $as_echo_n_body as_echo'
  fi
  export as_echo_body
  as_echo='sh -c $as_echo_body as_echo'
fi

# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
  PATH_SEPARATOR=:
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
      PATH_SEPARATOR=';'
  }
fi


# IFS
# We need space, tab and new line, in precisely that order.  Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" ""	$as_nl"

# Find who we are.  Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
  *[\\/]* ) as_myself=$0 ;;
  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
  done
IFS=$as_save_IFS

     ;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
  as_myself=$0
fi
if test ! -f "$as_myself"; then
  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
  exit 1
fi

# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there.  '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '

# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE

# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH


# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
  as_status=$1; test $as_status -eq 0 && as_status=1
  if test "$4"; then
    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
  fi
  $as_echo "$as_me: error: $2" >&2
  as_fn_exit $as_status
} # as_fn_error


# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
  return $1
} # as_fn_set_status

# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
  set +e
  as_fn_set_status $1
  exit $1
} # as_fn_exit

# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
  { eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
  eval 'as_fn_append ()
  {
    eval $1+=\$2
  }'
else
  as_fn_append ()
  {
    eval $1=\$$1\$2
  }
fi # as_fn_append

# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
  eval 'as_fn_arith ()
  {
    as_val=$(( $* ))
  }'
else
  as_fn_arith ()
  {
    as_val=`expr "$@" || test $? -eq 1`
  }
fi # as_fn_arith


if expr a : '\(a\)' >/dev/null 2>&1 &&
   test "X`expr 00001 : '.*\(...\)'`" = X001; then
  as_expr=expr
else
  as_expr=false
fi

if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
  as_basename=basename
else
  as_basename=false
fi

if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
  as_dirname=dirname
else
  as_dirname=false
fi

as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
	 X"$0" : 'X\(//\)$' \| \
	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
    sed '/^.*\/\([^/][^/]*\)\/*$/{
	    s//\1/
	    q
	  }
	  /^X\/\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\/\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`

# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits

ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
  case `echo 'xy\c'` in
  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
  xy)  ECHO_C='\c';;
  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
       ECHO_T='	';;
  esac;;
*)
  ECHO_N='-n';;
esac

rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
  rm -f conf$$.dir/conf$$.file
else
  rm -f conf$$.dir
  mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
  if ln -s conf$$.file conf$$ 2>/dev/null; then
    as_ln_s='ln -s'
    # ... but there are two gotchas:
    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
    # In both cases, we have to default to `cp -pR'.
    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
      as_ln_s='cp -pR'
  elif ln conf$$.file conf$$ 2>/dev/null; then
    as_ln_s=ln
  else
    as_ln_s='cp -pR'
  fi
else
  as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null


# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{

  case $as_dir in #(
  -*) as_dir=./$as_dir;;
  esac
  test -d "$as_dir" || eval $as_mkdir_p || {
    as_dirs=
    while :; do
      case $as_dir in #(
      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
      *) as_qdir=$as_dir;;
      esac
      as_dirs="'$as_qdir' $as_dirs"
      as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$as_dir" : 'X\(//\)[^/]' \| \
	 X"$as_dir" : 'X\(//\)$' \| \
	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_dir" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
      test -d "$as_dir" && break
    done
    test -z "$as_dirs" || eval "mkdir $as_dirs"
  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"


} # as_fn_mkdir_p
if mkdir -p . 2>/dev/null; then
  as_mkdir_p='mkdir -p "$as_dir"'
else
  test -d ./-p && rmdir ./-p
  as_mkdir_p=false
fi


# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
  test -f "$1" && test -x "$1"
} # as_fn_executable_p
as_test_x='test -x'
as_executable_p=as_fn_executable_p

# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"

# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"


exec 6>&1
## ----------------------------------- ##
## Main body of $CONFIG_STATUS script. ##
## ----------------------------------- ##
_ASEOF
test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Save the log message, to keep $0 and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by ABINIT $as_me 10.0.9, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  CONFIG_FILES    = $CONFIG_FILES
  CONFIG_HEADERS  = $CONFIG_HEADERS
  CONFIG_LINKS    = $CONFIG_LINKS
  CONFIG_COMMANDS = $CONFIG_COMMANDS
  $ $0 $@

on `(hostname || uname -n) 2>/dev/null | sed 1q`
"

_ACEOF

case $ac_config_files in *"
"*) set x $ac_config_files; shift; ac_config_files=$*;;
esac

case $ac_config_headers in *"
"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
esac


cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# Files that config.status was made for.
config_files="$ac_config_files"
config_headers="$ac_config_headers"
config_commands="$ac_config_commands"

_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
\`$as_me' instantiates files and other configuration actions
from templates according to the current configuration.  Unless the files
and actions are specified as TAGs, all are instantiated by default.

Usage: $0 [OPTION]... [TAG]...

  -h, --help       print this help, then exit
  -V, --version    print version number and configuration settings, then exit
      --config     print configuration, then exit
  -q, --quiet, --silent
                   do not print progress messages
  -d, --debug      don't remove temporary files
      --recheck    update $as_me by reconfiguring in the same conditions
      --file=FILE[:TEMPLATE]
                   instantiate the configuration file FILE
      --header=FILE[:TEMPLATE]
                   instantiate the configuration header FILE

Configuration files:
$config_files

Configuration headers:
$config_headers

Configuration commands:
$config_commands

Report bugs to <https://bugs.launchpad.net/abinit/>."

_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
ABINIT config.status 10.0.9
configured by $0, generated by GNU Autoconf 2.69,
  with options \\"\$ac_cs_config\\"

Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."

ac_pwd='$ac_pwd'
srcdir='$srcdir'
INSTALL='$INSTALL'
MKDIR_P='$MKDIR_P'
AWK='$AWK'
test -n "\$AWK" || AWK=awk
_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# The default lists apply if the user does not specify any file.
ac_need_defaults=:
while test $# != 0
do
  case $1 in
  --*=?*)
    ac_option=`expr "X$1" : 'X\([^=]*\)='`
    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
    ac_shift=:
    ;;
  --*=)
    ac_option=`expr "X$1" : 'X\([^=]*\)='`
    ac_optarg=
    ac_shift=:
    ;;
  *)
    ac_option=$1
    ac_optarg=$2
    ac_shift=shift
    ;;
  esac

  case $ac_option in
  # Handling of the options.
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    ac_cs_recheck=: ;;
  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
    $as_echo "$ac_cs_version"; exit ;;
  --config | --confi | --conf | --con | --co | --c )
    $as_echo "$ac_cs_config"; exit ;;
  --debug | --debu | --deb | --de | --d | -d )
    debug=: ;;
  --file | --fil | --fi | --f )
    $ac_shift
    case $ac_optarg in
    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
    '') as_fn_error $? "missing file argument" ;;
    esac
    as_fn_append CONFIG_FILES " '$ac_optarg'"
    ac_need_defaults=false;;
  --header | --heade | --head | --hea )
    $ac_shift
    case $ac_optarg in
    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
    esac
    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
    ac_need_defaults=false;;
  --he | --h)
    # Conflict between --help and --header
    as_fn_error $? "ambiguous option: \`$1'
Try \`$0 --help' for more information.";;
  --help | --hel | -h )
    $as_echo "$ac_cs_usage"; exit ;;
  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  | -silent | --silent | --silen | --sile | --sil | --si | --s)
    ac_cs_silent=: ;;

  # This is an error.
  -*) as_fn_error $? "unrecognized option: \`$1'
Try \`$0 --help' for more information." ;;

  *) as_fn_append ac_config_targets " $1"
     ac_need_defaults=false ;;

  esac
  shift
done

ac_configure_extra_args=

if $ac_cs_silent; then
  exec 6>/dev/null
  ac_configure_extra_args="$ac_configure_extra_args --silent"
fi

_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
  shift
  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
  CONFIG_SHELL='$SHELL'
  export CONFIG_SHELL
  exec "\$@"
fi

_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
exec 5>>config.log
{
  echo
  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
  $as_echo "$ac_log"
} >&5

_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"

_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1

# Handling of arguments.
for ac_config_target in $ac_config_targets
do
  case $ac_config_target in
    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
    "fallbacks/INSTALL") CONFIG_FILES="$CONFIG_FILES fallbacks/INSTALL" ;;
    "fallbacks/README") CONFIG_FILES="$CONFIG_FILES fallbacks/README" ;;
    "fallbacks/build-abinit-fallbacks.sh") CONFIG_FILES="$CONFIG_FILES fallbacks/build-abinit-fallbacks.sh" ;;
    "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;

  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
  esac
done


# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used.  Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
fi

# Have a temporary directory for convenience.  Make it in the build tree
# simply because there is no reason against having it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
# Hook for its removal unless debugging.
# Note that there is a small window in which the directory will not be cleaned:
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
  tmp= ac_tmp=
  trap 'exit_status=$?
  : "${ac_tmp:=$tmp}"
  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
' 0
  trap 'as_fn_exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.

{
  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
  test -d "$tmp"
}  ||
{
  tmp=./conf$$-$RANDOM
  (umask 077 && mkdir "$tmp")
} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
ac_tmp=$tmp

# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then


ac_cr=`echo X | tr X '\015'`
# On cygwin, bash can eat \r inside `` if the user requested igncr.
# But we know of no other shell where ac_cr would be empty at this
# point, so we can use a bashism as a fallback.
if test "x$ac_cr" = x; then
  eval ac_cr=\$\'\\r\'
fi
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
  ac_cs_awk_cr='\\r'
else
  ac_cs_awk_cr=$ac_cr
fi

echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
_ACEOF


{
  echo "cat >conf$$subs.awk <<_ACEOF" &&
  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
  echo "_ACEOF"
} >conf$$subs.sh ||
  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
  . ./conf$$subs.sh ||
    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5

  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
  if test $ac_delim_n = $ac_delim_num; then
    break
  elif $ac_last_try; then
    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
  else
    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
  fi
done
rm -f conf$$subs.sh

cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
_ACEOF
sed -n '
h
s/^/S["/; s/!.*/"]=/
p
g
s/^[^!]*!//
:repl
t repl
s/'"$ac_delim"'$//
t delim
:nl
h
s/\(.\{148\}\)..*/\1/
t more1
s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
p
n
b repl
:more1
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t nl
:delim
h
s/\(.\{148\}\)..*/\1/
t more2
s/["\\]/\\&/g; s/^/"/; s/$/"/
p
b
:more2
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t delim
' <conf$$subs.awk | sed '
/^[^""]/{
  N
  s/\n//
}
' >>$CONFIG_STATUS || ac_write_fail=1
rm -f conf$$subs.awk
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACAWK
cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
  for (key in S) S_is_set[key] = 1
  FS = ""

}
{
  line = $ 0
  nfields = split(line, field, "@")
  substed = 0
  len = length(field[1])
  for (i = 2; i < nfields; i++) {
    key = field[i]
    keylen = length(key)
    if (S_is_set[key]) {
      value = S[key]
      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
      len += length(value) + length(field[++i])
      substed = 1
    } else
      len += 1 + keylen
  }

  print line
}

_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
else
  cat
fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF

# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
h
s///
s/^/:/
s/[	 ]*$/:/
s/:\$(srcdir):/:/g
s/:\${srcdir}:/:/g
s/:@srcdir@:/:/g
s/^:*//
s/:*$//
x
s/\(=[	 ]*\).*/\1/
G
s/\n//
s/^[^=]*=[	 ]*$//
}'
fi

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
fi # test -n "$CONFIG_FILES"

# Set up the scripts for CONFIG_HEADERS section.
# No need to generate them if there are no CONFIG_HEADERS.
# This happens for instance with `./config.status Makefile'.
if test -n "$CONFIG_HEADERS"; then
cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
BEGIN {
_ACEOF

# Transform confdefs.h into an awk script `defines.awk', embedded as
# here-document in config.status, that substitutes the proper values into
# config.h.in to produce config.h.

# Create a delimiter string that does not exist in confdefs.h, to ease
# handling of long lines.
ac_delim='%!_!# '
for ac_last_try in false false :; do
  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
  if test -z "$ac_tt"; then
    break
  elif $ac_last_try; then
    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
  else
    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
  fi
done

# For the awk script, D is an array of macro values keyed by name,
# likewise P contains macro parameters if any.  Preserve backslash
# newline sequences.

ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
sed -n '
s/.\{148\}/&'"$ac_delim"'/g
t rset
:rset
s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
t def
d
:def
s/\\$//
t bsnl
s/["\\]/\\&/g
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
D["\1"]=" \3"/p
s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
d
:bsnl
s/["\\]/\\&/g
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
D["\1"]=" \3\\\\\\n"\\/p
t cont
s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
t cont
d
:cont
n
s/.\{148\}/&'"$ac_delim"'/g
t clear
:clear
s/\\$//
t bsnlc
s/["\\]/\\&/g; s/^/"/; s/$/"/p
d
:bsnlc
s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
b cont
' <confdefs.h | sed '
s/'"$ac_delim"'/"\\\
"/g' >>$CONFIG_STATUS || ac_write_fail=1

cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
  for (key in D) D_is_set[key] = 1
  FS = ""
}
/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
  line = \$ 0
  split(line, arg, " ")
  if (arg[1] == "#") {
    defundef = arg[2]
    mac1 = arg[3]
  } else {
    defundef = substr(arg[1], 2)
    mac1 = arg[2]
  }
  split(mac1, mac2, "(") #)
  macro = mac2[1]
  prefix = substr(line, 1, index(line, defundef) - 1)
  if (D_is_set[macro]) {
    # Preserve the white space surrounding the "#".
    print prefix "define", macro P[macro] D[macro]
    next
  } else {
    # Replace #undef with comments.  This is necessary, for example,
    # in the case of _POSIX_SOURCE, which is predefined and required
    # on some systems where configure will not decide to define it.
    if (defundef == "undef") {
      print "/*", prefix defundef, macro, "*/"
      next
    }
  }
}
{ print }
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
fi # test -n "$CONFIG_HEADERS"


eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
shift
for ac_tag
do
  case $ac_tag in
  :[FHLC]) ac_mode=$ac_tag; continue;;
  esac
  case $ac_mode$ac_tag in
  :[FHL]*:*);;
  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
  :[FH]-) ac_tag=-:-;;
  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
  esac
  ac_save_IFS=$IFS
  IFS=:
  set x $ac_tag
  IFS=$ac_save_IFS
  shift
  ac_file=$1
  shift

  case $ac_mode in
  :L) ac_source=$1;;
  :[FH])
    ac_file_inputs=
    for ac_f
    do
      case $ac_f in
      -) ac_f="$ac_tmp/stdin";;
      *) # Look for the file first in the build tree, then in the source tree
	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
	 # because $ac_f cannot contain `:'.
	 test -f "$ac_f" ||
	   case $ac_f in
	   [\\/$]*) false;;
	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
	   esac ||
	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
      esac
      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
      as_fn_append ac_file_inputs " '$ac_f'"
    done

    # Let's still pretend it is `configure' which instantiates (i.e., don't
    # use $as_me), people would be surprised to read:
    #    /* config.h.  Generated by config.status.  */
    configure_input='Generated from '`
	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
	`' by configure.'
    if test x"$ac_file" != x-; then
      configure_input="$ac_file.  $configure_input"
      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
$as_echo "$as_me: creating $ac_file" >&6;}
    fi
    # Neutralize special characters interpreted by sed in replacement strings.
    case $configure_input in #(
    *\&* | *\|* | *\\* )
       ac_sed_conf_input=`$as_echo "$configure_input" |
       sed 's/[\\\\&|]/\\\\&/g'`;; #(
    *) ac_sed_conf_input=$configure_input;;
    esac

    case $ac_tag in
    *:-:* | *:-) cat >"$ac_tmp/stdin" \
      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
    esac
    ;;
  esac

  ac_dir=`$as_dirname -- "$ac_file" ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$ac_file" : 'X\(//\)[^/]' \| \
	 X"$ac_file" : 'X\(//\)$' \| \
	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$ac_file" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
  as_dir="$ac_dir"; as_fn_mkdir_p
  ac_builddir=.

case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
  # A ".." for each directory in $ac_dir_suffix.
  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
  case $ac_top_builddir_sub in
  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
  esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix

case $srcdir in
  .)  # We are building in place.
    ac_srcdir=.
    ac_top_srcdir=$ac_top_builddir_sub
    ac_abs_top_srcdir=$ac_pwd ;;
  [\\/]* | ?:[\\/]* )  # Absolute name.
    ac_srcdir=$srcdir$ac_dir_suffix;
    ac_top_srcdir=$srcdir
    ac_abs_top_srcdir=$srcdir ;;
  *) # Relative name.
    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
    ac_top_srcdir=$ac_top_build_prefix$srcdir
    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix


  case $ac_mode in
  :F)
  #
  # CONFIG_FILE
  #

  case $INSTALL in
  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
  esac
  ac_MKDIR_P=$MKDIR_P
  case $MKDIR_P in
  [\\/$]* | ?:[\\/]* ) ;;
  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
  esac
_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# If the template does not know about datarootdir, expand it.
# FIXME: This hack should be removed a few years after 2.60.
ac_datarootdir_hack=; ac_datarootdir_seen=
ac_sed_dataroot='
/datarootdir/ {
  p
  q
}
/@datadir@/p
/@docdir@/p
/@infodir@/p
/@localedir@/p
/@mandir@/p'
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
  ac_datarootdir_hack='
  s&@datadir@&$datadir&g
  s&@docdir@&$docdir&g
  s&@infodir@&$infodir&g
  s&@localedir@&$localedir&g
  s&@mandir@&$mandir&g
  s&\\\${datarootdir}&$datarootdir&g' ;;
esac
_ACEOF

# Neutralize VPATH when `$srcdir' = `.'.
# Shell code in configure.ac might set extrasub.
# FIXME: do we really want to maintain this feature?
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_sed_extra="$ac_vpsub
$extrasub
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
s|@configure_input@|$ac_sed_conf_input|;t t
s&@top_builddir@&$ac_top_builddir_sub&;t t
s&@top_build_prefix@&$ac_top_build_prefix&;t t
s&@srcdir@&$ac_srcdir&;t t
s&@abs_srcdir@&$ac_abs_srcdir&;t t
s&@top_srcdir@&$ac_top_srcdir&;t t
s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
s&@builddir@&$ac_builddir&;t t
s&@abs_builddir@&$ac_abs_builddir&;t t
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t
s&@MKDIR_P@&$ac_MKDIR_P&;t t
$ac_datarootdir_hack
"
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5

test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
      "$ac_tmp/out"`; test -z "$ac_out"; } &&
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined.  Please make sure it is defined" >&5
$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined.  Please make sure it is defined" >&2;}

  rm -f "$ac_tmp/stdin"
  case $ac_file in
  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
  esac \
  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 ;;
  :H)
  #
  # CONFIG_HEADER
  #
  if test x"$ac_file" != x-; then
    {
      $as_echo "/* $configure_input  */" \
      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
    } >"$ac_tmp/config.h" \
      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
$as_echo "$as_me: $ac_file is unchanged" >&6;}
    else
      rm -f "$ac_file"
      mv "$ac_tmp/config.h" "$ac_file" \
	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
    fi
  else
    $as_echo "/* $configure_input  */" \
      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
      || as_fn_error $? "could not create -" "$LINENO" 5
  fi
# Compute "$ac_file"'s index in $config_headers.
_am_arg="$ac_file"
_am_stamp_count=1
for _am_header in $config_headers :; do
  case $_am_header in
    $_am_arg | $_am_arg:* )
      break ;;
    * )
      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
  esac
done
echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$_am_arg" : 'X\(//\)[^/]' \| \
	 X"$_am_arg" : 'X\(//\)$' \| \
	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$_am_arg" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`/stamp-h$_am_stamp_count
 ;;

  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
$as_echo "$as_me: executing $ac_file commands" >&6;}
 ;;
  esac


  case $ac_file$ac_mode in
    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
  # 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
  shift
  for 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
    # 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 '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    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\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
      as_dir=$dirpart/$fdir; as_fn_mkdir_p
      # echo "creating $dirpart/$file"
      echo '# dummy' > "$dirpart/$file"
    done
  done
}
 ;;
    "default":C) chmod +x fallbacks/build-abinit-fallbacks.sh ;;

  esac
done # for ac_tag


as_fn_exit 0
_ACEOF
ac_clean_files=$ac_clean_files_save

test $ac_write_fail = 0 ||
  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5


# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
# Unfortunately, on DOS this fails, as config.log is still kept open
# by configure, so config.status won't be able to write to it; its
# output is simply discarded.  So we exec the FD to /dev/null,
# effectively closing config.log, so it can be properly (re)opened and
# appended to by config.status.  When coming back to configure, we
# need to make the FD available again.
if test "$no_create" != yes; then
  ac_cs_success=:
  ac_config_status_args=
  test "$silent" = yes &&
    ac_config_status_args="$ac_config_status_args --quiet"
  exec 5>/dev/null
  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
  exec 5>>config.log
  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
  # would make configure fail if this is the last instruction.
  $ac_cs_success || as_fn_exit 1
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi


# Check that we have all required fallbacks

    abi_fbk_list="${abi_fbk_required}"

    { $as_echo "$as_me:${as_lineno-$LINENO}: checking which fallbacks to look for" >&5
$as_echo_n "checking which fallbacks to look for... " >&6; }
  if test "${abi_fbk_list}" = ""; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_fbk_list}" >&5
$as_echo "${abi_fbk_list}" >&6; }
  fi

    if test "${abi_fbk_enable}" = "no" -a "${abi_fbk_list}" != ""; then


    abi_msg_file="${abinit_srcdir}/config/messages/fallbacks-required.msg"
  abi_msg_title="Abinit Fallbacks required"
  test "${abi_msg_title}" = "" && abi_msg_title="IMPORTANT NOTE"

    abi_msg_spacer="                                                            "
  abi_msg_tmp1=`echo "${abi_msg_title}" | sed -e 's/./ /g'`
  abi_msg_tmp2=`echo "${abi_msg_tmp1}" | grep "${abi_msg_spacer}"`
  abi_msg_spacer=`echo "${abi_msg_spacer}" | sed -e "s/${abi_msg_tmp1}//"`
  test "${abi_msg_tmp2}" = "" || abi_msg_spacer=""
  abi_msg_title="${abi_msg_title}${abi_msg_spacer}"

  if test -s "${abi_msg_file}"; then

    echo ""
  echo "        +--------------------------------------------------------------+"
  echo "        | ${abi_msg_title} |"
  echo "        +--------------------------------------------------------------+"

    while read abi_msg_line; do
    abi_msg_line=`eval echo ${abi_msg_line}`
    abi_msg_spacer="                                                            "
    abi_msg_tmp1=`echo "${abi_msg_line}" | sed -e 's/./ /g'`
    abi_msg_tmp2=`echo "${abi_msg_tmp1}" | grep "${abi_msg_spacer}"`
    test "${abi_msg_tmp1}" = "" || \
      abi_msg_spacer=`echo "${abi_msg_spacer}" | sed -e "s/${abi_msg_tmp1}//"`
    test "${abi_msg_tmp2}" = "" || abi_msg_spacer=""
    echo "        | ${abi_msg_line}${abi_msg_spacer} |"
  done <"${abi_msg_file}"

    echo "        +--------------------------------------------------------------+"
  echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

    as_fn_error $? "please provide consistent options for optional features
                 or build fallbacks and reconfigure Abinit" "$LINENO" 5
  fi

    tmp_fbk_list_ok="yes"
  for pkg in ${abi_fbk_list}; do
    tmp_fbk_enabled=`${abi_fbk_config} --enabled ${pkg} 2>/dev/null`
    if test "${tmp_fbk_enabled}" = "yes"; then
      for item in `${abi_fbk_config} --avail ${pkg}`; do
        case "${item}" in
          incs)
            { $as_echo "$as_me:${as_lineno-$LINENO}: setting ${item} flags for ${pkg}" >&5
$as_echo "$as_me: setting ${item} flags for ${pkg}" >&6;}
            eval abi_${pkg}_incs=\"`${abi_fbk_config} --incs ${pkg}`\"
            ;;
          libs)
            { $as_echo "$as_me:${as_lineno-$LINENO}: setting ${item} flags for ${pkg}" >&5
$as_echo "$as_me: setting ${item} flags for ${pkg}" >&6;}
            eval abi_${pkg}_libs=\"`${abi_fbk_config} --libs ${pkg}`\"
            ;;
        esac
      done
    else
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: the available Abinit Fallbacks do not provide '${pkg}'" >&5
$as_echo "$as_me: WARNING: the available Abinit Fallbacks do not provide '${pkg}'" >&2;}
      tmp_fbk_list_ok="no"
    fi
  done

    if test "${tmp_fbk_list_ok}" != "yes"; then


    abi_msg_file="${abinit_srcdir}/config/messages/fallbacks-required.msg"
  abi_msg_title="Abinit Fallbacks required"
  test "${abi_msg_title}" = "" && abi_msg_title="IMPORTANT NOTE"

    abi_msg_spacer="                                                            "
  abi_msg_tmp1=`echo "${abi_msg_title}" | sed -e 's/./ /g'`
  abi_msg_tmp2=`echo "${abi_msg_tmp1}" | grep "${abi_msg_spacer}"`
  abi_msg_spacer=`echo "${abi_msg_spacer}" | sed -e "s/${abi_msg_tmp1}//"`
  test "${abi_msg_tmp2}" = "" || abi_msg_spacer=""
  abi_msg_title="${abi_msg_title}${abi_msg_spacer}"

  if test -s "${abi_msg_file}"; then

    echo ""
  echo "        +--------------------------------------------------------------+"
  echo "        | ${abi_msg_title} |"
  echo "        +--------------------------------------------------------------+"

    while read abi_msg_line; do
    abi_msg_line=`eval echo ${abi_msg_line}`
    abi_msg_spacer="                                                            "
    abi_msg_tmp1=`echo "${abi_msg_line}" | sed -e 's/./ /g'`
    abi_msg_tmp2=`echo "${abi_msg_tmp1}" | grep "${abi_msg_spacer}"`
    test "${abi_msg_tmp1}" = "" || \
      abi_msg_spacer=`echo "${abi_msg_spacer}" | sed -e "s/${abi_msg_tmp1}//"`
    test "${abi_msg_tmp2}" = "" || abi_msg_spacer=""
    echo "        | ${abi_msg_line}${abi_msg_spacer} |"
  done <"${abi_msg_file}"

    echo "        +--------------------------------------------------------------+"
  echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

    as_fn_error $? "please provide a valid fallback installation prefix or
                 build the missing packages for which there is no fallback
                 (see above warnings)" "$LINENO" 5
  fi



# Report situation
#if test "${abi_fbk_required}" = ""; then
#  AC_MSG_NOTICE([no fallback required - you may run production calculations])
#else
#  AC_MSG_NOTICE([fallbacks required - you should not run production calculations])
#fi

# Check exit
if test ! -z "${status}" -o ! -z "${mandatory}"; then
      exit 2
fi


#-------------------- END JMB --------------------------------------------#

# FIXME: copying linear algebra tarball for now,
#        ensuring ~/.abinit/tarballs/ exists
if test "${abi_fbk_linalg}" = "yes"; then
  tmp_abinit_tardir="${HOME}/.abinit/tarballs"
  tmp_linalg_tarball="lapack-abinit_6.10.tar.gz"
  if test ! -s "${tmp_abinit_tardir}/${tmp_linalg_tarball}"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: using tarball repository ${tmp_abinit_tardir}" >&5
$as_echo "$as_me: using tarball repository ${tmp_abinit_tardir}" >&6;}
    if test ! -e "${tmp_abinit_tardir}"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: creating '${tmp_abinit_tardir}'" >&5
$as_echo "$as_me: creating '${tmp_abinit_tardir}'" >&6;}
      ${INSTALL} -d -m 755 "${tmp_abinit_tardir}"
    elif test ! -d "${tmp_abinit_tardir}"; then
      as_fn_error $? "'${tmp_abinit_tardir}' is not a directory
        please move away the current file and reconfigure Abinit" "$LINENO" 5
    fi

    { $as_echo "$as_me:${as_lineno-$LINENO}: installing linear algebra fallback tarball to '${tmp_abinit_tardir}'" >&5
$as_echo "$as_me: installing linear algebra fallback tarball to '${tmp_abinit_tardir}'" >&6;}
    ${INSTALL} -m 644 "${abinit_srcdir}/fallbacks/${tmp_linalg_tarball}" \
      "${tmp_abinit_tardir}"
  fi
fi

# Check that all triggers or their fallbacks are working
# FIXME: triggers must not fall back if with_* options are provided
for pkg in ${abi_trig_packages}; do
  tmp_trig_errors=""
  eval tmp_pkg_ok=\"\$\{abi_${pkg}_ok\}\"
  eval tmp_fbk_ok=\"\$\{abi_fbk_${pkg}_ok\}\"
  if test "${tmp_pkg_ok}" = "no" -a "${tmp_fbk_ok}" != "yes"; then
    tmp_trig_errors="${tmp_trig_errors} ${pkg}"
  fi
done
if test "${tmp_trig_errors}" != ""; then
  for pkg in ${tmp_trig_errors}; do
    tmp_fbk_error=`echo "${abi_fbk_packages}" | grep "${pkg}"`
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${pkg} support is unavailable or broken" >&5
$as_echo "$as_me: WARNING: ${pkg} support is unavailable or broken" >&2;}
    if test "${tmp_fbk_error}" != ""; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${pkg} fallback is unavailable" >&5
$as_echo "$as_me: WARNING: ${pkg} fallback is unavailable" >&2;}
    fi
  done
  as_fn_error $? "some optional features were not found on this system
                  (see messages above)
                  Please correct the options of configure to match your
                  actual situation" "$LINENO" 5
fi

# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #

#
# Optional source code
#



  abi_sec_title="Optional source code"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# Defines and conditionals for CPP options
# (see config/specs/options.conf for details)

  { $as_echo "$as_me:${as_lineno-$LINENO}: setting build switches associated to command-line options" >&5
$as_echo "$as_me: setting build switches associated to command-line options" >&6;}


  # Triggers for enable_avx_safe_mode
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to disable vectorization in problematic procedures" >&5
$as_echo_n "checking whether to disable vectorization in problematic procedures... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_avx_safe_mode_enable}" >&5
$as_echo "${abi_avx_safe_mode_enable}" >&6; }

  if test "${abi_avx_safe_mode_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'HAVE_AVX_SAFE_MODE' preprocessing macro" >&5
$as_echo "$as_me: defining the 'HAVE_AVX_SAFE_MODE' preprocessing macro" >&6;}

$as_echo "#define HAVE_AVX_SAFE_MODE 1" >>confdefs.h

  fi

  # Triggers for enable_crpa_optim
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable optimize cRPA calculations for ifort <= 17.0" >&5
$as_echo_n "checking whether to enable optimize cRPA calculations for ifort <= 17.0... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_crpa_optim_enable}" >&5
$as_echo "${abi_crpa_optim_enable}" >&6; }

  if test "${abi_crpa_optim_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'HAVE_CRPA_OPTIM' preprocessing macro" >&5
$as_echo "$as_me: defining the 'HAVE_CRPA_OPTIM' preprocessing macro" >&6;}

$as_echo "#define HAVE_CRPA_OPTIM 1" >>confdefs.h

  fi

  # Triggers for enable_gw_dpc
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to activate double-precision GW calculations" >&5
$as_echo_n "checking whether to activate double-precision GW calculations... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_gw_dpc_enable}" >&5
$as_echo "${abi_gw_dpc_enable}" >&6; }

  if test "${abi_gw_dpc_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'HAVE_GW_DPC' preprocessing macro" >&5
$as_echo "$as_me: defining the 'HAVE_GW_DPC' preprocessing macro" >&6;}

$as_echo "#define HAVE_GW_DPC 1" >>confdefs.h

  fi

  # Triggers for enable_libtetra
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to activate internal support for libtetra(hedron) in ABINIT" >&5
$as_echo_n "checking whether to activate internal support for libtetra(hedron) in ABINIT... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_libtetra_enable}" >&5
$as_echo "${abi_libtetra_enable}" >&6; }

  if test "${abi_libtetra_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'HAVE_LIBTETRA_ABINIT' preprocessing macro" >&5
$as_echo "$as_me: defining the 'HAVE_LIBTETRA_ABINIT' preprocessing macro" >&6;}

$as_echo "#define HAVE_LIBTETRA_ABINIT 1" >>confdefs.h

  fi

  # Triggers for enable_lotf
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to activate LOTF functionality (UNMAINTAINED)" >&5
$as_echo_n "checking whether to activate LOTF functionality (UNMAINTAINED)... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_lotf_enable}" >&5
$as_echo "${abi_lotf_enable}" >&6; }

  if test "${abi_lotf_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: triggering the 'DO_BUILD_65_LOTF_BASE' conditional" >&5
$as_echo "$as_me: triggering the 'DO_BUILD_65_LOTF_BASE' conditional" >&6;}
  fi
   if test "${abi_lotf_enable}" = "yes"; then
  DO_BUILD_65_LOTF_BASE_TRUE=
  DO_BUILD_65_LOTF_BASE_FALSE='#'
else
  DO_BUILD_65_LOTF_BASE_TRUE='#'
  DO_BUILD_65_LOTF_BASE_FALSE=
fi

  if test "${abi_lotf_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: triggering the 'DO_BUILD_68_LOTF' conditional" >&5
$as_echo "$as_me: triggering the 'DO_BUILD_68_LOTF' conditional" >&6;}
  fi
   if test "${abi_lotf_enable}" = "yes"; then
  DO_BUILD_68_LOTF_TRUE=
  DO_BUILD_68_LOTF_FALSE='#'
else
  DO_BUILD_68_LOTF_TRUE='#'
  DO_BUILD_68_LOTF_FALSE=
fi

  if test "${abi_lotf_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'HAVE_LOTF' preprocessing macro" >&5
$as_echo "$as_me: defining the 'HAVE_LOTF' preprocessing macro" >&6;}

$as_echo "#define HAVE_LOTF 1" >>confdefs.h

  fi

  # Triggers for enable_memory_profiling
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable memory profiling" >&5
$as_echo_n "checking whether to enable memory profiling... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_memory_profiling_enable}" >&5
$as_echo "${abi_memory_profiling_enable}" >&6; }

  if test "${abi_memory_profiling_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'HAVE_MEM_PROFILING' preprocessing macro" >&5
$as_echo "$as_me: defining the 'HAVE_MEM_PROFILING' preprocessing macro" >&6;}

$as_echo "#define HAVE_MEM_PROFILING 1" >>confdefs.h

  fi

  # Triggers for enable_mpi_gpu_aware
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to assume support for passing GPU buffers to MPI" >&5
$as_echo_n "checking whether to assume support for passing GPU buffers to MPI... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_mpi_gpu_aware_enable}" >&5
$as_echo "${abi_mpi_gpu_aware_enable}" >&6; }

  if test "${abi_mpi_gpu_aware_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'HAVE_GPU_MPI' preprocessing macro" >&5
$as_echo "$as_me: defining the 'HAVE_GPU_MPI' preprocessing macro" >&6;}

$as_echo "#define HAVE_GPU_MPI 1" >>confdefs.h

  fi

  # Triggers for enable_mpi_inplace
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to activate support for MPI_IN_PLACE" >&5
$as_echo_n "checking whether to activate support for MPI_IN_PLACE... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_mpi_inplace_enable}" >&5
$as_echo "${abi_mpi_inplace_enable}" >&6; }

  if test "${abi_mpi_inplace_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'HAVE_MPI2_INPLACE' preprocessing macro" >&5
$as_echo "$as_me: defining the 'HAVE_MPI2_INPLACE' preprocessing macro" >&6;}

$as_echo "#define HAVE_MPI2_INPLACE 1" >>confdefs.h

  fi

  # Triggers for enable_mpi_interfaces_bugfix
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to activate workaround for buggy MPI interfaces (not having interfaces for scalars)" >&5
$as_echo_n "checking whether to activate workaround for buggy MPI interfaces (not having interfaces for scalars)... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_mpi_interfaces_bugfix_enable}" >&5
$as_echo "${abi_mpi_interfaces_bugfix_enable}" >&6; }

  if test "${abi_mpi_interfaces_bugfix_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'HAVE_MPI_BUGGY_INTERFACES' preprocessing macro" >&5
$as_echo "$as_me: defining the 'HAVE_MPI_BUGGY_INTERFACES' preprocessing macro" >&6;}

$as_echo "#define HAVE_MPI_BUGGY_INTERFACES 1" >>confdefs.h

  fi

  # Triggers for enable_mpi_io_default
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use MPI I/O as default I/O library (maintainer-only option)" >&5
$as_echo_n "checking whether to use MPI I/O as default I/O library (maintainer-only option)... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_mpi_io_default_enable}" >&5
$as_echo "${abi_mpi_io_default_enable}" >&6; }

  if test "${abi_mpi_io_default_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'HAVE_MPI_IO_DEFAULT' preprocessing macro" >&5
$as_echo "$as_me: defining the 'HAVE_MPI_IO_DEFAULT' preprocessing macro" >&6;}

$as_echo "#define HAVE_MPI_IO_DEFAULT 1" >>confdefs.h

  fi

  # Triggers for enable_netcdf_default
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NetCDF as default I/O library (maintainer-only option)" >&5
$as_echo_n "checking whether to use NetCDF as default I/O library (maintainer-only option)... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_netcdf_default_enable}" >&5
$as_echo "${abi_netcdf_default_enable}" >&6; }

  if test "${abi_netcdf_default_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'HAVE_NETCDF_DEFAULT' preprocessing macro" >&5
$as_echo "$as_me: defining the 'HAVE_NETCDF_DEFAULT' preprocessing macro" >&6;}

$as_echo "#define HAVE_NETCDF_DEFAULT 1" >>confdefs.h

  fi

  # Triggers for enable_openmp
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to activate support for OpenMP" >&5
$as_echo_n "checking whether to activate support for OpenMP... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_openmp_enable}" >&5
$as_echo "${abi_openmp_enable}" >&6; }

  if test "${abi_openmp_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'HAVE_OPENMP' preprocessing macro" >&5
$as_echo "$as_me: defining the 'HAVE_OPENMP' preprocessing macro" >&6;}

$as_echo "#define HAVE_OPENMP 1" >>confdefs.h

  fi

  # Triggers for enable_openmp_offload
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to activate support for OpenMP GPU offload capabilities" >&5
$as_echo_n "checking whether to activate support for OpenMP GPU offload capabilities... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_openmp_offload_enable}" >&5
$as_echo "${abi_openmp_offload_enable}" >&6; }

  if test "${abi_openmp_offload_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'HAVE_OPENMP_OFFLOAD' preprocessing macro" >&5
$as_echo "$as_me: defining the 'HAVE_OPENMP_OFFLOAD' preprocessing macro" >&6;}

$as_echo "#define HAVE_OPENMP_OFFLOAD 1" >>confdefs.h

  fi
  if test "${abi_openmp_offload_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'HAVE_OPENMP' preprocessing macro" >&5
$as_echo "$as_me: defining the 'HAVE_OPENMP' preprocessing macro" >&6;}

$as_echo "#define HAVE_OPENMP 1" >>confdefs.h

  fi

  # Triggers for enable_python_invocation
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to activate possibility to call python scripts externally by invoking a python interpreter" >&5
$as_echo_n "checking whether to activate possibility to call python scripts externally by invoking a python interpreter... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_python_invocation_enable}" >&5
$as_echo "${abi_python_invocation_enable}" >&6; }

  if test "${abi_python_invocation_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'HAVE_PYTHON_INVOCATION' preprocessing macro" >&5
$as_echo "$as_me: defining the 'HAVE_PYTHON_INVOCATION' preprocessing macro" >&6;}

$as_echo "#define HAVE_PYTHON_INVOCATION 1" >>confdefs.h

  fi

  # Triggers for enable_stdin
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to tell ABINIT to read file lists from standard input" >&5
$as_echo_n "checking whether to tell ABINIT to read file lists from standard input... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_stdin_enable}" >&5
$as_echo "${abi_stdin_enable}" >&6; }

  if test "${abi_stdin_enable}" = "no"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'READ_FROM_FILE' preprocessing macro" >&5
$as_echo "$as_me: defining the 'READ_FROM_FILE' preprocessing macro" >&6;}

$as_echo "#define READ_FROM_FILE 1" >>confdefs.h

  fi

  # Triggers for enable_triqs_v1_4
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to activate internal support for TRIQS 1.4" >&5
$as_echo_n "checking whether to activate internal support for TRIQS 1.4... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_triqs_v1_4_enable}" >&5
$as_echo "${abi_triqs_v1_4_enable}" >&6; }

  if test "${abi_triqs_v1_4_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'HAVE_TRIQS_v1_4' preprocessing macro" >&5
$as_echo "$as_me: defining the 'HAVE_TRIQS_v1_4' preprocessing macro" >&6;}

$as_echo "#define HAVE_TRIQS_v1_4 1" >>confdefs.h

  fi

  # Triggers for enable_triqs_v2_0
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to activate internal support for TRIQS 2.0 (This option is dominant over the others versions)" >&5
$as_echo_n "checking whether to activate internal support for TRIQS 2.0 (This option is dominant over the others versions)... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_triqs_v2_0_enable}" >&5
$as_echo "${abi_triqs_v2_0_enable}" >&6; }

  if test "${abi_triqs_v2_0_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'HAVE_TRIQS_v2_0' preprocessing macro" >&5
$as_echo "$as_me: defining the 'HAVE_TRIQS_v2_0' preprocessing macro" >&6;}

$as_echo "#define HAVE_TRIQS_v2_0 1" >>confdefs.h

  fi

  # Triggers for enable_zdot_bugfix
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to activate workaround for bugged ZDOTC and ZDOTU" >&5
$as_echo_n "checking whether to activate workaround for bugged ZDOTC and ZDOTU... " >&6; }
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${abi_zdot_bugfix_enable}" >&5
$as_echo "${abi_zdot_bugfix_enable}" >&6; }

  if test "${abi_zdot_bugfix_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'HAVE_LINALG_ZDOTC_BUG' preprocessing macro" >&5
$as_echo "$as_me: defining the 'HAVE_LINALG_ZDOTC_BUG' preprocessing macro" >&6;}

$as_echo "#define HAVE_LINALG_ZDOTC_BUG 1" >>confdefs.h

  fi
  if test "${abi_zdot_bugfix_enable}" = "yes"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: defining the 'HAVE_LINALG_ZDOTU_BUG' preprocessing macro" >&5
$as_echo "$as_me: defining the 'HAVE_LINALG_ZDOTU_BUG' preprocessing macro" >&6;}

$as_echo "#define HAVE_LINALG_ZDOTU_BUG 1" >>confdefs.h

  fi



 if test "${enable_python_invocation}" = "yes"; then
  DO_BUILD_67_PYTHON_INVOCATION_EXT_TRUE=
  DO_BUILD_67_PYTHON_INVOCATION_EXT_FALSE='#'
else
  DO_BUILD_67_PYTHON_INVOCATION_EXT_TRUE='#'
  DO_BUILD_67_PYTHON_INVOCATION_EXT_FALSE=
fi

# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #

#
# Buggy Fortran compilers
#

# NOTE: must be done at the end because the wrapper is built by configure

# Wrap buggy Fortran compilers
FC_NOWRAP="${FC}"
if test "${abi_fc_wrap}" = "yes"; then
  FC="${abinit_builddir}/config/wrappers/wrap-fc"
fi


# Force F77 and F90 environment variables (keep always last)
F77="${FC}"
FFLAGS="${FCFLAGS}"
F90="${FC}"
F90FLAGS="${FCFLAGS}"

# The following is required for oldish fixed-form Fortran libraries



# Void CPPFLAGS to allow for C/Fortran mixing
ABI_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS=""

# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #

# FIXME: Temporary options to remove
case "${ABINIT_LEGACY_OPTION}" in
  mpi1)

$as_echo "#define HAVE_MPI1 1" >>confdefs.h

    ;;
  wannier90_v1)

$as_echo "#define HAVE_WANNIER90_V1 1" >>confdefs.h

    ;;
esac

# FIXME: temporary translation of XML status
if test "${abi_libxml2_enable}" = "yes"; then

$as_echo "#define HAVE_XML 1" >>confdefs.h

fi

# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #

#
# Output configuration
#



  abi_sec_title="Output"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# Output files
# Note: later, add tests/atconfig and tests/atlocal for test suite

    ac_config_files="$ac_config_files config.dump config.pc config.sh config/split/make-src-symlinks config/wrappers/wrap-fc abichecks/abichecks.env shared/common/src/14_hidewrite/m_build_info.F90 Makefile abichecks/Makefile shared/Makefile shared/common/Makefile shared/common/src/Makefile shared/common/src/incs/Makefile shared/common/src/mods/Makefile shared/libpaw/Makefile shared/libpaw/incs/Makefile shared/libpaw/mods/Makefile src/Makefile src/incs/Makefile src/mods/Makefile cmake/Makefile doc/Makefile tests/Makefile shared/common/src/02_clib/Makefile shared/common/src/10_defs/Makefile shared/common/src/11_memory_mpi/Makefile shared/common/src/12_hide_mpi/Makefile shared/common/src/14_hidewrite/Makefile shared/common/src/16_hideleave/Makefile shared/common/src/16_kokkos_toolbox/Makefile shared/common/src/17_gpu_toolbox/Makefile shared/common/src/17_libtetra_ext/Makefile shared/common/src/17_minimax/Makefile shared/common/src/17_yaml_out/Makefile shared/common/src/18_timing/Makefile shared/common/src/21_hashfuncs/Makefile shared/common/src/27_toolbox_oop/Makefile shared/common/src/28_numeric_noabirule/Makefile shared/common/src/29_kpoints/Makefile shared/common/src/32_util/Makefile shared/common/src/33_xc_lowlevel/Makefile shared/libpaw/src/Makefile src/41_geometry/Makefile src/42_nlstrain/Makefile src/42_parser/Makefile src/43_ptgroups/Makefile src/43_wvl_wrappers/Makefile src/44_abitools/Makefile src/44_abitypes_defs/Makefile src/44_manage_kokkos/Makefile src/45_geomoptim/Makefile src/45_xgTools/Makefile src/46_ghc_omp/Makefile src/46_manage_cuda/Makefile src/48_diago/Makefile src/49_gw_toolbox_oop/Makefile src/51_manage_mpi/Makefile src/52_fft_mpi_noabirule/Makefile src/53_ffts/Makefile src/54_spacepar/Makefile src/55_abiutil/Makefile src/56_io_mpi/Makefile src/56_mixing/Makefile src/56_recipspace/Makefile src/56_xc/Makefile src/57_iopsp_parser/Makefile src/57_iovars/Makefile src/61_occeig/Makefile src/62_cg_noabirule/Makefile src/62_ctqmc/Makefile src/62_iowfdenpot/Makefile src/62_poisson/Makefile src/62_wvl_wfs/Makefile src/64_psp/Makefile src/65_lotf_base/Makefile src/65_paw/Makefile src/66_nonlocal/Makefile src/66_vdwxc/Makefile src/66_wfs/Makefile src/67_common/Makefile src/67_python_invocation_ext/Makefile src/67_triqs_ext/Makefile src/68_dmft/Makefile src/68_lotf/Makefile src/68_recursion/Makefile src/68_rsprc/Makefile src/69_wfdesc/Makefile src/70_gw/Makefile src/71_bse/Makefile src/71_wannier/Makefile src/72_response/Makefile src/77_ddb/Makefile src/77_suscep/Makefile src/78_effpot/Makefile src/78_eph/Makefile src/79_seqpar_mpi/Makefile src/80_rttddft/Makefile src/80_tdep/Makefile src/94_scfcv/Makefile src/95_drive/Makefile src/98_main/Makefile"


    ac_config_commands="$ac_config_commands dump-optim"

  ac_config_commands="$ac_config_commands long-lines"

  ac_config_commands="$ac_config_commands script-perms"

  ac_config_commands="$ac_config_commands source-split"


    cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs, see configure's option --config-cache.
# It is not useful on other systems.  If it contains results you don't
# want to keep, you may remove or edit it.
#
# config.status only pays attention to the cache file if you give it
# the --recheck option to rerun configure.
#
# `ac_cv_env_foo' variables (set or unset) will be overridden when
# loading this file, other *unset* `ac_cv_foo' will be assigned the
# following values.

_ACEOF

# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, we kill variables containing newlines.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(
  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
    eval ac_val=\$$ac_var
    case $ac_val in #(
    *${as_nl}*)
      case $ac_var in #(
      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
      esac
      case $ac_var in #(
      _ | IFS | as_nl) ;; #(
      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
      *) { eval $ac_var=; unset $ac_var;} ;;
      esac ;;
    esac
  done

  (set) 2>&1 |
    case $as_nl`(ac_space=' '; set) 2>&1` in #(
    *${as_nl}ac_space=\ *)
      # `set' does not quote correctly, so add quotes: double-quote
      # substitution turns \\\\ into \\, and sed turns \\ into \.
      sed -n \
	"s/'/'\\\\''/g;
	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
      ;; #(
    *)
      # `set' quotes correctly as required by POSIX, so do not add quotes.
      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
      ;;
    esac |
    sort
) |
  sed '
     /^ac_cv_env_/b end
     t clear
     :clear
     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
     t end
     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
     :end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
  if test -w "$cache_file"; then
    if test "x$cache_file" != "x/dev/null"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
$as_echo "$as_me: updating cache $cache_file" >&6;}
      if test ! -f "$cache_file" || test -h "$cache_file"; then
	cat confcache >"$cache_file"
      else
        case $cache_file in #(
        */* | ?:*)
	  mv -f confcache "$cache_file"$$ &&
	  mv -f "$cache_file"$$ "$cache_file" ;; #(
        *)
	  mv -f confcache "$cache_file" ;;
	esac
      fi
    fi
  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
  fi
fi
rm -f confcache

test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'

DEFS=-DHAVE_CONFIG_H

ac_libobjs=
ac_ltlibobjs=
U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
  # 1. Remove the extension, and $U if already installed.
  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
  #    will be set to the directory where LIBOBJS objects are built.
  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs

LTLIBOBJS=$ac_ltlibobjs


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
$as_echo_n "checking that generated files are newer than configure... " >&6; }
   if test -n "$am_sleep_pid"; then
     # Hide warnings about reused PIDs.
     wait $am_sleep_pid 2>/dev/null
   fi
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
$as_echo "done" >&6; }
 if test -n "$EXEEXT"; then
  am__EXEEXT_TRUE=
  am__EXEEXT_FALSE='#'
else
  am__EXEEXT_TRUE='#'
  am__EXEEXT_FALSE=
fi

if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
  as_fn_error $? "conditional \"AMDEP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_32_CONTRACT_TRUE}" && test -z "${DO_BUILD_32_CONTRACT_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_32_CONTRACT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi

if test -z "${DO_BUILD_CCLOCK_TRUE}" && test -z "${DO_BUILD_CCLOCK_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_CCLOCK\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_17_GPU_TOOLBOX_TRUE}" && test -z "${DO_BUILD_17_GPU_TOOLBOX_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_17_GPU_TOOLBOX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_46_MANAGE_CUDA_TRUE}" && test -z "${DO_BUILD_46_MANAGE_CUDA_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_46_MANAGE_CUDA\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_NVTX_TRUE}" && test -z "${DO_BUILD_NVTX_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_NVTX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_16_KOKKOS_TOOLBOX_TRUE}" && test -z "${DO_BUILD_16_KOKKOS_TOOLBOX_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_16_KOKKOS_TOOLBOX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_44_MANAGE_KOKKOS_TRUE}" && test -z "${DO_BUILD_44_MANAGE_KOKKOS_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_44_MANAGE_KOKKOS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_PSML_TRUE}" && test -z "${DO_BUILD_PSML_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_PSML\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_01_LIBXC_EXT_TRUE}" && test -z "${DO_BUILD_01_LIBXC_EXT_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_01_LIBXC_EXT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_67_TRIQS_EXT_TRUE}" && test -z "${DO_BUILD_67_TRIQS_EXT_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_67_TRIQS_EXT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_SHARED_COMMON_TRUE}" && test -z "${DO_BUILD_SHARED_COMMON_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_SHARED_COMMON\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_SHARED_LIBPAW_TRUE}" && test -z "${DO_BUILD_SHARED_LIBPAW_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_SHARED_LIBPAW\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${am__EXEEXT_TRUE}" && test -z "${am__EXEEXT_FALSE}"; then
  as_fn_error $? "conditional \"am__EXEEXT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_65_LOTF_BASE_TRUE}" && test -z "${DO_BUILD_65_LOTF_BASE_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_65_LOTF_BASE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_68_LOTF_TRUE}" && test -z "${DO_BUILD_68_LOTF_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_68_LOTF\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${DO_BUILD_67_PYTHON_INVOCATION_EXT_TRUE}" && test -z "${DO_BUILD_67_PYTHON_INVOCATION_EXT_FALSE}"; then
  as_fn_error $? "conditional \"DO_BUILD_67_PYTHON_INVOCATION_EXT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi

: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
as_write_fail=0
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.

debug=false
ac_cs_recheck=false
ac_cs_silent=false

SHELL=\${CONFIG_SHELL-$SHELL}
export SHELL
_ASEOF
cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##

# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
  emulate sh
  NULLCMD=:
  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '${1+"$@"}'='"$@"'
  setopt NO_GLOB_SUBST
else
  case `(set -o) 2>/dev/null` in #(
  *posix*) :
    set -o posix ;; #(
  *) :
     ;;
esac
fi


as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
  as_echo='print -r --'
  as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
  as_echo='printf %s\n'
  as_echo_n='printf %s'
else
  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
    as_echo_n='/usr/ucb/echo -n'
  else
    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
    as_echo_n_body='eval
      arg=$1;
      case $arg in #(
      *"$as_nl"*)
	expr "X$arg" : "X\\(.*\\)$as_nl";
	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
      esac;
      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
    '
    export as_echo_n_body
    as_echo_n='sh -c $as_echo_n_body as_echo'
  fi
  export as_echo_body
  as_echo='sh -c $as_echo_body as_echo'
fi

# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
  PATH_SEPARATOR=:
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
      PATH_SEPARATOR=';'
  }
fi


# IFS
# We need space, tab and new line, in precisely that order.  Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" ""	$as_nl"

# Find who we are.  Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
  *[\\/]* ) as_myself=$0 ;;
  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
  done
IFS=$as_save_IFS

     ;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
  as_myself=$0
fi
if test ! -f "$as_myself"; then
  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
  exit 1
fi

# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there.  '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '

# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE

# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH


# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
  as_status=$1; test $as_status -eq 0 && as_status=1
  if test "$4"; then
    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
  fi
  $as_echo "$as_me: error: $2" >&2
  as_fn_exit $as_status
} # as_fn_error


# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
  return $1
} # as_fn_set_status

# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
  set +e
  as_fn_set_status $1
  exit $1
} # as_fn_exit

# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
  { eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
  eval 'as_fn_append ()
  {
    eval $1+=\$2
  }'
else
  as_fn_append ()
  {
    eval $1=\$$1\$2
  }
fi # as_fn_append

# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
  eval 'as_fn_arith ()
  {
    as_val=$(( $* ))
  }'
else
  as_fn_arith ()
  {
    as_val=`expr "$@" || test $? -eq 1`
  }
fi # as_fn_arith


if expr a : '\(a\)' >/dev/null 2>&1 &&
   test "X`expr 00001 : '.*\(...\)'`" = X001; then
  as_expr=expr
else
  as_expr=false
fi

if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
  as_basename=basename
else
  as_basename=false
fi

if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
  as_dirname=dirname
else
  as_dirname=false
fi

as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
	 X"$0" : 'X\(//\)$' \| \
	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
    sed '/^.*\/\([^/][^/]*\)\/*$/{
	    s//\1/
	    q
	  }
	  /^X\/\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\/\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`

# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits

ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
  case `echo 'xy\c'` in
  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
  xy)  ECHO_C='\c';;
  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
       ECHO_T='	';;
  esac;;
*)
  ECHO_N='-n';;
esac

rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
  rm -f conf$$.dir/conf$$.file
else
  rm -f conf$$.dir
  mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
  if ln -s conf$$.file conf$$ 2>/dev/null; then
    as_ln_s='ln -s'
    # ... but there are two gotchas:
    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
    # In both cases, we have to default to `cp -pR'.
    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
      as_ln_s='cp -pR'
  elif ln conf$$.file conf$$ 2>/dev/null; then
    as_ln_s=ln
  else
    as_ln_s='cp -pR'
  fi
else
  as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null


# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{

  case $as_dir in #(
  -*) as_dir=./$as_dir;;
  esac
  test -d "$as_dir" || eval $as_mkdir_p || {
    as_dirs=
    while :; do
      case $as_dir in #(
      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
      *) as_qdir=$as_dir;;
      esac
      as_dirs="'$as_qdir' $as_dirs"
      as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$as_dir" : 'X\(//\)[^/]' \| \
	 X"$as_dir" : 'X\(//\)$' \| \
	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_dir" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
      test -d "$as_dir" && break
    done
    test -z "$as_dirs" || eval "mkdir $as_dirs"
  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"


} # as_fn_mkdir_p
if mkdir -p . 2>/dev/null; then
  as_mkdir_p='mkdir -p "$as_dir"'
else
  test -d ./-p && rmdir ./-p
  as_mkdir_p=false
fi


# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
  test -f "$1" && test -x "$1"
} # as_fn_executable_p
as_test_x='test -x'
as_executable_p=as_fn_executable_p

# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"

# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"


exec 6>&1
## ----------------------------------- ##
## Main body of $CONFIG_STATUS script. ##
## ----------------------------------- ##
_ASEOF
test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Save the log message, to keep $0 and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by ABINIT $as_me 10.0.9, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  CONFIG_FILES    = $CONFIG_FILES
  CONFIG_HEADERS  = $CONFIG_HEADERS
  CONFIG_LINKS    = $CONFIG_LINKS
  CONFIG_COMMANDS = $CONFIG_COMMANDS
  $ $0 $@

on `(hostname || uname -n) 2>/dev/null | sed 1q`
"

_ACEOF

case $ac_config_files in *"
"*) set x $ac_config_files; shift; ac_config_files=$*;;
esac

case $ac_config_headers in *"
"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
esac


cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# Files that config.status was made for.
config_files="$ac_config_files"
config_headers="$ac_config_headers"
config_commands="$ac_config_commands"

_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
\`$as_me' instantiates files and other configuration actions
from templates according to the current configuration.  Unless the files
and actions are specified as TAGs, all are instantiated by default.

Usage: $0 [OPTION]... [TAG]...

  -h, --help       print this help, then exit
  -V, --version    print version number and configuration settings, then exit
      --config     print configuration, then exit
  -q, --quiet, --silent
                   do not print progress messages
  -d, --debug      don't remove temporary files
      --recheck    update $as_me by reconfiguring in the same conditions
      --file=FILE[:TEMPLATE]
                   instantiate the configuration file FILE
      --header=FILE[:TEMPLATE]
                   instantiate the configuration header FILE

Configuration files:
$config_files

Configuration headers:
$config_headers

Configuration commands:
$config_commands

Report bugs to <https://bugs.launchpad.net/abinit/>."

_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
ABINIT config.status 10.0.9
configured by $0, generated by GNU Autoconf 2.69,
  with options \\"\$ac_cs_config\\"

Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."

ac_pwd='$ac_pwd'
srcdir='$srcdir'
INSTALL='$INSTALL'
MKDIR_P='$MKDIR_P'
AWK='$AWK'
test -n "\$AWK" || AWK=awk
_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# The default lists apply if the user does not specify any file.
ac_need_defaults=:
while test $# != 0
do
  case $1 in
  --*=?*)
    ac_option=`expr "X$1" : 'X\([^=]*\)='`
    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
    ac_shift=:
    ;;
  --*=)
    ac_option=`expr "X$1" : 'X\([^=]*\)='`
    ac_optarg=
    ac_shift=:
    ;;
  *)
    ac_option=$1
    ac_optarg=$2
    ac_shift=shift
    ;;
  esac

  case $ac_option in
  # Handling of the options.
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    ac_cs_recheck=: ;;
  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
    $as_echo "$ac_cs_version"; exit ;;
  --config | --confi | --conf | --con | --co | --c )
    $as_echo "$ac_cs_config"; exit ;;
  --debug | --debu | --deb | --de | --d | -d )
    debug=: ;;
  --file | --fil | --fi | --f )
    $ac_shift
    case $ac_optarg in
    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
    '') as_fn_error $? "missing file argument" ;;
    esac
    as_fn_append CONFIG_FILES " '$ac_optarg'"
    ac_need_defaults=false;;
  --header | --heade | --head | --hea )
    $ac_shift
    case $ac_optarg in
    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
    esac
    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
    ac_need_defaults=false;;
  --he | --h)
    # Conflict between --help and --header
    as_fn_error $? "ambiguous option: \`$1'
Try \`$0 --help' for more information.";;
  --help | --hel | -h )
    $as_echo "$ac_cs_usage"; exit ;;
  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  | -silent | --silent | --silen | --sile | --sil | --si | --s)
    ac_cs_silent=: ;;

  # This is an error.
  -*) as_fn_error $? "unrecognized option: \`$1'
Try \`$0 --help' for more information." ;;

  *) as_fn_append ac_config_targets " $1"
     ac_need_defaults=false ;;

  esac
  shift
done

ac_configure_extra_args=

if $ac_cs_silent; then
  exec 6>/dev/null
  ac_configure_extra_args="$ac_configure_extra_args --silent"
fi

_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
  shift
  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
  CONFIG_SHELL='$SHELL'
  export CONFIG_SHELL
  exec "\$@"
fi

_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
exec 5>>config.log
{
  echo
  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
  $as_echo "$ac_log"
} >&5

_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"

_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1

# Handling of arguments.
for ac_config_target in $ac_config_targets
do
  case $ac_config_target in
    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
    "fallbacks/INSTALL") CONFIG_FILES="$CONFIG_FILES fallbacks/INSTALL" ;;
    "fallbacks/README") CONFIG_FILES="$CONFIG_FILES fallbacks/README" ;;
    "fallbacks/build-abinit-fallbacks.sh") CONFIG_FILES="$CONFIG_FILES fallbacks/build-abinit-fallbacks.sh" ;;
    "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
    "config.dump") CONFIG_FILES="$CONFIG_FILES config.dump" ;;
    "config.pc") CONFIG_FILES="$CONFIG_FILES config.pc" ;;
    "config.sh") CONFIG_FILES="$CONFIG_FILES config.sh" ;;
    "config/split/make-src-symlinks") CONFIG_FILES="$CONFIG_FILES config/split/make-src-symlinks" ;;
    "config/wrappers/wrap-fc") CONFIG_FILES="$CONFIG_FILES config/wrappers/wrap-fc" ;;
    "abichecks/abichecks.env") CONFIG_FILES="$CONFIG_FILES abichecks/abichecks.env" ;;
    "shared/common/src/14_hidewrite/m_build_info.F90") CONFIG_FILES="$CONFIG_FILES shared/common/src/14_hidewrite/m_build_info.F90" ;;
    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
    "abichecks/Makefile") CONFIG_FILES="$CONFIG_FILES abichecks/Makefile" ;;
    "shared/Makefile") CONFIG_FILES="$CONFIG_FILES shared/Makefile" ;;
    "shared/common/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/Makefile" ;;
    "shared/common/src/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/Makefile" ;;
    "shared/common/src/incs/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/incs/Makefile" ;;
    "shared/common/src/mods/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/mods/Makefile" ;;
    "shared/libpaw/Makefile") CONFIG_FILES="$CONFIG_FILES shared/libpaw/Makefile" ;;
    "shared/libpaw/incs/Makefile") CONFIG_FILES="$CONFIG_FILES shared/libpaw/incs/Makefile" ;;
    "shared/libpaw/mods/Makefile") CONFIG_FILES="$CONFIG_FILES shared/libpaw/mods/Makefile" ;;
    "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
    "src/incs/Makefile") CONFIG_FILES="$CONFIG_FILES src/incs/Makefile" ;;
    "src/mods/Makefile") CONFIG_FILES="$CONFIG_FILES src/mods/Makefile" ;;
    "cmake/Makefile") CONFIG_FILES="$CONFIG_FILES cmake/Makefile" ;;
    "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
    "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
    "shared/common/src/02_clib/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/02_clib/Makefile" ;;
    "shared/common/src/10_defs/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/10_defs/Makefile" ;;
    "shared/common/src/11_memory_mpi/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/11_memory_mpi/Makefile" ;;
    "shared/common/src/12_hide_mpi/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/12_hide_mpi/Makefile" ;;
    "shared/common/src/14_hidewrite/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/14_hidewrite/Makefile" ;;
    "shared/common/src/16_hideleave/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/16_hideleave/Makefile" ;;
    "shared/common/src/16_kokkos_toolbox/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/16_kokkos_toolbox/Makefile" ;;
    "shared/common/src/17_gpu_toolbox/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/17_gpu_toolbox/Makefile" ;;
    "shared/common/src/17_libtetra_ext/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/17_libtetra_ext/Makefile" ;;
    "shared/common/src/17_minimax/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/17_minimax/Makefile" ;;
    "shared/common/src/17_yaml_out/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/17_yaml_out/Makefile" ;;
    "shared/common/src/18_timing/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/18_timing/Makefile" ;;
    "shared/common/src/21_hashfuncs/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/21_hashfuncs/Makefile" ;;
    "shared/common/src/27_toolbox_oop/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/27_toolbox_oop/Makefile" ;;
    "shared/common/src/28_numeric_noabirule/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/28_numeric_noabirule/Makefile" ;;
    "shared/common/src/29_kpoints/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/29_kpoints/Makefile" ;;
    "shared/common/src/32_util/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/32_util/Makefile" ;;
    "shared/common/src/33_xc_lowlevel/Makefile") CONFIG_FILES="$CONFIG_FILES shared/common/src/33_xc_lowlevel/Makefile" ;;
    "shared/libpaw/src/Makefile") CONFIG_FILES="$CONFIG_FILES shared/libpaw/src/Makefile" ;;
    "src/41_geometry/Makefile") CONFIG_FILES="$CONFIG_FILES src/41_geometry/Makefile" ;;
    "src/42_nlstrain/Makefile") CONFIG_FILES="$CONFIG_FILES src/42_nlstrain/Makefile" ;;
    "src/42_parser/Makefile") CONFIG_FILES="$CONFIG_FILES src/42_parser/Makefile" ;;
    "src/43_ptgroups/Makefile") CONFIG_FILES="$CONFIG_FILES src/43_ptgroups/Makefile" ;;
    "src/43_wvl_wrappers/Makefile") CONFIG_FILES="$CONFIG_FILES src/43_wvl_wrappers/Makefile" ;;
    "src/44_abitools/Makefile") CONFIG_FILES="$CONFIG_FILES src/44_abitools/Makefile" ;;
    "src/44_abitypes_defs/Makefile") CONFIG_FILES="$CONFIG_FILES src/44_abitypes_defs/Makefile" ;;
    "src/44_manage_kokkos/Makefile") CONFIG_FILES="$CONFIG_FILES src/44_manage_kokkos/Makefile" ;;
    "src/45_geomoptim/Makefile") CONFIG_FILES="$CONFIG_FILES src/45_geomoptim/Makefile" ;;
    "src/45_xgTools/Makefile") CONFIG_FILES="$CONFIG_FILES src/45_xgTools/Makefile" ;;
    "src/46_ghc_omp/Makefile") CONFIG_FILES="$CONFIG_FILES src/46_ghc_omp/Makefile" ;;
    "src/46_manage_cuda/Makefile") CONFIG_FILES="$CONFIG_FILES src/46_manage_cuda/Makefile" ;;
    "src/48_diago/Makefile") CONFIG_FILES="$CONFIG_FILES src/48_diago/Makefile" ;;
    "src/49_gw_toolbox_oop/Makefile") CONFIG_FILES="$CONFIG_FILES src/49_gw_toolbox_oop/Makefile" ;;
    "src/51_manage_mpi/Makefile") CONFIG_FILES="$CONFIG_FILES src/51_manage_mpi/Makefile" ;;
    "src/52_fft_mpi_noabirule/Makefile") CONFIG_FILES="$CONFIG_FILES src/52_fft_mpi_noabirule/Makefile" ;;
    "src/53_ffts/Makefile") CONFIG_FILES="$CONFIG_FILES src/53_ffts/Makefile" ;;
    "src/54_spacepar/Makefile") CONFIG_FILES="$CONFIG_FILES src/54_spacepar/Makefile" ;;
    "src/55_abiutil/Makefile") CONFIG_FILES="$CONFIG_FILES src/55_abiutil/Makefile" ;;
    "src/56_io_mpi/Makefile") CONFIG_FILES="$CONFIG_FILES src/56_io_mpi/Makefile" ;;
    "src/56_mixing/Makefile") CONFIG_FILES="$CONFIG_FILES src/56_mixing/Makefile" ;;
    "src/56_recipspace/Makefile") CONFIG_FILES="$CONFIG_FILES src/56_recipspace/Makefile" ;;
    "src/56_xc/Makefile") CONFIG_FILES="$CONFIG_FILES src/56_xc/Makefile" ;;
    "src/57_iopsp_parser/Makefile") CONFIG_FILES="$CONFIG_FILES src/57_iopsp_parser/Makefile" ;;
    "src/57_iovars/Makefile") CONFIG_FILES="$CONFIG_FILES src/57_iovars/Makefile" ;;
    "src/61_occeig/Makefile") CONFIG_FILES="$CONFIG_FILES src/61_occeig/Makefile" ;;
    "src/62_cg_noabirule/Makefile") CONFIG_FILES="$CONFIG_FILES src/62_cg_noabirule/Makefile" ;;
    "src/62_ctqmc/Makefile") CONFIG_FILES="$CONFIG_FILES src/62_ctqmc/Makefile" ;;
    "src/62_iowfdenpot/Makefile") CONFIG_FILES="$CONFIG_FILES src/62_iowfdenpot/Makefile" ;;
    "src/62_poisson/Makefile") CONFIG_FILES="$CONFIG_FILES src/62_poisson/Makefile" ;;
    "src/62_wvl_wfs/Makefile") CONFIG_FILES="$CONFIG_FILES src/62_wvl_wfs/Makefile" ;;
    "src/64_psp/Makefile") CONFIG_FILES="$CONFIG_FILES src/64_psp/Makefile" ;;
    "src/65_lotf_base/Makefile") CONFIG_FILES="$CONFIG_FILES src/65_lotf_base/Makefile" ;;
    "src/65_paw/Makefile") CONFIG_FILES="$CONFIG_FILES src/65_paw/Makefile" ;;
    "src/66_nonlocal/Makefile") CONFIG_FILES="$CONFIG_FILES src/66_nonlocal/Makefile" ;;
    "src/66_vdwxc/Makefile") CONFIG_FILES="$CONFIG_FILES src/66_vdwxc/Makefile" ;;
    "src/66_wfs/Makefile") CONFIG_FILES="$CONFIG_FILES src/66_wfs/Makefile" ;;
    "src/67_common/Makefile") CONFIG_FILES="$CONFIG_FILES src/67_common/Makefile" ;;
    "src/67_python_invocation_ext/Makefile") CONFIG_FILES="$CONFIG_FILES src/67_python_invocation_ext/Makefile" ;;
    "src/67_triqs_ext/Makefile") CONFIG_FILES="$CONFIG_FILES src/67_triqs_ext/Makefile" ;;
    "src/68_dmft/Makefile") CONFIG_FILES="$CONFIG_FILES src/68_dmft/Makefile" ;;
    "src/68_lotf/Makefile") CONFIG_FILES="$CONFIG_FILES src/68_lotf/Makefile" ;;
    "src/68_recursion/Makefile") CONFIG_FILES="$CONFIG_FILES src/68_recursion/Makefile" ;;
    "src/68_rsprc/Makefile") CONFIG_FILES="$CONFIG_FILES src/68_rsprc/Makefile" ;;
    "src/69_wfdesc/Makefile") CONFIG_FILES="$CONFIG_FILES src/69_wfdesc/Makefile" ;;
    "src/70_gw/Makefile") CONFIG_FILES="$CONFIG_FILES src/70_gw/Makefile" ;;
    "src/71_bse/Makefile") CONFIG_FILES="$CONFIG_FILES src/71_bse/Makefile" ;;
    "src/71_wannier/Makefile") CONFIG_FILES="$CONFIG_FILES src/71_wannier/Makefile" ;;
    "src/72_response/Makefile") CONFIG_FILES="$CONFIG_FILES src/72_response/Makefile" ;;
    "src/77_ddb/Makefile") CONFIG_FILES="$CONFIG_FILES src/77_ddb/Makefile" ;;
    "src/77_suscep/Makefile") CONFIG_FILES="$CONFIG_FILES src/77_suscep/Makefile" ;;
    "src/78_effpot/Makefile") CONFIG_FILES="$CONFIG_FILES src/78_effpot/Makefile" ;;
    "src/78_eph/Makefile") CONFIG_FILES="$CONFIG_FILES src/78_eph/Makefile" ;;
    "src/79_seqpar_mpi/Makefile") CONFIG_FILES="$CONFIG_FILES src/79_seqpar_mpi/Makefile" ;;
    "src/80_rttddft/Makefile") CONFIG_FILES="$CONFIG_FILES src/80_rttddft/Makefile" ;;
    "src/80_tdep/Makefile") CONFIG_FILES="$CONFIG_FILES src/80_tdep/Makefile" ;;
    "src/94_scfcv/Makefile") CONFIG_FILES="$CONFIG_FILES src/94_scfcv/Makefile" ;;
    "src/95_drive/Makefile") CONFIG_FILES="$CONFIG_FILES src/95_drive/Makefile" ;;
    "src/98_main/Makefile") CONFIG_FILES="$CONFIG_FILES src/98_main/Makefile" ;;
    "dump-optim") CONFIG_COMMANDS="$CONFIG_COMMANDS dump-optim" ;;
    "long-lines") CONFIG_COMMANDS="$CONFIG_COMMANDS long-lines" ;;
    "script-perms") CONFIG_COMMANDS="$CONFIG_COMMANDS script-perms" ;;
    "source-split") CONFIG_COMMANDS="$CONFIG_COMMANDS source-split" ;;

  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
  esac
done


# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used.  Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
fi

# Have a temporary directory for convenience.  Make it in the build tree
# simply because there is no reason against having it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
# Hook for its removal unless debugging.
# Note that there is a small window in which the directory will not be cleaned:
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
  tmp= ac_tmp=
  trap 'exit_status=$?
  : "${ac_tmp:=$tmp}"
  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
' 0
  trap 'as_fn_exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.

{
  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
  test -d "$tmp"
}  ||
{
  tmp=./conf$$-$RANDOM
  (umask 077 && mkdir "$tmp")
} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
ac_tmp=$tmp

# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then


ac_cr=`echo X | tr X '\015'`
# On cygwin, bash can eat \r inside `` if the user requested igncr.
# But we know of no other shell where ac_cr would be empty at this
# point, so we can use a bashism as a fallback.
if test "x$ac_cr" = x; then
  eval ac_cr=\$\'\\r\'
fi
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
  ac_cs_awk_cr='\\r'
else
  ac_cs_awk_cr=$ac_cr
fi

echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
_ACEOF


{
  echo "cat >conf$$subs.awk <<_ACEOF" &&
  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
  echo "_ACEOF"
} >conf$$subs.sh ||
  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
  . ./conf$$subs.sh ||
    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5

  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
  if test $ac_delim_n = $ac_delim_num; then
    break
  elif $ac_last_try; then
    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
  else
    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
  fi
done
rm -f conf$$subs.sh

cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
_ACEOF
sed -n '
h
s/^/S["/; s/!.*/"]=/
p
g
s/^[^!]*!//
:repl
t repl
s/'"$ac_delim"'$//
t delim
:nl
h
s/\(.\{148\}\)..*/\1/
t more1
s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
p
n
b repl
:more1
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t nl
:delim
h
s/\(.\{148\}\)..*/\1/
t more2
s/["\\]/\\&/g; s/^/"/; s/$/"/
p
b
:more2
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t delim
' <conf$$subs.awk | sed '
/^[^""]/{
  N
  s/\n//
}
' >>$CONFIG_STATUS || ac_write_fail=1
rm -f conf$$subs.awk
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACAWK
cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
  for (key in S) S_is_set[key] = 1
  FS = ""

}
{
  line = $ 0
  nfields = split(line, field, "@")
  substed = 0
  len = length(field[1])
  for (i = 2; i < nfields; i++) {
    key = field[i]
    keylen = length(key)
    if (S_is_set[key]) {
      value = S[key]
      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
      len += length(value) + length(field[++i])
      substed = 1
    } else
      len += 1 + keylen
  }

  print line
}

_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
else
  cat
fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF

# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
h
s///
s/^/:/
s/[	 ]*$/:/
s/:\$(srcdir):/:/g
s/:\${srcdir}:/:/g
s/:@srcdir@:/:/g
s/^:*//
s/:*$//
x
s/\(=[	 ]*\).*/\1/
G
s/\n//
s/^[^=]*=[	 ]*$//
}'
fi

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
fi # test -n "$CONFIG_FILES"

# Set up the scripts for CONFIG_HEADERS section.
# No need to generate them if there are no CONFIG_HEADERS.
# This happens for instance with `./config.status Makefile'.
if test -n "$CONFIG_HEADERS"; then
cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
BEGIN {
_ACEOF

# Transform confdefs.h into an awk script `defines.awk', embedded as
# here-document in config.status, that substitutes the proper values into
# config.h.in to produce config.h.

# Create a delimiter string that does not exist in confdefs.h, to ease
# handling of long lines.
ac_delim='%!_!# '
for ac_last_try in false false :; do
  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
  if test -z "$ac_tt"; then
    break
  elif $ac_last_try; then
    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
  else
    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
  fi
done

# For the awk script, D is an array of macro values keyed by name,
# likewise P contains macro parameters if any.  Preserve backslash
# newline sequences.

ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
sed -n '
s/.\{148\}/&'"$ac_delim"'/g
t rset
:rset
s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
t def
d
:def
s/\\$//
t bsnl
s/["\\]/\\&/g
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
D["\1"]=" \3"/p
s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
d
:bsnl
s/["\\]/\\&/g
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
D["\1"]=" \3\\\\\\n"\\/p
t cont
s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
t cont
d
:cont
n
s/.\{148\}/&'"$ac_delim"'/g
t clear
:clear
s/\\$//
t bsnlc
s/["\\]/\\&/g; s/^/"/; s/$/"/p
d
:bsnlc
s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
b cont
' <confdefs.h | sed '
s/'"$ac_delim"'/"\\\
"/g' >>$CONFIG_STATUS || ac_write_fail=1

cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
  for (key in D) D_is_set[key] = 1
  FS = ""
}
/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
  line = \$ 0
  split(line, arg, " ")
  if (arg[1] == "#") {
    defundef = arg[2]
    mac1 = arg[3]
  } else {
    defundef = substr(arg[1], 2)
    mac1 = arg[2]
  }
  split(mac1, mac2, "(") #)
  macro = mac2[1]
  prefix = substr(line, 1, index(line, defundef) - 1)
  if (D_is_set[macro]) {
    # Preserve the white space surrounding the "#".
    print prefix "define", macro P[macro] D[macro]
    next
  } else {
    # Replace #undef with comments.  This is necessary, for example,
    # in the case of _POSIX_SOURCE, which is predefined and required
    # on some systems where configure will not decide to define it.
    if (defundef == "undef") {
      print "/*", prefix defundef, macro, "*/"
      next
    }
  }
}
{ print }
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
fi # test -n "$CONFIG_HEADERS"


eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
shift
for ac_tag
do
  case $ac_tag in
  :[FHLC]) ac_mode=$ac_tag; continue;;
  esac
  case $ac_mode$ac_tag in
  :[FHL]*:*);;
  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
  :[FH]-) ac_tag=-:-;;
  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
  esac
  ac_save_IFS=$IFS
  IFS=:
  set x $ac_tag
  IFS=$ac_save_IFS
  shift
  ac_file=$1
  shift

  case $ac_mode in
  :L) ac_source=$1;;
  :[FH])
    ac_file_inputs=
    for ac_f
    do
      case $ac_f in
      -) ac_f="$ac_tmp/stdin";;
      *) # Look for the file first in the build tree, then in the source tree
	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
	 # because $ac_f cannot contain `:'.
	 test -f "$ac_f" ||
	   case $ac_f in
	   [\\/$]*) false;;
	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
	   esac ||
	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
      esac
      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
      as_fn_append ac_file_inputs " '$ac_f'"
    done

    # Let's still pretend it is `configure' which instantiates (i.e., don't
    # use $as_me), people would be surprised to read:
    #    /* config.h.  Generated by config.status.  */
    configure_input='Generated from '`
	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
	`' by configure.'
    if test x"$ac_file" != x-; then
      configure_input="$ac_file.  $configure_input"
      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
$as_echo "$as_me: creating $ac_file" >&6;}
    fi
    # Neutralize special characters interpreted by sed in replacement strings.
    case $configure_input in #(
    *\&* | *\|* | *\\* )
       ac_sed_conf_input=`$as_echo "$configure_input" |
       sed 's/[\\\\&|]/\\\\&/g'`;; #(
    *) ac_sed_conf_input=$configure_input;;
    esac

    case $ac_tag in
    *:-:* | *:-) cat >"$ac_tmp/stdin" \
      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
    esac
    ;;
  esac

  ac_dir=`$as_dirname -- "$ac_file" ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$ac_file" : 'X\(//\)[^/]' \| \
	 X"$ac_file" : 'X\(//\)$' \| \
	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$ac_file" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
  as_dir="$ac_dir"; as_fn_mkdir_p
  ac_builddir=.

case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
  # A ".." for each directory in $ac_dir_suffix.
  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
  case $ac_top_builddir_sub in
  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
  esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix

case $srcdir in
  .)  # We are building in place.
    ac_srcdir=.
    ac_top_srcdir=$ac_top_builddir_sub
    ac_abs_top_srcdir=$ac_pwd ;;
  [\\/]* | ?:[\\/]* )  # Absolute name.
    ac_srcdir=$srcdir$ac_dir_suffix;
    ac_top_srcdir=$srcdir
    ac_abs_top_srcdir=$srcdir ;;
  *) # Relative name.
    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
    ac_top_srcdir=$ac_top_build_prefix$srcdir
    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix


  case $ac_mode in
  :F)
  #
  # CONFIG_FILE
  #

  case $INSTALL in
  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
  esac
  ac_MKDIR_P=$MKDIR_P
  case $MKDIR_P in
  [\\/$]* | ?:[\\/]* ) ;;
  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
  esac
_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# If the template does not know about datarootdir, expand it.
# FIXME: This hack should be removed a few years after 2.60.
ac_datarootdir_hack=; ac_datarootdir_seen=
ac_sed_dataroot='
/datarootdir/ {
  p
  q
}
/@datadir@/p
/@docdir@/p
/@infodir@/p
/@localedir@/p
/@mandir@/p'
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
  ac_datarootdir_hack='
  s&@datadir@&$datadir&g
  s&@docdir@&$docdir&g
  s&@infodir@&$infodir&g
  s&@localedir@&$localedir&g
  s&@mandir@&$mandir&g
  s&\\\${datarootdir}&$datarootdir&g' ;;
esac
_ACEOF

# Neutralize VPATH when `$srcdir' = `.'.
# Shell code in configure.ac might set extrasub.
# FIXME: do we really want to maintain this feature?
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_sed_extra="$ac_vpsub
$extrasub
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
s|@configure_input@|$ac_sed_conf_input|;t t
s&@top_builddir@&$ac_top_builddir_sub&;t t
s&@top_build_prefix@&$ac_top_build_prefix&;t t
s&@srcdir@&$ac_srcdir&;t t
s&@abs_srcdir@&$ac_abs_srcdir&;t t
s&@top_srcdir@&$ac_top_srcdir&;t t
s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
s&@builddir@&$ac_builddir&;t t
s&@abs_builddir@&$ac_abs_builddir&;t t
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t
s&@MKDIR_P@&$ac_MKDIR_P&;t t
$ac_datarootdir_hack
"
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5

test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
      "$ac_tmp/out"`; test -z "$ac_out"; } &&
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined.  Please make sure it is defined" >&5
$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined.  Please make sure it is defined" >&2;}

  rm -f "$ac_tmp/stdin"
  case $ac_file in
  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
  esac \
  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 ;;
  :H)
  #
  # CONFIG_HEADER
  #
  if test x"$ac_file" != x-; then
    {
      $as_echo "/* $configure_input  */" \
      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
    } >"$ac_tmp/config.h" \
      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
$as_echo "$as_me: $ac_file is unchanged" >&6;}
    else
      rm -f "$ac_file"
      mv "$ac_tmp/config.h" "$ac_file" \
	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
    fi
  else
    $as_echo "/* $configure_input  */" \
      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
      || as_fn_error $? "could not create -" "$LINENO" 5
  fi
# Compute "$ac_file"'s index in $config_headers.
_am_arg="$ac_file"
_am_stamp_count=1
for _am_header in $config_headers :; do
  case $_am_header in
    $_am_arg | $_am_arg:* )
      break ;;
    * )
      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
  esac
done
echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$_am_arg" : 'X\(//\)[^/]' \| \
	 X"$_am_arg" : 'X\(//\)$' \| \
	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$_am_arg" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`/stamp-h$_am_stamp_count
 ;;

  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
$as_echo "$as_me: executing $ac_file commands" >&6;}
 ;;
  esac


  case $ac_file$ac_mode in
    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
  # 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
  shift
  for 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
    # 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 '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    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\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
      as_dir=$dirpart/$fdir; as_fn_mkdir_p
      # echo "creating $dirpart/$file"
      echo '# dummy' > "$dirpart/$file"
    done
  done
}
 ;;
    "default":C) chmod +x fallbacks/build-abinit-fallbacks.sh ;;
    "dump-optim":C) ${PYTHON} ${abinit_srcdir}/config/scripts/make-optim-dumper ;;
    "long-lines":C) /bin/sh ${abinit_srcdir}/config/scripts/shrink-src-files ${abinit_srcdir} ${abinit_builddir} ;;
    "script-perms":C) chmod u+x config/wrappers/wrap-fc ;;
    "source-split":C) /bin/sh config/split/make-src-symlinks ;;

  esac
done # for ac_tag


as_fn_exit 0
_ACEOF
ac_clean_files=$ac_clean_files_save

test $ac_write_fail = 0 ||
  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5


# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
# Unfortunately, on DOS this fails, as config.log is still kept open
# by configure, so config.status won't be able to write to it; its
# output is simply discarded.  So we exec the FD to /dev/null,
# effectively closing config.log, so it can be properly (re)opened and
# appended to by config.status.  When coming back to configure, we
# need to make the FD available again.
if test "$no_create" != yes; then
  ac_cs_success=:
  ac_config_status_args=
  test "$silent" = yes &&
    ac_config_status_args="$ac_config_status_args --quiet"
  exec 5>/dev/null
  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
  exec 5>>config.log
  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
  # would make configure fail if this is the last instruction.
  $ac_cs_success || as_fn_exit 1
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi



# FIXME: Generate fake makefile for the fallbacks until the test farm is
#        updated
test -e "fallbacks" || ${INSTALL} -d -m 755 "fallbacks"
${INSTALL} -m 644 "${abinit_srcdir}/config/makefiles/fallbacks.mf" \
  "fallbacks/Makefile"

# Call CMake to generate Makefile for Kokkos sources directories
if test "${sd_kokkos_enable}" = "yes"; then
  rm ${abinit_builddir}/src/16_kokkos_toolbox/Makefile
  cd ${abinit_builddir}/src/16_kokkos_toolbox && \
    cmake ${abinit_srcdir}/shared/common/src/16_kokkos_toolbox/. -Wno-dev  \
    -DUSE_AUTOTOOLS_BUILD_COMPAT=ON -DABINIT_SRC_DIR=${abinit_srcdir} \
    -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_Fortran_FLAGS="${FCFLAGS}"  \
    -DCMAKE_CXX_FLAGS="-O2" -DCMAKE_C_COMPILER=${CC}  -DCMAKE_CXX_COMPILER=${CXX} \
    -DCMAKE_Fortran_COMPILER=${FC} && \
    cd -
  rm ${abinit_builddir}/src/44_manage_kokkos/Makefile
  cd ${abinit_builddir}/src/44_manage_kokkos && \
    cmake ${abinit_srcdir}/src/44_manage_kokkos/. -Wno-dev  \
    -DUSE_AUTOTOOLS_BUILD_COMPAT=ON -DABINIT_SRC_DIR=${abinit_srcdir} \
    -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_Fortran_FLAGS="${FCFLAGS}"  \
    -DCMAKE_CXX_FLAGS="-O2" -DCMAKE_C_COMPILER=${CC}  -DCMAKE_CXX_COMPILER=${CXX} \
    -DCMAKE_Fortran_COMPILER=${FC} && \
    cd -
fi

# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #



  abi_sec_title="Final remarks"

    abi_sec_spaces="                                                                      "
  abi_sec_tmp="${abi_sec_title}"
  while test "${abi_sec_tmp}" != ""; do
    abi_sec_spaces=`echo "${abi_sec_spaces}" | sed -e 's/^.//'`
    abi_sec_tmp=`echo "${abi_sec_tmp}" | sed -e 's/^.//'`
  done

  echo ""
  echo " =============================================================================="
  echo " === ${abi_sec_title}${abi_sec_spaces} ==="
  echo " =============================================================================="
  echo ""


# The end
if test "${sd_linalg_flavor}" = "netlib-fallback"; then


    abi_msg_file="${abinit_srcdir}/config/messages/linalg-abinit.msg"
  abi_msg_title="Suboptimal linear algebra configuration"
  test "${abi_msg_title}" = "" && abi_msg_title="IMPORTANT NOTE"

    abi_msg_spacer="                                                            "
  abi_msg_tmp1=`echo "${abi_msg_title}" | sed -e 's/./ /g'`
  abi_msg_tmp2=`echo "${abi_msg_tmp1}" | grep "${abi_msg_spacer}"`
  abi_msg_spacer=`echo "${abi_msg_spacer}" | sed -e "s/${abi_msg_tmp1}//"`
  test "${abi_msg_tmp2}" = "" || abi_msg_spacer=""
  abi_msg_title="${abi_msg_title}${abi_msg_spacer}"

  if test -s "${abi_msg_file}"; then

    echo ""
  echo "        +--------------------------------------------------------------+"
  echo "        | ${abi_msg_title} |"
  echo "        +--------------------------------------------------------------+"

    while read abi_msg_line; do
    abi_msg_line=`eval echo ${abi_msg_line}`
    abi_msg_spacer="                                                            "
    abi_msg_tmp1=`echo "${abi_msg_line}" | sed -e 's/./ /g'`
    abi_msg_tmp2=`echo "${abi_msg_tmp1}" | grep "${abi_msg_spacer}"`
    test "${abi_msg_tmp1}" = "" || \
      abi_msg_spacer=`echo "${abi_msg_spacer}" | sed -e "s/${abi_msg_tmp1}//"`
    test "${abi_msg_tmp2}" = "" || abi_msg_spacer=""
    echo "        | ${abi_msg_line}${abi_msg_spacer} |"
  done <"${abi_msg_file}"

    echo "        +--------------------------------------------------------------+"
  echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

fi
if test "${sd_libxc_kxc_ok}" = "no"; then


    abi_msg_file="${abinit_srcdir}/config/messages/libxc-kxc.msg"
  abi_msg_title="Suboptimal libxc configuration"
  test "${abi_msg_title}" = "" && abi_msg_title="IMPORTANT NOTE"

    abi_msg_spacer="                                                            "
  abi_msg_tmp1=`echo "${abi_msg_title}" | sed -e 's/./ /g'`
  abi_msg_tmp2=`echo "${abi_msg_tmp1}" | grep "${abi_msg_spacer}"`
  abi_msg_spacer=`echo "${abi_msg_spacer}" | sed -e "s/${abi_msg_tmp1}//"`
  test "${abi_msg_tmp2}" = "" || abi_msg_spacer=""
  abi_msg_title="${abi_msg_title}${abi_msg_spacer}"

  if test -s "${abi_msg_file}"; then

    echo ""
  echo "        +--------------------------------------------------------------+"
  echo "        | ${abi_msg_title} |"
  echo "        +--------------------------------------------------------------+"

    while read abi_msg_line; do
    abi_msg_line=`eval echo ${abi_msg_line}`
    abi_msg_spacer="                                                            "
    abi_msg_tmp1=`echo "${abi_msg_line}" | sed -e 's/./ /g'`
    abi_msg_tmp2=`echo "${abi_msg_tmp1}" | grep "${abi_msg_spacer}"`
    test "${abi_msg_tmp1}" = "" || \
      abi_msg_spacer=`echo "${abi_msg_spacer}" | sed -e "s/${abi_msg_tmp1}//"`
    test "${abi_msg_tmp2}" = "" || abi_msg_spacer=""
    echo "        | ${abi_msg_line}${abi_msg_spacer} |"
  done <"${abi_msg_file}"

    echo "        +--------------------------------------------------------------+"
  echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

fi
# GPU 2024 implementation : deactivate this warning
#if test "${abi_gpu_enable}" = "yes" -a "${sd_linalg_chk_gpu}" != "magma"; then
#  ABI_MSG_NOTICE([gpu-without-magma],
#    [Suboptimal GPU configuration])
#fi


  case "${abi_fc_vendor}" in

    absoft)


    abi_msg_file="${abinit_srcdir}/config/messages/fc-absoft.msg"
  abi_msg_title="About the ABSoft Fortran compiler"
  test "${abi_msg_title}" = "" && abi_msg_title="IMPORTANT NOTE"

    abi_msg_spacer="                                                            "
  abi_msg_tmp1=`echo "${abi_msg_title}" | sed -e 's/./ /g'`
  abi_msg_tmp2=`echo "${abi_msg_tmp1}" | grep "${abi_msg_spacer}"`
  abi_msg_spacer=`echo "${abi_msg_spacer}" | sed -e "s/${abi_msg_tmp1}//"`
  test "${abi_msg_tmp2}" = "" || abi_msg_spacer=""
  abi_msg_title="${abi_msg_title}${abi_msg_spacer}"

  if test -s "${abi_msg_file}"; then

    echo ""
  echo "        +--------------------------------------------------------------+"
  echo "        | ${abi_msg_title} |"
  echo "        +--------------------------------------------------------------+"

    while read abi_msg_line; do
    abi_msg_line=`eval echo ${abi_msg_line}`
    abi_msg_spacer="                                                            "
    abi_msg_tmp1=`echo "${abi_msg_line}" | sed -e 's/./ /g'`
    abi_msg_tmp2=`echo "${abi_msg_tmp1}" | grep "${abi_msg_spacer}"`
    test "${abi_msg_tmp1}" = "" || \
      abi_msg_spacer=`echo "${abi_msg_spacer}" | sed -e "s/${abi_msg_tmp1}//"`
    test "${abi_msg_tmp2}" = "" || abi_msg_spacer=""
    echo "        | ${abi_msg_line}${abi_msg_spacer} |"
  done <"${abi_msg_file}"

    echo "        +--------------------------------------------------------------+"
  echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

      ;;

    ibm)


    abi_msg_file="${abinit_srcdir}/config/messages/fc-ibm.msg"
  abi_msg_title="About the IBM XL Fortran compiler"
  test "${abi_msg_title}" = "" && abi_msg_title="IMPORTANT NOTE"

    abi_msg_spacer="                                                            "
  abi_msg_tmp1=`echo "${abi_msg_title}" | sed -e 's/./ /g'`
  abi_msg_tmp2=`echo "${abi_msg_tmp1}" | grep "${abi_msg_spacer}"`
  abi_msg_spacer=`echo "${abi_msg_spacer}" | sed -e "s/${abi_msg_tmp1}//"`
  test "${abi_msg_tmp2}" = "" || abi_msg_spacer=""
  abi_msg_title="${abi_msg_title}${abi_msg_spacer}"

  if test -s "${abi_msg_file}"; then

    echo ""
  echo "        +--------------------------------------------------------------+"
  echo "        | ${abi_msg_title} |"
  echo "        +--------------------------------------------------------------+"

    while read abi_msg_line; do
    abi_msg_line=`eval echo ${abi_msg_line}`
    abi_msg_spacer="                                                            "
    abi_msg_tmp1=`echo "${abi_msg_line}" | sed -e 's/./ /g'`
    abi_msg_tmp2=`echo "${abi_msg_tmp1}" | grep "${abi_msg_spacer}"`
    test "${abi_msg_tmp1}" = "" || \
      abi_msg_spacer=`echo "${abi_msg_spacer}" | sed -e "s/${abi_msg_tmp1}//"`
    test "${abi_msg_tmp2}" = "" || abi_msg_spacer=""
    echo "        | ${abi_msg_line}${abi_msg_spacer} |"
  done <"${abi_msg_file}"

    echo "        +--------------------------------------------------------------+"
  echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

      ;;

    intel)


    abi_msg_file="${abinit_srcdir}/config/messages/fc-intel.msg"
  abi_msg_title="About the Intel Fortran compiler"
  test "${abi_msg_title}" = "" && abi_msg_title="IMPORTANT NOTE"

    abi_msg_spacer="                                                            "
  abi_msg_tmp1=`echo "${abi_msg_title}" | sed -e 's/./ /g'`
  abi_msg_tmp2=`echo "${abi_msg_tmp1}" | grep "${abi_msg_spacer}"`
  abi_msg_spacer=`echo "${abi_msg_spacer}" | sed -e "s/${abi_msg_tmp1}//"`
  test "${abi_msg_tmp2}" = "" || abi_msg_spacer=""
  abi_msg_title="${abi_msg_title}${abi_msg_spacer}"

  if test -s "${abi_msg_file}"; then

    echo ""
  echo "        +--------------------------------------------------------------+"
  echo "        | ${abi_msg_title} |"
  echo "        +--------------------------------------------------------------+"

    while read abi_msg_line; do
    abi_msg_line=`eval echo ${abi_msg_line}`
    abi_msg_spacer="                                                            "
    abi_msg_tmp1=`echo "${abi_msg_line}" | sed -e 's/./ /g'`
    abi_msg_tmp2=`echo "${abi_msg_tmp1}" | grep "${abi_msg_spacer}"`
    test "${abi_msg_tmp1}" = "" || \
      abi_msg_spacer=`echo "${abi_msg_spacer}" | sed -e "s/${abi_msg_tmp1}//"`
    test "${abi_msg_tmp2}" = "" || abi_msg_spacer=""
    echo "        | ${abi_msg_line}${abi_msg_spacer} |"
  done <"${abi_msg_file}"

    echo "        +--------------------------------------------------------------+"
  echo ""

  else
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: message file ${abi_msg_file} not found" >&5
$as_echo "$as_me: WARNING: message file ${abi_msg_file} not found" >&2;}
  fi

      ;;

  esac


# Set OpenMP status reports
#
if test "${abi_openmp_enable}" = "yes"; then
  tmp_omp_collapse="${abi_omp_has_collapse}"
  tmp_omp_gpu_offload="${abi_omp_has_gpu_offload}"
else
  tmp_omp_collapse="ignored"
  tmp_omp_gpu_offload="ignored"
fi

# Set library-related status reports

# Linalg
#if test "${with_linalg_libs}" = ""; then
if test "${sd_linalg_flavor}" != "${sd_linalg_flavor_req}"; then
  tmp_rep_linalg_libs="auto-detected"
else
  tmp_rep_linalg_libs="user-defined"
fi
test "${sd_linalg_flavor}" = "netlib-fallback" && \
  tmp_rep_linalg_libs="internal"
test "${sd_linalg_flavor}" = "none" -o \
     "${sd_linalg_flavor}" = "netlib-fallback" && \
  tmp_rep_linalg_libs="ignored"

# FFT
if test "${sd_fft_init}" = "def"; then
  tmp_rep_fft_libs="auto-detected"
else
  tmp_rep_fft_libs="user-defined"
fi
test "${sd_fft_flavor}" = "none" && \
  tmp_rep_fft_libs="ignored"

# Display values of important configure options and ending message
cat <<EOF

Core build parameters
---------------------

  * C compiler        : ${abi_cc_vendor} version ${abi_cc_version}
  * Fortran compiler  : ${abi_fc_vendor} version ${abi_fc_version}
  * architecture      : ${abi_cpu_vendor} ${abi_cpu_model} (${abi_cpu_bits} bits)
  * debugging         : ${abi_debug_flavor}
  * optimizations     : ${abi_optim_flavor}

  * MPI    enabled    : ${abi_mpi_enable} (flavor: ${abi_mpi_flavor})
  * MPI    in-place   : ${abi_mpi_inplace_enable}
  * MPI-IO enabled    : ${abi_mpi_io_enable}
  * OpenMP enabled    : ${abi_openmp_enable} (collapse: ${tmp_omp_collapse}; GPU offload: ${tmp_omp_gpu_offload})
  * GPU    enabled    : ${abi_gpu_enable} (flavor: ${abi_gpu_flavor})

  * LibXML2 enabled   : ${abi_libxml2_enable}
  * LibPSML enabled   : ${sd_libpsml_enable}
  * XMLF90  enabled   : ${sd_xmlf90_enable}
  * HDF5 enabled      : ${sd_hdf5_enable} (MPI support: ${sd_hdf5_mpi_ok})
  * NetCDF enabled    : ${sd_netcdf_enable} (MPI support: ${sd_netcdf_mpi_ok})
  * NetCDF-F enabled  : ${sd_netcdf_fortran_enable} (MPI support: ${sd_netcdf_fortran_mpi_ok})

  * FFT flavor        : ${sd_fft_flavor} (libs: ${tmp_rep_fft_libs})
  * LINALG flavor     : ${sd_linalg_flavor} (libs: ${tmp_rep_linalg_libs})
  * SCALAPACK enabled : ${sd_linalg_has_scalapack}
  * ELPA enabled      : ${sd_linalg_has_elpa}
  * MAGMA enabled     : ${sd_linalg_has_magma} (magma version >= 1.5 ? ${sd_linalg_has_magma_15})

  * FCFLAGS           : ${FCFLAGS}
  * NVCC_CFLAGS       : ${NVCC_CFLAGS}
  * CPATH             : ${CPATH}

  * Build workflow    : ${abi_build_steps}

${abi_opt_deprecated_count} deprecated options have been used:${abi_opt_deprecated_used}.

Configuration complete.
You may now type "make" to build Abinit.
(or "make -j<n>", where <n> is the number of available processors)

EOF

