Skip to content

Commit

Permalink
FAQ PR (#24)
Browse files Browse the repository at this point in the history
* undefined symbol

* Failed to load

* Clarified undefined symbol FAQ
  • Loading branch information
davidedelvento authored Jun 23, 2024
1 parent 655de43 commit a9f929c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions content/getting_started/Faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<VERSION>.so`

## Many errors occur, starting with `Failed to load passes from '/path/to/LLDEnzyme-<VERSION>.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!

0 comments on commit a9f929c

Please sign in to comment.