tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: finding isnan



On Mon, Nov 06, 2023 at 12:36:27AM +0100, Joerg Sonnenberger wrote:
> On Monday, November 6, 2023 12:34:05 AM CET Thomas Klausner wrote:
> > On Mon, Nov 06, 2023 at 12:26:35AM +0100, Joerg Sonnenberger wrote:
> > > On Monday, November 6, 2023 12:21:49 AM CET Thomas Klausner wrote:
> > > > Hi!
> > > > 
> > > > math/py-scikit-learn currently doesn't build because it doesn't find
> > > > 'isnan'.
> > > > 
> > > > As I understand it, that symbol should be available for C++ files from
> > > > C++11 onwards, so I tried adding 'c++11' to USE_LANGUAGES, but that
> > > > didn't help, even though -std=c++11 ended up on the compiler line.
> > > > 
> > > > http://www.ki.nu/pkgsrc/reports/current/NetBSD-9.0/20231104.1950/py310-scikit-learn-1.3.2/build.log
> > > 
> > > If it is including cmath, it should be using std::isnan. If it is mixing math.h and cmath,
> > > it should stop doing that, ideally by including cmath first.
> > 
> > If I understand the build process correctly, it's using math.h only,
> > but the code is in files generated by cython, for code like this:
> > 
> > sklearn/utils/_isfinite.pyx:from libc.math cimport isnan, isinf
> > sklearn/utils/_isfinite.pyx:        if isnan(v):
> 
> Not according to the build log, it's including <complex> and recursively gets <cmath>.

I've tried changing the source files to use

from libcpp.cmath cimport isnan

but that makes the cython fail.

I'll let someone else fix this one.
 Thomas


Home | Main Index | Thread Index | Old Index