Skip to content

[ORC-RT] Initial check-in for a new, top-level ORC runtime project. #113499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
fb7698d
[ORC-RT] Initial check-in for a new, top-level ORC runtime project.
lhames Oct 23, 2024
f801afb
clang-format
lhames Oct 24, 2024
6011619
Simplify CMake files, add install support.
lhames Oct 27, 2024
81dc0e4
Use '//' style comments.
lhames Oct 28, 2024
7106b9d
Add missing copyright header.
lhames Oct 28, 2024
db27097
Use 'install (DIRECTORY...' instead of file sets.
lhames Oct 28, 2024
b0eb599
Add missing copyright header.
lhames Oct 28, 2024
400d2fc
Add license and documentation.
lhames Oct 30, 2024
4a03938
Remove CREDITS.TXT
lhames Oct 31, 2024
e872a8c
Remove legacy license text.
lhames Oct 31, 2024
bb5fb11
Fix default for ORC_RT_INCLUDE_DOCS option.
lhames Oct 31, 2024
267fd01
Switch docs from reStructuredText to markdown.
lhames Oct 31, 2024
327a64a
Silence python linter.
lhames Oct 31, 2024
0a25634
Python linter is persnickety.
lhames Oct 31, 2024
b348769
Update orc-rt/docs/Building-orc-rt.md
lhames Mar 3, 2025
7a3a185
[ORC-RT][docs] Fix copyright year and project name capitalization.
Mar 3, 2025
b804b1f
[ORC-RT] Update sphinx version.
lhames Mar 4, 2025
c57f7ce
[ORC-RT] Add TODO to switch to filesets when we can.
lhames Mar 4, 2025
e31c343
Specify COMPONENT for headers, use 'install(TARGETS ...' rather than
lhames May 14, 2025
e512c16
Rename project LibOrcRT -> OrcRT.
lhames May 14, 2025
91e73b1
Remove unnecessary target_include_directories(...)
lhames May 14, 2025
ea1955d
Adding ways to find utils during a RT build
jaredwy Aug 1, 2025
cab25e9
Merge branch 'main' into new-new-orc-rt
lhames Aug 4, 2025
3d624db
Update lit.cfg.py to fix formatting.
lhames Aug 5, 2025
124d7e4
Merge branch 'main' into new-new-orc-rt
lhames Aug 5, 2025
6957220
Merge branch 'main' into new-new-orc-rt
lhames Aug 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ endif()
# As we migrate runtimes to using the bootstrapping build, the set of default runtimes
# should grow as we remove those runtimes from LLVM_ENABLE_PROJECTS above.
set(LLVM_DEFAULT_RUNTIMES "libcxx;libcxxabi;libunwind")
set(LLVM_SUPPORTED_RUNTIMES "libc;libunwind;libcxxabi;pstl;libcxx;compiler-rt;openmp;llvm-libgcc;offload")
set(LLVM_SUPPORTED_RUNTIMES "libc;libunwind;libcxxabi;pstl;libcxx;compiler-rt;openmp;llvm-libgcc;offload;orc-rt")
set(LLVM_ENABLE_RUNTIMES "" CACHE STRING
"Semicolon-separated list of runtimes to build, or \"all\" (${LLVM_DEFAULT_RUNTIMES}). Supported runtimes are ${LLVM_SUPPORTED_RUNTIMES}.")
if(LLVM_ENABLE_RUNTIMES STREQUAL "all")
Expand Down
2 changes: 2 additions & 0 deletions llvm/projects/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ foreach(entry ${entries})
(NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libcxx) AND
(NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libcxxabi) AND
(NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libunwind) AND
(NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/orc-rt) AND
(NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/test-suite) AND
(NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/openmp) AND
(NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/cross-project-tests))
Expand All @@ -33,6 +34,7 @@ if(${LLVM_BUILD_RUNTIME})
add_llvm_external_project(libc)
add_llvm_external_project(libcxxabi)
add_llvm_external_project(libcxx)
add_llvm_external_project(orc-rt)
endif()
if(NOT LLVM_BUILD_EXTERNAL_COMPILER_RT)
add_llvm_external_project(compiler-rt)
Expand Down
41 changes: 41 additions & 0 deletions orc-rt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# CMake build for ORC-RT.

#===============================================================================
# Setup Project
#===============================================================================

cmake_minimum_required(VERSION 3.20.0)

set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
NO_POLICY_SCOPE)

project(LibOrcRT LANGUAGES C CXX ASM)

include(GNUInstallDirs)

#===============================================================================
# Setup CMake Options
#===============================================================================

