diff --git a/include/boost/math/interpolators/detail/cardinal_trigonometric_detail.hpp b/include/boost/math/interpolators/detail/cardinal_trigonometric_detail.hpp index 30d96db06..62ef4bace 100644 --- a/include/boost/math/interpolators/detail/cardinal_trigonometric_detail.hpp +++ b/include/boost/math/interpolators/detail/cardinal_trigonometric_detail.hpp @@ -8,13 +8,20 @@ #include #include #include -#include #include #ifdef BOOST_HAS_FLOAT128 #include #endif +#ifdef __has_include +# if __has_include() +# include +# else +# error "This feature is unavailable without fftw3 installed" +#endif +#endif + namespace boost { namespace math { namespace interpolators { namespace detail { template diff --git a/include/boost/math/special_functions/chebyshev_transform.hpp b/include/boost/math/special_functions/chebyshev_transform.hpp index 81543c6f4..20390be6e 100644 --- a/include/boost/math/special_functions/chebyshev_transform.hpp +++ b/include/boost/math/special_functions/chebyshev_transform.hpp @@ -7,7 +7,6 @@ #define BOOST_MATH_SPECIAL_CHEBYSHEV_TRANSFORM_HPP #include #include -#include #include #include @@ -15,6 +14,14 @@ #include #endif +#ifdef __has_include +# if __has_include() +# include +# else +# error "This feature is unavailable without fftw3 installed" +#endif +#endif + namespace boost { namespace math { namespace detail{ diff --git a/test/compile_test/interpolators_cardinal_trig_incl_test.cpp b/test/compile_test/interpolators_cardinal_trig_incl_test.cpp index 18b4539c3..3b32d4b07 100644 --- a/test/compile_test/interpolators_cardinal_trig_incl_test.cpp +++ b/test/compile_test/interpolators_cardinal_trig_incl_test.cpp @@ -6,6 +6,8 @@ // A sanity check that this file // #includes all the files that it needs to. // +#if __has_include() + #include // // Note this header includes no other headers, this is @@ -23,3 +25,6 @@ void compile_and_link_test() boost::math::interpolators::cardinal_trigonometric> s(data, 3, 2); check_result(s(1.0)); } +#else +void compile_and_link_test() {} +#endif // __has_include diff --git a/test/compile_test/sf_chebyshev_transform_incl_test.cpp b/test/compile_test/sf_chebyshev_transform_incl_test.cpp index 72abc21fe..3416f5b1a 100644 --- a/test/compile_test/sf_chebyshev_transform_incl_test.cpp +++ b/test/compile_test/sf_chebyshev_transform_incl_test.cpp @@ -6,6 +6,8 @@ // Basic sanity check that header // #includes all the files that it needs to. // +#if __has_include() + #include // // Note this header includes no other headers, this is @@ -19,3 +21,7 @@ void compile_and_link_test() boost::math::chebyshev_transform test(f, 0.0, 1.0); check_result(test(1.0)); } + +#else +void compile_and_link_test() {} +#endif // __has_include