Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
3b13a77
[cling] Never resolve JIT symbols against legacy MSVC runtimes
aaronj0 Sep 29, 2026
34cc8a8
[cppinterop] Do not expose inherited special-member constructors [ups…
aaronj0 Aug 19, 2026
303cd04
[cppinterop] Require public path between same-template base instantia…
aaronj0 Aug 24, 2026
e1cce99
[cppinterop] Use a spellable return type in wrapper codegen [upstream]
aaronj0 Sep 5, 2026
3c0c26c
[cppinterop] Keep template arguments qualified in GetCompleteName [up…
aaronj0 Sep 5, 2026
1e052d8
[cppinterop] Print type and scope names platform-independently [upstr…
aaronj0 Sep 5, 2026
d852d9f
[cppinterop] Reject ill-formed instantiations in BestOverloadFunction…
aaronj0 Jul 14, 2026
05fba24
[cppinterop] Resolve globals whose symbol exists in no loaded binary …
aaronj0 Sep 8, 2026
c045a24
[cppinterop] Test smart-pointer detection of a templated operator-> […
aaronj0 Sep 29, 2026
a63240a
[cppinterop] Add Cling-specific lookup and codegen patches [ROOT-patch]
aaronj0 Sep 30, 2026
99078ed
[cppinterop] Compile call wrappers without access control [upstream]
aaronj0 Sep 8, 2026
26d9e48
[cppinterop] Share one dispatch table across Windows DLLs [upstream]
aaronj0 Sep 10, 2026
f977515
[cppinterop] Print template arguments without literal suffixes [ROOT-…
aaronj0 Sep 29, 2026
1e1ce71
[cppjit] Vendor upstream cppjit at 7dc6bf0ff
aaronj0 Sep 8, 2026
e54c75c
[cppjit] Make GetActualClass robust across platforms [upstream]
aaronj0 Aug 31, 2026
459eb66
[cppjit] Resolve template arguments with real C++ unqualified lookup …
aaronj0 Sep 8, 2026
010a147
[cppjit] Resolve qualified names relative to a parent scope [upstream]
aaronj0 Aug 28, 2026
901451f
[cppjit] Instantiate templated operator-> in smart-ptr detection [ups…
aaronj0 Sep 8, 2026
5d40bee
[cppjit] Do not autocast to anonymous-namespace types [upstream]
aaronj0 Aug 31, 2026
c475939
[cppjit] Refactor the global call-policy system into GlobalPolicyFlag…
aaronj0 Sep 8, 2026
30bf7ac
[cppjit] Match basic_string names with and without default arguments …
aaronj0 Aug 28, 2026
1a9ea48
[cppjit] Match function-pointer overloads via TCppType_t [upstream]
aaronj0 Sep 8, 2026
b16d109
[cppjit] Exempt T* const& from the mutable pointer-reference ban [ups…
aaronj0 Aug 28, 2026
b4973c8
[cppjit] Only pythonize size() as __len__ for integer-sized container…
aaronj0 Sep 8, 2026
c55e8d1
[cppjit] Retry template lookup with 2-tuples typed as std::pair [upst…
aaronj0 Sep 8, 2026
d729425
[cppjit] Type Python complex as std::complex<double> in template args…
aaronj0 Aug 28, 2026
43218e3
[cppjit] Do not implicitly convert to unrelated stdlib implementation…
aaronj0 Sep 8, 2026
83c04a6
[cppjit] Expose non-public methods re-exposed via public using-declar…
aaronj0 Sep 8, 2026
01a8556
[cppjit] Use comparison operators inherited from base classes [upstream]
aaronj0 Sep 8, 2026
3539901
[cppjit] Search the global scope before the left operand's namespace …
aaronj0 Sep 8, 2026
aa43d71
[cppjit] Honor the policy flag for implicit smart-pointer conversion …
aaronj0 Sep 8, 2026
93c1ba7
[cppjit] Exclude std::tuple from the aggregate pseudo-constructor [up…
aaronj0 Aug 29, 2026
68425f8
[cppjit] Accept a Python string from the pretty printer in op_str [up…
aaronj0 Sep 29, 2026
3d7b5f0
[cppjit] Pythonize: add std::span support and no-std wstring aliases …
aaronj0 Sep 8, 2026
015243a
[cppjit] Always convert returned std::string to a Python str [ROOT-pa…
aaronj0 Sep 8, 2026
d5f877d
[cppjit] Normalize exposed names to cppjit's canonical form [ROOT-patch]
aaronj0 Sep 8, 2026
7f64369
[cppjit] Apply ROOT patches to the interop layer [ROOT-patch]
aaronj0 Sep 8, 2026
12f5f20
[cppjit] Use Cpp::GetOrForceDefinition in auto-downcast [ROOT-patch]
aaronj0 Sep 8, 2026
0231fd6
[cppjit] Serialize CppInterOp calls with ROOT's interpreter lock [ROO…
aaronj0 Sep 8, 2026
04174dd
[cppjit] Resolve cppjit.gbl.gROOT to its underlying variable [ROOT-pa…
aaronj0 Sep 8, 2026
1ff29b8
[cppjit] Apply ROOT-specific patches [ROOT-patch]
aaronj0 Sep 8, 2026
9b983a5
[cppjit] Adjust cppjit test expectations for the interop migration [R…
aaronj0 Sep 8, 2026
e3e41c7
[cppjit] Build the vendored cppjit as PyROOT's cpyrt [ROOT-patch]
aaronj0 Sep 29, 2026
d72b31a
[cppjit] Rewire PyROOT from the cppyy stack to vendored cppjit [ROOT-…
aaronj0 Sep 29, 2026
b502c34
[pyroot] Refactor RDF Filter/Define callable dispatch [ROOT-patch]
aaronj0 May 21, 2026
455e784
[misc] Export C++-mangled read-only data from bindexplib [ROOT-patch]
aaronj0 Jul 18, 2026
6a360cc
[roottest] Disable python-cling-api on Windows [ROOT-patch]
aaronj0 Jul 19, 2026
a253718
[tutorials] Disable JIT-heavy fit tutorials on Windows 32 bit [ROOT-p…
aaronj0 Jul 19, 2026
9ed405b
[cppjit] Cache types resolved through the typeof trampoline [upstream]
guitargeek Sep 27, 2026
62abbde
[cppjit] Cache actual class and base offset lookups [upstream]
guitargeek Oct 1, 2026
6071b03
[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