Commit c2615eb7 authored by Peter W. Draper's avatar Peter W. Draper

Merge branch 'non_standard_fftw_path' into 'master'

Allow the user to specify a non-standard path for the FFTW library at configure time.

See merge request !534
parents f003c29e a40a25e1
......@@ -444,6 +444,10 @@ if test "x$with_gsl" != "xno"; then
AC_MSG_ERROR(something is wrong with the GSL library!), $GSL_LIBS)
have_gsl="yes"
fi
if test "$have_gsl" = "no"; then
GSL_LIBS=""
GSL_INCS=""
fi
fi
AC_SUBST([GSL_LIBS])
AC_SUBST([GSL_INCS])
......@@ -543,6 +547,45 @@ AC_SUBST([GRACKLE_LIBS])
AC_SUBST([GRACKLE_INCS])
AM_CONDITIONAL([HAVEGRACKLE],[test -n "$GRACKLE_LIBS"])
# Check for FFTW. We test for this in the standard directories by default,
# and only disable if using --with-fftw=no or --without-fftw. When a value
# is given GSL must be found.
have_fftw="no"
AC_ARG_WITH([fftw],
[AS_HELP_STRING([--with-fftw=PATH],
[root directory where fftw is installed @<:@yes/no@:>@]
)],
[with_fftw="$withval"],
[with_fftw="test"]
)
if test "x$with_fftw" != "xno"; then
if test "x$with_fftw" != "xyes" -a "x$with_fftw" != "xtest" -a "x$with_fftw" != "x"; then
FFTW_LIBS="-L$with_fftw/lib -lfftw3"
FFTW_INCS="-I$with_fftw/include"
else
FFTW_LIBS="-lfftw3"
FFTW_INCS=""
fi
# FFTW is not specified, so just check if we have it.
if test "x$with_fftw" = "xtest"; then
AC_CHECK_LIB([fftw3],[fftw_malloc],[have_fftw="yes"],[have_fftw="no"],$FFTW_LIBS)
if test "x$have_fftw" != "xno"; then
AC_DEFINE([HAVE_FFTW],1,[The FFTW library appears to be present.])
fi
else
AC_CHECK_LIB([fftw3],[fftw_malloc],
AC_DEFINE([HAVE_FFTW],1,[The FFTW library appears to be present.]),
AC_MSG_ERROR(something is wrong with the FFTW library!), $FFTW_LIBS)
have_fftw="yes"
fi
if test "$have_fftw" = "no"; then
FFTW_LIBS=""
FFTW_INCS=""
fi
fi
AC_SUBST([FFTW_LIBS])
AC_SUBST([FFTW_INCS])
AM_CONDITIONAL([HAVEFFTW],[test -n "$FFTW_LIBS"])
# Check for tcmalloc a fast malloc that is part of the gperftools.
have_tcmalloc="no"
......@@ -704,16 +747,6 @@ if test "$ac_cv_func_pthread_setaffinity_np" = "yes"; then
fi
fi
# Check for FFTW
have_fftw3="no"
AC_CHECK_HEADER([fftw3.h])
if test "$ac_cv_header_fftw3_h" = "yes"; then
AC_CHECK_LIB([fftw3],[fftw_malloc], [AC_DEFINE([HAVE_FFTW],
[1],[Defined if FFTW 3.x exists.])] )
FFTW_LIBS="-lfftw3"
have_fftw3="yes"
fi
AC_SUBST([FFTW_LIBS])
# Check for Intel and PowerPC intrinsics header optionally used by vector.h.
AC_CHECK_HEADERS([immintrin.h])
......@@ -1114,7 +1147,7 @@ AC_MSG_RESULT([
HDF5 enabled : $with_hdf5
- parallel : $have_parallel_hdf5
Metis enabled : $have_metis
FFTW3 enabled : $have_fftw3
FFTW3 enabled : $have_fftw
GSL enabled : $have_gsl
libNUMA enabled : $have_numa
GRACKLE enabled : $have_grackle
......
......@@ -18,8 +18,8 @@
# Common flags
MYFLAGS =
# Add the source directory and debug to CFLAGS
AM_CFLAGS = -I$(top_srcdir)/src $(HDF5_CPPFLAGS) $(GSL_INCS)
# Add the source directory and the non-standard paths to the included library headers to CFLAGS
AM_CFLAGS = -I$(top_srcdir)/src $(HDF5_CPPFLAGS) $(GSL_INCS) $(FFTW_INCS)
AM_LDFLAGS = $(HDF5_LDFLAGS)
......
......@@ -15,8 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Add the debug flag to the whole thing
AM_CFLAGS = $(HDF5_CPPFLAGS) $(GSL_INCS)
# Add the non-standard paths to the included library headers
AM_CFLAGS = $(HDF5_CPPFLAGS) $(GSL_INCS) $(FFTW_INCS)
# Assign a "safe" version number
AM_LDFLAGS = $(HDF5_LDFLAGS) $(FFTW_LIBS) -version-info 0:0:0
......
......@@ -14,8 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Add the source directory and debug to CFLAGS
AM_CFLAGS = -I$(top_srcdir)/src $(HDF5_CPPFLAGS) $(GSL_INCS)
# Add the source directory and the non-standard paths to the included library headers to CFLAGS
AM_CFLAGS = -I$(top_srcdir)/src $(HDF5_CPPFLAGS) $(GSL_INCS) $(FFTW_INCS)
AM_LDFLAGS = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS) $(HDF5_LIBS) $(FFTW_LIBS) $(GRACKLE_LIBS) $(GSL_LIBS)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment