cling icon indicating copy to clipboard operation
cling copied to clipboard

Allowing clang to be built from an external repo

Open rblake-llnl opened this issue 4 years ago • 10 comments

Useful for packaging Cling with spack, intended to be used with this integration of the ROOT cling-patches onto llvm-project's repository.

New location of the cling-patches, integrated with llvm-project and based off of [email protected]:

https://github.com/rblake-llnl/llvm-project/tree/cling-patches/clang

Old location of the clang cling-patches, standalone

http://root.cern.ch/git/clang.git , branch cling-patches.

I also have a version of llvm-project that can be used to build cling with spack standalone. This links to the github project using git submodules.

https://github.com/rblake-llnl/llvm-project/tree/full-cling-build/

rblake-llnl avatar Jun 18 '20 00:06 rblake-llnl

I'm not sure why this is failing-- the errors say that it can't find llvm's llvm/Config/config.h file. The changes I've made shouldn't affect this because I'm not changing the directory of llvm's includes.

rblake-llnl avatar Jun 22 '20 22:06 rblake-llnl

Here's a source tree that can be used to build cling inline with clang rebased off of LLVM's base repository.

https://github.com/rblake-llnl/llvm-project/tree/full-cling-build

rblake-llnl avatar Jun 22 '20 22:06 rblake-llnl

@rblake-llnl Can you please write, how to build cling with the mono repo. I want to test it, but I'm not able to compile it.

SimeonEhrig avatar Jun 24 '20 15:06 SimeonEhrig

git clone https://github.com/rblake-llnl/llvm-project
cd llvm-project
git checkout full-cling-build
git submodule update --init
mkdir build
cd build
cmake "-DLLVM_ENABLE_PROJECTS:STRING=clang;clang-tools-extra" ../llvm
make

AFAICT, llvm and clang used to be subversion based with llvm and clang as separate subdirectories. This way, a single subversion revision could represent both llvm and clang at once. When llvm moved over to git, they designed their git repository so that a single git SHA could represent a snapshot of both llvm and clang. This had the unfortunate side effect of moving llvm and clang into the same top level directory. This differs from how cling developers set up their git repository-- they based it off of the old subversion repository. This lead to an incompatibility with how upstream llvm migrated over to git.

Checking around with gitk, you can see that all I did was rebase all the changes in http://root.cern.ch/git/clang.git onto the 5.0.2 branch of https://github.com/llvm/llvm-project, then added a submodule for cling based on http://root.cern.ch/git/cling.git to put it in the location as prescribed by the cling build instructions.

I need this pull request to use the script above. The problem is that the clang directory is not parallel with the cling directory when using the llvm-project directory layout.

What I don't know: how to build cling standalone without this? How is Travis building cling standalone, thus generating an error?

rblake-llnl avatar Jun 24 '20 20:06 rblake-llnl

What I don't know: how to build cling standalone without this? How is Travis building cling standalone, thus generating an error?

Travis use cpt tool to build cling and test it. If I'm correct, you don't modify this tool and/or the travis job and travis simply download the original, speperated ROOT LLVM and Clang repos. So the Travis error is not related to your changes.

SimeonEhrig avatar Jun 25 '20 07:06 SimeonEhrig

Also, I'm not sure if it's useful to anyone on the cling team, but I've rebased the cling team's patches to clang on llvm-6, llvm-7, and so on all the way to llvm-10. Some of them no longer compile, in particular llvm-8 changed they way that the virtual file system cache works in a way that caused havok with cling's patches. I tried to clean it up as best I could, but I'm sure I missed something.

If you'd like me to publish those patches as well, I can make them available. It might benefit someone to get cling available on a newer compiler than llvm-5.0.2

rblake-llnl avatar Jun 25 '20 07:06 rblake-llnl

In general, it is planned to update the llvm base to a new version. I know, an upgrade was planned for the spring this year, but the Corvid situation changed a lot of. So, I'm not sure what is the current status of the upgrade.In the near future I would like to talk to @Axel-Naumann about the upgrade, because I am personally interested in it, because the support of new CUDA versions is enabled by new clang versions.

SimeonEhrig avatar Jun 25 '20 07:06 SimeonEhrig

I found the reason the for config.h error. See #349

SimeonEhrig avatar Jun 25 '20 09:06 SimeonEhrig

I am glad someone addresses getting Cling into my favorite package manager :tada:

Should this PR be revived? :) @vgvassilev @Axel-Naumann

ax3l avatar Oct 14 '20 07:10 ax3l

I believe this repo is just a mirror, consider moving your PR here instead: https://github.com/root-project/root/pulls (subdirectory interpreter/cling). Thanks!

ferdymercury avatar Apr 12 '24 09:04 ferdymercury