0

I am trying to use an LLVM plugin (Enzyme) for a C++ library I am writing using CMake for the build process. I am new to CMake and LLVM so not sure about the best way to approach this using Modern CMake practices.

I have indentified a few steps that I need to perform in order to get the plugin working, but am not sure how to implement this in CMake for my library.

  • Require LLVM-12 and LLVM-LIT to be installed.
  • Compile plugin against LLVM which generates ClangEnzyme-.so shared library
  • Now I can compile C++ using the plugin with clang test2.cpp -Xclang -load -Xclang /path/to/ClangEnzyme-11.so -O2 -fno-vectorize -fno-unroll-loops

How would I go about writing a CMake program to add this plugin for my library so it can be linked and used by the rest of the library?

Any help is greatly appreciated

0 Answers0