Build: Don't use bundled zstd for blosc #121197

Open
Lukas Stockner wants to merge 1 commits from LukasStockner/blender:fix-zstd-conflict into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

By default, blosc builds its own zstd which gets linked into libopenvdb, which in turns ends up overriding the explicitly built and linked zstd (at least on Linux).

This results in e.g. multithreading not being available, even though it's enabled in zstd.cmake.

By default, blosc builds its own zstd which gets linked into libopenvdb, which in turns ends up overriding the explicitly built and linked zstd (at least on Linux). This results in e.g. multithreading not being available, even though it's enabled in `zstd.cmake`.
Ray molenkamp was assigned by Lukas Stockner 2024-04-29 03:08:04 +02:00
Lukas Stockner added 1 commit 2024-04-29 03:08:15 +02:00
By default, blosc builds its own zstd which gets linked into libopenvdb,
which in turns ends up overriding the explicitly built and linked zstd.
Lukas Stockner added this to the Platforms, Builds Tests & Devices project 2024-04-29 03:08:22 +02:00
Alaska requested review from Ray molenkamp 2024-04-29 10:52:00 +02:00
Ray molenkamp was unassigned by Lukas Stockner 2024-04-29 12:59:55 +02:00
Ray molenkamp requested changes 2024-05-02 21:31:19 +02:00
Ray molenkamp left a comment
Member

More of a status update than a review, I'm still looking into this, and this still needs work (but i'll do it, just time is a bit scarce currently)

This breaks things pretty badly on windows as the filenames are different between the platforms, so the following bit will be needed regardless of.... the next issue

diff --git a/build_files/build_environment/cmake/blosc.cmake b/build_files/build_environment/cmake/blosc.cmake
index 7807431cfc2..4409f619b68 100644
--- a/build_files/build_environment/cmake/blosc.cmake
+++ b/build_files/build_environment/cmake/blosc.cmake
@@ -6,7 +6,7 @@ set(BLOSC_EXTRA_ARGS
   -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
   -DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
   -DZSTD_INCLUDE_DIR=${LIBDIR}/zstd/include/
-  -DZSTD_LIBRARY=${LIBDIR}/zstd/lib/libzstd${LIBEXT}
+  -DZSTD_LIBRARY=${LIBDIR}/zstd/lib/${ZSTD_LIBRARY}
   -DBUILD_TESTS=OFF
   -DBUILD_BENCHMARKS=OFF
   -DCMAKE_DEBUG_POSTFIX=_d
diff --git a/build_files/build_environment/cmake/options.cmake b/build_files/build_environment/cmake/options.cmake
index 47bf54338fb..05f4fdb3b54 100644
--- a/build_files/build_environment/cmake/options.cmake
+++ b/build_files/build_environment/cmake/options.cmake
@@ -273,8 +273,10 @@ if(WIN32)
   else()
     set(ZLIB_LIBRARY zlibstatic${LIBEXT})
   endif()
+  set(ZSTD_LIBRARY zstd_static${LIBEXT})
 else()
   set(ZLIB_LIBRARY libz${LIBEXT})
+  set(ZSTD_LIBRARY libzstd${LIBEXT})
 endif()

 if(MSVC)

with that in, openvdb doesn't link zstd, so it craps out with a linker error, now openvdb does have config option called BLOSC_USE_EXTERNAL_SOURCES but that assumes all of the deps are build with external sources and it can't find zl4 and snappy, which is where i had to leave things cause something else came along .

I'll try to circle back to this and get this in working order, but likely not this week.

More of a status update than a review, I'm still looking into this, and this still needs work (but i'll do it, just time is a bit scarce currently) This breaks things pretty badly on windows as the filenames are different between the platforms, so the following bit will be needed regardless of.... the next issue ```diff diff --git a/build_files/build_environment/cmake/blosc.cmake b/build_files/build_environment/cmake/blosc.cmake index 7807431cfc2..4409f619b68 100644 --- a/build_files/build_environment/cmake/blosc.cmake +++ b/build_files/build_environment/cmake/blosc.cmake @@ -6,7 +6,7 @@ set(BLOSC_EXTRA_ARGS -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/ -DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY} -DZSTD_INCLUDE_DIR=${LIBDIR}/zstd/include/ - -DZSTD_LIBRARY=${LIBDIR}/zstd/lib/libzstd${LIBEXT} + -DZSTD_LIBRARY=${LIBDIR}/zstd/lib/${ZSTD_LIBRARY} -DBUILD_TESTS=OFF -DBUILD_BENCHMARKS=OFF -DCMAKE_DEBUG_POSTFIX=_d diff --git a/build_files/build_environment/cmake/options.cmake b/build_files/build_environment/cmake/options.cmake index 47bf54338fb..05f4fdb3b54 100644 --- a/build_files/build_environment/cmake/options.cmake +++ b/build_files/build_environment/cmake/options.cmake @@ -273,8 +273,10 @@ if(WIN32) else() set(ZLIB_LIBRARY zlibstatic${LIBEXT}) endif() + set(ZSTD_LIBRARY zstd_static${LIBEXT}) else() set(ZLIB_LIBRARY libz${LIBEXT}) + set(ZSTD_LIBRARY libzstd${LIBEXT}) endif() if(MSVC) ``` with that in, openvdb doesn't link zstd, so it craps out with a linker error, now openvdb does have config option called `BLOSC_USE_EXTERNAL_SOURCES` but that assumes _all_ of the deps are build with external sources and it can't find zl4 and snappy, which is where i had to leave things cause something else came along . I'll try to circle back to this and get this in working order, but likely not this week.
Author
Member

Hi, thanks for the info and for looking into it! This isn't urgent or anything, the PR where I wanted to use the multithreading support has many other issues 😅

I mostly figured I'd open this to avoid any surprises in the future, e.g. when we try to version-bump zstd and then later find out that we're still actually shipping the old version.

Hi, thanks for the info and for looking into it! This isn't urgent or anything, the PR where I wanted to use the multithreading support has many other issues 😅 I mostly figured I'd open this to avoid any surprises in the future, e.g. when we try to version-bump zstd and then later find out that we're still actually shipping the old version.
Merge conflict checking is in progress. Try again in few moments.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u fix-zstd-conflict:LukasStockner-fix-zstd-conflict
git checkout LukasStockner-fix-zstd-conflict
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#121197
No description provided.