Skip to content
Snippets Groups Projects
  1. Sep 26, 2018
  2. Sep 25, 2018
  3. Sep 24, 2018
  4. Sep 22, 2018
  5. Sep 05, 2018
  6. Sep 04, 2018
  7. Aug 28, 2018
    • Vassil Vassilev's avatar
      [cxxmodules] Fix nightly builds. · 362065d2
      Vassil Vassilev authored
      This patch splits the headers required at both compile time and runtime.
      The Cling_Runtime_Extra module does not require __CLING__ to be defined.
      It allows the headers from it to be included at compile time as well
      where we do not have __CLING__ defined.
      362065d2
  8. Aug 27, 2018
  9. Aug 24, 2018
    • Yuka Takahashi's avatar
      Implement parsing cache for the LookupHelper. · 33940f0f
      Yuka Takahashi authored
      The operations done by the LookupHelper are costly in both memory and
      performance. Almost every operation requires memory allocation and parsing
      of often non-trivial C++ code.
      
      Unfortunately, the LookupHelper is used very intensively by rootcling and
      ROOT. The callers usually do not use any caching mechanisms and redo the
      expensive operations over and over even though the answer is known to be
      the same as before. For instance, building the dictionary of shows:
      
      ```
      MathCore:
        Cached entries: 217
        Total parse requests: 54051
        Cache hits: 53834
      TreePlayer:
        Cached entries: 183
        Total parse requests: 57697
        Cache hits: 57514
      ```
      
      This patch introduces the first set of caching functionality. In
      particular, each LookupHelper::find* function allocates a memory buffer
      which is then stored in the clang::SourceManager. We hash the buffer
      content and keep a mapping between a hash and FileID and next time we
      encounter the same content we do not allocate a new FileID but reuse the
      old one. We see decrease in memory footprint by 7% for non-cxxmodules ROOT.
      
      For cxxmodules we see significant reduction of the pcm sizes (by half)
      which translates into rss improvements:
      
      ```
        master before:
          cpu  time = 0.291462 seconds
          sys  time = 0.064409 seconds
          res  memory = 345.816 Mbytes
          vir  memory = 573.508 Mbytes
        master after:
         cpu  time = 0.235828 seconds
         sys  time = 0.098327 seconds
         res  memory = 260.012 Mbytes
         vir  memory = 377.945 Mbytes
      ```
      
      Patch by Yuka Takahashi and me.
      33940f0f
    • Guilherme Amadio's avatar
      Set CMake policy CMP0075 to NEW · 97923d1f
      Guilherme Amadio authored
      This is to avoid CMake to fallback to old behavior of
      ignoring the value of CMAKE_REQUIRED_LIBRARIES.
      97923d1f
  10. Aug 22, 2018
    • Vassil Vassilev's avatar
      [clad] Specify where the clang header files are. · cd4080c1
      Vassil Vassilev authored
      In cases where we build ROOT with -Dbuiltin_llvm=Off -Dbuiltin_clang=On
      and we have installed both llvm and clang in /usr/ clad will pick up
      the clang headers from there too.
      
      This patch gives higher priority to the header files which ROOT is
      supposed to use. It fixes a very obscure initialization issue due to
      different versions of the ASTContext.h installed and used by ROOT.
      cd4080c1
  11. Aug 21, 2018
    • Vassil Vassilev's avatar
      [D47118] Backport r337353. · 55e2f6e3
      Vassil Vassilev authored
      Original commit message:
      "[modules] Print input files when -module-file-info file switch is passed.
      
      This patch improves traceability of duplicated header files which end up in multiple pcms.
      "
      55e2f6e3
  12. Aug 17, 2018
  13. Aug 10, 2018
  14. Aug 08, 2018
    • Yuka Takahashi's avatar
      [cxxmodules] Do not emit relocation error when -fno-validate-pch is set · c29a4657
      Yuka Takahashi authored
      This patch already landed in llvm.
      
      Clang emits error when implicit modules was relocated from the
      first build directory. However this was biting our usecase where we copy
      the contents of build directory to another directory in order to
      distribute.
      c29a4657
    • Vassil Vassilev's avatar
      Update clad to v0.2 · b361f73f
      Vassil Vassilev authored
      The relevant highlights are:
      
      * Support better Windows (thanks to Bertrand Bellenot!);
      
      * Disabled automatic discovery of system LLVM -- clad should only
        search for LLVM at DCLAD_PATH_TO_LLVM_BUILD. On some platforms
        (discovered by Oksana Shadura via rootbench) clad discovers the
        system LLVM which is compatible in principle but this is not what
        we want for ROOT.
      
      * Implemented -CLAD_BUILD_STATIC_ONLY -- this covers the ROOT usecase
        where we do not need shared objects but link the libraries against
        another shared object (libCling.so). This allows platforms which have
        disabled LLVM_ENABLE_PLUGINS to still build clad and use it. Such
        example is CYGWIN and Windows.
      
      See more at: https://github.com/vgvassilev/clad/releases/tag/v0.2
      b361f73f
  15. Aug 03, 2018
    • Vassil Vassilev's avatar
      Enable the automatic differentiation library clad in ROOT. · 3590e277
      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!
      3590e277
  16. Jul 27, 2018
    • Vassil Vassilev's avatar
      [cling] Implement clang plugin support. · 2762a323
      Vassil Vassilev authored
      Clang allows third party shared libraries to provide user-defined
      extensions. For example, a custom libTemplateInstantiation.so can
      visualize all template instantiation chains in clang. To enable it
      one needs to pass a set of options such as -fplugin.
      
      Cling should be able to inherently work with clang plugins. However,
      cling still does not make full use of the clang driver where the plugin
      setup is handled.
      
      This patch enables plugins in cling and extends them in some aspects.
      In particular, cling allows loading of plugins from shared libraries
      but also if they are linked to the same library where cling is. This is
      very useful in cases where cling runs itself in a shared library (eg
      libCling). Users of libCling (such as ROOT) prefer to keep all llvm and
      clang related symbols local to avoid symbol clashes if there is another
      version of clang and llvm linked against a package. This can be done by
      dlopen-ing libCling with RTLD_LOCAL visibility mode. Then the only way
      for clang plugins to work in this scenario is to be linked to libCling.
      
      Patch by Aleksandr Efremov and me.
      2762a323
    • Yuka Takahashi's avatar
      [cxxmodules] Autoload subdirectory modulemaps with specific LangOpts · f2b41075
      Yuka Takahashi authored
      This patch already landed in https://reviews.llvm.org/rL336660 in Clang.
      
      This was biting us to enable runtime modules in CMSSW.
      
      Detailed desciption:
      https://bugs.llvm.org/show_bug.cgi?id=37878
      
      lookupModule was falling back to loadSubdirectoryModuleMaps when it couldn't
      find ModuleName in (proper) search paths. This was causing iteration over all
      files in the search path subdirectories for example "/usr/include/foobar" in
      bugzilla case.
      
      Users don't expect Clang to load modulemaps in subdirectories implicitly, and
      also the disk access is not cheap.
      
      if (AllowExtraModuleMapSearch) true with ObjC with @import ModuleName.
      f2b41075
    • Vassil Vassilev's avatar
      [libcling] Add missing link libraries. · eb9c5341
      Vassil Vassilev authored
      eb9c5341
  17. Jul 25, 2018
  18. Jul 19, 2018
    • Guilherme Amadio's avatar
      Use NEW behavior for CMake policy CMP0051 · 3d651ae5
      Guilherme Amadio authored
      We need to move LLVM in ROOT to use the new behavior of policy CMP0051
      as it will be removed soon and the warning below will become an error:
      
      CMake Deprecation Warning at interpreter/llvm/src/CMakeLists.txt:15 (cmake_policy):
        The OLD behavior for policy CMP0051 will be removed from a future version
        of CMake.
      
        The cmake-policies(7) manual explains that the OLD behaviors of all
        policies are deprecated and that a policy should be set to OLD only under
        specific short-term circumstances.  Projects should be ported to the NEW
        behavior and not rely on setting a policy to OLD.
      3d651ae5
  19. Jun 27, 2018
  20. Jun 26, 2018
  21. Jun 25, 2018
Loading