-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
Hugo edited this page Feb 26, 2026
·
1 revision
| Dependency | Notes |
|---|---|
| CMake >= 3.16 | Build system |
| LLVM + Clang (same major version) | Project is developed/tested with LLVM 20 |
| C++20 compiler | Required by the project |
| Python 3 | Needed for smoke/integration scripts (optional) |
brew install cmake llvm@20# Install LLVM repository helper
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 20
# Install build dependencies
sudo apt install -y cmake llvm-20-dev libclang-20-dev clang-20build.sh expects to be run from the build/ directory.
git clone https://github.com/CoreTrace/coretrace-compiler.git
cd coretrace-compiler
mkdir -p build
cd build
../build.shOutput binary: build/cc.
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DLLVM_DIR=$(brew --prefix llvm@20)/lib/cmake/llvm \
-DClang_DIR=$(brew --prefix llvm@20)/lib/cmake/clang \
-DUSE_SHARED_LIB=OFF
cmake --build build --config Releasecmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DLLVM_DIR=/usr/lib/llvm-20/lib/cmake/llvm \
-DClang_DIR=/usr/lib/llvm-20/lib/cmake/clang \
-DCLANG_LINK_CLANG_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DUSE_SHARED_LIB=OFF
cmake --build build -j"$(nproc)"| Option | Default | Purpose |
|---|---|---|
BUILD_TESTS |
OFF |
Build optional C++ test executable if present |
ENABLE_DEBUG_ASAN |
OFF |
Build with ASan + debug flags |
CLANG_RESOURCE_DIR |
auto | Override detected clang resource dir |
CLANG_LINK_CLANG_DYLIB |
platform-dependent | Link clang-cpp shared library |
LLVM_LINK_LLVM_DYLIB |
platform-dependent | Link monolithic LLVM shared library |
./build/cc --help
echo 'int main(){return 0;}' > /tmp/ct_smoke.c
./build/cc /tmp/ct_smoke.c -o /tmp/ct_smoke
/tmp/ct_smoke && echo OK# macOS
bash test/scripts/macos_compile.sh
# Linux
bash test/scripts/linux_compile.shpython3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install git+https://github.com/CoreTrace/coretrace-testkit.git
python test/examples/test_smoke.py
python test/examples/test_help_smoke.py
python test/examples/test_extern_project.pydocker build -f test/docker/Dockerfile .Start
Architecture
Instrumentation
Developer