alecjacobson / libigl-enzyme-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

libigl 🤝 enzyme

Build

Enzyme requires matching to its version of llvm. On Mac its not obvious how to use the built in clang/llvm, so instead we'll assume you have installed llvm and enzyme via homebrew:

brew install llvm enzyme

Then you can build with the usual

mkdir build
cd build
cmake ../
make

Run

From within the build directory just issue:

./example

A glfw app should launch displaying a knight with white lines indicating the computed gradients.

Known Issues

At the moment, Enzyme will crash at compile time differentiating programs that contain calls to std::cerr<<.

Libigl as of fe65ecb (e.g., pulled by this repos build) avoids std::cerr but some functions will still do it (e.g., when a solver or meshIO fails).

About


Languages

Language:CMake 60.3%Language:C++ 39.7%