|
| 1 | +.. _Building_ORC_RT: |
| 2 | + |
| 3 | +================== |
| 4 | +Building ORC-RT |
| 5 | +================== |
| 6 | + |
| 7 | +.. contents:: |
| 8 | + :local: |
| 9 | + |
| 10 | +.. _build instructions: |
| 11 | + |
| 12 | +Getting Started |
| 13 | +=============== |
| 14 | + |
| 15 | +The basic steps needed to build orc-rt are: |
| 16 | + |
| 17 | +#. Checkout llvm-project: |
| 18 | + |
| 19 | + * ``cd where-you-want-llvm-to-live`` |
| 20 | + * ``git clone https://github.com/llvm/llvm-project.git`` |
| 21 | + |
| 22 | +#. Configure and build orc-rt: |
| 23 | + |
| 24 | + CMake is the only supported configuration system. |
| 25 | + |
| 26 | + Clang is the preferred compiler when building and using orc-rt. |
| 27 | + |
| 28 | + * ``cd where you want to build llvm`` |
| 29 | + * ``mkdir build`` |
| 30 | + * ``cd build`` |
| 31 | + * ``cmake -G <generator> -DLLVM_ENABLE_RUNTIMES=orc-rt [options] <llvm-monorepo>/runtimes`` |
| 32 | + |
| 33 | + For more information about configuring orc-rt see :ref:`CMake Options`. |
| 34 | + |
| 35 | + * ``make orc-rt`` --- will build orc-rt. |
| 36 | + * ``make check-orc-rt`` --- will run the test suite. |
| 37 | + |
| 38 | + Shared and static libraries for orc-rt should now be present in |
| 39 | + llvm/build/lib. |
| 40 | + |
| 41 | +#. **Optional**: Install orc-rt |
| 42 | + |
| 43 | + Remember Use the CMake option ``CMAKE_INSTALL_PREFIX`` to select a safe |
| 44 | + place to install orc-rt. |
| 45 | + |
| 46 | + * ``make install-orc-rt`` --- Will install the libraries and the headers |
| 47 | + |
| 48 | +.. _CMake Options: |
| 49 | + |
| 50 | +CMake Options |
| 51 | +============= |
| 52 | + |
| 53 | +Here are some of the CMake variables that are used often, along with a |
| 54 | +brief explanation and LLVM-specific notes. For full documentation, check the |
| 55 | +CMake docs or execute ``cmake --help-variable VARIABLE_NAME``. |
| 56 | + |
| 57 | +**CMAKE_BUILD_TYPE**:STRING |
| 58 | + Sets the build type for ``make`` based generators. Possible values are |
| 59 | + Release, Debug, RelWithDebInfo and MinSizeRel. On systems like Visual Studio |
| 60 | + the user sets the build type with the IDE settings. |
| 61 | + |
| 62 | +**CMAKE_INSTALL_PREFIX**:PATH |
| 63 | + Path where LLVM will be installed if "make install" is invoked or the |
| 64 | + "INSTALL" target is built. |
| 65 | + |
| 66 | +**CMAKE_CXX_COMPILER**:STRING |
| 67 | + The C++ compiler to use when building and testing orc-rt. |
| 68 | + |
| 69 | +.. _orc-rt-specific options: |
| 70 | + |
| 71 | +orc-rt specific options |
| 72 | +-------------------------- |
| 73 | + |
| 74 | +.. option:: ORC_RT_ENABLE_ASSERTIONS:BOOL |
| 75 | + |
| 76 | + **Default**: ``ON`` |
| 77 | + |
| 78 | + Toggle assertions independent of the build mode. |
| 79 | + |
| 80 | +.. option:: ORC_RT_ENABLE_PEDANTIC:BOOL |
| 81 | + |
| 82 | + **Default**: ``ON`` |
| 83 | + |
| 84 | + Compile with -Wpedantic. |
| 85 | + |
| 86 | +.. option:: ORC_RT_ENABLE_WERROR:BOOL |
| 87 | + |
| 88 | + **Default**: ``ON`` |
| 89 | + |
| 90 | + Compile with -Werror |
0 commit comments