I have an older system with an old AMD Phenom II that does not support SSE4/AVX ISA for embree. Something about the way the cmake file for embree is setup causes the linking of the binary to fail. from blender-3.0.0/build_files/cmake/Modules/FindEmbree.cmake: ================= IF(NOT (("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") OR (APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")))) SET(_embree_SIMD_COMPONENTS embree_sse42 embree_avx embree_avx2 ) ENDIF() SET(_embree_FIND_COMPONENTS embree3 ${_embree_SIMD_COMPONENTS} lexers math simd sys tasking ) ================= This section of code apparently does not work the way the authors intended. The "${_embree_SIMD_COMPONENTS}" variable expansion messes it up on my SSE only system and it fails to link with all the embree symbols missing. After removing that line with the variable, the linking succeeds. Reproducible: Always
Please do include the build.log and emerge --info, especially given its going to aid debugging here.
Created attachment 757571 [details] emerge info
Created attachment 757572 [details] build log
Do you by any chance installed embree static libraries? If you continue reading the build_files/cmake/Modules/FindEmbree.cmake file, you can see that _embree_SIMD_COMPONENTS shouldn't matter for systems where only a shared library is installed. It will not find any libraries named embree_* as those are the static .a libraries. So it will fallback to the .so embree3 library. So I'm very curious how this breaks your system.
yes, embree has the static USE flag set. I honestly have no idea why either. I never enable static unless it is required by something. Perhaps it was required at some point and now no longer is.
Can you try to build it without static libs and see if that works? Either way we will either have to make "-static-libs" a requirement for building blender with embree or we will have to fix the cmake stuff in blender. It is a bit unfortunate as no matter if you use static or dynamic libraries, embree will detect the CPU at runtime and use the appropriate functions. So this means that you could actually build the `embree_*` static libraries and link them in and not have any issues. I think what is happening now is that those are missing so the cmake code falls back to the "oh we are probably using the shared library", but we are actually not and it fails.
Confirmed blender builds succeeds when embree is built as shared lib
Can you try to remove the build_files/cmake/Modules/FindEmbree.cmake file in the ebuild and then building it with static libs? It should then fall back to using the system cmake files installed by embree.
Build fails in the same manner as before with build_files/cmake/Modules/FindEmbree.cmake removed.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1de82f166b57f466bd2dc6f91c90d075214296bd commit 1de82f166b57f466bd2dc6f91c90d075214296bd Author: Sebastian Parborg <darkdefende@gmail.com> AuthorDate: 2022-02-17 18:34:48 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-02-18 02:36:58 +0000 media-libs/embree: Remove static-lib useflag It could cause build issues with the Blender ebuild when using older CPUs. It will also fail to build with newer TBB versions. It doesn't bring any real benifit to build static libs for Blender currently either. (The only package in portage that uses embree) Closes: https://bugs.gentoo.org/828447 Closes: https://bugs.gentoo.org/831377 Signed-off-by: Sebastian Parborg <darkdefende@gmail.com> Signed-off-by: Sam James <sam@gentoo.org> media-libs/embree/embree-3.13.0-r2.ebuild | 4 ++-- media-libs/embree/embree-3.13.2.ebuild | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)