#1002698 libvolk2-dev: isinf not declared in scope

Package:
libvolk2-dev
Source:
volk
Description:
vector optimized function headers
Submitter:
Balbir Thomas
Date:
2021-12-28 13:12:03 UTC
Severity:
minor
Tags:
#1002698#5
Date:
2021-12-27 17:46:55 UTC
From:
To:
Dear Maintainer,

Attempting to compile C++ software using libvolk2 may lead
to the following error
-------

In file included from /usr/include/volk/volk.h:31,
/usr/include/volk/volk_common.h: In function ‘float log2f_non_ieee(float)’:
/usr/include/volk/volk_common.h:153:12: error: ‘isinf’ was not declared in this scope; did you mean ‘std::isinf’?
  153 |     return isinf(result) ? copysignf(127.0f, result) : result;
      |            ^~~~~
      |            std::isinf
/usr/include/c++/10/cmath:605:5: note: ‘std::isinf’ declared here
  605 |     isinf(_Tp __x)
------- This issue has been discussed here https://github.com/gnuradio/volk/issues/430 A patch to fix this problem is available here https://github.com/gnuradio/volk/commit/b4c1f077048ed00fddd76dd5edfcfee4960a5918.patch
#1002698#14
Date:
2021-12-27 19:24:57 UTC
From:
To:
Other Debian packages using libvolk2-dev did not result in this error,
so I reduced the severity.

Also, is this a Debian bug?
I am not able to reproduce this on my Debian machines.

Is this really a libvolk2-dev bug? The upstream discussion leads
to the conclusion that this is a now-fixed compiler bug.

#1002698#19
Date:
2021-12-28 13:08:30 UTC
From:
To:
I ran into this problem when trying to compile
https://github.com/analogdevicesinc/scopy/. Specifically the first
compile failure occurs when trying to compile
https://github.com/analogdevicesinc/scopy/blob/master/src/HistogramDisplayPlot.cc.
I did try to reproduce with simple examples (since scopy is complex to
build) but like you was unable to do so. At the same time I was unable
to see anything wrong with scopy's code. Using the patch linked above
fixed the compile failure and I was able to build scopy successfully.
So I can also confirm the patch applies cleanly.

The issue dicussion does indeed seem to conclude that this is a
compiler bug in gcc <= 6. However I do see the problem even with
gcc 10 that is part of Debian/Bullseye. I linked to the issue above
precisely since I was a bit surprised.

Despite the discussion in that issue there is an open pull request
at https://github.com/gnuradio/volk/pull/455 from which the
patch linked above was extracted.

The patch only introduces "_cplusplus" header guards that does seem like
the right thing to do since libvolk intends to support compilation with
both C and C++. Given the nature of this patch, regressions are very
unlikely.

A quick check shows at present only Gnuradio plugins and Gqrx depend on
libvolk. Most of the former are implemented in C. Perhaps this may be
the reason why the bug (?) was not exposed as yet.

If you are convinced to let this patch through I will be happy to help
in any way I can.