Configure modified so that it recognizes FFTW3 and FFT libraries from ACML.

Mostly untested. Support for external fftw v.2 removed.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@5228 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
giannozz 2008-10-18 14:40:51 +00:00
parent ba4cbb2a3d
commit 0b8cbf3b75
10 changed files with 298 additions and 1053 deletions

View File

@ -1,4 +1,8 @@
<<<<<<< BUGS
* PWCOND: a bug with some array bounds fixed (A. Smogunov)
=======
* CPV: array qv allocated in newd wasn't deallocated in all cases,
leading to either ia crash or a memory leak (Ralph)
@ -7,6 +11,7 @@
* PWCOND: a bug with some array bounds fixed (A. Smogunov)
>>>>>>> 1.41
* Problem with the generation of the atomic wavefunctions in the
projwfc code when a scalar relativistic PP is used with lspinorb=.true.

View File

@ -374,10 +374,10 @@
LOGICAL :: dofft( nfftx ), done
INTEGER, PARAMETER :: stdout = 6
#if defined __FFTW
#if defined __FFTW || defined __FFTW3
C_POINTER, SAVE :: fw_planx( ndims ) = 0, fw_plany( ndims ) = 0
C_POINTER, SAVE :: bw_planx( ndims ) = 0, bw_plany( ndims ) = 0
C_POINTER, SAVE :: fw_plan( 2, ndims ) = 0
C_POINTER, SAVE :: bw_plan( 2, ndims ) = 0
#elif defined __ACML
@ -387,11 +387,6 @@
COMPLEX (DP), SAVE :: fw_tablex( ltabl, ndims ), bw_tablex( ltabl, ndims )
COMPLEX (DP), SAVE :: fw_tabley( ltabl, ndims ), bw_tabley( ltabl, ndims )
#elif defined __FFTW3
C_POINTER, SAVE :: fw_plan( 2, ndims ) = 0
C_POINTER, SAVE :: bw_plan( 2, ndims ) = 0
#elif defined __ESSL || defined __LINUX_ESSL
INTEGER, PARAMETER :: ltabl = 20000 + 3 * nfftx
@ -459,15 +454,15 @@
#if defined __FFTW
IF( fw_plany( icurrent) /= 0 ) CALL DESTROY_PLAN_1D( fw_plany( icurrent) )
IF( bw_plany( icurrent) /= 0 ) CALL DESTROY_PLAN_1D( bw_plany( icurrent) )
idir = -1; CALL CREATE_PLAN_1D( fw_plany( icurrent), ny, idir)
idir = 1; CALL CREATE_PLAN_1D( bw_plany( icurrent), ny, idir)
IF( fw_plan( 2,icurrent) /= 0 ) CALL DESTROY_PLAN_1D( fw_plan( 2,icurrent) )
IF( bw_plan( 2,icurrent) /= 0 ) CALL DESTROY_PLAN_1D( bw_plan( 2,icurrent) )
idir = -1; CALL CREATE_PLAN_1D( fw_plan( 2,icurrent), ny, idir)
idir = 1; CALL CREATE_PLAN_1D( bw_plan( 2,icurrent), ny, idir)
IF( fw_planx( icurrent) /= 0 ) CALL DESTROY_PLAN_1D( fw_planx( icurrent) )
IF( bw_planx( icurrent) /= 0 ) CALL DESTROY_PLAN_1D( bw_planx( icurrent) )
idir = -1; CALL CREATE_PLAN_1D( fw_planx( icurrent), nx, idir)
idir = 1; CALL CREATE_PLAN_1D( bw_planx( icurrent), nx, idir)
IF( fw_plan( 1,icurrent) /= 0 ) CALL DESTROY_PLAN_1D( fw_plan( 1,icurrent) )
IF( bw_plan( 1,icurrent) /= 0 ) CALL DESTROY_PLAN_1D( bw_plan( 1,icurrent) )
idir = -1; CALL CREATE_PLAN_1D( fw_plan( 1,icurrent), nx, idir)
idir = 1; CALL CREATE_PLAN_1D( bw_plan( 1,icurrent), nx, idir)
#elif defined __ACML
@ -560,12 +555,12 @@
IF( isign < 0 ) THEN
CALL FFT_X_STICK( fw_planx(ip), r(1), nx, ny, nzl, ldx, ldy )
CALL FFT_X_STICK( fw_plan(1,ip), r(1), nx, ny, nzl, ldx, ldy )
do i = 1, nx
do k = 1, nzl
IF( dofft( i ) ) THEN
j = i + ldx*ldy * ( k - 1 )
call FFT_Y_STICK(fw_plany(ip), r(j), ny, ldx)
call FFT_Y_STICK(fw_plan(2,ip), r(j), ny, ldx)
END IF
end do
end do
@ -578,11 +573,11 @@
do k = 1, nzl
IF( dofft( i ) ) THEN
j = i + ldx*ldy * ( k - 1 )
call FFT_Y_STICK( bw_plany(ip), r(j), ny, ldx)
call FFT_Y_STICK( bw_plan(2,ip), r(j), ny, ldx)
END IF
end do
end do
CALL FFT_X_STICK( bw_planx(ip), r(1), nx, ny, nzl, ldx, ldy )
CALL FFT_X_STICK( bw_plan(1,ip), r(1), nx, ny, nzl, ldx, ldy )
END IF

View File

