Repository navigation
Conversation
| cmake --build . --parallel "${ncpus}" | ||
| cmake --install . | ||
|
|
||
| # Stage cling's runtime headers and modulemaps as ROOT, |
There was a problem hiding this comment.
Why cmake install does not install them?
There was a problem hiding this comment.
.modulemap files in the source tree are not installed https://github.com/root-project/cling/blob/1807a1e6f8819029e0931e8c829de794db60f71f/CMakeLists.txt#L406-L413 check here there
is no .modulemap extension. Moreover, adding *.modulemap is not enough, because there are two module.modulemap, one is for cling's own way to include its own compile time headers
(the headers include llvm), other for being able to support using modules with cling, which is named module.modulemap.build and it is renamed to the module.modulemap later. So if we
just add *.modulemap to the cmake list, it will lead to install wrong modulemap.
How ROOT solves it: https://github.com/root-project/root/blob/master/core/clingutils/CMakeLists.txt#L158 it installs other necessary .modulemap files while excluding
module.modulemap(cling's compile time headers),
https://github.com/root-project/root/blob/master/core/clingutils/CMakeLists.txt#L171
Later, installs and renames module.modulemap.build (Runtime module) . So either we change cling code, or install these in CI manually.
There was a problem hiding this comment.
I just duplicated ROOT's code but seems like we do not need to install runtime headers, the reason cling installs them is to build a .pch for runtime headers, so probably it is enough to install necessary .modulemap files
|
Is that not needed anymore? |
Yes we solved it on Cling side |
Cling cannot use -fmodules after cmake --install.
libstdc++ and glibc do not supply modulemaps. cling supplies its own. But its install rule does not copy .modulemap files.
https://github.com/root-project/cling/blob/1807a1e6f8819029e0931e8c829de794db60f71f/CMakeLists.txt#L405-L413
And without modulemaps this PR introduces, cling can not work in module mode.
So we are copying these modulemaps into an etc/Interpreter directory as ROOT does, https://github.com/root-project/root/blob/3de9c792f4c8594f6a360e18b7b604c06879439c/core/clingutils/CMakeLists.txt#L158-L180
The PR is linux limited, the problem itself and the way ROOT handles it were different for macos and microsoft
@vgvassilev