Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
57e5c25
[cling] Never resolve JIT symbols against legacy MSVC runtimes
aaronj0 Sep 29, 2026
f80cf5b
[cppinterop] Upgrade to upstream e731565e32ae
aaronj0 Oct 1, 2026
5880a0e
[cppinterop] Do not expose inherited special-member constructors [ups…
aaronj0 Aug 19, 2026
140563d
[cppinterop] Require public path between same-template base instantia…
aaronj0 Aug 24, 2026
a3def76
[cppinterop] Use a spellable return type in wrapper codegen [upstream]
aaronj0 Sep 5, 2026
71974c5
[cppinterop] Keep template arguments qualified in GetCompleteName [up…
aaronj0 Sep 5, 2026
e7d988a
[cppinterop] Print type and scope names platform-independently [upstr…
aaronj0 Sep 5, 2026
401eb0d
[cppinterop] Reject ill-formed instantiations in BestOverloadFunction…
aaronj0 Jul 14, 2026
28ac889
[cppinterop] Resolve globals whose symbol exists in no loaded binary …
aaronj0 Sep 8, 2026
b91addf
[cppinterop] Test smart-pointer detection of a templated operator-> […
aaronj0 Sep 29, 2026
cb2b1cb
[cppinterop] Guard lazily deserialized reflection queries with Synthe…
aaronj0 Sep 29, 2026
1f1b755
[cppinterop] Add Cling-specific lookup and codegen patches [ROOT-patch]
aaronj0 Sep 30, 2026
183b30d
[cppinterop] Compile call wrappers without access control [upstream]
aaronj0 Sep 8, 2026
0b6092d
[cppinterop] Share one dispatch table across Windows DLLs [upstream]
aaronj0 Sep 10, 2026
5d23277
[cppinterop] Print template arguments without literal suffixes [ROOT-…
aaronj0 Sep 29, 2026
3a0351f
[cppjit] Vendor upstream cppjit at 7dc6bf0ff
aaronj0 Sep 8, 2026
e65edab
[cppjit] Make GetActualClass robust across platforms [upstream]
aaronj0 Aug 31, 2026
06c929c
[cppjit] Resolve template arguments with real C++ unqualified lookup …
aaronj0 Sep 8, 2026
08bd4f8
[cppjit] Resolve qualified names relative to a parent scope [upstream]
aaronj0 Aug 28, 2026
a926b31
[cppjit] Instantiate templated operator-> in smart-ptr detection [ups…
aaronj0 Sep 8, 2026
dcdc004
[cppjit] Do not autocast to anonymous-namespace types [upstream]
aaronj0 Aug 31, 2026
a584876
[cppjit] Refactor the global call-policy system into GlobalPolicyFlag…
aaronj0 Sep 8, 2026
eac20bd
[cppjit] Match basic_string names with and without default arguments …
aaronj0 Aug 28, 2026
12b3069
[cppjit] Match function-pointer overloads via TCppType_t [upstream]
aaronj0 Sep 8, 2026
6a219a7
[cppjit] Exempt T* const& from the mutable pointer-reference ban [ups…
aaronj0 Aug 28, 2026
4440ed5
[cppjit] Only pythonize size() as __len__ for integer-sized container…
aaronj0 Sep 8, 2026
b5f277b
[cppjit] Retry template lookup with 2-tuples typed as std::pair [upst…
aaronj0 Sep 8, 2026
569dc9d
[cppjit] Type Python complex as std::complex<double> in template args…
aaronj0 Aug 28, 2026
7f37f43
[cppjit] Do not implicitly convert to unrelated stdlib implementation…
aaronj0 Sep 8, 2026
ab10757
[cppjit] Expose non-public methods re-exposed via public using-declar…
aaronj0 Sep 8, 2026
6b54b67
[cppjit] Use comparison operators inherited from base classes [upstream]
aaronj0 Sep 8, 2026
1c74a0e
[cppjit] Search the global scope before the left operand's namespace …
aaronj0 Sep 8, 2026
5ba95a5
[cppjit] Honor the policy flag for implicit smart-pointer conversion …
aaronj0 Sep 8, 2026
8c00e99
[cppjit] Exclude std::tuple from the aggregate pseudo-constructor [up…
aaronj0 Aug 29, 2026
486b322
[cppjit] Accept a Python string from the pretty printer in op_str [up…
aaronj0 Sep 29, 2026
c45b122
[cppjit] Pythonize: add std::span support and no-std wstring aliases …
aaronj0 Sep 8, 2026
4d23d1e
[cppjit] Always convert returned std::string to a Python str [ROOT-pa…
aaronj0 Sep 8, 2026
0bd2d1a
[cppjit] Normalize exposed names to cppjit's canonical form [ROOT-patch]
aaronj0 Sep 8, 2026
2a0c863
[cppjit] Apply ROOT patches to the interop layer [ROOT-patch]
aaronj0 Sep 8, 2026
2ac0671
[cppjit] Use Cpp::GetOrForceDefinition in auto-downcast [ROOT-patch]
aaronj0 Sep 8, 2026
3231aec
[cppjit] Serialize CppInterOp calls with ROOT's interpreter lock [ROO…
aaronj0 Sep 8, 2026
39b519c
[cppjit] Resolve cppjit.gbl.gROOT to its underlying variable [ROOT-pa…
aaronj0 Sep 8, 2026
6574b0d
[cppjit] Apply ROOT-specific patches [ROOT-patch]
aaronj0 Sep 8, 2026
d938521
[cppjit] Adjust cppjit test expectations for the interop migration [R…
aaronj0 Sep 8, 2026
a1f3053
[cppjit] Build the vendored cppjit as PyROOT's cpyrt [ROOT-patch]
aaronj0 Sep 29, 2026
8a2c1cb
[cppjit] Rewire PyROOT from the cppyy stack to vendored cppjit [ROOT-…
aaronj0 Sep 29, 2026
b5a2d0f
[pyroot] Refactor RDF Filter/Define callable dispatch [ROOT-patch]
aaronj0 May 21, 2026
169c777
[misc] Export C++-mangled read-only data from bindexplib [ROOT-patch]
aaronj0 Jul 18, 2026
556b774
[roottest] Disable python-cling-api on Windows [ROOT-patch]
aaronj0 Jul 19, 2026
e6ff412
[tutorials] Disable JIT-heavy fit tutorials on Windows 32 bit [ROOT-p…
aaronj0 Jul 19, 2026
9c5b35d
[cppjit] Cache types resolved through the typeof trampoline [upstream]
guitargeek Sep 27, 2026
c4c40ab
[cppjit] Cache actual class and base offset lookups [upstream]
guitargeek Oct 1, 2026
8058981
[cppjit] Cache subclass checks [upstream]
guitargeek Oct 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 7 additions & 1 deletion bindings/pyroot/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@
# For the licensing terms see $ROOTSYS/LICENSE.
# For the list of contributors see $ROOTSYS/README/CREDITS.

add_subdirectory(cppyy)
# The vendored cppjit tree builds through ROOT-owned CMake files inside it
# (src/, python/, test/); upstream's own top-level CMakeLists.txt is vendored
# but unreferenced.
add_subdirectory(cppjit/src)
add_subdirectory(cppjit/python)
ROOT_ADD_TEST_SUBDIRECTORY(cppjit/test)

add_subdirectory(pythonizations)
15 changes: 15 additions & 0 deletions bindings/pyroot/cppjit/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
BasedOnStyle: LLVM

Language: Cpp
Standard: c++17
PointerAlignment: Left

IncludeCategories:
- Regex: '^"[^/]+\"'
Priority: 10
- Regex: '^"clang/'
Priority: 30
- Regex: '^"llvm/'
Priority: 40
- Regex: '^<'
Priority: 50
33 changes: 33 additions & 0 deletions bindings/pyroot/cppjit/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Byte-compiled
__pycache__/
*.py[cod]

# Built test dictionaries and extension modules
*.so
*.so.*.tmp
*Dict.lock

# Packaging
build/
dist/
*.egg-info/
wheelhouse/

# Test and coverage artifacts
.pytest_cache/
.coverage
.coverage.*
coverage.xml
htmlcov/

# Environments and local config
.venv/
venv/
.env
.envrc
.python-version

# Editors / OS
.idea/
.vscode/
.DS_Store
163 changes: 163 additions & 0 deletions bindings/pyroot/cppjit/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
cmake_minimum_required(VERSION 3.20)
project(CppJIT LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

include(GNUInstallDirs)

# This option won't make a lot of sense since we only ship the shared library in site-packages
# Perhaps this should permanently be OFF and users can build their own CppInterOp if they want to run the tests?
option(CPPJIT_ENABLE_CPPINTEROP_TESTS "enable CppInterOp tests" OFF)
set(CPPINTEROP_GIT_REPOSITORY "https://github.com/compiler-research/CppInterOp.git" CACHE STRING "")
set(CPPINTEROP_GIT_TAG "c8126249dd18363000b89333b34313ca2a83fb82" CACHE STRING "")
set(CPPINTEROP_SOURCE_DIR "" CACHE PATH
"Override default CppInterOp built by ExternalProject_Add, with a path to local CppInterOp source")

# The full Development component requires libpython, which manylinux
# images do not ship and extension modules do not need.
set(Python_FIND_VIRTUALENV ONLY)
find_package(Python COMPONENTS Interpreter Development.Module)
if(NOT Python_FOUND)
set(Python_FIND_VIRTUALENV STANDARD)
find_package(Python COMPONENTS Interpreter Development.Module)
endif()
if(NOT Python_Development.Module_FOUND)
message(FATAL_ERROR "Python development headers not found")
endif()

# The LLVM range the pinned CppInterOp supports; update together with the tag.
set(CPPJIT_LLVM_VERSION_MIN 20)
set(CPPJIT_LLVM_VERSION_MAX 22)

# Runtime fallback anchor for the dispatch (see cppinterop_paths()): the
# installed package under scikit-build-core, the build tree otherwise --
# a plain `cmake --build` yields a runnable tree under <build>/python.
if(SKBUILD)
execute_process(
COMMAND ${Python_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_path('platlib'))"
OUTPUT_VARIABLE _python_platlib
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(CPPINTEROP_INSTALL_PREFIX "${_python_platlib}/cppjit")
else()
set(CPPINTEROP_INSTALL_PREFIX "${CMAKE_BINARY_DIR}")
endif()

# CppInterOp stages into the build tree in the runtime layout; the wheel
# ships a subset of it.
set(CPPINTEROP_STAGE_DIR "${CMAKE_BINARY_DIR}/interop")

# Acquire CppInterOp: an external prebuilt one (CppInterOp_DIR /
# CMAKE_PREFIX_PATH), else the pinned ExternalProject. Exports the
# CPPJIT_INTEROP_* coordinates consumed below.
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/AddCppInterOp.cmake)
cppjit_add_cppinterop()

# this libcppjit.so merges both cpyrt and the interop wrapper
file(GLOB CPYRT_SOURCES CONFIGURE_DEPENDS src/cpyrt/*.cxx)
set(INTEROP_SOURCES
src/interop/interop_wrapper.cxx
src/interop/cppinterop_dispatch.cxx
)

add_library(cppjit SHARED ${CPYRT_SOURCES} ${INTEROP_SOURCES})
if(TARGET CppInterOp)
add_dependencies(cppjit CppInterOp)
endif()

# The wrapper anchors these coordinates at its own load location, falling
# back to the install prefix (see cppinterop_paths()); the clang major
# names the versioned compiler probed for the runtime resource dir.
target_compile_definitions(cppjit PRIVATE
CPPINTEROP_INSTALL_PREFIX="${CPPINTEROP_INSTALL_PREFIX}"
CPPINTEROP_LIBRARY="${CPPJIT_INTEROP_LIBRARY}"
CPPINTEROP_INCLUDE_DIR="${CPPJIT_INTEROP_RUNTIME_INCLUDES}"
CPPJIT_CLANG_MAJOR="${CPPJIT_INTEROP_CLANG_MAJOR}"
CPPJIT_CLANG_INCLUDE_DIR="${CPPJIT_INTEROP_CLANG_DIR}"
$<$<BOOL:${CPPJIT_USE_CLING}>:CPPJIT_USE_CLING>
)

target_include_directories(cppjit PRIVATE
# src/ itself resolves the public "cpyrt/*.h" spellings against the
# flattened src/cpyrt/ directory
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/src/cpyrt
${CMAKE_CURRENT_SOURCE_DIR}/src/interop
${CPPJIT_INTEROP_COMPILE_INCLUDES}
${Python_INCLUDE_DIRS}
)

target_compile_options(cppjit PRIVATE
-Wall -Wno-strict-aliasing -Wno-register
)

if(CMAKE_COMPILER_IS_GNUCXX)
target_link_options(cppjit PRIVATE -Wl,-Bsymbolic-functions)
endif()

# macOS needs to allow undefined Python symbols
if(APPLE)
set_target_properties(cppjit PROPERTIES
LINK_FLAGS "-undefined dynamic_lookup"
SUFFIX ".so"
)
endif()

set_target_properties(cppjit PROPERTIES
OUTPUT_NAME "cppjit"
PREFIX "lib"
)

# A plain build yields a runnable tree: the extension and the python
# sources assemble under <build>/python, beside <build>/interop.
if(NOT SKBUILD)
set_target_properties(cppjit PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/python/cppjit"
)
add_custom_target(cppjit-python-tree ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_CURRENT_SOURCE_DIR}/python/cppjit"
"${CMAKE_BINARY_DIR}/python/cppjit"
)
endif()

# the extension lives inside the package (import cppjit.libcppjit)
install(TARGETS cppjit
LIBRARY DESTINATION cppjit
)

# scikit-build-core ships the python sources itself (wheel.packages); a
# plain CMake install lays them out here so PYTHONPATH=<prefix> works.
if(NOT SKBUILD)
install(DIRECTORY python/cppjit
DESTINATION .
PATTERN "__pycache__" EXCLUDE
)
endif()

# An external CppInterOp is consumed in place and nothing of it ships;
# the bundled one installs with the builtin headers of the build clang,
# laid out as a headers-only resource dir (only include/ ships).
if(TARGET CppInterOp)
install(DIRECTORY "${CPPINTEROP_STAGE_DIR}/lib/"
DESTINATION cppjit/interop/lib
)
install(DIRECTORY "${CPPINTEROP_STAGE_DIR}/include/"
DESTINATION cppjit/interop/include
)
install(DIRECTORY "${CPPJIT_INTEROP_CLANG_RESOURCE_DIR}/include/"
DESTINATION "cppjit/interop/lib/clang/${CPPJIT_INTEROP_CLANG_MAJOR}/include"
)
endif()

# the public cpyrt API headers keep their installed cpyrt/ prefix
install(FILES
src/cpyrt/API.h
src/cpyrt/CommonDefs.h
src/cpyrt/DispatchPtr.h
src/cpyrt/PyException.h
src/cpyrt/Reflex.h
DESTINATION cppjit/interop/include/cpyrt
)
Loading
Loading