- Sep 22, 2018
-
-
Konstantin Gizdov authored
-
- Aug 03, 2018
-
-
Vassil Vassilev authored
clad is a C++ plugin for clang and cling that implements automatic differentiation of user-defined functions by employing the chain rule in forward and reverse mode, coupled with source code transformation and AST constant fold. In mathematics and computer algebra, automatic differentiation (AD) is a set of techniques to numerically evaluate the derivative of a function specified by a computer program. AD exploits the fact that every computer program, no matter how complicated, executes a sequence of elementary arithmetic operations (addition, subtraction, multiplication, division, etc.) and elementary functions (exp, log, sin, cos, etc.). By applying the chain rule repeatedly to these operations, derivatives of arbitrary order can be computed automatically, accurately to working precision, and using at most a small constant factor more arithmetic operations than the original program. AD is an alternative technique to symbolic and numerical differentiation. These classical methods run into problems: symbolic differentiation leads to inefficient code (unless done carefully) and faces the difficulty of converting a computer program into a single expression, while numerical differentiation can introduce round-off errors in the discretization process and cancellation. Both classical methods have problems with calculating higher derivatives, where the complexity and errors increase. Finally, both classical methods are slow at computing the partial derivatives of a function with respect to many inputs, as is needed for gradient-based optimization algorithms. Automatic differentiation solves all of these problems, at the expense of introducing more software dependencies. This patch allows ROOT to interoperate with clad. Namely, users can ask the interpreter to produce a derivative or a gradient to a known function. An illustrative example code for first order derivative: root [0] #include "Math/CladDerivator.h" root [1] double my_pow2(double x) { return x*x; } root [2] auto meta_obj = clad::differentiate(my_pow2, /*wrt 1-st argument*/0); root [3] meta_obj.dump(); The code is: double my_pow2_darg0(double x) { return (1. * x + x * 1.); } root [5] meta_obj.execute(1) // no iterations, at the cost of function call. (double) 2.0000000 Learn more about clad at https://github.com/vgvassilev/clad Patch by Aleksandr Efremov and me!
-
- May 02, 2018
-
-
Oksana Shadura authored
-
- Mar 28, 2018
-
-
Vassil Vassilev authored
To do so one needs to pass -Dbuiltin_llvm=Off -Dbuiltin_clang=Off and the PATH should contain the path to llvm-config. Note this is not enabling ROOT to work with vanilla clang! This patch allows ROOT to be built against a prebuilt clang and llvm from https://root.cern.ch/git/{llvm.git,clang.git}. It allows to reduce ROOT's build times (in cases when cmake decides to rebuild the in-tree llvm for no good reason). It moves the common denominator of different ROOT builds in one place to save space. It also allows easy switch between LLVM in debug and release mode. To build the external clang and llvm exactly in the same way as the in-tree builds use: CMAKE_FLAGS="\ -DLLVM_ENABLE_WARNINGS=OFF \ -DLLVM_INCLUDE_TESTS=OFF \ -DCLANG_INCLUDE_TESTS=OFF \ -DLLVM_INCLUDE_EXAMPLES=OFF \ -DCLANG_BUILD_TOOLS=OFF \ -DCLANG_TOOL_ARCMT_TEST_BUILD=OFF \ -DCLANG_TOOL_CLANG_CHECK_BUILD=OFF \ -DCLANG_TOOL_CLANG_FORMAT_BUILD=OFF \ -DCLANG_TOOL_CLANG_FORMAT_VS_BUILD=OFF \ -DCLANG_TOOL_CLANG_FUZZER_BUILD=OFF \ -DCLANG_TOOL_CLANG_IMPORT_TEST_BUILD=OFF \ -DCLANG_TOOL_CLANG_OFFLOAD_BUNDLER_BUILD=OFF \ -DCLANG_TOOL_CLANG_RENAME_BUILD=OFF \ -DCLANG_TOOL_C_ARCMT_TEST_BUILD=OFF \ -DCLANG_TOOL_C_INDEX_TEST_BUILD=OFF \ -DCLANG_TOOL_DIAGTOOL_BUILD=OFF \ -DCLANG_TOOL_LIBCLANG_BUILD=OFF \ -DCLANG_TOOL_SCAN_BUILD_BUILD=OFF \ -DCLANG_TOOL_SCAN_VIEW_BUILD=OFF \ -DLLVM_BUILD_TOOLS=OFF \ -DLLVM_TOOL_LLVM_AR_BUILD=OFF \ -DCLANG_TOOL_CLANG_OFFLOAD_BUNDLER_BUILD=OFF \ -DLLVM_FORCE_USE_OLD_TOOLCHAIN=ON \ -DCLANG_ENABLE_STATIC_ANALYZER=OFF \ -DCLANG_ENABLE_ARCMT=OFF \ -DCLANG_ENABLE_FORMAT=OFF \ -DLLVM_TARGETS_TO_BUILD=host \ -DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF \ -DLLVM_ENABLE_ABI_BREAKING_CHECKS=OFF \ -DCMAKE_INSTALL_PREFIX=.. \ -DCMAKE_BUILD_TYPE=Debug" cmake "$CMAKE_FLAGS" ../../../sources/root-llvm/
-
- Mar 20, 2018
-
-
Guilherme Amadio authored
This option uses ExternalProject_Add() to clone and build the clad plugin. However, things that assume a network connection have to be disabled by default in order not to break builds on machines without a network connection or inside a sandbox environment.
-
- Feb 21, 2018
-
-
Guilherme Amadio authored
The directory is hard-coded without suffix in other places, so necessary headers for clang are not installed if the suffix is kept.
-
Guilherme Amadio authored
-
- Feb 20, 2018
-
-
Vassil Vassilev authored
-
Vassil Vassilev authored
This patch allows ROOT to be built against compatible external llvm (5.0 or 5.0.1). Note that we still need to build clang (eg. we require builtin_clang=On) due to the ROOT-specific patches which are not yet upstream. Since we have externally installed llvm, we configure and build clang as a standalone project. The configuration relies on finding llvm-config-5.0 and uses an adapted version of the standard clang standalone build procedure. Clang provides dependencies such as FileCheck and not which are used by cling's testsuite and are not being installed with the standard llvm package. Cling (which depends on llvm and clang) is built as a clang tool to avoid unresolved dependencies to clang and complicating further the already complicated cmake setup. This patch intends a minimal change and follows the initial (suboptimal) design to configure and build llvm, clang and cling as part of ROOT. An ultimate solution would be to have llvm, clang and cling built as separate standalone projects (following the recommended way by the LLVM cmake developers).
-
Vassil Vassilev authored
-
Vassil Vassilev authored
We rely on clang's plugin infrastructure for loading, argument processing and unloading plugins. This patch teaches cling to work with clang plugins such as clad -- a clang plugin implementing automatic differentiation facilities.
-
- Jan 30, 2018
-
-
Vassil Vassilev authored
This reverts commit 86c95d96. We are not quite ready to do this. Our PR infrastructure gave green light while it shouldn't have.
-
- Jan 29, 2018
-
-
Vassil Vassilev authored
-
- Nov 03, 2017
-
-
Vassil Vassilev authored
This patch should be used only to test if it fixes our use case and we will put it upstream and backport it.
-
- Oct 19, 2017
-
-
Bertrand Bellenot authored
-
- Oct 18, 2017
-
-
Bertrand Bellenot authored
-
Bertrand Bellenot authored
Replace dashes in the -EH* and -GR* flags with slashes (/EH* /GR*) only for the interpreter (they are modified later in HandleLLVMOptions.cmake)
-
- Oct 10, 2017
-
-
Vassil Vassilev authored
This would allow us to check cling-related pull requests by just specifying -Dclingtest=On.
-
Vassil Vassilev authored
-
Vassil Vassilev authored
-
- Oct 05, 2017
-
-
Bertrand Bellenot authored
-
- Sep 11, 2017
-
-
Raphael Isemann authored
So far we just hard-coded the default definitions that LLVM uses to the CLING_CXXFLAGS. This means that once LLVM actually changes its compile defintions, code that uses the CLING_CXXFLAGS is no longer in sync and starts reading invalid memory and so on. This patch extracts these flags from LLVM now and properly adds them to the CLING_CXXFLAGS instead of hardcoded them. This fixes the failing roottest-root-aclic-misc-assertROOT7027 test. Thanks to Axel for debugging this!
-
- Aug 09, 2017
-
-
Raphael Isemann authored
This fixes the OS X warnings like this one: ld: warning: direct access in function 'XXX' from file 'libLLVMScalarOpts.a(NewGVN.cpp.o)' to global weak symbol 'llvm::ReverseIterate<bool>::value' from file 'interpreter/llvm/src/lib/libclingUtils.a(AST.cpp.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings. I assume it's a compiler bug and it maybe fixes itself in LLVM 6.0 as this is quite recently introduced code, so let's go with the most conservative fix and just disable this validation layer in LLVM (that we don't use from what I can see).
-
- Jul 26, 2017
-
-
Raphael Isemann authored
Currently LLVM LTO and other parts depend on the git HEAD file because they pull in the current git revision (and should update when the git revision changes). This is causing some unnecessary rebuilding everytime someone is touching his git HEAD file. This commit is disabling this in future LLVM versions by setting the appropriate flag in LLVM to OFF (doesn't do a lot by now as we first need to get this revision in the ROOT llvm version https://reviews.llvm.org/D35377).
-
- Jun 08, 2017
-
-
Vassil Vassilev authored
-
Vassil Vassilev authored
Add a force set the variable enabling the build of the cling binary.
-
Vassil Vassilev authored
Otherwise it breaks the cmake configuration likely due to the leading # char in the read file.
-
Vassil Vassilev authored
-
Vassil Vassilev authored
-
- May 11, 2017
-
-
Axel Naumann authored
-
- May 03, 2017
-
-
David Abdurachmanov authored
The patch adds C++17 (C++1z) mode to ROOT and LLVM. This requires GCC 7.1.0 which supports full C++17 standard. It's to be released soon (probably within a month). C++14 continues to be default standard version in GCC 7.1.0. This C++17 option is not enabled by default. Signed-off-by:
David Abdurachmanov <davidlt@cern.ch>
-
- Apr 05, 2017
-
-
Vassil Vassilev authored
-
- Mar 15, 2017
-
-
Vassil Vassilev authored
This gets picked up by jenkins and marks the PR builds as unstable.
-
- Mar 06, 2017
-
-
Raphael Isemann authored
Signed-off-by:
Vassil Vassilev <vvasilev@cern.ch>
-
- Jan 31, 2017
-
-
Pere Mato Vila authored
-
- Oct 12, 2016
-
-
Pere Mato Vila authored
-
- Oct 04, 2016
-
-
Pere Mato Vila authored
-
- Sep 21, 2016
-
-
Vassil Vassilev authored
Patch developed in collaboration with Pere Mato.
-
- Sep 19, 2016
-
-
Vassil Vassilev authored
This will inform LLVM that it builds in modules mode and it would reorder some dependencies.
-
- Sep 12, 2016
-
-
Axel Naumann authored
-