Commit c5aac757 authored by Pietro Incardona's avatar Pietro Incardona

activate multiprecision only if libquadmath present

parent 4192ec42
...@@ -119,6 +119,14 @@ if test x"$with_hdf5" = x"no"; then ...@@ -119,6 +119,14 @@ if test x"$with_hdf5" = x"no"; then
fi fi
##########
## Check for quadmath
AC_CHECK_LIB(quadmath, sinq, [AC_DEFINE(HAVE_LIBQUADMATH,[],[Have quad math lib])
LIBQUADMATH=" -lquadmath "
], [])
####### include OpenFPM_numerics include path" ####### include OpenFPM_numerics include path"
INCLUDES_PATH+=" -I/usr/local/include -I. -Iconfig -I../../openfpm_devices/src -I../../openfpm_data/src -I../../openfpm_io/src -I../../openfpm_vcluster/src -I../../src" INCLUDES_PATH+=" -I/usr/local/include -I. -Iconfig -I../../openfpm_devices/src -I../../openfpm_data/src -I../../openfpm_io/src -I../../openfpm_vcluster/src -I../../src"
...@@ -311,6 +319,7 @@ AC_DEFINE([HAVE_MPI],[],[MPI Enabled]) ...@@ -311,6 +319,7 @@ AC_DEFINE([HAVE_MPI],[],[MPI Enabled])
AC_SUBST(NVCCFLAGS) AC_SUBST(NVCCFLAGS)
AC_SUBST(INCLUDES_PATH) AC_SUBST(INCLUDES_PATH)
AC_SUBST(LIBQUADMATH)
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
......
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
#define OPENFPM_NUMERICS_SRC_PSE_KERNELS_UNIT_TESTS_HPP_ #define OPENFPM_NUMERICS_SRC_PSE_KERNELS_UNIT_TESTS_HPP_
#include "PSE/Kernels_test_util.hpp" #include "PSE/Kernels_test_util.hpp"
#ifdef HAVE_LIBQUADMATH
#include <boost/multiprecision/float128.hpp> #include <boost/multiprecision/float128.hpp>
#endif
BOOST_AUTO_TEST_SUITE( pse_kernels_unit_tests ) BOOST_AUTO_TEST_SUITE( pse_kernels_unit_tests )
...@@ -36,11 +38,13 @@ BOOST_AUTO_TEST_CASE( pse_ker ) ...@@ -36,11 +38,13 @@ BOOST_AUTO_TEST_CASE( pse_ker )
/////// Order 2 ////////////// /////// Order 2 //////////////
#ifdef HAVE_LIBQUADMATH
PSE_test<boost::multiprecision::float128,Lap_PSE<1,boost::multiprecision::float128,2>>(i,2,err); PSE_test<boost::multiprecision::float128,Lap_PSE<1,boost::multiprecision::float128,2>>(i,2,err);
y.last().add(err.linf_error); y.last().add(err.linf_error);
PSE_test<boost::multiprecision::float128,Lap_PSE<1,boost::multiprecision::float128,2>>(i,4,err); PSE_test<boost::multiprecision::float128,Lap_PSE<1,boost::multiprecision::float128,2>>(i,4,err);
y.last().add(err.linf_error); y.last().add(err.linf_error);
#endif
PSE_test<double,Lap_PSE<1,double,2>>(i,2,err); PSE_test<double,Lap_PSE<1,double,2>>(i,2,err);
y.last().add(err.linf_error); y.last().add(err.linf_error);
...@@ -56,6 +60,7 @@ BOOST_AUTO_TEST_CASE( pse_ker ) ...@@ -56,6 +60,7 @@ BOOST_AUTO_TEST_CASE( pse_ker )
//////// Order 4 ///////////// //////// Order 4 /////////////
#ifdef HAVE_LIBQUADMATH
PSE_test<boost::multiprecision::float128,Lap_PSE<1,boost::multiprecision::float128,4>>(i,2,err); PSE_test<boost::multiprecision::float128,Lap_PSE<1,boost::multiprecision::float128,4>>(i,2,err);
y.last().add(err.linf_error); y.last().add(err.linf_error);
...@@ -78,6 +83,8 @@ BOOST_AUTO_TEST_CASE( pse_ker ) ...@@ -78,6 +83,8 @@ BOOST_AUTO_TEST_CASE( pse_ker )
PSE_test<boost::multiprecision::float128,Lap_PSE<1,boost::multiprecision::float128,8>>(i,16,err); PSE_test<boost::multiprecision::float128,Lap_PSE<1,boost::multiprecision::float128,8>>(i,16,err);
y.last().add(err.linf_error); y.last().add(err.linf_error);
#endif
} }
// Check the result // Check the result
......
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