Skip to content
Snippets Groups Projects
Commit 24867f22 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'fftw-openmp' into 'master'

Add checks for OpenMP FFTW when pthread version is not found

Closes #831

See merge request !1672
parents 705c38cb 0b2326a5
No related branches found
No related tags found
3 merge requests!1715Update planetary strength after planetary plus's master rebase,!1693More threapool plotting tweaks,!1672Add checks for OpenMP FFTW when pthread version is not found
...@@ -872,10 +872,11 @@ AH_VERBATIM([__STDC_FORMAT_MACROS], ...@@ -872,10 +872,11 @@ AH_VERBATIM([__STDC_FORMAT_MACROS],
# Check for FFTW. We test for this in the standard directories by default, # 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 # and only disable if using --with-fftw=no or --without-fftw. When a value
# is given FFTW must be found. # is given FFTW must be found.
# If FFTW is found, we check whether this is the threaded version. # If FFTW is found, we check whether this is the threaded or openmp version.
have_fftw="no" have_fftw="no"
have_mpi_fftw="no" have_mpi_fftw="no"
have_threaded_fftw="no" have_threaded_fftw="no"
have_openmp_fftw="no"
AC_ARG_WITH([fftw], AC_ARG_WITH([fftw],
[AS_HELP_STRING([--with-fftw=PATH], [AS_HELP_STRING([--with-fftw=PATH],
[root directory where fftw is installed @<:@yes/no@:>@] [root directory where fftw is installed @<:@yes/no@:>@]
...@@ -936,9 +937,33 @@ if test "x$with_fftw" != "xno"; then ...@@ -936,9 +937,33 @@ if test "x$with_fftw" != "xno"; then
FFTW_LIBS=$FFTW_THREADED_LIBS FFTW_LIBS=$FFTW_THREADED_LIBS
FFTW_INCS=$FFTW_THREADED_INCS FFTW_INCS=$FFTW_THREADED_INCS
else
# Same checks for OpenMP if preferred threaded failed.
if test "x$with_fftw" != "xyes" -a "x$with_fftw" != "xtest" -a "x$with_fftw" != "x"; then
FFTW_OPENMP_LIBS="-L$with_fftw/lib -lfftw3_omp -lfftw3"
FFTW_OPENMP_INCS="-I$with_fftw/include"
else
FFTW_OPENMP_LIBS="-lfftw3_omp -lfftw3"
FFTW_OPENMP_INCS=""
fi
# Verify that the library works. Note requires AC_OPENMP called above.
AC_CHECK_LIB([fftw3],[fftw_init_threads],[have_openmp_fftw="yes"],
[have_openmp_fftw="no"], $FFTW_OPENMP_LIBS)
# If found, update things
if test "x$have_openmp_fftw" = "xyes"; then
# Note OpenMP and pthreads use mostly the same calls, so define both.
AC_DEFINE([HAVE_THREADED_FFTW],1,[The threaded OpenMP FFTW library appears to be present.])
AC_DEFINE([HAVE_OPENMP_FFTW],1,[The OpenMP FFTW library appears to be present.])
FFTW_LIBS=$FFTW_OPENMP_LIBS
FFTW_INCS=$FFTW_OPENMP_INCS
fi fi
fi fi
fi
# If MPI mesh gravity is not disabled, check whether we have the MPI version of FFTW # If MPI mesh gravity is not disabled, check whether we have the MPI version of FFTW
if test "x$enable_mpi" = "xyes" -a "x$with_mpi_mesh_gravity" != "xno"; then if test "x$enable_mpi" = "xyes" -a "x$with_mpi_mesh_gravity" != "xno"; then
# Was FFTW's location specifically given? # Was FFTW's location specifically given?
...@@ -2946,7 +2971,7 @@ AC_MSG_RESULT([ ...@@ -2946,7 +2971,7 @@ AC_MSG_RESULT([
- parallel : $have_parallel_hdf5 - parallel : $have_parallel_hdf5
METIS/ParMETIS : $have_metis / $have_parmetis METIS/ParMETIS : $have_metis / $have_parmetis
FFTW3 enabled : $have_fftw FFTW3 enabled : $have_fftw
- threaded : $have_threaded_fftw - threaded/openmp : $have_threaded_fftw / $have_openmp_fftw
- MPI : $have_mpi_fftw - MPI : $have_mpi_fftw
- ARM : $have_arm_fftw - ARM : $have_arm_fftw
GSL enabled : $have_gsl GSL enabled : $have_gsl
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment