Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
mscuttari committed Jan 16, 2025
1 parent ebb0dc5 commit 020ba8f
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# MARCO Runtime
The project contains the runtime libraries that are used by the MARCO compiler during the link phase.

## Project structure
According to their purpose, they can be categorized as follows:
- **Skeleton libraries**\
They handle the basic aspects of the executable (e.g., arguments parsing) and manage the various stages of the simulation.
Expand All @@ -21,3 +22,44 @@ Differently from driver libraries, they do not handle more basic aspects of the
Differently from the other categories, the purpose of support libraries is to provide the implementation of functions that are called by the compiled model and are not generated by the compiler.
This is useful in case of operations whose generation in terms of LLVM-IR -- or even higher abstractions -- would be inconvenient when comparing performance improvements and maintainability.

## Building
Two development Docker images, `marco-runtime-dev-debug-debian-12` and `marco-runtime-dev-release-debian-12` are made available.
Their purpose and content follow the same principles for the compiler development images.
The `debug` image has the LLVM assertions enabled, while the `release` image does not.

### Native build
The following instructions explain how to build the runtime libraries.
LLVM is assumed to be already installed. See the instructions for compiling MARCO for more instructions on its installation.

The `RUNTIME_INSTALL_PATH` variable must be set to the desired installation path.

The `LLVM_PATH` variable must be set to the installation path that was used during the LLVM installation process.

By default, the CMake configuration searches for SUNDIALS libraries within the OS.
Alternatively, they can be built manually using the `dependencies/sundials.sh` script.
If the Sundials library have been built manually, the build system of MARCO can be instructed to use them by setting the `MARCO_USE_BUILTIN_SUNDIALS` CMake option must to `ON` and the `SUNDIALS_PATH` variable to their installation path.

The `LLVM_EXTERNAL_LIT` variable represent the path (including the executable name) to the `lit` tool. If it has been installed in user mode, it is usually `/home/user/.local/bin/lit`.

```bash
git clone https://github.com/marco-compiler/marco-runtime.git
cd marco-runtime
mkdir build && cd build

# Set the installation path.
RUNTIME_INSTALL_PATH=runtime_install_path

cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${RUNTIME_INSTALL_PATH} \
-DLLVM_PATH=${LLVM_INSTALL_PATH} \
..

cmake --build .

# Run the unit tests.
cmake --build . --target test

# Install the runtime library.
cmake --build . --target install
```

0 comments on commit 020ba8f

Please sign in to comment.