mitsuba-renderer / drjit

Dr.Jit — A Just-In-Time-Compiler for Differentiable Rendering
BSD 3-Clause "New" or "Revised" License
572 stars 40 forks source link

Example project of Binding C++ code? #158

Closed 111116 closed 1 year ago

111116 commented 1 year ago

Hi, I'm looking for an example build system that binds C++ code that operates on dr::Array, and create a Python interface. There used to be a link to https://github.com/wjakob/dr_python_test which expires. I'd appreciate such example, or any help because I was struggling to get a working build system. Thanks!

dvicini commented 1 year ago

Hi,

Maybe there is a simpler example I am not aware of, but I went through this process with the following package: https://github.com/rgl-epfl/fastsweep

This uses both C++ and Python DrJit and compiles into a package that can be pip-installed. Not that the version of this package needs to remain consistent with DrJit to ensure interoperability. It also needs to be compiled with the same compiler and settings (e.g., compiling fastsweep locally will be incompatible with the pip-installed drjit version)

njroussel commented 1 year ago

Hi @111116

Indeed, I think the fastsweep project is the best/smallest project we have at this time. Once you have setup your build system, feel free to share it here if you think it can help out others :+1: