Skip to content

Commit

Permalink
Fix the example to use the full path to clad.
Browse files Browse the repository at this point in the history
  • Loading branch information
vgvassilev committed Feb 4, 2020
1 parent 842bdba commit da53fbf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# Clad
Clad enables [automatic differentiation (AD)](https://en.wikipedia.org/wiki/Automatic_differentiation) for C++. It is based on LLVM compiler infrastructure and is a plugin for [Clang compiler](http://clang.llvm.org/). Clad is based on source code transformation. Given C++ source code of a mathematical function, it can automatically generate C++ code for computing derivatives of the function. It supports both forward-mode and reverse-mode AD.
## How to use Clad
Since Clad is a Clang plugin, it must be properly attached when Clang compiler is invoked. First, the plugin must be built to get `libdclad.so` (or `.dylib`). To compile `SourceFile.cpp` with Clad enabled use:
Since Clad is a Clang plugin, it must be properly attached when Clang compiler is invoked. First, the plugin must be built to get `libclad.so` (or `.dylib`). To compile `SourceFile.cpp` with Clad enabled use:
```
clang -cc1 -x c++ -std=c++11 -load libclad.so -plugin clad SourceFile.cpp
clang -cc1 -x c++ -std=c++11 -load /full/path/to/lib/clad.so -plugin clad SourceFile.cpp
```
Clad provides two API functions:
- `clad::differentiate` to use forward-mode AD
Expand Down

0 comments on commit da53fbf

Please sign in to comment.