Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] Fix for Blender and TBB without testing repo? (Read 838 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] Fix for Blender and TBB without testing repo?

Hello all. Does anyone know how to set the version of tbb used when building blender?

I would prefer to not have to downgrade tbb, because this breaks many other packages, and would force me to downgrade all of them, as well. That cascade is very difficult to manage.

For context, this is what I have tried in order to force Blender to build against TBB soversion 12.4 (which is what is in Artix). I don't really understand their weird python build scripts, or even CMake, apparently.

Built options and env vars
Code: [Select]
	export	TBB_SET_SOVERSION=ON
export TBB_SET_SOVERSION=ON
export TBB_VERSION=12.4
export TBB_VERSION=12.4
export TBB_SOVERSION=12.4
export SET_TBB_VERSION=12.4
export SET_TBB_SOVERSION=12.4
export TBB_MAJOR_VERSION=12
export TBB_VERSION_MAJOR=12
export TBB_MINOR_VERSION=4
export TBB_VERSION_MINOR=4
MakeOpts=(
(...more options we don't need to see here...)
-DTBB_SET_SOVERSION=ON
-DCMAKE_TBB_SET_SOVERSION=ON
-DTBB_VERSION=12.4
-DCMAKE_TBB_VERSION=12.4
-DCMAKE_TBB_SOVERSION=12.4
-DCMAKE_SET_TBB_VERSION=12.4
-DCMAKE_SET_TBB_SOVERSION=12.4
-DCMAKE_TBB_MAJOR_VERSION=12
-DCMAKE_TBB_VERSION_MAJOR=12
-DCMAKE_TBB_MINOR_VERSION=4
-DCMAKE_TBB_VERSION_MINOR=4
);
cmake "${MakeOpts[@]}"

CMake... patch files???
Code: [Select]
diff --git a/build_files/build_environment/patches/cmakelists_tbb.txt b/build_files/build_environment/patches/cmakelists_tbb.txt
index e05f27afdd6..a7c6429661d 100644
--- a/build_files/build_environment/patches/cmakelists_tbb.txt
+++ b/build_files/build_environment/patches/cmakelists_tbb.txt
@@ -287,7 +287,7 @@ if (TBB_BUILD_SHARED)
   target_include_directories(tbb INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>" "$<INSTALL_INTERFACE:${TBB_INSTALL_INCLUDE_DIR}>")
   set_property(TARGET tbb APPEND_STRING PROPERTY COMPILE_FLAGS ${ENABLE_RTTI})
   if (TBB_SET_SOVERSION)
-    set_property(TARGET tbb PROPERTY SOVERSION 2)
+    set_property(TARGET tbb PROPERTY SOVERSION 12.4)
   endif ()
 
   target_compile_definitions(tbb
@@ -359,7 +359,7 @@ if(TBB_BUILD_TBBMALLOC)
     set_property(TARGET tbbmalloc APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
     set_property(TARGET tbbmalloc APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
     if (TBB_SET_SOVERSION)
-      set_property(TARGET tbbmalloc PROPERTY SOVERSION 2)
+      set_property(TARGET bbmalloc PROPERTY SOVERSION 12.4)
     endif ()
     add_dependencies(tbbmalloc tbb_def_files)
     if (APPLE)
@@ -407,7 +407,7 @@ if(TBB_BUILD_TBBMALLOC_PROXY)
     set_property(TARGET tbbmalloc_proxy APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
     set_property(TARGET tbbmalloc_proxy APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
     if (TBB_SET_SOVERSION)
-      set_property(TARGET tbbmalloc_proxy PROPERTY SOVERSION 2)
+      set_property(TARGET tbbmalloc_proxy PROPERTY SOVERSION 12.4)
     endif ()
     target_link_libraries(tbbmalloc_proxy PUBLIC tbbmalloc)
     if (TBB_INSTALL_TARGETS)
@@ -647,6 +647,7 @@ if (TBB_BUILD_PYTHON)
     endif ()
 
     # UseSWIG generates now standard target names
+
     if (CMAKE_VERSION VERSION_LESS 3.13)
       set (module_target ${SWIG_MODULE_api_REAL_NAME})
     else ()


Re: Fix for Blender and TBB without testing repo?

Reply #2
edit: In general, I don't think `blender-3.0-bin` is a solution to the actual package being broken, and the code not building against current Artix packages.

Which repos do you have enabled? And do you have any packages (such as TBB) that are downgraded/not-upgraded?

Because the binary package also links against TBB 2, and that is *not* the current TBB package, as far as I can tell:

Code: [Select]
blender: error while loading shared libraries: libtbb.so.2: cannot open shared object file: No such file or directory


edit: The aur *binary* package actually has a completely different set of problems. I have no idea what's going on with this thing. Also WTF does this package have someone else;s user-directory in it? Who built this monstrosity? What even *is* this package? ? ? ? `sybren` is not my user.

Code: [Select]
/run/user/1000/gvfs/ non-existent directory
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = '/usr/share/blender/blender-3.0'
  isolated = 0
  environment = 1
  user site = 0
  import site = 1
  sys._base_executable = '/bin/python3.9'
  sys.base_prefix = '/home/sybren/buildbot-builder/linux_glibc217_x86_64_cmake/build_deps/deps/Release/python'
  sys.base_exec_prefix = '/home/sybren/buildbot-builder/linux_glibc217_x86_64_cmake/build_deps/deps/Release/python'
  sys.platlibdir = 'lib'
  sys.executable = '/bin/python3.9'
  sys.prefix = '/home/sybren/buildbot-builder/linux_glibc217_x86_64_cmake/build_deps/deps/Release/python'
  sys.exec_prefix = '/home/sybren/buildbot-builder/linux_glibc217_x86_64_cmake/build_deps/deps/Release/python'
  sys.path = [
    '/home/sybren/buildbot-builder/linux_glibc217_x86_64_cmake/build_deps/deps/Release/python/lib/python39.zip',
    '/home/sybren/buildbot-builder/linux_glibc217_x86_64_cmake/build_deps/deps/Release/python/lib/python3.9',
    '/home/sybren/buildbot-builder/linux_glibc217_x86_64_cmake/build_deps/deps/Release/python/lib/lib-dynload',
  ]
Internal error initializing Python!
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007fb031d71200 (most recent call first):
<no Python frame>

Re: Fix for Blender and TBB without testing repo?

Reply #3
You know, I think this may have been a build-caching issue. I completely deleted and redownloaded all the sources, and uninstalled ccache, and now I'm getting different issues.

The build is failing earlier now, which tells me two things: 1) the build was not using my configuration changes until now, and, 2) I can't tell if it's changing the TBB version, because it's not getting to the linking stage.

Therefor, 3, I guess I have more problems to solve before I get to see if I have actually changed the TBB version successfully, and if Blender will link against 12 successfully.


edit: sigh. Not a caching issue. Right back to libtbb.so.2 not found.... I hate dependency management in C/++.

Re: Fix for Blender and TBB without testing repo?

Reply #4
I don't see tbb mentioned in the PKGBUILD of blender-3.0.git so I guess (don't know for sure) it will build against whatever version you have installed because the "configure" stage typically detects those sort of things automatically. If 3.0-git doesn't work then try another version which is built from source. Possibly older versions won't support newer deps for other reasons though, really just a case of try it and see in the absence of better info. blender-develop-git looks the newest version so most likely to have the latest fixes.
Also if you do makepkg -o then use # cp -a on the parent dir to make a vanilla backup, then use makepkg -ef you can easily go back to that point without downloading the files again. (Probably other ways but copying the whole thing is usually too dumb to fail.)
https://devtalk.blender.org/search?q=tbb%20order%3Alatest_topic
There is some tbb talk there, seems there could be other issues, perhaps you could also get some more knowledgeable advice if you get stuck.

 

Re: Fix for Blender and TBB without testing repo?

Reply #5
I was finally able to get to resolution by following the advice of the `blender-git` AUR packager.

I built everything against the new `tbb`, and then I afterwards created a new package that contains only the one missing file from the old `tbb`, and *then* I built blender.

I am now using blender-3.1 successfully. Thanks to everyone who chimed in!