Author Topic: How to load Clang-13 compiler for Codeblocks on Ubuntu  (Read 4886 times)

Offline pabristow

  • Multiple posting newcomer
  • *
  • Posts: 75
How to load Clang-13 compiler for Codeblocks on Ubuntu
« on: April 27, 2022, 06:58:17 pm »
I have installed clang-12 OK and can compiler and link and run with it.
But when I try the analogous command for version 13
   sudo apt-get install clang-13 lldb-13 lld-13 --install-suggests

I just get

 Package clang-13 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source.

https://apt.llvm.org/  suggests that version 13 (and later) are available

To install just clang, lld and lldb (13 release):

apt-get install clang-13 lldb-13 lld-13

with same messages.

I have also found
https://packages.ubuntu.com/source/impish/llvm-toolchain-13

but don't know how to install it.

Any hints for install novice?  Thanks.




Offline jordi

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: How to load Clang-13 compiler for Codeblocks on Ubuntu
« Reply #1 on: April 27, 2022, 07:28:12 pm »
It seems that the package is not in the repository of your ubuntu release.
You could execute the following command to verify it:
apt-cache search clang-1

Online Commaster

  • Almost regular
  • **
  • Posts: 171
Re: How to load Clang-13 compiler for Codeblocks on Ubuntu
« Reply #2 on: April 27, 2022, 08:24:10 pm »
As you can see here Clang 13 is only available in ubuntu 21.10 (Impish) and newer.

You can match your current release
Code
> lsb_release -dirc
to this list and see which are available/supported.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: How to load Clang-13 compiler for Codeblocks on Ubuntu
« Reply #3 on: April 27, 2022, 10:53:01 pm »
Maybe this will help.

https://apt.llvm.org/

I've used the automatic installer with the <version number> parameter and it work well on Windows WSL Ubuntu

After the install, clang ended up in /usr/bin/ as clang-13<whatever>
Code
pecan@Zbook17:~$ whereis clang-13
clang-13: /usr/bin/clang-13 /usr/share/man/man1/clang-13.1.gz
pecan@Zbook17:~$ cd /usr/bin
pecan@Zbook17:/usr/bin$ ls clang*
clang++-10                   clang-check-10           clang-format-diff         clang-query-10
clang++-13                   clang-cl-10              clang-format-diff-10      clang-refactor-10
clang-10                     clang-cpp-10             clang-import-test-10      clang-rename-10
clang-13                     clang-cpp-13             clang-include-fixer-10    clang-reorder-fields-10
clang-apply-replacements     clang-doc-10             clang-move-10             clang-scan-deps-10
clang-apply-replacements-10  clang-extdef-mapping-10  clang-offload-bundler-10  clangd
clang-change-namespace-10    clang-format             clang-offload-wrapper-10
clang-check                  clang-format-10          clang-query
pecan@Zbook17:/usr/bin$
« Last Edit: April 27, 2022, 11:04:19 pm by Pecan »

Offline pabristow

  • Multiple posting newcomer
  • *
  • Posts: 75
Re: How to load Clang-13 compiler for Codeblocks on Ubuntu
« Reply #4 on: April 28, 2022, 04:14:59 pm »
Correct. 
https://apt.llvm.org/
For convenience there is an automatic installation script available that installs LLVM for you.

"To install a specific version of LLVM:

Code
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 13

and got expected clang++-13 files.

Thanks.

Online Commaster

  • Almost regular
  • **
  • Posts: 171
Re: How to load Clang-13 compiler for Codeblocks on Ubuntu
« Reply #5 on: April 28, 2022, 07:47:05 pm »
On one hand the page https://apt.llvm.org/ even has apt repository settings for every Ubuntu version if you scroll down...

On the other hand, this is not related to Code::Blocks according to the rules.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: How to load Clang-13 compiler for Codeblocks on Ubuntu
« Reply #6 on: April 28, 2022, 08:10:35 pm »
On one hand the page https://apt.llvm.org/ even has apt repository settings for every Ubuntu version if you scroll down...

On the other hand, this is not related to Code::Blocks according to the rules.

Hmmm, we help with gcc and mingw etc. Why not clang?
Where, in the rules, does it say we won't help with an addition of and configuration of compilers used within CB ?
I think that rule should be changed.

Is there something other than rule 5: that looks like it means we help set up and configuration?
Code
5. Before posting, look where you post. There's the "Using CodeBlocks" board to help newbies set up their compilers and change their configuration.
« Last Edit: April 28, 2022, 08:18:38 pm by Pecan »