-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[cxxmodules] Teach ACLiC to build modules. #3850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cxxmodules] Teach ACLiC to build modules. #3850
Conversation
|
Starting build on |
|
Build failed on mac1014/cxx17. Errors:
|
|
Build failed on ROOT-performance-centos7-multicore/default. Errors:
Warnings:
|
|
Build failed on ROOT-ubuntu16/rtcxxmod. Errors:
Warnings:
|
|
Build failed on ROOT-fedora27/noimt. Errors:
Warnings:
|
|
Build failed on windows10/default. |
|
Build failed on ROOT-fedora29/python3. Errors:
|
b0c6cf9 to
70391d1
Compare
|
Starting build on |
|
Build failed on mac1014/cxx17. Errors:
|
70391d1 to
810b3af
Compare
|
Starting build on |
810b3af to
f9f9396
Compare
|
Starting build on |
f9f9396 to
8c1b72d
Compare
|
Starting build on |
8c1b72d to
9da8355
Compare
|
Starting build on |
|
Build failed on mac1014/cxx17. Errors:
|
9da8355 to
669b288
Compare
|
Starting build on |
|
Build failed on windows10/default. |
669b288 to
f6ba851
Compare
0d51f1a to
c2986f4
Compare
|
Starting build on |
|
Build failed on windows10/default. |
c2986f4 to
b6e839d
Compare
|
Starting build on |
|
Build failed on windows10/default. Warnings:
|
b6e839d to
fafed31
Compare
|
Starting build on |
fafed31 to
03f9162
Compare
|
Starting build on |
|
@phsft-bot build with flags -DCTEST_TEST_EXCLUDE_NONE=On @Axel-Naumann could you take a look, I’d like to land it soon. |
|
Starting build on |
Axel-Naumann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, lot of good stuff here!
03f9162 to
3a0b63d
Compare
|
Starting build on |
|
Build failed on mac1014/cxx17. Warnings:
Failing tests: |
Axel-Naumann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please adjust the FIXME comment - otherwise fine, thanks!
core/base/src/TSystem.cxx
Outdated
| rcling.Append(filename_fullpath).Append("\" \"").Append(linkdef).Append("\"");; | ||
|
|
||
| // Create a modulemap | ||
| // FIXME: Merge the generation from cmake and here in rootcling. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot parse the comment. Do you mean "Merge this module file generation with that in cmake"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The modulemap generation is what I meant. I will clarify.
ACLiC now synthesizes a modulemap with a suffix _ACLiC_dict.modulemap. The file contains the source file to be compiled and the corresponding library. The modulemap is then passed to rootcling via -fmodule-map-file= flag to avoid naming clashes with possibly existing other modulemap files. This patch teaches cling to work with the -fmodule-map-file= flag. ACLiC supports automatic inclusion of Rtypes.h (making ClassDef macro available). Modules are built in isolation and are resilient to #include of Rtypes.h at rootcling startup time. We make module Core (containing Rtypes.h) visible via a newly implemented callback.
If the user calls rootcling ... /full/path/a.h, and the current working directory is /full/path/ rootcling removes the full path and #includes "a.h" instead of what the user specified on the prompt. This odd feature caused problems for modules in ACLiC because the generated modulemap contained the full path to the header (i.e. header "/full/path/a.h") which confuses the modules system as it could not detect it is the same header in case where no include guards or #pragma once exist. This patch centralizes the rootcling make-path-relative logic into a function accessible from ACLiC in TSystem.
…ing.
ACLiC has the following modes to autoload and select whether and how ACLiC
tracks the dependency of the libraries:
0 - No tracking
1 - [Default] New libraries are explicitly linked to all currently loaded
libraries
2 - Generate and use rootmap file for each library
3 - Generate rootmap file for each library _and_ explicitly link to the
needed libraries.
On Windows, the default is 3
This patch enables cxxmodules for mode 2 and 3.
The initial implementation 'almost' allows running it by default except for the
following tests:
* roottest.cling.template.separateDict.roottest_cling_template_separateDict_make
* roottest.root.io.interface.roottest_root_io_interface_make
* roottest.root.meta.evolution.roottest_root_meta_evolution_execCheckSum
* roottest.root.tree.selectorreader.roottest_root_tree_selectorreader_make
* roottest.root.tree.selector.roottest_root_tree_selector_make
* projectroot.roottest.cling.template.roottest_cling_template_runtemplatefriend
We could fix them but enabling modules for 'bare' ACLiC might be too much.
In many cases users have legacy headers or other not well structured C++ code
and that might be problematic.
The intent for the moment is to remove completely rootmap files when we use
-Druntime_cxxmodules=On while keeping the dependency tracking information intact.
3a0b63d to
46939bc
Compare
|
Starting build on |
ACLiC now synthesizes a modulemap with a suffix _ACLiC_dict.modulemap. The file contains the source file to be compiled and the corresponding library.
The modulemap is then passed to rootcling via -fmodule-map-file= flag to avoid naming clashes with possibly existing other modulemap files.
This patch teaches cling to work with the -fmodule-map-file= flag.
ACLiC supports automatic inclusion of Rtypes.h (making ClassDef macro available). Modules are built in isolation and are resilient to #include of Rtypes.h at rootcling startup time. We make module Core (containing Rtypes.h) visible via a newly implemented callback.
Depends on #3798