Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 828447 - media-gfx/blender-3.0 USE=embree fails on older computers without more recent SIMD ISAs
Summary: media-gfx/blender-3.0 USE=embree fails on older computers without more recent...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Adrian
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-06 05:09 UTC by Reuben Martin
Modified: 2022-02-18 02:44 UTC (History)
3 users (show)

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


Attachments
emerge info (emerge.info,8.17 KB, text/plain)
2021-12-06 16:37 UTC, Reuben Martin
Details
build log (build.zip,648.90 KB, application/zip)
2021-12-06 16:38 UTC, Reuben Martin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Reuben Martin 2021-12-06 05:09:33 UTC
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
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-06 13:08:04 UTC
Please do include the build.log and emerge --info, especially given its going to aid debugging here.
Comment 2 Reuben Martin 2021-12-06 16:37:17 UTC
Created attachment 757571 [details]
emerge info
Comment 3 Reuben Martin 2021-12-06 16:38:46 UTC
Created attachment 757572 [details]
build log
Comment 4 Sebastian Parborg 2021-12-07 12:24:21 UTC
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.
Comment 5 Reuben Martin 2021-12-07 16:51:32 UTC
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.
Comment 6 Sebastian Parborg 2021-12-07 17:07:22 UTC
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.
Comment 7 Reuben Martin 2021-12-07 19:38:46 UTC
Confirmed blender builds succeeds when embree is built as shared lib
Comment 8 Sebastian Parborg 2021-12-08 11:39:30 UTC
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.
Comment 9 Reuben Martin 2021-12-08 18:56:27 UTC
Build fails in the same manner as before with build_files/cmake/Modules/FindEmbree.cmake removed.
Comment 10 Larry the Git Cow gentoo-dev 2022-02-18 02:44:19 UTC
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(-)