How to deceive cmake and make llvm test suite computer scientist-friendly again.
This software is made for computer scientist who want to configure the compilation of llvm test-suite (eg. using their own passes) with the new test architecture.
Remember the good ol' time when, to use llvm-test-suite with your own configuration you just had to write your TEST.name.Makefile and TEST.name.report? Now, with this CMake-based architecture, it's impossible. Cmake write all the makefiles for you and there is not way to tell him what you want. clang-hook
is made for you!
In fact, until LLVM 3.7, you could just use configure
to use the old architecture (maybe with a little trick to disable the warning). But since 3.8, configure
contains nothing but the warning.
You just have to configure cmake so that it use clang-hook
as the C compiler and all you have to do is to write the configuration file for clang-hook
.
- LLVM version you want (obviously).
clang-hook
will useclang
,opt
andllc
. - Python3 (>=3.5) and its standard library.
That's all!
Clone the repo, and make install
(global install, need root (not recommended) or a virtualenv) or make localinstall
(local install, I use that).
There is a user documentation.
-
Does it work? Yes, absolutely! I used it a lot of time.
-
How does it work? Well... you really want to know? In this case, there is developper documentation. Otherwise, keep away for this black magic.
-
How do I use it?
export CC=clang-hook
export CXX=clang-hook
cmake path/to/source/tree
make
And obviously, write config files. Look at the examples.
- Can I run
make -j4
. No... sorry.clang-hook
don't like to be run multiple times on the same configuration at the same time. But there is a solution. Use instead
over-make make -j4
- What is this
over-make
anyway? It is a program that synchronisesclang-hook
(and makes them run even faster!). There is a specific documentation. You will need to know how to useclang-hook
anyway. It achieves its task by communicating withclang-hook
using a server-client architecture. In this case,clang-hook
run in network mode, but don't worry, it works the same way for the user.
You want to contribute?! Great! There is a few constraints. First, use only the standard Python3 library and make it work for Python3 in the version we find in Ubuntu packages (or other mainstream distribution). I want to keep it easy to install and relatively easy to use.
If you could follow the PEP-8, it would be great.