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

LLVM_full_jll does not contain clang++ #769

Closed
tkf opened this issue Apr 5, 2020 · 4 comments · Fixed by #786
Closed

LLVM_full_jll does not contain clang++ #769

tkf opened this issue Apr 5, 2020 · 4 comments · Fixed by #786

Comments

@tkf
Copy link

tkf commented Apr 5, 2020

To use LLVM 10 to build julia, I needed to add a symlink clang++ manually like this JuliaLang/julia#35341 (comment):

tooldir=$HOME/.julia/artifacts/8cd56e3e81e5770720c31304026f3b23f129153e/tools
cd $tooldir
ln -s clang-10 clang++
cd -
... PATH="$tooldir:$PATH" make USECLANG=1 ...

Is it intentional that LLVM_full_jll contains a symlink clang but not clang++? If not, can this be added to the distribution?

@vchuravy
Copy link
Member

vchuravy commented Apr 6, 2020

clang++ vs clang makes no difference in my experience. But we don't do anything different from the upstream project here.

@tkf
Copy link
Author

tkf commented Apr 6, 2020

Specifying CXX=$tooldir/clang did work for me but I thought it'd be nice if I can just set PATH="$tooldir:$PATH" as then make would pick up other CLIs like llvm-config and llvm-symbolizer.

So maybe it's better to set CXX to clang when USECLANG? Currently it's CXX := $(CROSS_COMPILE)clang++.

@maleadt
Copy link
Contributor

maleadt commented Apr 7, 2020

clang++ vs clang makes no difference in my experience.

It does change the default language selection:

tim@taurus /tmp$ cat test.h                                                                                                                                                                                                                                                   
#ifdef __cplusplus
#error C++
#else
#error C
#endif

tim@taurus /tmp$ clang test.h                                                                                                                                                                                                                                                 
test.h:4:2: error: C
#error C
 ^
1 error generated.

tim@taurus /tmp$ clang++ test.h                                                                                                                                                                                                                                               
clang-9: warning: treating 'c-header' input as 'c++-header' when in C++ mode, this behavior is deprecated [-Wdeprecated]
test.h:2:2: error: C++
#error C++
 ^
1 error generated

But we don't do anything different from the upstream project here.

When building LLVM/Clang with the Julia build system but not using BB we do get a symlink:

$ ls -la ./deps/llvm-6.0.1/build_Release/bin/clang++
lrwxrwxrwx 1 maleadt maleadt 9 Mar 29 16:19 ./deps/llvm-6.0.1/build_Release/bin/clang++ -> clang-6.0

And this seems to be done by upstream: https://github.com/llvm/llvm-project/blob/717a460867633008520713614018f3c37503a5ca/clang/tools/driver/CMakeLists.txt#L65-L71

So for consistency, and to make the LLVM_full tarball as usable as possible as a toolchain outside of Julia, it would be useful if it included these symlinks.

@vchuravy
Copy link
Member

vchuravy commented Apr 7, 2020

Huh, I then wonder why we don't. Didn't change the buildscript in any way. Happy to take PRs

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 a pull request may close this issue.

3 participants