@ -9,16 +9,7 @@
#include "c_defs.h"
#if defined __FFTW
#if defined __USE_INTERNAL_FFTW
# include "fftw.c"
#else
# if defined __FFTW_WITH_SIZE
# include <dfftw.h>
# else
# include <fftw.h>
# endif
#endif
int F77_FUNC_ (create_plan_1d, CREATE_PLAN_1D)(fftw_plan *p, int *n, int *idir)
{

500
configure vendored
View File

@ -308,7 +308,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os F77 FFLAGS LDFLAGS ac_ct_F77 EXEEXT OBJEXT CC CFLAGS CPPFLAGS ac_ct_CC CPP EGREP SIZEOF_INT_P SET_MAKE FLIBS ranlib cc cflags dflags fdflags cpp cppflags f90 mpif90 f90flags f77 fflags fflags_noopt pre_fdflags imod iflags includefftw ld ldflags blas_libs lapack_libs fft_libs mpi_libs mass_libs pgplot_libs ar arflags arflags_dynamic f90rule blas_line lapack_line fft_line mpi_line mass_line parallel_report LIBOBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os F77 FFLAGS LDFLAGS ac_ct_F77 EXEEXT OBJEXT CC CFLAGS CPPFLAGS ac_ct_CC CPP EGREP SIZEOF_INT_P SET_MAKE FLIBS ranlib cc cflags dflags fdflags cpp cppflags f90 mpif90 f90flags f77 fflags fflags_noopt pre_fdflags imod iflags ld ldflags blas_libs lapack_libs fft_libs mpi_libs mass_libs pgplot_libs ar arflags arflags_dynamic f90rule blas_line lapack_line fft_line mpi_line mass_line parallel_report LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@ -1345,7 +1345,6 @@ libdirs=$LIBDIRS
ar=$AR
arflags=$ARFLAGS
arflags_dynamic=$ARFLAGS_DYNAMIC
includefftw=$INCLUDEFFTW
pgplot_libs=$PGPLOT_LIBS
# command-line arguments
@ -1662,7 +1661,7 @@ fi
# Provide some information about the compiler.
echo "$as_me:1665:" \
echo "$as_me:1664:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@ -2090,7 +2089,7 @@ fi
# Provide some information about the compiler.
echo "$as_me:2093:" \
echo "$as_me:2092:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@ -4166,7 +4165,7 @@ fi
# Provide some information about the compiler.
echo "$as_me:4169:" \
echo "$as_me:4168:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@ -4696,7 +4695,7 @@ _ACEOF
# flags.
ac_save_FFLAGS=$FFLAGS
FFLAGS="$FFLAGS $ac_verb"
(eval echo $as_me:4699: \"$ac_link\") >&5
(eval echo $as_me:4698: \"$ac_link\") >&5
ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
echo "$ac_f77_v_output" >&5
FFLAGS=$ac_save_FFLAGS
@ -4774,7 +4773,7 @@ _ACEOF
# flags.
ac_save_FFLAGS=$FFLAGS
FFLAGS="$FFLAGS $ac_cv_prog_f77_v"
(eval echo $as_me:4777: \"$ac_link\") >&5
(eval echo $as_me:4776: \"$ac_link\") >&5
ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
echo "$ac_f77_v_output" >&5
FFLAGS=$ac_save_FFLAGS
@ -5476,7 +5475,6 @@ have_lapack=0
have_essl=0
have_fft=0
have_fftw=0
have_fftw_h=0
have_mpi=0
# check for blas
@ -7778,9 +7776,10 @@ echo setting LAPACK_LIBS... $lapack_libs
# check for FFT libraries
# supported vendor replacements:
# essl on aix
# essl on aix and some IBM linux machines
# SUNperf on sparc
# internal version is used if none is found
# ASL/Mathkeisan on Nec
# acml on amd
if test "$fft_libs" = ""
then
# check directories in LD_LIBRARY_PATH too
@ -8435,76 +8434,23 @@ if test "$ac_cv_search_dcft" != no; then
fi
;;
esac
if test "$have_fft" -eq 0
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 for fftw (in several directories)
case "$f90" in
ifort* | ifc* )
try_libdirs="/usr/local/lib /cineca/prod/intel/lib" ;;
pgf* ) try_libdirs="/usr/local/lib /cineca/prod/pgi/lib" ;;
* ) try_libdirs="/usr/local/lib /cineca/prod/gnu/lib" ;;
esac
try_libdirs="$libdirs $try_libdirs $ld_library_path"
for dir in none $try_libdirs
do
unset ac_cv_search_fftwnd # clear cached value
if test "$dir" = "none"
then
try_loption=
else
echo $ECHO_N "in $dir: " $ECHO_C
try_loption="-L$dir"
fi
CFLAGS="$test_cflags"
CPPFLAGS="$test_cppflags"
LDFLAGS="$c_ldflags $try_loption"
LIBS="$fft_libs"
echo "$as_me:$LINENO: checking for library containing fftwnd" >&5
echo $ECHO_N "checking for library containing fftwnd... $ECHO_C" >&6
if test "${ac_cv_search_fftwnd+set}" = set; then
amd64:pgf* )
# check for acml
unset ac_cv_search_zfft1mx # clear cached value
FFLAGS="$test_fflags"
LDFLAGS="$test_ldflags"
LIBS="$fft_libs"
echo "$as_me:$LINENO: checking for library containing zfft1mx" >&5
echo $ECHO_N "checking for library containing zfft1mx... $ECHO_C" >&6
if test "${ac_cv_search_zfft1mx+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_func_search_save_LIBS=$LIBS
ac_cv_search_fftwnd=no
ac_cv_search_zfft1mx=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char fftwnd ();
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
fftwnd ();
;
return 0;
}
program main
call zfft1mx
end
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
@ -8515,7 +8461,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
{ ac_try='test -z "$ac_f77_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
@ -8528,7 +8474,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_search_fftwnd="none required"
ac_cv_search_zfft1mx="none required"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@ -8536,38 +8482,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test "$ac_cv_search_fftwnd" = no; then
for ac_lib in fftw; do
LIBS="-l$ac_lib -lm $ac_func_search_save_LIBS"
if test "$ac_cv_search_zfft1mx" = no; then
for ac_lib in acml; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char fftwnd ();
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
fftwnd ();
;
return 0;
}
program main
call zfft1mx
end
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
@ -8578,7 +8499,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
{ ac_try='test -z "$ac_f77_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
@ -8591,7 +8512,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_search_fftwnd="-l$ac_lib"
ac_cv_search_zfft1mx="-l$ac_lib"
break
else
echo "$as_me: failed program was:" >&5
@ -8604,79 +8525,55 @@ rm -f conftest.err conftest.$ac_objext \
fi
LIBS=$ac_func_search_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_search_fftwnd" >&5
echo "${ECHO_T}$ac_cv_search_fftwnd" >&6
if test "$ac_cv_search_fftwnd" != no; then
test "$ac_cv_search_fftwnd" = "none required" || LIBS="$ac_cv_search_fftwnd $LIBS"
have_fftw=1
fft_libs="$try_loption $LIBS"
echo "$as_me:$LINENO: result: $ac_cv_search_zfft1mx" >&5
echo "${ECHO_T}$ac_cv_search_zfft1mx" >&6
if test "$ac_cv_search_zfft1mx" != no; then
test "$ac_cv_search_zfft1mx" = "none required" || LIBS="$ac_cv_search_zfft1mx $LIBS"
have_fft=1 fft_libs="$LIBS"
fi
if test "$ac_cv_search_fftwnd" != "no"
then break ; fi
done
;;
esac
ac_ext=f
ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_f77_compiler_gnu
fi
fi
echo setting FFT_LIBS... $fft_libs
# final checks on available FFT libraries
if test "$have_fft" -eq 0
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 for fftw v.3 (in several directories)
case "$f90" in
ifort* | ifc* )
try_libdirs="/usr/local/lib /cineca/prod/intel/lib" ;;
pgf* ) try_libdirs="/usr/local/lib /cineca/prod/pgi/lib" ;;
* ) try_libdirs="/usr/local/lib /cineca/prod/gnu/lib" ;;
esac
try_libdirs="$libdirs $try_libdirs $ld_library_path"
try_dflags="$try_dflags -D__FFTW"
CFLAGS="$test_cflags"
LDFLAGS="$c_ldflags"
LIBS="$fft_libs"
echo "$as_me:$LINENO: checking for library containing fftwnd" >&5
echo $ECHO_N "checking for library containing fftwnd... $ECHO_C" >&6
if test "${ac_cv_search_fftwnd+set}" = set; then
for dir in none $try_libdirs
do
unset ac_cv_search_dfftw_execute_dft # clear cached value
if test "$dir" = "none"
then
try_loption=
else
echo $ECHO_N "in $dir: " $ECHO_C
try_loption="-L$dir"
fi
CFLAGS="$test_cflags"
CPPFLAGS="$test_cppflags"
LDFLAGS="$c_ldflags $try_loption"
LIBS="$fft_libs"
echo "$as_me:$LINENO: checking for library containing dfftw_execute_dft" >&5
echo $ECHO_N "checking for library containing dfftw_execute_dft... $ECHO_C" >&6
if test "${ac_cv_search_dfftw_execute_dft+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_func_search_save_LIBS=$LIBS
ac_cv_search_fftwnd=no
ac_cv_search_dfftw_execute_dft=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char fftwnd ();
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
fftwnd ();
;
return 0;
}
program main
call dfftw_execute_dft
end
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
@ -8687,7 +8584,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
{ ac_try='test -z "$ac_f77_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
@ -8700,7 +8597,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_search_fftwnd="none required"
ac_cv_search_dfftw_execute_dft="none required"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@ -8708,38 +8605,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test "$ac_cv_search_fftwnd" = no; then
for ac_lib in ""; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
if test "$ac_cv_search_dfftw_execute_dft" = no; then
for ac_lib in fftw3; do
LIBS="-l$ac_lib -lm $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char fftwnd ();
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
fftwnd ();
;
return 0;
}
program main
call dfftw_execute_dft
end
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
@ -8750,7 +8622,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
{ ac_try='test -z "$ac_f77_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
@ -8763,7 +8635,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_search_fftwnd="-l$ac_lib"
ac_cv_search_dfftw_execute_dft="-l$ac_lib"
break
else
echo "$as_me: failed program was:" >&5
@ -8776,208 +8648,28 @@ rm -f conftest.err conftest.$ac_objext \
fi
LIBS=$ac_func_search_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_search_fftwnd" >&5
echo "${ECHO_T}$ac_cv_search_fftwnd" >&6
if test "$ac_cv_search_fftwnd" != no; then
test "$ac_cv_search_fftwnd" = "none required" || LIBS="$ac_cv_search_fftwnd $LIBS"
echo "$as_me:$LINENO: result: $ac_cv_search_dfftw_execute_dft" >&5
echo "${ECHO_T}$ac_cv_search_dfftw_execute_dft" >&6
if test "$ac_cv_search_dfftw_execute_dft" != no; then
test "$ac_cv_search_dfftw_execute_dft" = "none required" || LIBS="$ac_cv_search_dfftw_execute_dft $LIBS"
have_fft=1 have_fftw=1
fft_libs="$try_loption $LIBS"
fi
# find location of fftw.h (if needed)
if test "$have_fftw" -ne 0
then
if test "$includefftw" = ""
if test "$ac_cv_search_dfftw_execute_dft" != "no"
then
# if libfftw is in /some/path/lib, then fftw.h is
# probably in /some/path/include
includefftw=`echo $fft_libs |
sed 's/.*-L\([^ ]*\) *-lfftw.*/\1/
s/lib/include/'`
try_dflags="$try_dflags -D__FFTW3"
break
fi
try_includedirs="$includefftw /usr/local/include \
/cineca/lib/fftw-2.1.3/fftw"
for dir in none $try_includedirs
do
unset ac_cv_header_fftw_h # clear cached value
if test "$dir" = "none"
then
try_ifftw=
else
echo $ECHO_N "in $dir: " $ECHO_C
try_ifftw="-I$dir"
fi
CFLAGS="$test_cflags $try_ifftw"
CPPFLAGS="$test_cppflags $try_ifftw"
LDFLAGS="$c_ldflags"
LIBS="$fft_libs"
includefftw="$try_ifftw"
if test "${ac_cv_header_fftw_h+set}" = set; then
echo "$as_me:$LINENO: checking for fftw.h" >&5
echo $ECHO_N "checking for fftw.h... $ECHO_C" >&6
if test "${ac_cv_header_fftw_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: $ac_cv_header_fftw_h" >&5
echo "${ECHO_T}$ac_cv_header_fftw_h" >&6
else
# Is the header compilable?
echo "$as_me:$LINENO: checking fftw.h usability" >&5
echo $ECHO_N "checking fftw.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <fftw.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6
# Is the header present?
echo "$as_me:$LINENO: checking fftw.h presence" >&5
echo $ECHO_N "checking fftw.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <fftw.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
else
ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: fftw.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: fftw.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: fftw.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: fftw.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: fftw.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: fftw.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: fftw.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: fftw.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: fftw.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: fftw.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: fftw.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: fftw.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: fftw.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: fftw.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: fftw.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: fftw.h: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## ----------------------------------- ##
## Report this to the ESPRESSO lists. ##
## ----------------------------------- ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
;;
esac
echo "$as_me:$LINENO: checking for fftw.h" >&5
echo $ECHO_N "checking for fftw.h... $ECHO_C" >&6
if test "${ac_cv_header_fftw_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_fftw_h=$ac_header_preproc
fi
echo "$as_me:$LINENO: result: $ac_cv_header_fftw_h" >&5
echo "${ECHO_T}$ac_cv_header_fftw_h" >&6
done
fi
if test $ac_cv_header_fftw_h = yes; then
have_fftw_h=1
try_iflags="$try_iflags $try_ifftw"
fi
if test "$ac_cv_header_fftw_h" != "no"
then break ; fi
done
fi
# if no valid FFT library was found, use the local copy
if test "$have_fft" -eq 0
then
try_dflags="$try_dflags -D__USE_INTERNAL_FFTW"
fi
if test "$have_fftw" -ne 0 && test "$have_fftw_h" -eq 0
then
try_dflags="$try_dflags -D__USE_INTERNAL_FFTW"
{ echo "$as_me:$LINENO: WARNING: fftw library detected, but fftw.h not found" >&5
echo "$as_me: WARNING: fftw library detected, but fftw.h not found" >&2;}
fi
ac_ext=f
ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_f77_compiler_gnu
echo setting FFT_LIBS... $fft_libs
# if no valid FFT library was found, use the local copy
if test "$have_fft" -eq 0
then
try_dflags="$try_dflags -D__FFTW"
fi
F77=$f90
@ -9922,12 +9614,6 @@ echo setting RANLIB... $ranlib
blas_line="BLAS_LIBS=$blas_libs"
lapack_line="LAPACK_LIBS=$lapack_libs"
fft_line="FFT_LIBS=$fft_libs"
if test "$have_fft" -ne 0 && test "$have_fftw" -ne 0 &&
test "$have_fftw_h" -eq 0
then
fft_line="$fft_line FFT_LIBS=$fft_libs\\
WARNING: fftw library detected, but fftw.h not found"
fi
if test "$mpi_libs" != "" ; then mpi_line="MPI_LIBS=$mpi_libs"
else mpi_line="@delete@" ; fi
if test "$arch" = "aix" ; then mass_line="MASS_LIBS=$mass_libs"
@ -9982,7 +9668,6 @@ fi
ac_config_headers="$ac_config_headers include/c_defs.h:include/c_defs.h.in"
@ -10639,7 +10324,6 @@ s,@fflags_noopt@,$fflags_noopt,;t t
s,@pre_fdflags@,$pre_fdflags,;t t
s,@imod@,$imod,;t t
s,@iflags@,$iflags,;t t
s,@includefftw@,$includefftw,;t t
s,@ld@,$ld,;t t
s,@ldflags@,$ldflags,;t t
s,@blas_libs@,$blas_libs,;t t

View File

@ -36,7 +36,6 @@ libdirs=$LIBDIRS
ar=$AR
arflags=$ARFLAGS
arflags_dynamic=$ARFLAGS_DYNAMIC
includefftw=$INCLUDEFFTW
pgplot_libs=$PGPLOT_LIBS
# command-line arguments
@ -701,7 +700,6 @@ have_lapack=0
have_essl=0
have_fft=0
have_fftw=0
have_fftw_h=0
have_mpi=0
# check for blas
@ -1183,9 +1181,10 @@ echo setting LAPACK_LIBS... $lapack_libs
# check for FFT libraries
# supported vendor replacements:
# essl on aix
# essl on aix and some IBM linux machines
# SUNperf on sparc
# internal version is used if none is found
# ASL/Mathkeisan on Nec
# acml on amd
if test "$fft_libs" = ""
then
# check directories in LD_LIBRARY_PATH too
@ -1294,107 +1293,60 @@ then
LIBS="$fft_libs"
AC_SEARCH_LIBS(dcft, essl, have_fft=1 fft_libs="$LIBS")
;;
amd64:pgf* )
# check for acml
unset ac_cv_search_zfft1mx # clear cached value
FFLAGS="$test_fflags"
LDFLAGS="$test_ldflags"
LIBS="$fft_libs"
AC_SEARCH_LIBS(zfft1mx, acml, have_fft=1 fft_libs="$LIBS")
;;
esac
if test "$have_fft" -eq 0
then
AC_LANG_PUSH(C)
# check for fftw (in several directories)
case "$f90" in
ifort* | ifc* )
try_libdirs="/usr/local/lib /cineca/prod/intel/lib" ;;
pgf* ) try_libdirs="/usr/local/lib /cineca/prod/pgi/lib" ;;
* ) try_libdirs="/usr/local/lib /cineca/prod/gnu/lib" ;;
esac
try_libdirs="$libdirs $try_libdirs $ld_library_path"
for dir in none $try_libdirs
do
unset ac_cv_search_fftwnd # clear cached value
if test "$dir" = "none"
then
try_loption=
else
echo $ECHO_N "in $dir: " $ECHO_C
try_loption="-L$dir"
fi
CFLAGS="$test_cflags"
CPPFLAGS="$test_cppflags"
LDFLAGS="$c_ldflags $try_loption"
LIBS="$fft_libs"
AC_SEARCH_LIBS(fftwnd, fftw, have_fftw=1
fft_libs="$try_loption $LIBS", , -lm)
if test "$ac_cv_search_fftwnd" != "no"
then break ; fi
done
AC_LANG_POP(C)
fi
fi
echo setting FFT_LIBS... $fft_libs
# final checks on available FFT libraries
if test "$have_fft" -eq 0
then
AC_LANG_PUSH(C)
try_dflags="$try_dflags -D__FFTW"
# check for fftw v.3 (in several directories)
case "$f90" in
ifort* | ifc* )
try_libdirs="/usr/local/lib /cineca/prod/intel/lib" ;;
pgf* ) try_libdirs="/usr/local/lib /cineca/prod/pgi/lib" ;;
* ) try_libdirs="/usr/local/lib /cineca/prod/gnu/lib" ;;
esac
try_libdirs="$libdirs $try_libdirs $ld_library_path"
CFLAGS="$test_cflags"
LDFLAGS="$c_ldflags"
LIBS="$fft_libs"
AC_SEARCH_LIBS(fftwnd, "", have_fft=1 have_fftw=1)
# find location of fftw.h (if needed)
if test "$have_fftw" -ne 0
then
if test "$includefftw" = ""
for dir in none $try_libdirs
do
unset ac_cv_search_dfftw_execute_dft # clear cached value
if test "$dir" = "none"
then
# if libfftw is in /some/path/lib, then fftw.h is
# probably in /some/path/include
includefftw=`echo $fft_libs |
sed 's/.*-L\([[^ ]]*\) *-lfftw.*/\1/
s/lib/include/'`
try_loption=
else
echo $ECHO_N "in $dir: " $ECHO_C
try_loption="-L$dir"
fi
try_includedirs="$includefftw /usr/local/include \
/cineca/lib/fftw-2.1.3/fftw"
for dir in none $try_includedirs
do
unset ac_cv_header_fftw_h # clear cached value
if test "$dir" = "none"
then
try_ifftw=
else
echo $ECHO_N "in $dir: " $ECHO_C
try_ifftw="-I$dir"
fi
CFLAGS="$test_cflags $try_ifftw"
CPPFLAGS="$test_cppflags $try_ifftw"
LDFLAGS="$c_ldflags"
LIBS="$fft_libs"
includefftw="$try_ifftw"
AC_CHECK_HEADER(fftw.h, have_fftw_h=1
try_iflags="$try_iflags $try_ifftw")
if test "$ac_cv_header_fftw_h" != "no"
then break ; fi
done
fi
CFLAGS="$test_cflags"
CPPFLAGS="$test_cppflags"
LDFLAGS="$c_ldflags $try_loption"
LIBS="$fft_libs"
AC_SEARCH_LIBS(dfftw_execute_dft, fftw3, have_fft=1 have_fftw=1
fft_libs="$try_loption $LIBS", , -lm)
if test "$ac_cv_search_dfftw_execute_dft" != "no"
then
try_dflags="$try_dflags -D__FFTW3"
break
fi
done
# if no valid FFT library was found, use the local copy
if test "$have_fft" -eq 0
then
try_dflags="$try_dflags -D__USE_INTERNAL_FFTW"
fi
fi
echo setting FFT_LIBS... $fft_libs
if test "$have_fftw" -ne 0 && test "$have_fftw_h" -eq 0
then
try_dflags="$try_dflags -D__USE_INTERNAL_FFTW"
AC_MSG_WARN([fftw library detected, but fftw.h not found])
fi
AC_LANG_POP(C)
# if no valid FFT library was found, use the local copy
if test "$have_fft" -eq 0
then
try_dflags="$try_dflags -D__FFTW"
fi
F77=$f90
@ -1559,12 +1511,6 @@ echo setting RANLIB... $ranlib
blas_line="BLAS_LIBS=$blas_libs"
lapack_line="LAPACK_LIBS=$lapack_libs"
fft_line="FFT_LIBS=$fft_libs"
if test "$have_fft" -ne 0 && test "$have_fftw" -ne 0 &&
test "$have_fftw_h" -eq 0
then
fft_line="$fft_line FFT_LIBS=$fft_libs\\
WARNING: fftw library detected, but fftw.h not found"
fi
if test "$mpi_libs" != "" ; then mpi_line="MPI_LIBS=$mpi_libs"
else mpi_line="@delete@" ; fi
if test "$arch" = "aix" ; then mass_line="MASS_LIBS=$mass_libs"
@ -1601,7 +1547,6 @@ AC_SUBST(fflags_noopt)
AC_SUBST(pre_fdflags)
AC_SUBST(imod)
AC_SUBST(iflags)
AC_SUBST(includefftw)
AC_SUBST(ld)
AC_SUBST(ldflags)
AC_SUBST(blas_libs)

