Bug 1181871

Summary: GCC 11: libmfx package fails
Product: [openSUSE] openSUSE Tumbleweed Reporter: Martin Liška <martin.liska>
Component: BasesystemAssignee: Gfx Bugs <gfx-bugs>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P3 - Medium CC: martin.liska
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 1181859    

Description Martin Liška 2021-02-06 11:11:57 UTC
Fails here:
https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:Gcc7/libmfx/standard/x86_64

with:
[   34s] [ 47%] Building CXX object _studio/mfx_lib/vpp/CMakeFiles/vpp_hw.dir/src/mfx_vpp_main.cpp.o
[   34s] /home/abuild/rpmbuild/BUILD/MediaSDK-intel-mediasdk-20.3.0/_studio/mfx_lib/mctf_package/mctf/src/mctf_common.cpp: In function 'mfxU16 CalcNoiseStrength(double, double)':
[   34s] /home/abuild/rpmbuild/BUILD/MediaSDK-intel-mediasdk-20.3.0/_studio/mfx_lib/mctf_package/mctf/src/mctf_common.cpp:2302:37: error: 'numeric_limits' is not a member of 'std'
[   34s]  2302 |     if (std::fabs(NSC) <= 10 * std::numeric_limits<double>::epsilon()) return 0;
[   34s]       |                                     ^~~~~~~~~~~~~~
[   34s] /home/abuild/rpmbuild/BUILD/MediaSDK-intel-mediasdk-20.3.0/_studio/mfx_lib/mctf_package/mctf/src/mctf_common.cpp:2302:52: error: expected primary-expression before 'double'
[   34s]  2302 |     if (std::fabs(NSC) <= 10 * std::numeric_limits<double>::epsilon()) return 0;
[   34s]       |                                                    ^~~~~~
[   34s] /home/abuild/rpmbuild/BUILD/MediaSDK-intel-mediasdk-20.3.0/_studio/mfx_lib/mctf_package/mctf/src/mctf_common.cpp:2302:52: error: expected ')' before 'double'
[   34s]  2302 |     if (std::fabs(NSC) <= 10 * std::numeric_limits<double>::epsilon()) return 0;
[   34s]       |        ~                                           ^~~~~~
[   34s]       |                                                    )
Comment 1 Stefan Dirsch 2021-02-10 11:15:39 UTC
Hmm. No idea. I can only guess. Is there missing a/some include lines maybe like

#include <limits>
#include <iostream>
#include <functional>
#include <string>

before? How can I testbuild this myself?

I guess I'm not the only victim here. Generic instructions for these kind of errors would be useful to save a lot of developer time I believe.
Comment 2 Martin Liška 2021-02-10 13:07:09 UTC
The issues is mentioned here:
http://www.gnu.org/software/gcc/gcc-11/porting_to.html#header-dep-changes

The following headers are used less widely in libstdc++ and may need to be included explicitly when compiled with GCC 11:

<limits> (for std::numeric_limits)
<memory> (for std::unique_ptr, std::shared_ptr etc.)
<utility> (for std::pair, std::tuple_size, std::index_sequence etc.)
Comment 3 Martin Liška 2021-02-10 13:08:35 UTC
You can test it with:
$ osc co openSUSE:Factory/libmfx
$ cd ...
$ osc build --alternative-project openSUSE:Factory:Staging:Gcc7
Comment 4 Stefan Dirsch 2021-02-10 13:25:30 UTC
Thanks! Adding 

  #include <limits>

fixed build with

  osc build --alternative-project openSUSE:Factory:Staging:Gcc7 standard

Submitted. Closing.
Comment 5 OBSbugzilla Bot 2021-02-10 14:00:08 UTC
This is an autogenerated message for OBS integration:
This bug (1181871) was mentioned in
https://build.opensuse.org/request/show/870902 Factory / libmfx