option(ORC_RT_INCLUDE_DOCS "Build the ORC-RT documentation." ${ORC_RT_INCLUDE_DOCS})
option(ORC_RT_ENABLE_ASSERTIONS "Enable assertions independent of build mode." ON)
option(ORC_RT_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
option(ORC_RT_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)

set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to conform to")
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)
set(CMAKE_FOLDER "orc-rt")

#===============================================================================
# Setup Source Code
#===============================================================================

if (ORC_RT_INCLUDE_DOCS)
add_subdirectory(docs)
endif()

add_subdirectory(include)
add_subdirectory(lib)
add_subdirectory(tools)
13 changes: 13 additions & 0 deletions orc-rt/CREDITS.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This file is a partial list of people who have contributed to the LLVM
project. If you have contributed a patch or made some other contribution to
LLVM, please submit a patch to this file to add yourself, and it will be
done!

The list is sorted by surname and formatted to allow easy grepping and
beautification by scripts. The fields are: name (N), email (E), web-address
(W), PGP key ID and fingerprint (P), description (D), snail-mail address
(S), and (I) IRC handle.

N: Lang Hames
E: [email protected]
D: Initial code
311 changes: 311 additions & 0 deletions orc-rt/LICENSE.TXT

Large diffs are not rendered by default.

90 changes: 90 additions & 0 deletions orc-rt/docs/Building-ORC-RT.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
.. _Building_ORC_RT:

==================
Building ORC-RT
==================

.. contents::
:local:

.. _build instructions:

Getting Started
===============

The basic steps needed to build orc-rt are:

#. Checkout llvm-project:

* ``cd where-you-want-llvm-to-live``
* ``git clone https://github.com/llvm/llvm-project.git``

#. Configure and build orc-rt:

CMake is the only supported configuration system.

Clang is the preferred compiler when building and using orc-rt.

* ``cd where you want to build llvm``
* ``mkdir build``
* ``cd build``
* ``cmake -G <generator> -DLLVM_ENABLE_RUNTIMES=orc-rt [options] <llvm-monorepo>/runtimes``

For more information about configuring orc-rt see :ref:`CMake Options`.

* ``make orc-rt`` --- will build orc-rt.
* ``make check-orc-rt`` --- will run the test suite.

Shared and static libraries for orc-rt should now be present in
llvm/build/lib.

#. **Optional**: Install orc-rt

Remember Use the CMake option ``CMAKE_INSTALL_PREFIX`` to select a safe
place to install orc-rt.

* ``make install-orc-rt`` --- Will install the libraries and the headers

.. _CMake Options:

CMake Options
=============

Here are some of the CMake variables that are used often, along with a
brief explanation and LLVM-specific notes. For full documentation, check the
CMake docs or execute ``cmake --help-variable VARIABLE_NAME``.

**CMAKE_BUILD_TYPE**:STRING
Sets the build type for ``make`` based generators. Possible values are
Release, Debug, RelWithDebInfo and MinSizeRel. On systems like Visual Studio
the user sets the build type with the IDE settings.

**CMAKE_INSTALL_PREFIX**:PATH
Path where LLVM will be installed if "make install" is invoked or the
"INSTALL" target is built.

**CMAKE_CXX_COMPILER**:STRING
The C++ compiler to use when building and testing orc-rt.

.. _orc-rt-specific options:

orc-rt specific options
--------------------------

.. option:: ORC_RT_ENABLE_ASSERTIONS:BOOL

**Default**: ``ON``

Toggle assertions independent of the build mode.

.. option:: ORC_RT_ENABLE_PEDANTIC:BOOL

**Default**: ``ON``

Compile with -Wpedantic.

.. option:: ORC_RT_ENABLE_WERROR:BOOL

**Default**: ``ON``

Compile with -Werror
8 changes: 8 additions & 0 deletions orc-rt/docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if (LLVM_ENABLE_SPHINX)
include(AddSphinxTarget)
if (SPHINX_FOUND)
if (${SPHINX_OUTPUT_HTML})
add_sphinx_target(html orc-rt)
endif()
endif()
endif()
13 changes: 13 additions & 0 deletions orc-rt/docs/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ORC-RT Documentation
====================

The ORC-RT documentation is written using the Sphinx documentation generator. It is
currently tested with Sphinx 1.1.3.

To build the documents into html configure ORC-RT with the following cmake options:

* -DLLVM_ENABLE_SPHINX=ON
* -DORC_RT_INCLUDE_DOCS=ON

After configuring ORC-RT with these options the make rule `docs-orc-rt-html`
should be available.
Loading
Loading