Cycles shared library #1
No reviewers
Labels
No Label
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Reference: blender/cycles#1
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "boberfly/cycles:cycles_shared_lib"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
From the archives: https://archive.blender.org/developer/D16736
Hello,
This is an experiment with making a cleaner way of packaging Cycles into one shared library, as well as bringing along a single header + config which brings along all the build pre-processor defines so that other code linking to Cycles doesn't get conflicting or out-of-sync defines, which we've been finding when linking against Gaffer/GafferCycles.
I've added WITH_CYCLES_SHARED_LIBRARY but set as off as default. The idea is that when this is enabled, it'll generate a shared library of Cycles instead, and the Hydra delegate and standalone cycles in App will link to this instead of statically-linking.
I'm anticipating some tweaks to this to get things just right, but I've already tested the single header with Gaffer. What I haven't fully tested is all the dependencies like OpenImageIO as static instead of dynamic.
Some open questions, should all headers join the source/ sub-directory that's designed for runtime compiling of shaders (this is what the patch currently does) or should they live in a dedicated include/ directory? With packaging in Gaffer we were preferring the latter, as well as putting the dynamic library into lib/ and executable into bin/.
My hand-created cycles.h includes all the necessary headers that both the Hydra delegate and Gaffer module need to compile with, but should this just contain all headers instead of my hand-picked ones, that's generated by CMake also.
Cheers
Updated with the changes Brecht commented
Open questions/TODOs
This would be great to have
f8a9628758
tobe5f561005
Hey @brecht
https://projects.blender.org/boberfly/blender/src/branch/cycles_shared_lib
I've moved this one to Blender itself (I feel kind of silly that I didn't know of
make cycles
until now) so I think this is probably best to move this one forward so I don't break the Blender build while tweaking this one.Hello,
Having Cycles as a normal dependency would be really interesting for me. To integrate Cycles into my project I have to build it every time I rebuild my project. This weighs heavily on build time.
Anyway, just to ask you why Cycles hasn't yet been designed as a shared library?
I'm currently looking to deploying Cycles in a production environment using rez which this is needed to reduce compiling and library bloat as well. Cycles has traditionally been compiled into Blender so it hasn't been a huge need, and hdCycles is deployed as a USD library already, same as GafferCycles but it's a bit heavy to support agreed.
Checkout
From your project repository, check out a new branch and test the changes.