Skip to content

Instantly share code, notes, and snippets.

View christopherbate's full-sized avatar

Christopher Bate christopherbate

  • Boulder, CO
View GitHub Profile
@christopherbate
christopherbate / mlir-tensorrt-build-wheels.sh
Last active January 14, 2026 21:06
Build MLIR-TensorRT wheels (self-contained script).
#!/usr/bin/env bash
set -euo pipefail
git clone https://github.com/NVIDIA/TensorRT-Incubator.git
cd TensorRT-Incubator/mlir-tensorrt
# Checkout a specific commit/tag if desired.
# Recommended toolchain components:
# - clang 20, lld 20, cmake 4+, ninja, ccache
# - We use `uv` to manage build Python wheels.
@christopherbate
christopherbate / DebugCMakeScriptModeAddCustomCommand.md
Last active February 14, 2025 15:23
Debugging CMake build-time script mode calls from `add_custom_command`

Recently, I wanted to understand what was occuring in some CMake script run by LLVM's CMake build system. It runs at build time via add_custom_command, invoking CMake in script mode (-P). I was trying to find out what happens in the script when ${llvm_source_dir} is empty. The internal details of GenerateVersionFromVCS were a bit hard to follow.

  set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSRevision.h")
  set(generate_vcs_version_script "${LLVM_CMAKE_DIR}/GenerateVersionFromVCS.cmake")