Skip to content
Source Code Generation for Automatic Differentiation using Operator Overloading
C++ CMake Other
Find file
Failed to load latest commit information.
cmake improved examples
debian improved debian documentation package (uses doxygen generated documen…
doc improved debian documentation package (uses doxygen generated documen…
example minor comment fix
include added specialized Evaluator for AD<CG<Base>> which also copies variab…
pkgconfig added work around in tests for issue 7 (github) of CppAD
speed replaced CppAD::extra namespace with CppAD::cg in example and speed
test improved examples
.gitignore added an IDE file to the ignore list
.travis.yml changed cmake_install_prefix to cppad_prefix
AUTHORS removed CppAD from the project; moved build system to CMake; renamed …
CMakeLists.txt improved examples
INSTALL improved README improved examples
epl-v10.txt removed CppAD from the project; moved build system to CMake; renamed …
gpl3.txt changed licenses to EPL1 and GPL3

CppADCodeGen Build Status

CppADCodeGen performs hybrid Automatic Differentiation (AD), that is, uses operator-overloading and produces source-code. Such source-code can be statically compiled at runtime using an existing compiler and linked dynamically or, alternatively, go through a JIT compilation using Clang/LLVM.

In addition to C source generation, CppADCodeGen can also produce Latex and html+MathML source-code files for your algorithm. Latex sources can be used to create PDF files for documentation purposes, while html+MathML can be used to display your algorithm in a MathML capable web browser.

CppADCodeGen can also be used to perform differentiation index reduction of Differential Algebraic Equations (DAE) through the Pantelides and Dummy Derivatives methods.

CppADCodeGen is built on top of the CppAD library, which is a header only C++ AD library using operator overloading.


CppADCodeGen is available with both the EPL and GPL licenses (suitable for both open-source and closed-source commercial projects). See epl-v10.txt and gpl3.txt for a copy of the licenses.


CppADCodeGen is a C++11 header only library so there aren't many dependencies:

  • CppAD (2016)
  • A C++11 compiler (such as GCC and Clang).
  • Clang/LLVM 3.2, 3.4, or 3.6 (only for JIT compilation)
  • Eigen 3 (only for DAE differentiation index reduction)

Runtime compilation and dynamic linking:

  • Linux (it might be very easy to support other OSes but it is not implemented yet)


General installation

Just copy the contents of the folder include to anywhere you would like to include from.


A debian installation package can be created at the root of the project. Typically you can create the installer by just typing:


It will create a debian package outside the project's folder.

Using CppADCodeGen

See the wiki.

The folder example includes some simple use cases.

Repository Content

Directories Description
bin Helper shell and sed scripts used for CppAD development.
bug Directory containing demonstration of known bugs (may be empty).
doc Holds files for generation of developer documentation.
debian Debian package creation files (Linux).
include The CppADCodeGen header files.
example CppADCodegen example files are here.
pkgconfig pkg-config support files.
test Contains tests for CppADCodeGen.
speed Contains some benchmarks for CppADCodeGen.
Files Description
AUTHORS Statement of authorship and copyright.
CMakeLists.txt CppADCodeGen CMake input file.
COPYING Statement of user license to use software.
epl-v10.txt A copy of the Eclipse Public License version 1.
gpl3.txt A copy of the GNU General Public License version 3.
INSTALL Points to this file.
Something went wrong with that request. Please try again.