Skip to content

Conversation

@vgvassilev
Copy link
Member

Depends on #3850.

@phsft-bot
Copy link

Starting build on ROOT-performance-centos7-multicore/default, ROOT-fedora27/noimt, ROOT-fedora29/python3, ROOT-ubuntu16/rtcxxmod, mac1014/cxx17, windows10/default
How to customize builds

@phsft-bot
Copy link

Starting build on ROOT-performance-centos7-multicore/default, ROOT-fedora27/noimt, ROOT-fedora29/python3, ROOT-ubuntu16/rtcxxmod, mac1014/cxx17, windows10/default
How to customize builds

@vgvassilev vgvassilev force-pushed the cxxmodules-kill-rootmaps branch 2 times, most recently from e7a5641 to 4c11030 Compare July 5, 2019 08:55
@phsft-bot
Copy link

Starting build on ROOT-performance-centos7-multicore/default, ROOT-fedora27/noimt, ROOT-fedora29/python3, ROOT-ubuntu16/rtcxxmod, mac1014/cxx17, windows10/default
How to customize builds

@root-project root-project deleted a comment from phsft-bot Jul 5, 2019
@root-project root-project deleted a comment from phsft-bot Jul 5, 2019
@root-project root-project deleted a comment from phsft-bot Jul 5, 2019
@phsft-bot
Copy link

Starting build on ROOT-performance-centos7-multicore/default, ROOT-fedora27/noimt, ROOT-fedora29/python3, ROOT-ubuntu16/rtcxxmod, mac1014/cxx17, windows10/default
How to customize builds

@phsft-bot
Copy link

Starting build on ROOT-performance-centos7-multicore/default, ROOT-fedora27/noimt, ROOT-fedora29/python3, ROOT-ubuntu16/rtcxxmod, mac1014/cxx17, windows10/default
How to customize builds

@phsft-bot
Copy link

Build failed on ROOT-ubuntu16/rtcxxmod.
See console output.

Errors:

  • FAILED: cd /mnt/build/workspace/root-pullrequests-build/build/tutorials && LD_LIBRARY_PATH=/mnt/build/workspace/root-pullrequests-build/build/lib: ROOTIGNOREPREFIX=1 ROOT_HIST=0 /mnt/build/workspace/root-pullrequests-build/build/bin/root.exe -l -q -b -n -x hsimple.C -e return

@vgvassilev vgvassilev force-pushed the cxxmodules-kill-rootmaps branch from eeae536 to bcf826a Compare July 7, 2019 19:38
@phsft-bot
Copy link

Starting build on ROOT-performance-centos7-multicore/default, ROOT-fedora27/noimt, ROOT-fedora29/python3, ROOT-ubuntu16/rtcxxmod, mac1014/cxx17, windows10/default
How to customize builds

@phsft-bot
Copy link

Starting build on ROOT-performance-centos7-multicore/default, ROOT-fedora27/noimt, ROOT-fedora29/python3, ROOT-ubuntu16/rtcxxmod, mac1014/cxx17, windows10/default
How to customize builds

@phsft-bot
Copy link

Build failed on ROOT-fedora27/noimt.
See console output.

Failing tests:

@phsft-bot
Copy link

Starting build on ROOT-performance-centos7-multicore/default, ROOT-fedora27/noimt, ROOT-fedora29/python3, ROOT-ubuntu16/rtcxxmod, mac1014/cxx17, windows10/default with flags -DCTEST_TEST_EXCLUDE_NONE=On
How to customize builds

Move common code into lambda. Extract out the lookup in dynamic sections into
a separate routine.
Both data structures are used to store the dirname of the system and non-system
library respectively. Their use is to provide a stable offset for the
LibraryPath.
…in ACLiC

When ACLiC builds a shared library it does either explicit linking (enumerating
all related libraries with -l) or implicit symbol resolution. When ROOT6
appeared we could only rely on rootmaps to compute library dependencies and
this hardened the implementation of explicit linking.

