Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 886273 - sci-libs/caffe2-1.12.0 fails to compile (CLANG-STRICTER-SYSTEM): Optional.h:522:13: error: builtin __has_trivial_copy is deprecated; use __is_trivially_copyable instead [-Werror,-Wdeprecated-builtins]
Summary: sci-libs/caffe2-1.12.0 fails to compile (CLANG-STRICTER-SYSTEM): Optional.h:5...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Tupone Alfredo
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-16 08:38 UTC by Agostino Sarubbo
Modified: 2023-01-12 12:08 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log.xz (build.log.xz,789.02 KB, application/x-xz)
2022-12-16 08:38 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2022-12-16 08:38:29 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: sci-libs/caffe2-1.12.0 fails to compile (CLANG-STRICTER-SYSTEM).
Discovered on: amd64 (internal ref: clang-stricter_tinderbox)

NOTE:
(CLANG-STRICTER-SYSTEM) in the summary means that the bug was found on a machine that runs clang with stricter mode

This machine uses clang with CFLAGS/CXXFLAGS=-Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-function-pointer-types

See also:
https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240
https://wiki.gentoo.org/wiki/Modern_C_porting
Comment 1 Agostino Sarubbo gentoo-dev 2022-12-16 08:38:38 UTC
Created attachment 842977 [details]
build.log.xz

build log and emerge --info (compressed because it exceeds attachment limit, use 'xzless' to read it)
Comment 2 Agostino Sarubbo gentoo-dev 2022-12-16 08:38:39 UTC
Error(s) that match a know pattern in addition to what has been reported in the summary:


-- Could NOT find Numa (missing: Numa_INCLUDE_DIR Numa_LIBRARIES) 
-- Could not find CUDA with FP16 support, compiling without torch.CudaHalfTensor
-- Could not find hardware support for NEON on this machine.
FAILED: caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/mkldnn/Pooling.cpp.o 
fatal: not a git repository (or any parent up to mount point /var/tmp)
/var/tmp/portage/sci-libs/caffe2-1.12.0/work/pytorch-1.12.0/c10/util/Optional.h:522:13: error: builtin __has_trivial_copy is deprecated; use __is_trivially_copyable instead [-Werror,-Wdeprecated-builtins]
Comment 3 Tupone Alfredo gentoo-dev 2023-01-12 07:33:03 UTC
The code in c10/macros/Macros.h:

#if defined(__GNUG__) && __GNUC__ < 5
#define C10_IS_TRIVIALLY_COPYABLE(T) __has_trivial_copy(T)
#else
#define C10_IS_TRIVIALLY_COPYABLE(T) std::is_trivially_copyable<T>::value
#endif

seems ok, it seems you are using a g++ compiler and that version is < 5.

But from the log gcc is 12 and clang is 15

Dunno what to say
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-01-12 07:47:51 UTC
I believe Clang will define itself as GCC 4.something.
Comment 5 Larry the Git Cow gentoo-dev 2023-01-12 12:08:38 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=05b4eaf3a0b650d61c1ae0adbcc52a1717aa36d4

commit 05b4eaf3a0b650d61c1ae0adbcc52a1717aa36d4
Author:     Alfredo Tupone <tupone@gentoo.org>
AuthorDate: 2023-01-12 12:05:46 +0000
Commit:     Alfredo Tupone <tupone@gentoo.org>
CommitDate: 2023-01-12 12:08:10 +0000

    sci-libs/caffe2: fix build with clang
    
    Closes: https://bugs.gentoo.org/886273
    Signed-off-by: Alfredo Tupone <tupone@gentoo.org>

 sci-libs/caffe2/caffe2-1.12.0-r1.ebuild         |  2 ++
 sci-libs/caffe2/files/caffe2-1.12.0-clang.patch | 42 +++++++++++++++++++++++++
 2 files changed, 44 insertions(+)