Skip to content
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

Allowing clang to be built from an external repo #348

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rblake-llnl
Copy link

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 llvm@5.0.2:

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/

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 llvm@5.0.2:
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.
@rblake-llnl
Copy link
Author

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
Copy link
Author

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

@SimeonEhrig
Copy link
Contributor

@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.

@rblake-llnl
Copy link
Author

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?

@SimeonEhrig
Copy link
Contributor

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.

@rblake-llnl
Copy link
Author

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

@SimeonEhrig
Copy link
Contributor

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
Copy link
Contributor

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

CMakeLists.txt Outdated Show resolved Hide resolved
Co-authored-by: Vassil Vassilev <v.g.vassilev@gmail.com>
@ax3l
Copy link
Collaborator

ax3l commented Oct 14, 2020

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

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

@ferdymercury
Copy link
Contributor

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!

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.

None yet

5 participants