Bug 236188 - devel/boost-libs and BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
Summary: devel/boost-libs and BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-office mailing list
URL: https://github.com/lballabio/QuantLib...
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2019-03-03 23:23 UTC by Mikhail Teterin
Modified: 2019-03-06 05:54 UTC (History)
6 users (show)

See Also:
bugzilla: maintainer-feedback? (office)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Teterin freebsd_committer 2019-03-03 23:23:16 UTC
According to the developers of QuantLib, the self-test failures blocking our upgrade of finance/quantlib are due to Boost being built without the BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS.

This seems to have an effect only on i386 -- and, presumably, only with clang -- but I'm out of my depth here: https://github.com/lballabio/QuantLib/pull/597

Can we review the need for our files/patch-boost_math_tools_config.hpp (added by Bug #199601)?
Comment 1 Jan Beich freebsd_committer 2019-03-04 08:18:53 UTC
FreeBSD libm (aka msun) does support long double functions but not everything as required by C99 e.g., tgammal(3) is a stub. Disabling all C99 math is likely to break a number of ports. Similar to bug 193528 the cost of pre-C99-math support was too high. Besides, QuantLib test case works fine on armv6 and armv7 which are also 32-bit architectures.

Feel free to request exp-run and find out.
Comment 2 Jan Beich freebsd_committer 2019-03-04 08:47:22 UTC
Can someone on powerpc (preferably, 32bit) check the following sample?

$ cat a.cc
// from https://github.com/lballabio/QuantLib/pull/597#issuecomment-466716805
#include <iostream>
#include <boost/math/distributions/non_central_chi_squared.hpp>

using namespace boost::math;

int main() {
    const double q = 0.3142;
    
    std::cout << std::setprecision(16) 
        << quantile(
            non_central_chi_squared_distribution<double>(3.0,1.0),q) 
        << std::endl;
}

$ pkg install boost-libs
$ c++ a.cc -isystem/usr/local/include
$ ./a.out
2.034589723572673
Comment 3 Alexey Dokuchaev freebsd_committer 2019-03-04 13:38:17 UTC
c++ won't work on FreeBSD/powerpc, because it is gcc 4.2.1.  I've built fresh devel/boost-libs using g++7, so it goes like this:

$ g++7 a.cc -isystem/usr/local/include -Wl,-rpath=/usr/local/lib/gcc7
$ ./a.out
2.034589723572673

This is on Mac mini G4, 32-bit, ~r302710 12.0-CURRENT.
Comment 4 Dennis Clarke 2019-03-04 17:36:03 UTC
(In reply to Alexey Dokuchaev from comment #3)

I have 'current' head at the moment here and would have to swap around hard disks and re-install 12-RELEASE to test. 

hydra# uname -a 
FreeBSD hydra 13.0-CURRENT FreeBSD 13.0-CURRENT r344744 GENERIC  powerpc


I'll make up a post-it note todo list for this.
Comment 5 Sean Bruno freebsd_committer 2019-03-05 23:02:50 UTC
ref12-ppc64.freebsd.org does exist and is a jail on real ppc64 hardware if you need to test things (for freebsd.org committers only).
Comment 6 Alexey Dokuchaev freebsd_committer 2019-03-06 05:54:10 UTC
Great!  Can you guys document its (ppc64 reference box) existence at the https://www.freebsd.org/internal/machines.html page?