Boost C++ Libraries: Ticket #7987: Problem compiling code to use the Bessel functions https://svn.boost.org/trac10/ticket/7987 <p> Hello; </p> <p> I am having fun replacing some of the math functionality in Apache <a class="missing wiki">OpenOffice</a> with boost functions. My platform is FreeBSD 9.1. </p> <p> I noticed that for Bessel functions there is no documentation about which header(s) to use. </p> <p> I assume you only need: #include &lt;boost/math/special_functions/bessel.hpp&gt; </p> <p> Everything seems fine in my code but I get this: .... /usr/ports/editors/openoffice-3-devel/work/ooo/main/scaddins/source/analysis/bessel.cxx:92: instantiated from here /usr/local/include/boost/math/special_functions/detail/bessel_kn.hpp:63: error: no matching function for call to 'fabs(long double&amp;)' /usr/local/include/boost/math/special_functions/detail/bessel_kn.hpp:63: error: no matching function for call to 'fabs(long double&amp;)' /usr/local/include/boost/math/special_functions/detail/bessel_kn.hpp:75: error: no matching function for call to 'fabs(long double&amp;)' </p> <p> /usr/local/include/boost/math/special_functions/detail/bessel_kn.hpp:63: error: no matching function for call to 'fabs(long double&amp;)' /usr/local/include/boost/math/special_functions/detail/bessel_kn.hpp:63: error: no matching function for call to 'fabs(long double&amp;)' /usr/local/include/boost/math/special_functions/detail/bessel_kn.hpp:75: error: no matching function for call to 'fabs(long double&amp;)' ... </p> <p> I have tried including &lt;math.h&gt; &lt;cmath&gt; and even the boost math libraries but still no luck. </p> <p> While here let me also mention this warning which should be easy to fix: </p> <p> /usr/local/include/boost/fusion/tuple/detail/preprocessed/tuple.hpp:21:7: warning: no newline at end of file </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7987 Trac 1.4.3 anonymous Wed, 06 Feb 2013 16:22:25 GMT <link>https://svn.boost.org/trac10/ticket/7987#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7987#comment:1</guid> <description> <p> Looks like there's no std::fabs(long double) on that platform? </p> <p> Try defining BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS before including the header, if that fixes things can you please let me know: </p> <ul><li>Whether <span class="underline">NO_LONG_DOUBLE_MATH is defined. </span></li><li>What values DBL_MANT_DIG and LDBL_MANT_DIG have? </li></ul><p> I'll fix the missing mention of the header file shortly. </p> <p> Cheers, John Maddock. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Wed, 06 Feb 2013 17:59:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7987#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7987#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/82763" title="Add bessel function header to docs. Refs #7987.">[82763]</a>) Add bessel function header to docs. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7987" title="#7987: Bugs: Problem compiling code to use the Bessel functions (closed: invalid)">#7987</a>. </p> </description> <category>Ticket</category> </item> <item> <author>Pedro Giffuni <giffunip@…></author> <pubDate>Wed, 06 Feb 2013 18:47:00 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7987#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7987#comment:3</guid> <description> <p> Thank you, </p> <p> I guess it might be a libstdc++ issue: libc does have fabsl(). </p> <p> I will try that but it takes about a day(!) to rebuild OpenOffice. </p> </description> <category>Ticket</category> </item> <item> <author>Pedro Giffuni <giffunip@…></author> <pubDate>Thu, 07 Feb 2013 01:53:49 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7987#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7987#comment:4</guid> <description> <p> (It's still building) </p> <p> Ugh.. I found an explanation in this posting: </p> <p> <a class="ext-link" href="http://lists.freebsd.org/pipermail/freebsd-hackers/2009-March/028030.html"><span class="icon">​</span>http://lists.freebsd.org/pipermail/freebsd-hackers/2009-March/028030.html</a> </p> <p> FreeBSD &lt;= 9 uses it's own BSD libc and the GNU libstdc++ (from gcc 4.2.1) and both don't seem to get along too well. The good news is that starting with FreeBSD 10 they/we moved to clang/libc++ so this will not be a problem for too long. </p> </description> <category>Ticket</category> </item> <item> <author>Pedro Giffuni <giffunip@…></author> <pubDate>Thu, 07 Feb 2013 04:25:52 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7987#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7987#comment:5</guid> <description> <p> I found the problem: </p> <p> The boost maintainer in FreeBSD re-enabled the long double support which is off by default in standard Boost. <a class="ext-link" href="http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/boost-libs/files/patch-freebsd-has-long-double?rev=1.1"><span class="icon">​</span>http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/boost-libs/files/patch-freebsd-has-long-double?rev=1.1</a> </p> <p> Please close this ticket and thank you for your help! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Wed, 13 Feb 2013 19:07:18 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7987#comment:6 https://svn.boost.org/trac10/ticket/7987#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> Ticket