[PATCH] switch to --with-fft=...
Nathan (Jasper) Myers
ncm at codesourcery.com
Tue Sep 20 00:55:07 UTC 2005
I have checked in the patch below. Your VSIPL++ "configure" command
lines must change accordingly. In particular,
--enable-fftw3 => --with-fft=fftw3
--enable-fftw2 --disable-fftw2-generic => --with-fft=fftw2-float
--enable-fftw2 --enable-fftw2-generic => --with-fft=fftw2-generic
--enable-ipp-fft => --with-fft=ipp
Note that it is now possible to build with double-precision FFTW2,
although the test suite's not very friendly to that choice.
(Failures occur for fftw2-float, too, but fewer; more tests assume
float support.)
Also, if you're configuring in IPP, you'll need to add one of
--with-ipp-suffix=
--with-ipp-suffix=em64t
--with-ipp-suffix=m7
or what-have-you, according to your IPP installation.
Nathan Myers
ncm
Index: ChangeLog
===================================================================
RCS file: /home/cvs/Repository/vpp/ChangeLog,v
retrieving revision 1.262
diff -u -p -r1.262 ChangeLog
--- ChangeLog 19 Sep 2005 21:06:45 -0000 1.262
+++ ChangeLog 20 Sep 2005 00:45:36 -0000
@@ -1,3 +1,10 @@
+2005-09-19 Nathan Myers <ncm at codesourcery.com>
+
+ * configure.ac: replace all --enable-fftw* and --enable-ipp-fft with
+ --with-fft={fftw3,fftw2-float,fftw2-double,fftw2-generic,ipp}.
+ Enable building with fftw2-double. Add --with-ipp-suffix, and
+ require it if using IPP.
+
2005-09-19 Don McCoy <don at codesourcery.com>
Added support for dot, trans and kron functions in [math.matvec]
Index: configure.ac
===================================================================
RCS file: /home/cvs/Repository/vpp/configure.ac,v
retrieving revision 1.38
diff -u -p -r1.38 configure.ac
--- configure.ac 19 Sep 2005 03:39:54 -0000 1.38
+++ configure.ac 20 Sep 2005 00:45:36 -0000
@@ -41,42 +41,33 @@ AC_ARG_WITH(ipp_prefix,
must be in PATH/include; libraries in PATH/lib.]),
dnl If the user specified --with-ipp-prefix, they mean to use IPP for sure.
[enable_ipp=yes])
-
-AC_ARG_ENABLE([ipp-fft],
- AS_HELP_STRING([--enable-ipp-fft],
- [use IPP FFT (default is to use it if it is found and
- no other FFT is enabled and found.)]),,
- [enable_ipp_fft=probe])
-
-AC_ARG_ENABLE([fftw3],
- AS_HELP_STRING([--disable-fftw3],
- [don't use FFTW3 (default is to use it if found)]),,
- [enable_fftw3=probe])
+AC_ARG_WITH(ipp_suffix,
+ AS_HELP_STRING([--with-ipp-suffix=TARGET],
+ [Specify the optimization target of IPP libraries, such as
+ a6, em64t, i7, m7, mx, px, t7, w7. E.g. a6 => -lippsa6.
+ TARGET may be the empty string.]),
+ dnl If the user specified --with-ipp-suffix, they mean to use IPP for sure.
+ [enable_ipp=yes])
+
+AC_ARG_WITH(fft,
+ AS_HELP_STRING([--with-fft=LIB],
+ [Specify FFT engine: fftw3, fftw2-float, fftw2-double,
+ fftw2-generic, or ipp. For fftw2-generic, float support
+ is in <fftw.h> and -lfftw, not <sfftw.h> and -lsfftw.]),
+ [chose_fft=yes])
+
AC_ARG_WITH(fftw3_prefix,
AS_HELP_STRING([--with-fftw3-prefix=PATH],
[Specify the installation prefix of the fftw3 library.
Headers must be in PATH/include; libraries in PATH/lib.]),
dnl If the user specified --with-fftw3-prefix, they mean to use FFTW3 for sure.
- [enable_fftw3=yes])
+ [with_fft=fftw3])
-AC_ARG_ENABLE([fftw2],
- AS_HELP_STRING([--disable-fftw2],
- [don't use FFTW2 (default is to try to use it)]),,
- [enable_fftw2=probe])
AC_ARG_WITH(fftw2_prefix,
AS_HELP_STRING([--with-fftw2-prefix=PATH],
[Specify an installation prefix of the FFTW2 library.
Headers must be in PATH/include; libraries in PATH/lib.]),
- [enable_fftw2=yes])
-AC_ARG_ENABLE([fftw2-generic],
- AS_HELP_STRING([--disable-fftw2-generic],
- [Look in <sfftw.h>, not <fftw.h> for fftw2 float headers.
- Link -lsfftw instead of -lfftw to get float fftw2 lib]),,
- [enable_fftw2_generic=yes])
-AC_ARG_ENABLE([fft_use_float],
- AS_HELP_STRING([--disable-fft-use-float],
- [Do not try to compile in float FFT support.]),,
- [fft_use_float=1])
+ [with_fft=fftw2])
# LAPACK and related libraries (Intel MKL)
@@ -201,17 +192,32 @@ vsip_impl_avoid_posix_memalign=
# At present, IPP, FFTW3, and FFTW2 are supported.
#
-if test "$enable_ipp_fft" == "yes"; then
- if test "$enable_fftw3" == "yes"; then
- AC_MSG_ERROR([Cannot enable both FFTW3 and IPP_FFT])
- fi
- enable_fftw3="no"
-
- if test "$enable_fftw2" == "yes" ; then
- AC_MSG_ERROR([Cannot enable both FFTW2 and IPP_FFT])
- fi
- enable_fftw2="no"
-fi
+enable_fftw3="no"
+enable_fftw2="no"
+enable_ipp_fft="no"
+
+if test "$with_fft" = "fftw3"; then
+ enable_fftw3="yes"
+elif test "$with_fft" = "fftw2-float"; then
+ enable_fftw2="yes"
+ enable_fftw2_float="yes"
+elif test "$with_fft" = "fftw2-double"; then
+ enable_fftw2="yes"
+ enable_fftw2_double="yes"
+elif test "$with_fft" = "fftw2-generic"; then
+ enable_fftw2="yes"
+ enable_fftw2_generic="yes"
+ enable_fftw2_float="yes"
+elif test "$with_fft" = "ipp"; then
+ enable_ipp_fft="yes"
+elif test "$chose_fft" != "yes"; then
+ enable_fftw3="probe"
+ enable_fftw2="probe"
+ enable_ipp_fft="probe"
+else
+ AC_MSG_ERROR([Argument to --with-fft= must be one of fftw3, fftw2-float,
+ fftw2-double, fftw2-generic, or ipp.])
+fi
if test "$enable_fftw3" != "no" ; then
keep_CPPFLAGS=$CPPFLAGS
@@ -231,8 +237,6 @@ if test "$enable_fftw3" != "no" ; then
LIBS="$keep_LIBS"
fi
else
- enable_ipp_fft="no"
- enable_fftw2="no"
AC_DEFINE_UNQUOTED(VSIP_IMPL_FFTW3, 1,
[Define to build using FFTW3 headers.])
@@ -267,12 +271,19 @@ if test "$enable_fftw3" != "no" ; then
keep_LIBS="$keep_LIBS -lfftw3l"])
LIBS="$keep_LIBS"
+
+ enable_ipp_fft="no"
+ enable_fftw2="no"
fi
fi
if test "$enable_fftw2" != "no" ; then
- vsip_impl_use_float=1
+ if test "$enable_fftw2_double" != "yes" ; then
+ vsip_impl_use_double=1
+ else
+ vsip_impl_use_float=1
+ fi
vsip_impl_fftw2=1
FFT_CPPFLAGS=
@@ -282,7 +293,8 @@ if test "$enable_fftw2" != "no" ; then
FFT_LDFLAGS="-L$with_fftw2_prefix/lib"
fi
FFT_LIBS=
- if test "$enable_fftw2_generic" == "yes" ; then
+ if test "$enable_fftw2_generic" == "yes" -o \
+ "$enable_fftw2_double" ; then
FFT_LIBS="-lfftw -lrfftw"
fftw2_h="fftw.h"
else
@@ -306,9 +318,13 @@ if test "$enable_fftw2" != "no" ; then
CPPFLAGS="$keep_CPPFLAGS"
fi
else
- enable_ipp_fft="no"
- AC_DEFINE_UNQUOTED(VSIP_IMPL_FFT_USE_FLOAT, $vsip_impl_use_float,
- [Define to build code with support for FFT on float types.])
+ if test "$enable_fftw2_double" == "yes"; then
+ AC_DEFINE_UNQUOTED(VSIP_IMPL_FFT_USE_DOUBLE, $vsip_impl_use_double,
+ [Define to build code with support for FFT on double types.])
+ else
+ AC_DEFINE_UNQUOTED(VSIP_IMPL_FFT_USE_FLOAT, $vsip_impl_use_float,
+ [Define to build code with support for FFT on float types.])
+ fi
AC_DEFINE_UNQUOTED(VSIP_IMPL_FFTW2, $vsip_impl_fftw2,
[Define to build using FFTW2 headers.])
if test "$enable_fftw2_generic" == "yes" ; then
@@ -318,6 +334,8 @@ if test "$enable_fftw2" != "no" ; then
AC_SUBST(FFT_CPPFLAGS)
AC_SUBST(FFT_LIBS)
+
+ enable_ipp_fft="no"
fi
fi
@@ -436,8 +454,9 @@ AC_DEFINE_UNQUOTED(VSIP_IMPL_PAR_SERVICE
if test "$enable_ipp_fft" == "yes"; then
if test "$enable_ipp" == "no"; then
AC_MSG_ERROR([IPP FFT requires IPP])
- fi
- enable_ipp="yes"
+ else
+ enable_ipp="yes"
+ fi
fi
if test "$enable_ipp" != "no"; then
@@ -454,22 +473,26 @@ if test "$enable_ipp" != "no"; then
AC_CHECK_HEADER([ipps.h], [vsipl_ipps_h_name='<ipps.h>'],, [// no prerequisites])
if test "$vsipl_ipps_h_name" == "not found"; then
if test "$enable_ipp" != "probe" -o "$enable_ipp_fft" == "yes"; then
- AC_MSG_ERROR([IPP or IPP_FFT enabled, but no ipps.h detected])
+ AC_MSG_ERROR([IPP enabled, but no ipps.h detected])
else
CPPFLAGS="$save_CPPFLAGS"
fi
+
else
+ if test "${with_ipp_suffix-unset}" == "unset"; then
+ AC_MSG_ERROR([IPP enabled, but library suffix not set.])
+ fi
# Find the library.
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $IPP_LDFLAGS"
LIBS="-lpthread $LIBS"
- AC_SEARCH_LIBS(ippCoreGetCpuType, [ippcoreem64t],,
+ AC_SEARCH_LIBS(ippCoreGetCpuType, ["ippcore$with_ipp_suffix"],,
[LD_FLAGS="$save_LDFLAGS"])
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $IPP_LDFLAGS"
- AC_SEARCH_LIBS(ippsMul_32f, [ippsem64t ippsm7 ipps],
+ AC_SEARCH_LIBS(ippsMul_32f, ["ipps$with_ipp_suffix"],
[
AC_SUBST(VSIP_IMPL_HAVE_IPP, 1)
AC_DEFINE_UNQUOTED(VSIP_IMPL_HAVE_IPP, 1,
@@ -502,7 +525,7 @@ int main(int, char **)
LDFLAGS="$LDFLAGS $IPP_FFT_LDFLAGS"
AC_SEARCH_LIBS(
- [ippiFFTFwd_CToC_32fc_C1R], [ippiem64t ippim7 ippi],
+ [ippiFFTFwd_CToC_32fc_C1R], ["ippi$with_ipp_suffix"],
[
AC_SUBST(VSIP_IMPL_IPP_FFT, 1)
AC_DEFINE_UNQUOTED(VSIP_IMPL_IPP_FFT, 1,
More information about the vsipl++
mailing list