IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
Late parsed templated are parsed from a token chain, as if expanding a macro. This confuses subsequent parses. Make sure that the token quere is emptied, which is exactly what ParseInternal() does after parsing.
In case of TProtoClass.cxx, all the loop was doing
is to copy the collection (loop body with comments
only - and those don't compile when removing the //.
Thus comment out the whole loop.
In TDFNodes.cxx remove the redundant get() as well.
There are some codes compiled at the start up time. For example,
- #include \"cling/Interpreter/RuntimeUniverse.h\"
- #include \"cling/Interpreter/DynamicLookupRuntimeUniverse.h\"
- namespace cling { class Interpreter; namespace runtime { Interpreter* gCling }}}
- PrintValue
These are passed to Cling as string and initialized at the start up time. So I think it makes sense to reduce top-level global variables, #includes and virtual functions.
1. Global variables
If we break at emitModule, we can get a list of global variables and functions which are actually deserialized. These include functions, variables, STL classes and all the functions derives from them.
I tried to change them to for example constexpr, so that it's processed at compile time.
2. Eagerly Deserialized decls
Thanks to @Axel 's hint and tip, we could minimize eagerly deserialized decls deserialized in ASTReader::PassInterestingDeclsToConsumer. We already removed most of eagerly deserialized decls (Some are remaining to be removed, some are hard to remove and some don't cost a lot).
So far, we got 9.2% of cpu time improvement and 8.8% of memory improvement at start up time in release build.
- root.exe -q -l
- master
cpu time = 0.09186914285714286 sec (average of 7 times)
res memory = 142.008 Mbytes
- HEAD
cpu time = 0.08337842857142856 sec
res memory = 129.508 Mbytes
- hsimple.C
Improved by 13% of cpu time and 8.5% of memory
- master
cpu time = 0.0954708 sec (average)
res memory = 142.891 Mbytes
- HEAD
cpu time = 0.0833258 sec
res memory = 130.73 Mbytes
With modules
- Improvement by 17.7% in cputime and 2% in memory on root.exe -q -l
(For memory, small improvement is because most of the memory is taken by LoadModules)
- With this patch, modules is 11.2% slower in cpu time and 6% better in residential memory.
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/
set the AuxTarget, if the LangOpt CUDA is true and enable the compilation of cuda runtime code
needs a preload of the libcudart.so and the arguments -std=c++11 and --cuda-host-only at start of cling
- cling: add missing symbol in the export list and fix semicolon issue in CMakeList.txt (it has to be in quotes)
- cling-demo: export symbols and format hexadecimal output
Using unary operator address of (eg. MyClass m; &m) takes into account
overloaded operators which may not give us the precide address of the
allocated storage.
This patch teaches cling to use std::addressof instead.
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).