Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Jerry_J_1
Beginner
96 Views

4.4 U3 build failure with gcc 6

I attempted to build the 4.4 U3 release for the upcoming Fedora 24 with a gcc 6 prerelease.  The build failed as follows:

In file included from /usr/include/c++/6.0.0/memory:62:0,
                 from ../../include/tbb/tbb_stddef.h:421,
                 from ../../src/tbb/itt_notify.h:24,
                 from ../../src/tbb/itt_notify.cpp:67:
/usr/include/c++/6.0.0/bits/stl_algobase.h:243:56: error: macro "min" passed 3 arguments, but takes just 2
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
                                                        ^
In file included from ../../src/tbb/itt_notify.cpp:47:0:
/usr/include/c++/6.0.0/bits/stl_algobase.h:195:5: error: expected unqualified-id before 'const'
     min(const _Tp& __a, const _Tp& __b)

[many more errors snipped]

This appears to be due to the following change to src/tbb/tools_api/ittnotify_static.c from 4.4 U2 to 4.4 U3:

@@ -806,12 +777,13 @@ static const char* __itt_get_lib_name(vo
     return lib_name;
 }
 
-/* Avoid clashes with std::min */
-#define __itt_min(a,b) (a) < (b) ? (a) : (b)
+#ifndef min
+#define min(a,b) (a) < (b) ? (a) : (b)
+#endif /* min */
 
 static __itt_group_id __itt_get_groups(void)
 {

 

0 Kudos
3 Replies
Jerry_J_1
Beginner
96 Views

Adding #undef min to the end of src/tbb/tools_api/ittnotify_static.c fixes the build.

96 Views

I hope this is addressed in Development Release tbb44_20160316oss_src.tgz 

https://www.threadingbuildingblocks.org/download#development-releases

Jerry_J_1
Beginner
96 Views

Yes, that fixes the problem.  Thank you, Alexandr.