View File

@ -85,10 +85,8 @@ Parallel execution:
__MPI Use MPI library
__SHMEM Use Shared Memory library (only Altix and Origin)
Libraries:
__FFTW FFT routines from the FFTW library
__FFTW3 as above, version 3
__USE_INTERNAL_FFTW use the local copy of FFTW, not an external lib
__FFTW_WITH_SIZE fftw specific option for cray xt3 (?)
__FFTW FFT routines from internal FFTW library
__FFTW3 FFT routines from external FFTW v.3 library
__SCSL FFT routines from SGI SCSL scientific library
__SUNPERF FFT routines from SUN sunperf scientific library
__ESSL use blas/lapack/fft routines from IBM ESSL library

500
install/configure vendored
View File

@ -308,7 +308,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os F77 FFLAGS LDFLAGS ac_ct_F77 EXEEXT OBJEXT CC CFLAGS CPPFLAGS ac_ct_CC CPP EGREP SIZEOF_INT_P SET_MAKE FLIBS ranlib cc cflags dflags fdflags cpp cppflags f90 mpif90 f90flags f77 fflags fflags_noopt pre_fdflags imod iflags includefftw ld ldflags blas_libs lapack_libs fft_libs mpi_libs mass_libs pgplot_libs ar arflags arflags_dynamic f90rule blas_line lapack_line fft_line mpi_line mass_line parallel_report LIBOBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os F77 FFLAGS LDFLAGS ac_ct_F77 EXEEXT OBJEXT CC CFLAGS CPPFLAGS ac_ct_CC CPP EGREP SIZEOF_INT_P SET_MAKE FLIBS ranlib cc cflags dflags fdflags cpp cppflags f90 mpif90 f90flags f77 fflags fflags_noopt pre_fdflags imod iflags ld ldflags blas_libs lapack_libs fft_libs mpi_libs mass_libs pgplot_libs ar arflags arflags_dynamic f90rule blas_line lapack_line fft_line mpi_line mass_line parallel_report LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@ -1345,7 +1345,6 @@ libdirs=$LIBDIRS
ar=$AR
arflags=$ARFLAGS
arflags_dynamic=$ARFLAGS_DYNAMIC
includefftw=$INCLUDEFFTW
pgplot_libs=$PGPLOT_LIBS
# command-line arguments
@ -1662,7 +1661,7 @@ fi
# Provide some information about the compiler.
echo "$as_me:1665:" \
echo "$as_me:1664:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@ -2090,7 +2089,7 @@ fi
# Provide some information about the compiler.
echo "$as_me:2093:" \
echo "$as_me:2092:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@ -4166,7 +4165,7 @@ fi
# Provide some information about the compiler.
echo "$as_me:4169:" \
echo "$as_me:4168:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@ -4696,7 +4695,7 @@ _ACEOF
# flags.
ac_save_FFLAGS=$FFLAGS
FFLAGS="$FFLAGS $ac_verb"
(eval echo $as_me:4699: \"$ac_link\") >&5
(eval echo $as_me:4698: \"$ac_link\") >&5
ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
echo "$ac_f77_v_output" >&5
FFLAGS=$ac_save_FFLAGS
@ -4774,7 +4773,7 @@ _ACEOF
# flags.
ac_save_FFLAGS=$FFLAGS
FFLAGS="$FFLAGS $ac_cv_prog_f77_v"
(eval echo $as_me:4777: \"$ac_link\") >&5
(eval echo $as_me:4776: \"$ac_link\") >&5
ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
echo "$ac_f77_v_output" >&5
FFLAGS=$ac_save_FFLAGS
@ -5476,7 +5475,6 @@ have_lapack=0
have_essl=0
have_fft=0
have_fftw=0
have_fftw_h=0
have_mpi=0
# check for blas
@ -7778,9 +7776,10 @@ echo setting LAPACK_LIBS... $lapack_libs
# check for FFT libraries
# supported vendor replacements:
# essl on aix
# essl on aix and some IBM linux machines
# SUNperf on sparc
# internal version is used if none is found
# ASL/Mathkeisan on Nec
# acml on amd
if test "$fft_libs" = ""
then
# check directories in LD_LIBRARY_PATH too
@ -8435,76 +8434,23 @@ if test "$ac_cv_search_dcft" != no; then
fi
;;
esac
if test "$have_fft" -eq 0
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 for fftw (in several directories)
case "$f90" in
ifort* | ifc* )
try_libdirs="/usr/local/lib /cineca/prod/intel/lib" ;;
pgf* ) try_libdirs="/usr/local/lib /cineca/prod/pgi/lib" ;;
* ) try_libdirs="/usr/local/lib /cineca/prod/gnu/lib" ;;
esac
try_libdirs="$libdirs $try_libdirs $ld_library_path"
for dir in none $try_libdirs
do
unset ac_cv_search_fftwnd # clear cached value
if test "$dir" = "none"
then
try_loption=
else
echo $ECHO_N "in $dir: " $ECHO_C
try_loption="-L$dir"
fi
CFLAGS="$test_cflags"
CPPFLAGS="$test_cppflags"
LDFLAGS="$c_ldflags $try_loption"
LIBS="$fft_libs"
echo "$as_me:$LINENO: checking for library containing fftwnd" >&5
echo $ECHO_N "checking for library containing fftwnd... $ECHO_C" >&6
if test "${ac_cv_search_fftwnd+set}" = set; then
amd64:pgf* )
# check for acml
unset ac_cv_search_zfft1mx # clear cached value
FFLAGS="$test_fflags"
LDFLAGS="$test_ldflags"
LIBS="$fft_libs"
echo "$as_me:$LINENO: checking for library containing zfft1mx" >&5
echo $ECHO_N "checking for library containing zfft1mx... $ECHO_C" >&6
if test "${ac_cv_search_zfft1mx+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_func_search_save_LIBS=$LIBS
ac_cv_search_fftwnd=no
ac_cv_search_zfft1mx=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char fftwnd ();
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
fftwnd ();
;
return 0;
}
program main
call zfft1mx
end
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
@ -8515,7 +8461,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
{ ac_try='test -z "$ac_f77_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
@ -8528,7 +8474,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_search_fftwnd="none required"
ac_cv_search_zfft1mx="none required"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@ -8536,38 +8482,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test "$ac_cv_search_fftwnd" = no; then
for ac_lib in fftw; do
LIBS="-l$ac_lib -lm $ac_func_search_save_LIBS"
if test "$ac_cv_search_zfft1mx" = no; then
for ac_lib in acml; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char fftwnd ();
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
fftwnd ();
;
return 0;
}
program main
call zfft1mx
end
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
@ -8578,7 +8499,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
{ ac_try='test -z "$ac_f77_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
@ -8591,7 +8512,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_search_fftwnd="-l$ac_lib"
ac_cv_search_zfft1mx="-l$ac_lib"
break
else
echo "$as_me: failed program was:" >&5
@ -8604,79 +8525,55 @@ rm -f conftest.err conftest.$ac_objext \
fi
LIBS=$ac_func_search_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_search_fftwnd" >&5
echo "${ECHO_T}$ac_cv_search_fftwnd" >&6
if test "$ac_cv_search_fftwnd" != no; then
test "$ac_cv_search_fftwnd" = "none required" || LIBS="$ac_cv_search_fftwnd $LIBS"
have_fftw=1
fft_libs="$try_loption $LIBS"
echo "$as_me:$LINENO: result: $ac_cv_search_zfft1mx" >&5
echo "${ECHO_T}$ac_cv_search_zfft1mx" >&6
if test "$ac_cv_search_zfft1mx" != no; then
test "$ac_cv_search_zfft1mx" = "none required" || LIBS="$ac_cv_search_zfft1mx $LIBS"
have_fft=1 fft_libs="$LIBS"
fi
if test "$ac_cv_search_fftwnd" != "no"
then break ; fi
done
;;
esac
ac_ext=f
ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_f77_compiler_gnu
fi
fi
echo setting FFT_LIBS... $fft_libs
# final checks on available FFT libraries
if test "$have_fft" -eq 0
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 for fftw v.3 (in several directories)
case "$f90" in
ifort* | ifc* )
try_libdirs="/usr/local/lib /cineca/prod/intel/lib" ;;
pgf* ) try_libdirs="/usr/local/lib /cineca/prod/pgi/lib" ;;
* ) try_libdirs="/usr/local/lib /cineca/prod/gnu/lib" ;;
esac
try_libdirs="$libdirs $try_libdirs $ld_library_path"
try_dflags="$try_dflags -D__FFTW"
CFLAGS="$test_cflags"
LDFLAGS="$c_ldflags"
LIBS="$fft_libs"
echo "$as_me:$LINENO: checking for library containing fftwnd" >&5
echo $ECHO_N "checking for library containing fftwnd... $ECHO_C" >&6
if test "${ac_cv_search_fftwnd+set}" = set; then
for dir in none $try_libdirs
do
unset ac_cv_search_dfftw_execute_dft # clear cached value
if test "$dir" = "none"
then
try_loption=
else
echo $ECHO_N "in $dir: " $ECHO_C
try_loption="-L$dir"
fi
CFLAGS="$test_cflags"
CPPFLAGS="$test_cppflags"
LDFLAGS="$c_ldflags $try_loption"
LIBS="$fft_libs"
echo "$as_me:$LINENO: checking for library containing dfftw_execute_dft" >&5
echo $ECHO_N "checking for library containing dfftw_execute_dft... $ECHO_C" >&6
if test "${ac_cv_search_dfftw_execute_dft+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_func_search_save_LIBS=$LIBS
ac_cv_search_fftwnd=no
ac_cv_search_dfftw_execute_dft=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char fftwnd ();
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
fftwnd ();
;
return 0;
}
program main
call dfftw_execute_dft
end
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
@ -8687,7 +8584,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
{ ac_try='test -z "$ac_f77_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
@ -8700,7 +8597,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_search_fftwnd="none required"
ac_cv_search_dfftw_execute_dft="none required"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@ -8708,38 +8605,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test "$ac_cv_search_fftwnd" = no; then
for ac_lib in ""; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
if test "$ac_cv_search_dfftw_execute_dft" = no; then
for ac_lib in fftw3; do
LIBS="-l$ac_lib -lm $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char fftwnd ();
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
fftwnd ();
;
return 0;
}
program main
call dfftw_execute_dft
end
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
@ -8750,7 +8622,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
{ ac_try='test -z "$ac_f77_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
@ -8763,7 +8635,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_search_fftwnd="-l$ac_lib"
ac_cv_search_dfftw_execute_dft="-l$ac_lib"
break
else
echo "$as_me: failed program was:" >&5
@ -8776,208 +8648,28 @@ rm -f conftest.err conftest.$ac_objext \
fi
LIBS=$ac_func_search_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_search_fftwnd" >&5
echo "${ECHO_T}$ac_cv_search_fftwnd" >&6
if test "$ac_cv_search_fftwnd" != no; then
test "$ac_cv_search_fftwnd" = "none required" || LIBS="$ac_cv_search_fftwnd $LIBS"
echo "$as_me:$LINENO: result: $ac_cv_search_dfftw_execute_dft" >&5
echo "${ECHO_T}$ac_cv_search_dfftw_execute_dft" >&6
if test "$ac_cv_search_dfftw_execute_dft" != no; then
test "$ac_cv_search_dfftw_execute_dft" = "none required" || LIBS="$ac_cv_search_dfftw_execute_dft $LIBS"
have_fft=1 have_fftw=1
fft_libs="$try_loption $LIBS"
fi
# find location of fftw.h (if needed)
if test "$have_fftw" -ne 0
then
if test "$includefftw" = ""
if test "$ac_cv_search_dfftw_execute_dft" != "no"
then
# if libfftw is in /some/path/lib, then fftw.h is
# probably in /some/path/include
includefftw=`echo $fft_libs |
sed 's/.*-L\([^ ]*\) *-lfftw.*/\1/
s/lib/include/'`
try_dflags="$try_dflags -D__FFTW3"
break
fi
try_includedirs="$includefftw /usr/local/include \
/cineca/lib/fftw-2.1.3/fftw"
for dir in none $try_includedirs
do
unset ac_cv_header_fftw_h # clear cached value
if test "$dir" = "none"
then
try_ifftw=
else
echo $ECHO_N "in $dir: " $ECHO_C
try_ifftw="-I$dir"
fi
CFLAGS="$test_cflags $try_ifftw"
CPPFLAGS="$test_cppflags $try_ifftw"
LDFLAGS="$c_ldflags"
LIBS="$fft_libs"
includefftw="$try_ifftw"
if test "${ac_cv_header_fftw_h+set}" = set; then
echo "$as_me:$LINENO: checking for fftw.h" >&5
echo $ECHO_N "checking for fftw.h... $ECHO_C" >&6
if test "${ac_cv_header_fftw_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: $ac_cv_header_fftw_h" >&5
echo "${ECHO_T}$ac_cv_header_fftw_h" >&6
else
# Is the header compilable?
echo "$as_me:$LINENO: checking fftw.h usability" >&5
echo $ECHO_N "checking fftw.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <fftw.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6
# Is the header present?
echo "$as_me:$LINENO: checking fftw.h presence" >&5
echo $ECHO_N "checking fftw.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <fftw.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
else
ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: fftw.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: fftw.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: fftw.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: fftw.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: fftw.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: fftw.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: fftw.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: fftw.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: fftw.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: fftw.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: fftw.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: fftw.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: fftw.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: fftw.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: fftw.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: fftw.h: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## ----------------------------------- ##
## Report this to the ESPRESSO lists. ##
## ----------------------------------- ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
;;
esac
echo "$as_me:$LINENO: checking for fftw.h" >&5
echo $ECHO_N "checking for fftw.h... $ECHO_C" >&6
if test "${ac_cv_header_fftw_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_fftw_h=$ac_header_preproc
fi
echo "$as_me:$LINENO: result: $ac_cv_header_fftw_h" >&5
echo "${ECHO_T}$ac_cv_header_fftw_h" >&6
done
fi
if test $ac_cv_header_fftw_h = yes; then
have_fftw_h=1
try_iflags="$try_iflags $try_ifftw"
fi
if test "$ac_cv_header_fftw_h" != "no"
then break ; fi
done
fi
# if no valid FFT library was found, use the local copy
if test "$have_fft" -eq 0
then
try_dflags="$try_dflags -D__USE_INTERNAL_FFTW"
fi
if test "$have_fftw" -ne 0 && test "$have_fftw_h" -eq 0
then
try_dflags="$try_dflags -D__USE_INTERNAL_FFTW"
{ echo "$as_me:$LINENO: WARNING: fftw library detected, but fftw.h not found" >&5
echo "$as_me: WARNING: fftw library detected, but fftw.h not found" >&2;}
fi
ac_ext=f
ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_f77_compiler_gnu
echo setting FFT_LIBS... $fft_libs
# if no valid FFT library was found, use the local copy
if test "$have_fft" -eq 0
then
try_dflags="$try_dflags -D__FFTW"
fi
F77=$f90
@ -9922,12 +9614,6 @@ echo setting RANLIB... $ranlib
blas_line="BLAS_LIBS=$blas_libs"
lapack_line="LAPACK_LIBS=$lapack_libs"
fft_line="FFT_LIBS=$fft_libs"
if test "$have_fft" -ne 0 && test "$have_fftw" -ne 0 &&
test "$have_fftw_h" -eq 0
then
fft_line="$fft_line FFT_LIBS=$fft_libs\\
WARNING: fftw library detected, but fftw.h not found"
fi
if test "$mpi_libs" != "" ; then mpi_line="MPI_LIBS=$mpi_libs"
else mpi_line="@delete@" ; fi
if test "$arch" = "aix" ; then mass_line="MASS_LIBS=$mass_libs"
@ -9982,7 +9668,6 @@ fi
ac_config_headers="$ac_config_headers include/c_defs.h:include/c_defs.h.in"
@ -10639,7 +10324,6 @@ s,@fflags_noopt@,$fflags_noopt,;t t
s,@pre_fdflags@,$pre_fdflags,;t t
s,@imod@,$imod,;t t
s,@iflags@,$iflags,;t t
s,@includefftw@,$includefftw,;t t
s,@ld@,$ld,;t t
s,@ldflags@,$ldflags,;t t
s,@blas_libs@,$blas_libs,;t t

View File

@ -36,7 +36,6 @@ libdirs=$LIBDIRS
ar=$AR
arflags=$ARFLAGS
arflags_dynamic=$ARFLAGS_DYNAMIC
includefftw=$INCLUDEFFTW
pgplot_libs=$PGPLOT_LIBS
# command-line arguments
@ -701,7 +700,6 @@ have_lapack=0
have_essl=0
have_fft=0
have_fftw=0
have_fftw_h=0
have_mpi=0
# check for blas
@ -1183,9 +1181,10 @@ echo setting LAPACK_LIBS... $lapack_libs
# check for FFT libraries
# supported vendor replacements:
# essl on aix
# essl on aix and some IBM linux machines
# SUNperf on sparc
# internal version is used if none is found
# ASL/Mathkeisan on Nec
# acml on amd
if test "$fft_libs" = ""
then
# check directories in LD_LIBRARY_PATH too
@ -1294,107 +1293,60 @@ then
LIBS="$fft_libs"
AC_SEARCH_LIBS(dcft, essl, have_fft=1 fft_libs="$LIBS")
;;
amd64:pgf* )
# check for acml
unset ac_cv_search_zfft1mx # clear cached value
FFLAGS="$test_fflags"
LDFLAGS="$test_ldflags"
LIBS="$fft_libs"
AC_SEARCH_LIBS(zfft1mx, acml, have_fft=1 fft_libs="$LIBS")
;;
esac
if test "$have_fft" -eq 0
then
AC_LANG_PUSH(C)
# check for fftw (in several directories)
case "$f90" in
ifort* | ifc* )
try_libdirs="/usr/local/lib /cineca/prod/intel/lib" ;;
pgf* ) try_libdirs="/usr/local/lib /cineca/prod/pgi/lib" ;;
* ) try_libdirs="/usr/local/lib /cineca/prod/gnu/lib" ;;
esac
try_libdirs="$libdirs $try_libdirs $ld_library_path"
for dir in none $try_libdirs
do
unset ac_cv_search_fftwnd # clear cached value
if test "$dir" = "none"
then
try_loption=
else
echo $ECHO_N "in $dir: " $ECHO_C
try_loption="-L$dir"
fi
CFLAGS="$test_cflags"
CPPFLAGS="$test_cppflags"
LDFLAGS="$c_ldflags $try_loption"
LIBS="$fft_libs"
AC_SEARCH_LIBS(fftwnd, fftw, have_fftw=1
fft_libs="$try_loption $LIBS", , -lm)
if test "$ac_cv_search_fftwnd" != "no"
then break ; fi
done
AC_LANG_POP(C)
fi
fi
echo setting FFT_LIBS... $fft_libs
# final checks on available FFT libraries
if test "$have_fft" -eq 0
then
AC_LANG_PUSH(C)
try_dflags="$try_dflags -D__FFTW"
# check for fftw v.3 (in several directories)
case "$f90" in
ifort* | ifc* )
try_libdirs="/usr/local/lib /cineca/prod/intel/lib" ;;
pgf* ) try_libdirs="/usr/local/lib /cineca/prod/pgi/lib" ;;
* ) try_libdirs="/usr/local/lib /cineca/prod/gnu/lib" ;;
esac
try_libdirs="$libdirs $try_libdirs $ld_library_path"
CFLAGS="$test_cflags"
LDFLAGS="$c_ldflags"
LIBS="$fft_libs"
AC_SEARCH_LIBS(fftwnd, "", have_fft=1 have_fftw=1)
# find location of fftw.h (if needed)
if test "$have_fftw" -ne 0
then
if test "$includefftw" = ""
for dir in none $try_libdirs
do
unset ac_cv_search_dfftw_execute_dft # clear cached value
if test "$dir" = "none"
then
# if libfftw is in /some/path/lib, then fftw.h is
# probably in /some/path/include
includefftw=`echo $fft_libs |
sed 's/.*-L\([[^ ]]*\) *-lfftw.*/\1/
s/lib/include/'`
try_loption=
else
echo $ECHO_N "in $dir: " $ECHO_C
try_loption="-L$dir"
fi
try_includedirs="$includefftw /usr/local/include \
/cineca/lib/fftw-2.1.3/fftw"
for dir in none $try_includedirs
do
unset ac_cv_header_fftw_h # clear cached value
if test "$dir" = "none"
then
try_ifftw=
else
echo $ECHO_N "in $dir: " $ECHO_C
try_ifftw="-I$dir"
fi
CFLAGS="$test_cflags $try_ifftw"
CPPFLAGS="$test_cppflags $try_ifftw"
LDFLAGS="$c_ldflags"
LIBS="$fft_libs"
includefftw="$try_ifftw"
AC_CHECK_HEADER(fftw.h, have_fftw_h=1
try_iflags="$try_iflags $try_ifftw")
if test "$ac_cv_header_fftw_h" != "no"
then break ; fi
done
fi
CFLAGS="$test_cflags"
CPPFLAGS="$test_cppflags"
LDFLAGS="$c_ldflags $try_loption"
LIBS="$fft_libs"
AC_SEARCH_LIBS(dfftw_execute_dft, fftw3, have_fft=1 have_fftw=1
fft_libs="$try_loption $LIBS", , -lm)
if test "$ac_cv_search_dfftw_execute_dft" != "no"
then
try_dflags="$try_dflags -D__FFTW3"
break
fi
done
# if no valid FFT library was found, use the local copy
if test "$have_fft" -eq 0
then
try_dflags="$try_dflags -D__USE_INTERNAL_FFTW"
fi
fi
echo setting FFT_LIBS... $fft_libs
if test "$have_fftw" -ne 0 && test "$have_fftw_h" -eq 0
then
try_dflags="$try_dflags -D__USE_INTERNAL_FFTW"
AC_MSG_WARN([fftw library detected, but fftw.h not found])
fi
AC_LANG_POP(C)
# if no valid FFT library was found, use the local copy
if test "$have_fft" -eq 0
then
try_dflags="$try_dflags -D__FFTW"
fi
F77=$f90
@ -1559,12 +1511,6 @@ echo setting RANLIB... $ranlib
blas_line="BLAS_LIBS=$blas_libs"
lapack_line="LAPACK_LIBS=$lapack_libs"
fft_line="FFT_LIBS=$fft_libs"
if test "$have_fft" -ne 0 && test "$have_fftw" -ne 0 &&
test "$have_fftw_h" -eq 0
then
fft_line="$fft_line FFT_LIBS=$fft_libs\\
WARNING: fftw library detected, but fftw.h not found"
fi
if test "$mpi_libs" != "" ; then mpi_line="MPI_LIBS=$mpi_libs"
else mpi_line="@delete@" ; fi
if test "$arch" = "aix" ; then mass_line="MASS_LIBS=$mass_libs"
@ -1601,7 +1547,6 @@ AC_SUBST(fflags_noopt)
AC_SUBST(pre_fdflags)
AC_SUBST(imod)
AC_SUBST(iflags)
AC_SUBST(includefftw)
AC_SUBST(ld)
AC_SUBST(ldflags)
AC_SUBST(blas_libs)

View File

@ -36,9 +36,8 @@ FDFLAGS = @fdflags@
# IFLAGS = how to locate directories where files to be included are
# In most cases, IFLAGS = -I../include
# If loading an external FFTW library, add the location of FFTW include files
IFLAGS = @iflags@ @includefftw@
IFLAGS = @iflags@
# MODFLAGS = flag used by f90 compiler to locate modules
# You need to search for modules in ./, in ../iotk/src, in ../Modules

View File

@ -36,9 +36,8 @@ FDFLAGS = @fdflags@
# IFLAGS = how to locate directories where files to be included are
# In most cases, IFLAGS = -I../include
# If loading an external FFTW library, add the location of FFTW include files
IFLAGS = @iflags@ @includefftw@
IFLAGS = @iflags@
# MODFLAGS = flag used by f90 compiler to locate modules
# You need to search for modules in ./, in ../iotk/src, in ../Modules