From a9f929c32c4814dd3633379545a403282ef990aa Mon Sep 17 00:00:00 2001 From: Davide <579771+davidedelvento@users.noreply.github.com> Date: Sun, 23 Jun 2024 09:48:45 -0600 Subject: [PATCH] FAQ PR (#24) * undefined symbol * Failed to load * Clarified undefined symbol FAQ --- content/getting_started/Faq.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/content/getting_started/Faq.md b/content/getting_started/Faq.md index c508571..654dea0 100644 --- a/content/getting_started/Faq.md +++ b/content/getting_started/Faq.md @@ -35,6 +35,19 @@ opt input.ll -load-pass-plugin=/path/to/LLVMEnzyme-VERSION.so -passes=enzyme -o If you are using CMake, Enzyme exports a special `ClangEnzymeFlags` target which will automatically add the correct flags. See [here](https://github.com/EnzymeAD/Enzyme/blob/main/enzyme/test/test_find_package/CMakeLists.txt#L14) for an example. +## I receive an `__enzime_autodiff` undefined symbol either at runtime or at compile time +This error means that you have Enzyme calls which did not run the the Enzyme AD transformation. Please check that you have Enzyme run as part of the compilation which resulted in the error. +In projects with multisource and/or complex building systems it's possible to overlook one source file being compiled/linked without the appropriate Enzyme plugin pass. +When using LLDEnzyme and LTO, make sure that **all** object file rules include the `-flto` argument and that the final linking step includes **both** `-fuse-ld=lld` and `-flto`. +Obviously, such final linking step must also include the Enzyme plugin with something like `-Wl,--load-pass-plugin=/path/to/LLDEnzyme-.so` + +## Many errors occur, starting with `Failed to load passes from '/path/to/LLDEnzyme-.so'. Request ignored.` +This means that the Enzyme plugin has not been loaded. There may be various reasons for this to happen, some common ones are +* typo in the `/path/to/` part +* plugin (e.g. using `LLDEnzyme` plugin for `Clang` or `LLVM` or some other incorrect combination) +* shared object not present because its compilation failed or had been deleted +* the `/path/to` contains shells expansions not honored by the build system, for example `Makefile` may fail to expand `~` but does correctly expland `$(HOME)` + ## Other If you have an issue not resolved here, please make an issue on [Github](https://github.com/EnzymeAD/Enzyme) and consider making a pull request to this FAQ!