Explicit linking happens in two ways:
  1. We read all rootmap files and store a mapping qualified name -> library.
     Whenever we read a RecordDecl when generating a dictionary in rootcling
     we check if the RecordDecl's qualified name exists in the map and store the
     corresponding library in a special *.out file.
  2. In the case of runtime_cxxmodule, if the -cxxmodule flag is passed to
     rootcling, whenever we deserialize a declaration we fill that information
     from RecordDecl's owning module.

This approach is suboptimal because the deserialized declaration can be a
forward declaration or codegen decided not to produce code because the entity
was not ord-used. We cannot use explicit linking when ROOT is running in mixed
mode, that is it has -Druntime_cxxmodules=On and no -cxxmodule flag in
rootcling.

The implicit linking means we do not use explicit linking but resolve undefined
symbols at library loading time. This is the preferrable way to resolve symbols
but it can be tricky and unefficient. It happens in two ways:
  1. Upon loading of a shared library we listen to a callback if the library
     failed to load. The dynamic linker gives an 'undefined symbol' error which
     we search for in the LD_LIBRARY_PATH.
  2. It can happen that the library loads successfully and the symbol lookup
     fails later. Currently there is no way to subscribe to such an event.

This patch enables implicit linking for the 2nd way solving the deficiency of
explicit linking when ROOT runs in hybrid mode. In that rare case, we iterate
over all undefined symbols in a given library and try to find their definitions
in the list of predefined library paths.

Currently the behavior is O(n*m) where n is the number of the undefined symbols
and m is the number of libraries. We can use a combination of caching and bloom
filters to improve the performance but it is not worth it, given the almost
corner-case we are in. An easier optimization is to check if the symbol is
resolvable via dlsym which means that the library contains an undefined symbol
but it was already loaded. This simple optimization brings ~30% improvement.
We have user library search paths which come from LD_LIBRARY_PATH or similar;
and system library search paths which are coming from the platform.

This patch enables external users performing symbol resolution to filter out
system search paths when they know the symbol cannot be there.

Now, TClingCallbacks can merge the modules vs non-modules code paths, where
the modules prebuilt path is essentially our LD_LIBRARY_PATH.
@vgvassilev vgvassilev force-pushed the cxxmodules-kill-rootmaps branch from c78f4f6 to ea2ea42 Compare July 18, 2019 07:29
@phsft-bot
Copy link

Starting build on ROOT-performance-centos7-multicore/default, ROOT-fedora27/noimt, ROOT-fedora29/python3, ROOT-ubuntu16/rtcxxmod, mac1014/cxx17, windows10/default with flags -DCTEST_TEST_EXCLUDE_NONE=On
How to customize builds

@vgvassilev
Copy link
Member Author

@phsft-bot build with flags -DCTEST_TEST_EXCLUDE_NONE=On

@phsft-bot
Copy link

Starting build on ROOT-performance-centos7-multicore/default, ROOT-fedora27/noimt, ROOT-fedora29/python3, ROOT-ubuntu16/rtcxxmod, mac1014/cxx17, windows10/default with flags -DCTEST_TEST_EXCLUDE_NONE=On
How to customize builds

@phsft-bot
Copy link

Build failed on ROOT-fedora29/python3.
See console output.

@phsft-bot
Copy link

Build failed on ROOT-fedora27/noimt.
See console output.

@phsft-bot
Copy link

Build failed on ROOT-ubuntu16/rtcxxmod.
See console output.

@phsft-bot
Copy link

Build failed on windows10/default.
See console output.

Errors:

  • CMake Error at TBB-stamp/TBB-download-Release.cmake:49 (message):

@vgvassilev
Copy link
Member Author

@phsft-bot build with flags -DCTEST_TEST_EXCLUDE_NONE=On

@phsft-bot
Copy link

Starting build on ROOT-performance-centos7-multicore/default, ROOT-fedora27/noimt, ROOT-fedora29/python3, ROOT-ubuntu16/rtcxxmod, mac1014/cxx17, windows10/default with flags -DCTEST_TEST_EXCLUDE_NONE=On
How to customize builds

@vgvassilev vgvassilev merged commit 410ffd3 into root-project:master Jul 18, 2019
@vgvassilev vgvassilev deleted the cxxmodules-kill-rootmaps branch July 18, 2019 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants