# Chapel with LLVM/CLANG

**URL:** <https://chapel.discourse.group/t/chapel-with-llvm-clang/8197>\
**Category:** Users\
**Created:** [November 17, 2021, 4:04am UTC](https://chapel.discourse.group/t/chapel-with-llvm-clang/8197 "2021-11-17T04:04:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![damianmoz](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/damianmoz/32/319_2.png) [@damianmoz](https://chapel.discourse.group/u/damianmoz)\
**Post date:** [November 17, 2021, 4:04am UTC](https://chapel.discourse.group/t/chapel-with-llvm-clang/8197/1 "2021-11-17T04:04:51Z")

</div>

I am about to try Chapel with Clang/LLVM. It appears that doing so builds both Clang and LLVM. Is this correct?

Will trying to do so on a LINUX system with CLANG and LLVM already installed, but only 3.4.2, cause any grief?

Thanks - Damian

---

<div class="post-metadata">

**Author:** ![mppf](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mppf](https://chapel.discourse.group/u/mppf)\
**Post date:** [November 17, 2021, 3:01pm UTC](https://chapel.discourse.group/t/chapel-with-llvm-clang/8197/2 "2021-11-17T15:01:03Z")

</div>

Hi Damian -

It's easiest to work with a system install of LLVM 11 if that is available to you (mainly to avoid the long `make` time for LLVM). If not, you can build the bundled version yourself and that should work just fine even if you have another, older clang and LLVM installed system-wide. As always please let us know if you run into problems here.

---

<div class="post-metadata">

**Author:** ![damianmoz](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/damianmoz/32/319_2.png) [@damianmoz](https://chapel.discourse.group/u/damianmoz)\
**Post date:** [November 17, 2021, 11:36pm UTC](https://chapel.discourse.group/t/chapel-with-llvm-clang/8197/3 "2021-11-17T23:36:11Z")

</div>

Thanks for the advice.

Sadly, RedHat (and CentOS) are not even remotely current in terms of packaged release of LLVM and CLANG.

I will build the bundled copy. I assume that Chapel puts any executables in the same search path as the chapel compiler.

---

<div class="post-metadata">

**Author:** ![bradcray](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/bradcray/32/72_2.png) [@bradcray](https://chapel.discourse.group/u/bradcray)\
**Post date:** [November 17, 2021, 11:45pm UTC](https://chapel.discourse.group/t/chapel-with-llvm-clang/8197/4 "2021-11-17T23:45:48Z")

</div>

Hi Damian —

> [@damianmoz](#):
>
> RedHat (and CentOS) are not even remotely current in terms of packaged release of LLVM and CLANG.

Not sure whether you'll have seen it, but in the [prereqs](https://chapel-lang.org/docs/usingchapel/prereqs.html#installation) file, for CentOS, it suggests:

```Chapel
sudo dnf install gcc gcc-c++ m4 perl python3 python3-devel bash make gawk\
 git cmake llvm-devel clang clang-devel 

```

if that's an option.

> [@damianmoz](#):
>
> I assume that Chapel puts any executables in the same search path as the chapel compiler.

I believe that it doesn't do that, but instead leaves them in an `install` directory under the `third-party` directory, where the compiler will know where to find them whenever used with `CHPL_LLVM=bundled`.

As Michael indicated, build time for LLVM is pretty massive. Definitely something to fire off before bed and check on in the morning. `make -j <n>` can help, but can also kill certain systems if n is too high and exhausts memory. Conservatively, I fire off the bundled build when I'm not waiting for it.

-Brad

---

<div class="post-metadata">

**Author:** ![damianmoz](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/damianmoz/32/319_2.png) [@damianmoz](https://chapel.discourse.group/u/damianmoz)\
**Post date:** [November 18, 2021, 10:25pm UTC](https://chapel.discourse.group/t/chapel-with-llvm-clang/8197/5 "2021-11-18T22:25:12Z")

</div>

> Not sure whether you'll have seen it, but in the prereqs file, for CentOS,  
> it suggests:
> 
> sudo dnf install gcc gcc-c++ m4 perl python3 python3-devel bash make gawk  
> git cmake llvm-devel clang clang-devel

Already done. But the last three are version

```
3.4.2

```

which is a long way short of the Version 11 that is needed which is what  
triggered my request in the first place.

> I believe that it doesn't do that, but instead leaves them in an install  
> directory under the third-party directory, where the compiler will know  
> where to find them whenever used with CHPL\_LLVM=bundled.

Smart. No clashes.

> As Michael indicated, build time for LLVM is pretty massive. Definitely  
> something to fire off before bed and check on in the morning. make -j   
> can help, but can also kill certain systems if n is too high and exhausts  
> memory. Conservatively, I fire off the bundled build when I'm not waiting  
> for it.

Wise man. It has 24 cores and 64GB.

Thanks for the advice - Damian

---

<div class="post-metadata">

**Author:** ![bradcray](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/bradcray/32/72_2.png) [@bradcray](https://chapel.discourse.group/u/bradcray)\
**Post date:** [November 18, 2021, 10:41pm UTC](https://chapel.discourse.group/t/chapel-with-llvm-clang/8197/6 "2021-11-18T22:41:50Z")

</div>

> [@damianmoz](#):
>
> But the last three are version
> 
> ```Chapel
> 3.4.2
> 
> ```

I can't say I'm a dnf user, but is there an `update`/`upgrade` style command that would refresh these packages if possible? Unless that number means something different than the 11 we're looking for, it sounds like it dates from the 2013+/-1 period (and even the most conservative system integrators don't tend to lag behind that far in my experience).

-Brad

---

<div class="post-metadata">

**Author:** ![damianmoz](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/damianmoz/32/319_2.png) [@damianmoz](https://chapel.discourse.group/u/damianmoz)\
**Post date:** [November 18, 2021, 11:23pm UTC](https://chapel.discourse.group/t/chapel-with-llvm-clang/8197/7 "2021-11-18T23:23:52Z")

</div>

CentOS/Redhat does with its standard packages.

They have some optional things for GCC/G++ which gives you V10 for those.  
But not for LLVM/CLANG.

A Redhat commercial subscription does have LLVM-11.0.

```
https://access.redhat.com/documentation/es-es/red_hat_developer_tools/1/pdf/using_llvm_11.0.0_toolset/red_hat_developer_tools-1-using_llvm_11.0.0_toolset-en-us.pdf

```

But I am running CentOS.

Don't worry, I will build from scratch.

Thanks - Damian

---

<div class="post-metadata">

**Author:** ![damianmoz](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/damianmoz/32/319_2.png) [@damianmoz](https://chapel.discourse.group/u/damianmoz)\
**Post date:** [November 18, 2021, 11:27pm UTC](https://chapel.discourse.group/t/chapel-with-llvm-clang/8197/8 "2021-11-18T23:27:36Z")

</div>

See also

```
https://forums.centos.org/viewtopic.php?t=78039

```

Stay safe - Damian
