Bug 236188

Summary: devel/boost-libs and BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
Product: Ports & Packages Reporter: Mikhail Teterin <mi>
Component: Individual Port(s)Assignee: FreeBSD Office Team <office>
Status: New ---    
Severity: Affects Only Me CC: bapt, danfe, dclarke, pi, powerpc, sbruno
Priority: --- Keywords: needs-patch, needs-qa
Version: LatestFlags: bugzilla: maintainer-feedback? (office)
Hardware: Any   
OS: Any   
URL: https://github.com/lballabio/QuantLib/pull/597

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(
        << std::endl;

$ pkg install boost-libs
$ c++ a.cc -isystem/usr/local/include
$ ./a.out
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

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?