Building clang

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Building clang

Hubert Tong via cfe-dev
Hi,

What is the fastest way to build clang from source? Currently I am using the following:

```
cmake -DLLVM_ENABLE_PROJECTS="clang" -G "Ninja" ../llvm
ninja
```

Kindly,

Anshil

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building clang

Hubert Tong via cfe-dev
It's typically a big performance improvement to leverage ccache and to use lld as the linker.

See "LLVM_ENABLE_LLD" and "LLVM_CCACHE_BUILD"  in https://llvm.org/docs/CMake.html#llvm-specific-variables

On Sun, Aug 23, 2020 at 1:12 PM Anshil Gandhi via cfe-dev <[hidden email]> wrote:
Hi,

What is the fastest way to build clang from source? Currently I am using the following:

```
cmake -DLLVM_ENABLE_PROJECTS="clang" -G "Ninja" ../llvm
ninja
```

Kindly,

Anshil
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


--
-Brian

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building clang

Hubert Tong via cfe-dev
On Sun, Aug 23, 2020 at 01:21:30PM -0500, Brian Cain via cfe-dev wrote:
> It's typically a big performance improvement to leverage ccache and to use
> lld as the linker.

Using ccache will normally not result in any performance improvements
for a one-off build and typically even decrease performance. Whether it
helps for update builds is questionable too.

Joerg
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building clang

Hubert Tong via cfe-dev
To improve speed of building, you may consider the argument DLLVM_BUILD_TESTS (I have OFF for this argument), DLLVM_TARGETS_TO_BUILD (x86 maybe), DLLVM_ENABLE_PROJECTS - select only projects that you need.

Hope that help!

----------------
Best regards,
Thien Tran.


On Sun, 23 Aug 2020 at 22:55, Joerg Sonnenberger via cfe-dev <[hidden email]> wrote:
On Sun, Aug 23, 2020 at 01:21:30PM -0500, Brian Cain via cfe-dev wrote:
> It's typically a big performance improvement to leverage ccache and to use
> lld as the linker.

Using ccache will normally not result in any performance improvements
for a one-off build and typically even decrease performance. Whether it
helps for update builds is questionable too.

Joerg
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev