-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
C++ Modules support (based on Clang) #15248
Comments
A new Issue was created by @davidlt . @davidlange6, @smuzaffar, @davidlt, @Dr15Jones can you please review it and eventually sign/assign? Thanks. cms-bot commands are listed here |
@vgvassilev: iostream.h -> iostream |
@vgvassilev if we use
|
Correction, same happens even if I don't use |
You can find I have used it with the failing command:
Output
Got 37M partial rootfs tarball with 1278 files touched in this execution. 483 headers are found in this tarball. You can grab it from: http://davidlt.web.cern.ch/davidlt/vault/cppmodules_partial_rootfs.tar.gz |
@davidlt yes I can reproduce the issue outside now. Thanks a lot! |
Some debugging aids (suggested by Richard Smith):
If a name is not visible in a modules build but is visible in a non-modules build, i usually find that's due to one of two things
|
A flavor of the |
It may be worth to give another try as the blocking issue was resolved. |
We now have a list of the cyclic dependencies in the headers of CMS master: https://teemperor.de/pub/cms/cycle_report.cycle.html (Should be updated every few seconds). It also contains some debugging help on how to break those cyclic dependencies. You can run this program to get the same output for your local changes: https://github.com/Teemperor/circle-break |
closing this issue. We have CXXMODULE IBs dedicated for this |
The C++ modules feature as described in https://clang.llvm.org/docs/Modules.html allow producing a binary header representation to avoid redundant header reparsing. This feature is used in ROOT's dictionary system since ROOT v6.20: https://github.com/root-project/root/blob/master/README/README.CXXMODULES.md CMSSW and other experiment migrate their dictionaries to use the provided by ROOT C++ modules support: cms-sw/cmssw#15248 Dictionaries which transiently include clhep can be further optimized by building a separate module for CLHEP which this MR aims for. The current patch introduces a module.modulemap file containing a mapping between a binary artifact (a module or a pcm file) and a set of header files. The C++ modules are more picky on translation unit encapsulation and thus require all headers which a translation unit uses to be included. In addition to the missing include we outline a few virtual destructors to avoid pollution of .o files with weak virtual tables. This patch enables builds with modules via rootcling/genreflex/rootcint and enables compile-time module builds if configured like: cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS="-fmodules -Xclang -fmodules-local-submodule-visibility" ../clhep/ The module.modulemap file is easy to maintain as it globs for the well-behaved header files and enumerates already the ones needed special treatment. Once merged we will backport this to cmssw. Conflicts: Matrix/src/DiagMatrix.cc Matrix/src/GenMatrix.cc Matrix/src/Matrix.cc Matrix/src/SymMatrix.cc Matrix/src/Vector.cc
The current very basic draft exist here: https://github.com/davidlt/cmssw/tree/cpp-modules
It can only be used with DEVEL IBs as it requires Clang pre-3.9. We will be updating Clang as needed in DEVEL IBs.
How to use it?
The text was updated successfully, but these errors were encountered: