This project gives an example of using the Enzyme AD tool on a simple C++ project using the Clang compiler, and the LLVM-based Intel DPC++/C++ Compiler.
LLVMEnzyme-15.so
, this is the Enzyme LLVM pass plugin built against LLVM version 15llvm-link
, version 15 (llvm bitcode module linker)opt
, version 15 (llvm bitcode module optimizer)icx
, version 2022.2.1 (Intel DPC++/C++ Compiler)
LLDEnzyme-15.so
, this is the Enzyme LLD pass plugin built against LLVM version 15ld.lld
, version 15 (llvm linker - drop in replacement for GNU'sld
linker)clang
, version 15
- If
clang
,ld.lld
,llvm-link
,opt
, oricx
aren't in your path then either add them to your path, or put their paths in the appropriate variables inMakefile
. - In
Makefile-icx
andMakefile-clang
, modify respectively the paths/usr/local/lib/Enzyme/LLVMEnzyme-15.so
to be and/usr/local/lib/Enzyme/LLDEnzyme-15.so
be actual paths to the libraries.
- Documentation for building
LLVMEnzyme-15.so
/LLDEnzyme-15.so
can be found at here, however the process can be simplified. Instead of building LLVM manually as suggested, simply install the llvm headers/libraries and build against these. The headers/libraries can be installed usingapt install llvm-15-dev
(you might need to first add the llvm 15 toolchain repository to apt)), and then the required cmake directory can be found usingdpkg -L llvm-15-dev | grep lib/cmake/llvm
, at which point one can then follow the Enzyme build steps. Furthermore, if you additionally install the headers/libraries for Clang, say usingapt install libclang-15-dev
, then the Clang pass pluginClangEnzyme-15.so
will also be built.